/* عجلة الحظ — أثر */
@font-face {
  font-family: "Alexandria"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("assets/fonts/alexandria-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Alexandria"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("assets/fonts/alexandria-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --teal: #50BEAB; --teal-600: #2B8C7D; --teal-700: #1E6B5F; --teal-200: #BFE7DE; --teal-100: #E2F5F1;
  --char: #3A3536; --ink: #081313; --ink-2: #0d1c1c;
  --fg: #F4F8F7; --fg-2: rgba(244, 248, 247, .74); --fg-3: rgba(244, 248, 247, .52);
  --line: rgba(255, 255, 255, .13); --line-2: rgba(255, 255, 255, .22);
  --surface: rgba(14, 30, 30, .62); --surface-2: rgba(22, 42, 42, .82);
  --danger: #FF8A7A; --gold: #E9C46A;
  --r-sm: 12px; --r-md: 18px; --r-lg: 26px; --r-xl: 36px;
  --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-in: cubic-bezier(.64, 0, .78, 0); --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --fs-body: clamp(15px, 2.2vmin, 30px);
  --fs-title: clamp(30px, 7.2vmin, 96px);
  --fs-h2: clamp(22px, 3.9vmin, 52px);
  --ctl-h: clamp(54px, 7.4vmin, 92px);
  --gap: clamp(12px, 2vmin, 28px);
  --ws: min(84dvh, 49vw);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: var(--ink); color: var(--fg);
  font-family: "Alexandria", "Segoe UI", Tahoma, system-ui, sans-serif; font-size: var(--fs-body); line-height: 1.6;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  overscroll-behavior: none; -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { -webkit-user-drag: none; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- backdrop */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-img { position: absolute; inset: 0; background: #0a1918 url("assets/bg/bg-landscape.webp") center / cover no-repeat; }
.bg-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(60vmax 50vmax at 30% 55%, rgba(80, 190, 171, .20), transparent 60%),
    radial-gradient(50vmax 40vmax at 85% 15%, rgba(80, 190, 171, .10), transparent 65%),
    linear-gradient(180deg, rgba(4, 10, 10, .15), rgba(4, 10, 10, .55));
}
.grain {
  position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (orientation: portrait) {
  .bg-img { background-image: url("assets/bg/bg-portrait.webp"); }
  .bg-glow { background: radial-gradient(70vmax 50vmax at 50% 30%, rgba(80, 190, 171, .22), transparent 60%), linear-gradient(180deg, rgba(4, 10, 10, .1), rgba(4, 10, 10, .6)); }
}

/* ---------------------------------------------------------------- top bar */
.top {
  position: fixed; z-index: 5; inset-inline: 0; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + clamp(12px, 2.4vmin, 36px)) clamp(16px, 3.4vmin, 56px) 0;
  pointer-events: none;
}
.brand { pointer-events: auto; background: none; border: 0; padding: 6px; border-radius: 12px; -webkit-touch-callout: none; }
.brand img { display: block; height: clamp(40px, 7vmin, 92px); width: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }
.brand:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
.net {
  pointer-events: none; font-size: clamp(11px, 1.4vmin, 16px); color: var(--fg-3); display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 99px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); opacity: 0; transition: opacity .3s;
}
.net.show { opacity: 1; }
.net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
.net.ok::before { background: var(--teal); }
.net.off::before { background: var(--gold); }

/* ---------------------------------------------------------------- layout */
.stage {
  position: fixed; inset: 0; z-index: 1; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: center;
  padding: clamp(80px, 12vmin, 150px) clamp(16px, 4vmin, 72px) clamp(16px, 4vmin, 56px);
  gap: clamp(16px, 3vmin, 48px);
}
.wheel-zone { display: grid; place-items: center; min-width: 0; }
.panel { min-width: 0; display: grid; align-content: center; justify-items: start; }

@media (orientation: portrait) {
  :root { --ws: min(90vw, 54dvh); }
  .stage { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; align-items: start; padding-top: clamp(72px, 11vmin, 150px); gap: clamp(8px, 2.4vmin, 40px); }
  .wheel-zone { grid-row: 1; padding-top: clamp(8px, 2vmin, 28px); }
  .panel { grid-row: 2; justify-items: center; text-align: center; align-content: start; padding-top: clamp(4px, 1.2vmin, 24px); }
  body.s-form .wheel-zone { display: none; }
  body.s-form .stage { grid-template-rows: auto; align-content: start; }
  body.s-form .panel { grid-row: 1; align-content: start; }
}

/* ---------------------------------------------------------------- panel views */
.view { display: none; flex-direction: column; align-items: inherit; gap: var(--gap); width: 100%; max-width: 860px; }
body.s-attract .v-attract, body.s-form .v-form, body.s-ready .v-ready, body.s-spinning .v-spinning, body.s-result .v-spinning { display: flex; animation: viewIn .42s var(--ease-out) both; }
.panel { justify-items: stretch; }
.view { align-items: flex-start; }
@media (orientation: portrait) { .view { align-items: center; margin-inline: auto; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.eyebrow { margin: 0; color: var(--teal); font-weight: 600; font-size: clamp(13px, 2vmin, 26px); }
.title { margin: 0; font-size: var(--fs-title); font-weight: 700; line-height: 1.3; padding-block: .14em .06em; text-wrap: balance;
  background: linear-gradient(180deg, #fff 30%, #cfeee7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title.sm { font-size: clamp(26px, 5.6vmin, 76px); }
.sub { margin: 0; color: var(--fg-2); font-size: clamp(17px, 3vmin, 40px); font-weight: 400; }
.hint { margin: 0; color: var(--fg-3); font-size: clamp(13px, 1.9vmin, 24px); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
.h2 { margin: 0; font-size: var(--fs-h2); font-weight: 700; line-height: 1.25; }
.muted { color: var(--fg-2); margin: 0; }
.small { font-size: .8em; }
.fine { margin: 0; color: var(--fg-3); font-size: clamp(12px, 1.6vmin, 20px); }

.card { padding: clamp(20px, 4vmin, 56px); border-radius: var(--r-xl); }
.glass {
  background: linear-gradient(180deg, rgba(30, 56, 54, .66), rgba(12, 26, 26, .72));
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 30px 80px -20px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .12);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: #10201f; } }
.v-form { max-width: 820px; }
@media (orientation: portrait) { .v-form { text-align: start; align-items: stretch; } }

/* ---------------------------------------------------------------- controls */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--ctl-h); padding: 0 1.4em; border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 700; font-size: clamp(17px, 2.6vmin, 34px); white-space: nowrap;
  transition: transform .12s var(--ease-out), opacity .2s, background-color .2s;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--teal-200); outline-offset: 3px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary {
  color: #062420; background: linear-gradient(180deg, #7ad9c8, #50BEAB 55%, #3aa794);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 -2px 0 rgba(0, 0, 0, .15) inset, 0 10px 30px -8px rgba(80, 190, 171, .65), 0 2px 6px rgba(0, 0, 0, .25);
}
.btn-ghost { background: rgba(255, 255, 255, .06); border-color: var(--line-2); color: var(--fg); }
.btn-danger { background: rgba(255, 138, 122, .1); border-color: rgba(255, 138, 122, .45); color: #ffc9c1; font-size: 16px; min-height: 52px; }
.btn-xl { min-height: clamp(64px, 10vmin, 128px); font-size: clamp(22px, 4.2vmin, 54px); padding: 0 1.6em; border-radius: var(--r-lg); margin-top: clamp(4px, 1.2vmin, 20px); }
.btn-xl svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.btn-xl::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 2px solid rgba(122, 217, 200, .7); animation: halo 2.4s var(--ease-out) infinite; pointer-events: none; }
@keyframes halo { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.12, 1.3); } }
.grow { flex: 1; }
.row { display: flex; gap: clamp(10px, 1.6vmin, 20px); width: 100%; align-items: center; }
.row.wrap { flex-wrap: wrap; }

.dots { display: none; gap: 6px; }
.dots i { width: .35em; height: .35em; border-radius: 50%; background: currentColor; animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: scale(.7); } 40% { opacity: 1; transform: none; } }
.btn.loading .lbl { display: none; } .btn.loading .dots { display: inline-flex; }

.field { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.label { font-weight: 600; color: var(--fg-2); font-size: clamp(14px, 2vmin, 26px); }
.field input, .field select, .search {
  width: 100%; min-height: var(--ctl-h); padding: 0 .8em; border-radius: var(--r-md);
  background: rgba(0, 0, 0, .25); border: 1.5px solid var(--line-2); outline: none;
  font-size: clamp(18px, 2.8vmin, 36px); font-weight: 500; transition: border-color .15s, box-shadow .15s;
  -webkit-user-select: text; user-select: text;
}
.field input::placeholder { color: rgba(255, 255, 255, .3); }
.field input:focus, .field select:focus, .search:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(80, 190, 171, .22); }
.field input[dir="ltr"] { text-align: left; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.field.bad input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255, 138, 122, .16); animation: shake .32s; }
@keyframes shake { 25% { transform: translateX(6px); } 75% { transform: translateX(-6px); } }
.err { min-height: 1.2em; color: var(--danger); font-size: clamp(13px, 1.8vmin, 22px); }
.err.center { text-align: center; }

.swipe-hint svg { width: clamp(80px, 14vmin, 180px); fill: none; stroke: var(--teal); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.swipe-hint { animation: swipe 1.8s var(--ease-out) infinite; }
@keyframes swipe { 0% { transform: translateX(30px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(-30px); opacity: 0; } }

/* ---------------------------------------------------------------- wheel */
.wheel { position: relative; width: var(--ws); height: var(--ws); --d: var(--ws); touch-action: none; }
.wheel-shadow { position: absolute; left: 6%; right: 6%; bottom: -7%; height: 16%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0)); }
.rim, .disk, .gloss { position: absolute; border-radius: 50%; }
.rim { inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 calc(var(--d) * .02) calc(var(--d) * .03) rgba(0, 0, 0, .5)); }
.disk { left: 5.5%; top: 5.5%; width: 89%; height: 89%; will-change: transform; }
.gloss { left: 5.5%; top: 5.5%; width: 89%; height: 89%; pointer-events: none;
  background:
    radial-gradient(120% 80% at 30% 12%, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 42%),
    radial-gradient(closest-side, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, .38) 100%);
  box-shadow: inset 0 calc(var(--d) * -.012) calc(var(--d) * .03) rgba(0, 0, 0, .45), inset 0 calc(var(--d) * .006) calc(var(--d) * .01) rgba(255, 255, 255, .2);
}
.bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb {
  position: absolute; left: 50%; top: 50%; width: calc(var(--d) * .034); height: calc(var(--d) * .034); margin: calc(var(--d) * -.017);
  border-radius: 50%; transform: rotate(var(--a)) translateY(calc(var(--d) * -.471));
  background: radial-gradient(circle at 40% 35%, #fff, #fff6da 40%, #ffd98a 75%, #c9942f);
  box-shadow: 0 0 calc(var(--d) * .012) calc(var(--d) * .004) rgba(255, 225, 150, .85), 0 0 calc(var(--d) * .035) rgba(255, 214, 120, .55);
  opacity: .35;
}
.bulbs[data-mode="idle"] .even { animation: bulbA 1.8s ease-in-out infinite; }
.bulbs[data-mode="idle"] .odd { animation: bulbA 1.8s ease-in-out infinite; animation-delay: -.9s; }
.bulbs[data-mode="spin"] .even { animation: bulbA .42s steps(1) infinite; }
.bulbs[data-mode="spin"] .odd { animation: bulbA .42s steps(1) infinite; animation-delay: -.21s; }
.bulbs[data-mode="win"] .bulb { animation: bulbWin .5s ease-in-out 5 both; }
.bulbs[data-mode="on"] .bulb { opacity: 1; }
@keyframes bulbA { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .3; } }
@keyframes bulbWin { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.hub {
  position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; transform: translate(-50%, -50%); border-radius: 50%;
  border: 0; padding: 0; display: grid; place-items: center; align-content: center; gap: 2%;
  background: radial-gradient(circle at 36% 28%, #575253, #2a2627 52%, #141213 100%);
  box-shadow: 0 0 0 calc(var(--d) * .009) #50BEAB, 0 0 0 calc(var(--d) * .016) #151314,
    0 calc(var(--d) * .016) calc(var(--d) * .04) rgba(0, 0, 0, .6), inset 0 calc(var(--d) * .004) 0 rgba(255, 255, 255, .22), inset 0 calc(var(--d) * -.01) calc(var(--d) * .02) rgba(0, 0, 0, .5);
  transition: transform .14s var(--ease-out);
}
.hub img { width: 56%; height: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.hub span { font-weight: 800; font-size: calc(var(--d) * .036); line-height: 1; color: #fff; }
.hub:active { transform: translate(-50%, -50%) scale(.94); }
.hub:focus-visible { outline: 3px solid var(--teal-200); outline-offset: 6px; }
.hub::before { content: ""; position: absolute; inset: -12%; border-radius: 50%; border: calc(var(--d) * .006) solid rgba(122, 217, 200, .9); opacity: 0; pointer-events: none; }
body.s-ready .hub::before { animation: hubPulse 1.6s var(--ease-out) infinite; }
@keyframes hubPulse { 0% { opacity: .9; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.25); } }

.pointer-wrap { position: absolute; left: 50%; top: -3.6%; width: 11%; margin-left: -5.5%; z-index: 3; pointer-events: none; }
.pointer { display: block; width: 100%; height: auto; transform-origin: 50% 32%; overflow: visible; }

/* ---------------------------------------------------------------- result */
.result { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(closest-side, rgba(8, 19, 19, .55), rgba(4, 10, 10, .82)); animation: fadeIn .3s var(--ease-out) both; }
.result-card { position: relative; width: min(92vw, calc(70vmin + 140px)); max-height: calc(100dvh - 32px); overflow: hidden; text-align: center; border-radius: var(--r-xl);
  padding: clamp(24px, 5vmin, 64px) clamp(20px, 4.5vmin, 60px); display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.6vmin, 20px);
  animation: popIn .55s var(--ease-spring) both; }
.res-burst { position: absolute; left: 50%; top: 0; width: 160%; aspect-ratio: 1; transform: translate(-50%, -48%); pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(122, 217, 200, .16) 0 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(closest-side, #000 20%, transparent 70%); mask: radial-gradient(closest-side, #000 20%, transparent 70%);
  animation: spinSlow 30s linear infinite; }
.res-icon { position: relative; width: clamp(130px, 26vmin, 300px); height: auto; aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .45)); animation: float 3.2s ease-in-out infinite; }
.res-title { position: relative; margin: 0; font-size: clamp(30px, 6.4vmin, 84px); font-weight: 700; line-height: 1.2; color: #fff; text-wrap: balance; }
.res-code { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: clamp(12px, 2vmin, 24px) clamp(24px, 5vmin, 64px);
  border-radius: var(--r-lg); background: rgba(0, 0, 0, .28); border: 1.5px dashed rgba(122, 217, 200, .55); }
.res-code strong { font-size: clamp(36px, 7.6vmin, 100px); line-height: 1.15; letter-spacing: .16em; font-weight: 800; color: var(--teal-200); font-variant-numeric: tabular-nums; margin-inline-start: .16em; }
.res-note { margin: 0; color: var(--fg-2); }
.res-note:empty { display: none; }
#doneBtn { min-width: 52%; margin-top: clamp(4px, 1vmin, 12px); }
.ring { width: 1.15em; height: 1.15em; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: rgba(6, 36, 32, .25); stroke-width: 4; }
.ring .ring-fg { stroke: #062420; stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 0; }
@keyframes popIn { from { opacity: 0; transform: translateY(30px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes float { 50% { transform: translateY(-10px) rotate(-2deg); } }
@keyframes spinSlow { to { transform: translate(-50%, -48%) rotate(360deg); } }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; visibility: hidden; }

.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(env(safe-area-inset-bottom) + clamp(16px, 4vmin, 48px)); transform: translate(-50%, 30px);
  max-width: min(92vw, 900px); padding: clamp(12px, 1.8vmin, 22px) clamp(18px, 3vmin, 36px); border-radius: var(--r-md);
  background: rgba(16, 30, 30, .94); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  font-size: clamp(15px, 2.4vmin, 30px); text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease-out); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { border-color: rgba(233, 196, 106, .6); }

/* ---------------------------------------------------------------- on-screen keyboard */
.osk { position: fixed; z-index: 15; bottom: 0; inset-inline-start: 0; width: 54%; padding: clamp(10px, 1.4vmin, 18px) clamp(10px, 1.6vmin, 22px) calc(env(safe-area-inset-bottom) + clamp(10px, 1.6vmin, 22px));
  background: linear-gradient(180deg, rgba(18, 34, 34, .92), rgba(8, 18, 18, .97)); border-top: 1px solid var(--line-2);
  border-start-end-radius: var(--r-lg); box-shadow: 0 -20px 60px rgba(0, 0, 0, .45); animation: sheetIn .32s var(--ease-out) both; }
@media (orientation: portrait) { .osk { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; } }
@keyframes sheetIn { from { transform: translateY(100%); } }
.osk-row { display: flex; gap: clamp(5px, .8vmin, 10px); justify-content: center; margin-bottom: clamp(5px, .8vmin, 10px); }
.osk-key { flex: 1 1 0; min-width: 0; height: clamp(54px, 7.4vmin, 92px); border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .06));
  font-size: clamp(20px, 3vmin, 36px); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 0 rgba(0, 0, 0, .35); transition: transform .08s; }
.osk-key:active { transform: translateY(2px) scale(.97); background: rgba(80, 190, 171, .35); }
.osk-key.wide { flex-grow: 2.2; } .osk-key.xwide { flex-grow: 5; }
.osk-key.act { background: linear-gradient(180deg, #7ad9c8, #50BEAB); color: #062420; font-weight: 800; }
.osk.num { width: min(560px, 54%); }
@media (orientation: portrait) { .osk.num { width: 100%; } }
.osk.num .osk-key { height: clamp(62px, 8.4vmin, 104px); font-size: clamp(26px, 4vmin, 48px); }
body.osk-open .stage { padding-bottom: 46vh; }
@media (orientation: landscape) { body.osk-open.s-form .panel { align-content: start; } body.osk-open .stage { padding-bottom: clamp(16px, 4vmin, 56px); } }

/* ---------------------------------------------------------------- PIN */
.pin { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(3, 8, 8, .7); padding: 16px; }
.pin-card { width: min(420px, 94vw); border-radius: var(--r-xl); padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pin-dots { display: flex; gap: 14px; direction: ltr; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); transition: background .12s; }
.pin-dots i.on { background: var(--teal); border-color: var(--teal); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.pin-pad button { height: 68px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .07); font-size: 28px; font-weight: 600; }
.pin-pad button:active { background: rgba(80, 190, 171, .35); }

/* ---------------------------------------------------------------- admin */
.admin { position: fixed; inset: 0; z-index: 45; background: #091515; overflow: auto; -webkit-user-select: text; user-select: text; font-size: 16px; touch-action: auto; }
.admin-shell { max-width: 1280px; margin: 0 auto; padding: 20px clamp(12px, 3vw, 32px) 60px; }
.admin-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: sticky; top: 0; z-index: 2; padding: 12px 0; background: #091515; }
.admin-top .h2 { font-size: 24px; flex: 1 1 auto; }
.admin .btn { font-size: 16px; min-height: 48px; padding: 0 18px; border-radius: 14px; }
.tabs { display: flex; gap: 6px; background: rgba(255, 255, 255, .05); padding: 5px; border-radius: 14px; }
.tabs button { border: 0; background: none; padding: 10px 18px; border-radius: 10px; font-weight: 600; color: var(--fg-2); }
.tabs button.on { background: var(--teal); color: #062420; }
.tabs b { font-weight: 700; opacity: .8; }
.admin-status { font-size: 14px; color: var(--fg-3); margin: 4px 0 14px; }
.admin-status.off { color: var(--gold); }
.prize-head, .entries-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.prize-head .row { width: auto; }
.prize-list { display: grid; gap: 12px; }
.prize { display: grid; grid-template-columns: 72px minmax(160px, 2fr) repeat(3, minmax(90px, 1fr)) auto; gap: 12px; align-items: end;
  padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.prize.off { opacity: .55; }
.prize .field { gap: 4px; }
.prize .label { font-size: 13px; }
.prize .field input, .prize .field select, .admin .field input, .admin .field select { min-height: 46px; font-size: 16px; border-radius: 12px; }
.prize-icon { width: 72px; height: 72px; border-radius: 16px; border: 1px solid var(--line-2); background: #e9f0ee center / 80% no-repeat; position: relative; }
.prize-icon::after { content: "✎"; position: absolute; inset-inline-end: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #062420; font-size: 13px; display: grid; place-items: center; }
.prize-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-size: 14px; color: var(--fg-2); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); padding: 0; }
.swatches button.on { outline: 3px solid #fff; outline-offset: 2px; }
.swatches input[type="color"] { width: 34px; height: 30px; border: 0; background: none; padding: 0; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.chip.pct { color: var(--teal-200); font-weight: 700; }
.chip.out { color: var(--gold); border-color: rgba(233, 196, 106, .5); }
.prize-actions { display: flex; gap: 8px; }
.icon-btn { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); display: grid; place-items: center; font-size: 18px; }
.icon-btn.del { color: var(--danger); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; padding: 10px; border-radius: 14px; background: rgba(0, 0, 0, .3); grid-column: 1 / -1; }
.icon-grid button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 12px; color: var(--fg-2); }
.icon-grid button.on { border-color: var(--teal); background: rgba(80, 190, 171, .16); }
.icon-grid img, .icon-grid .none { width: 54px; height: 54px; object-fit: contain; }
.icon-grid .none { display: grid; place-items: center; border-radius: 10px; border: 1px dashed var(--line-2); }
label.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-weight: 600; }
input[type="checkbox"] { appearance: none; width: 52px; height: 30px; border-radius: 99px; background: rgba(255, 255, 255, .18); position: relative; transition: background .2s; flex: none; cursor: pointer; }
input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease-out); }
input[type="checkbox"]:checked { background: var(--teal); }
input[type="checkbox"]:checked::after { transform: translateX(-22px); }
[dir="ltr"] input[type="checkbox"]:checked::after { transform: translateX(22px); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: end; max-width: 980px; }
.danger { margin-top: 36px; padding: 18px; border-radius: 18px; border: 1px solid rgba(255, 138, 122, .3); background: rgba(255, 138, 122, .04); max-width: 980px; }
.danger h3 { margin: 0 0 4px; color: #ffc9c1; }
.danger .row { margin-top: 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.search { max-width: 520px; min-height: 48px !important; font-size: 16px !important; }
.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--line); }
table.entries { width: 100%; border-collapse: collapse; font-size: 15px; }
.entries th, .entries td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.entries th { position: sticky; top: 0; background: #0f1f1f; color: var(--fg-2); font-weight: 600; }
.entries td.mono { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.entries tr.dup td { background: rgba(233, 196, 106, .06); }
.entries .tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); margin-inline-start: 6px; }
.empty { color: var(--fg-3); text-align: center; padding: 40px; }

@media (max-width: 760px) {
  .prize { grid-template-columns: 64px 1fr 1fr; }
  .prize-icon { width: 64px; height: 64px; }
  .prize > .field.name { grid-column: 2 / -1; }
  .prize-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .admin-top .h2 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
