:root {
  --bg: #060812;
  --bg2: #0d1022;
  --panel: rgba(16, 20, 42, 0.86);
  --panel2: rgba(23, 29, 58, 0.92);
  --border: rgba(96, 124, 255, 0.26);
  --text: #eef3ff;
  --muted: #99a6c7;
  --neon: #28e7ff;
  --neon2: #9b5cff;
  --gold: #ffd866;
  --danger: #ff4d6d;
  --ok: #52f2a6;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(40, 231, 255, 0.16), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(155, 92, 255, 0.20), transparent 28%),
    linear-gradient(140deg, var(--bg), var(--bg2) 55%, #050610);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}

button, input, a { font: inherit; }
button { cursor: pointer; }

.admin-link {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 5;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(10, 14, 29, 0.72);
  backdrop-filter: blur(10px);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 56px 14px 28px;
}

.hero-card,
.admin-login,
.admin-panel,
.admin-header,
.stat-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(19, 24, 53, .92), rgba(10, 13, 30, .9));
  box-shadow: var(--shadow), 0 0 26px rgba(40, 231, 255, 0.08);
}

.hero-card {
  width: min(560px, 100%);
  border-radius: 24px;
  padding: 22px;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.brand-row.centered { justify-content: center; }
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 900;
  color: #06101d;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--neon), var(--gold));
  box-shadow: 0 0 24px rgba(40, 231, 255, .35), 0 0 16px rgba(255, 216, 102, .25);
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: clamp(26px, 7vw, 38px); line-height: 1; }
h2 { font-size: 18px; margin-bottom: 14px; }
h3 { font-size: 15px; margin-bottom: 6px; }
.subtitle { color: var(--muted); margin-bottom: 0; font-size: 14px; }

.panel {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 16px;
}
.code-panel { margin-bottom: 16px; }
label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.code-row { display: flex; gap: 10px; align-items: stretch; }
input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(4, 7, 18, 0.78);
  outline: none;
}
input:focus { border-color: rgba(40, 231, 255, .72); box-shadow: 0 0 0 3px rgba(40, 231, 255, .12); }

.btn {
  border: 0;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  white-space: nowrap;
}
.btn.primary { color: #05101b; background: linear-gradient(135deg, var(--neon), #65f4ff); }
.btn.win-btn { color: #2a1800; background: linear-gradient(135deg, var(--gold), #ffb84d); box-shadow: 0 0 22px rgba(255, 216, 102, .18); }
.btn.lose-btn { color: #fff; background: linear-gradient(135deg, var(--neon2), #5c6bff); box-shadow: 0 0 22px rgba(155, 92, 255, .18); }
.btn.spin { width: 100%; margin-top: 15px; color: #07111d; background: linear-gradient(135deg, var(--gold), #ffb84d); letter-spacing: 1.5px; box-shadow: 0 0 24px rgba(255, 216, 102, .22); }
.btn.whatsapp { width: 100%; margin-top: 12px; color: #03140d; background: linear-gradient(135deg, #48ff9a, #16c768); }
.btn.ghost { border: 1px solid var(--border); background: rgba(255,255,255,.05); }
.btn.danger { background: linear-gradient(135deg, var(--danger), #b92546); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.message { min-height: 22px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.message.error { color: #ff8da0; }
.message.ok { color: var(--ok); }
.hidden { display: none !important; }

.slot-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.muted { color: var(--muted); display: block; font-size: 12px; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(2, 5, 14, 0.82);
  border: 1px solid rgba(40, 231, 255, .22);
  box-shadow: inset 0 0 22px rgba(40, 231, 255, .08);
}
.slot-cell {
  min-height: 72px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 0 18px rgba(0,0,0,.20);
  overflow: hidden;
}
.slot-cell.center-line {
  border-color: rgba(255, 216, 102, .38);
  box-shadow: inset 0 0 14px rgba(255,216,102,.08), 0 0 12px rgba(255,216,102,.05);
}
.symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 18px;
  user-select: none;
}
.symbol svg { width: 100%; height: 100%; display: block; }
.symbol.netflix { color: #ff3047; font-size: 34px; text-shadow: 0 0 14px rgba(255, 48, 71, .5); }
.symbol.dazn { font-size: 13px; border: 2px solid #fff; color: white; border-radius: 8px; letter-spacing: -1px; }
.symbol.star { color: #fff36d; font-size: 36px; text-shadow: 0 0 16px rgba(255, 243, 109, .5); }
.symbol.coin { color: #2a1800; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff7a5, #ffd35b 42%, #c57b16 74%); box-shadow: 0 0 18px rgba(255, 216, 102, .56); font-size: 22px; }

.rolling .symbol { animation: roll .28s linear infinite; }
.win-flash { animation: winFlash .85s ease-in-out 3; }
.result-message {
  margin-top: 12px;
  min-height: 28px;
  text-align: center;
  font-weight: 900;
  color: var(--gold);
  font-size: 18px;
}
.result-message .small { display: block; color: var(--text); font-size: 14px; font-weight: 700; margin-top: 4px; }

@keyframes roll {
  0% { transform: translateY(-18px) scale(.92); opacity: .35; filter: blur(1px); }
  50% { transform: translateY(0) scale(1.04); opacity: 1; filter: blur(0); }
  100% { transform: translateY(18px) scale(.92); opacity: .35; filter: blur(1px); }
}
@keyframes winFlash {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 28px rgba(255, 216, 102, .45); }
}

.admin-shell { width: min(1180px, 100%); margin: 0 auto; padding: 28px 14px; }
.admin-login { max-width: 480px; margin: 10vh auto 0; border-radius: 22px; padding: 22px; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 16px;
}
.admin-header .brand-row { margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card { border-radius: 18px; padding: 15px; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat-card strong { font-size: 30px; line-height: 1; }
.admin-panel { margin-bottom: 14px; }
.quick-generate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.section-separator { display: flex; align-items: center; gap: 10px; margin: 12px 0 14px; color: var(--muted); font-size: 12px; }
.section-separator::before,
.section-separator::after { content: ""; height: 1px; flex: 1; background: rgba(255,255,255,.10); }
.generate-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 11px;
}
.chip.active { background: rgba(40, 231, 255, .18); border-color: rgba(40, 231, 255, .6); }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 11px 10px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; font-size: 13px; }
th { color: var(--muted); background: rgba(0,0,0,.18); font-weight: 800; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; font-size: 12px; font-weight: 800; }
.badge.win { color: #07111d; background: var(--gold); }
.badge.lose { color: #fff; background: rgba(155, 92, 255, .5); }
.badge.used { color: #04130c; background: var(--ok); }
.badge.unused { color: var(--text); background: rgba(255,255,255,.10); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions .btn { min-height: 34px; padding: 0 10px; border-radius: 10px; font-size: 12px; }
.delete-all-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.09); }
canvas { width: 100%; max-width: 100%; background: rgba(0,0,0,.15); border-radius: 14px; }

@media (max-width: 720px) {
  .hero-card { padding: 16px; border-radius: 20px; }
  .code-row { flex-direction: column; }
  .slot-cell { min-height: 58px; border-radius: 12px; }
  .symbol { width: 38px; height: 38px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .quick-generate-grid,
  .generate-grid { grid-template-columns: 1fr; }
}
