@import url("./themes.css");
@import url("./introFilm.css");

:root {
  --cube-d: clamp(250px, 36vw, 500px);
  --font: "Heebo", "Arial Hebrew", "Noto Sans Hebrew", "David", Arial, sans-serif;
  --display: "Frank Ruhl Libre", "Georgia", "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg-0); color: var(--text); font-family: var(--font); }
body { overflow: hidden; }
button, input, textarea, select { font-family: inherit; }
[hidden] { display: none !important; }
button { cursor: pointer; }

.app { min-height: 100%; height: 100%; display: flex; flex-direction: column; background:
  radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--neon-purple) 22%, transparent), transparent 55%),
  radial-gradient(ellipse at 90% 80%, color-mix(in srgb, var(--neon-cyan) 14%, transparent), transparent 50%),
  linear-gradient(180deg, var(--bg-0), var(--bg-1) 60%, var(--bg-2));
}

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--gold-line); background: color-mix(in srgb, var(--bg-0) 70%, transparent); backdrop-filter: blur(16px); z-index: 20; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
.brand img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; border: 1px solid var(--gold-line); }
.brand small { display: block; letter-spacing: .4em; font-size: 9px; color: var(--text-dim); font-weight: 700; }
.brand strong { font-size: .95rem; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.icon-btn, .ghost-btn, .gold-btn {
  appearance: none; border-radius: 999px; border: 1px solid var(--gold-line);
  background: color-mix(in srgb, var(--bg-2) 55%, transparent); color: var(--neon-silver);
  min-height: 2.2rem; padding: 0 .9rem; font-weight: 700; font-size: .8rem;
}
.icon-btn { width: 2.2rem; padding: 0; display: grid; place-items: center; }
.gold-btn { border: 0; background: linear-gradient(180deg, var(--gold-a), var(--gold-b) 45%, var(--gold-c)); color: #0a0618; box-shadow: 0 8px 30px -10px var(--gold-glow); }
.ghost-btn:hover, .icon-btn:hover { border-color: var(--gold-b); color: var(--gold-b); }
.gold-btn.lg { font-size: 1.15rem; padding: .85rem 1.6rem; min-height: 3rem; }

.view { flex: 1; overflow: auto; position: relative; min-height: 0; }
.stage-center { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem 1rem 6rem; }
.eyebrow { letter-spacing: .4em; font-size: .72rem; font-weight: 700; color: var(--text-dim); }
h1.display { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 6vw, 4.2rem); line-height: 1.12; margin: .8rem 0 .4rem; }
.gold-text { background-image: linear-gradient(180deg, var(--gold-a), var(--gold-b) 55%, var(--gold-c)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { max-width: 36rem; color: var(--text-dim); line-height: 1.65; margin: .4rem auto 1.2rem; }
.cat-pills { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.2rem; }
.pill { border: 1px solid var(--gold-line); border-radius: 999px; padding: .35rem .8rem; font-size: .75rem; font-weight: 700; color: var(--text-dim); display: flex; align-items: center; gap: .4rem; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-b); display: block; }

/* Cube */
.cube-scene { width: var(--cube-d); height: var(--cube-d); perspective: 1600px; position: relative; margin: 1rem auto; }
.cube { width: var(--cube-d); height: var(--cube-d); transform-style: preserve-3d; will-change: transform; position: relative; }
.cube-face { border: 1px solid var(--gold-line); backface-visibility: hidden; background: linear-gradient(150deg, #120a22, #07070b); border-radius: 20px; position: absolute; inset: 0; overflow: hidden; box-shadow: inset 0 0 70px color-mix(in srgb, var(--neon-cyan) 22%, transparent), inset 0 0 0 1px #ffffff0d; }
.cube-face-photo, .cube-face-logo { position: absolute; inset: 0; background-size: cover; background-position: center; }
.cube-face-photo.is-empty { display: grid; place-items: center; }
.cube-dw { font-weight: 900; font-size: 4rem; background-image: linear-gradient(180deg, var(--gold-a), var(--gold-c)); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .85; }
.cube-face-logo { opacity: 0; background-color: #08080d; background-repeat: no-repeat; background-size: 62%; pointer-events: none; }
.cube-face-logo.is-on { opacity: 1; }
.cube-face-sheen { pointer-events: none; position: absolute; inset: 0; background: radial-gradient(circle at 76% 10%, #ffffff3d, #0000 46%), linear-gradient(200deg, #0000 42%, #0009); box-shadow: inset 0 0 0 1px #ffffff12, inset 0 -26px 60px #0000008c; }
.cube-face-label { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); white-space: nowrap; border-radius: 999px; border: 1px solid #ffffff26; background: #00000099; padding: 4px 12px; font-size: 11px; font-weight: 700; backdrop-filter: blur(6px); }
.cube-shadow { background: radial-gradient(ellipse at center, var(--gold-glow), transparent 72%); filter: blur(22px); opacity: .8; border-radius: 50%; width: 76%; height: 8%; position: absolute; bottom: -3%; left: 50%; transform: translate(-50%); }
.cube-idle { animation: 30s linear infinite idle-spin; }
@keyframes idle-spin {
  from { transform: translateZ(calc(var(--cube-d) / -2)) rotateX(-16deg) rotateY(22deg); }
  to { transform: translateZ(calc(var(--cube-d) / -2)) rotateX(-16deg) rotateY(382deg); }
}
@media (prefers-reduced-motion: reduce) { .cube-idle { animation: none; } }

/* Host bar */
.hostbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: linear-gradient(to top, color-mix(in srgb, var(--bg-0) 92%, transparent), transparent); }
.hostbar .hint { font-size: 11px; color: var(--text-dim); width: 100%; text-align: center; }

/* Task screens */
.task-frame { width: min(1100px, 96vw); }
.task-media { width: 100%; max-height: 56vh; object-fit: contain; border-radius: 1.2rem; border: 1px solid var(--gold-line); background: #000; box-shadow: 0 40px 120px -50px var(--gold-glow); }
.task-q { font-size: clamp(1.3rem, 3vw, 2.2rem); font-weight: 800; margin: 1rem 0 .4rem; }
.task-a { font-size: clamp(1.1rem, 2.4vw, 1.8rem); color: var(--gold-b); font-weight: 800; margin: .6rem 0 1rem; }
.word-hero { font-family: var(--display); font-size: clamp(3rem, 12vw, 8rem); font-weight: 900; line-height: 1; margin: 1rem 0; background-image: linear-gradient(180deg, var(--gold-a), var(--gold-b) 50%, var(--gold-c)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--neon-cyan) 30%, transparent)); }
.explain-card { max-width: 36rem; padding: 1.4rem 1.5rem; border: 1px solid var(--gold-line); border-radius: 1.4rem; background: color-mix(in srgb, var(--bg-1) 80%, transparent); }
.explain-card h2 { margin: 0 0 .4rem; font-size: 2rem; }

/* Timer */
.timer { width: 132px; height: 132px; margin: 1rem auto 0; position: relative; }
.timer svg { transform: rotate(-90deg); }
.timer .nums { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer .nums b { font-family: var(--display); font-size: 2.4rem; font-weight: 900; line-height: 1; }
.timer .nums span { font-size: 10px; letter-spacing: .25em; color: var(--text-dim); font-weight: 700; }
.timer.is-low b, .timer.is-low .ring { color: #f87171; }
.timer-glow { position: absolute; inset: 8px; border-radius: 50%; filter: blur(16px); background: color-mix(in srgb, var(--gold-b) 25%, transparent); }
.timer.is-low .timer-glow { background: #f8717133; animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.spin-label { margin-top: 1rem; font-weight: 800; letter-spacing: .06em; color: var(--gold-b); }

/* Finale */
.finale { position: relative; }
.finale-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .28; }
.finale-veil { position: absolute; inset: 0; background: linear-gradient(to bottom, #05051fcc, #05051f ee); }
.spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-b); box-shadow: 0 0 12px var(--gold-b); animation: twinkle 3.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .2; transform: scale(.6); } }

/* Admin */
.admin { padding: 1rem 1rem 3rem; max-width: 1100px; margin: 0 auto; }
.admin h1 { font-size: 1.6rem; margin: 0 0 1rem; }
.grid2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.panel { border: 1px solid var(--gold-line); border-radius: 1.1rem; padding: 1rem; background: color-mix(in srgb, var(--bg-1) 80%, transparent); margin-bottom: 1rem; }
.panel h2 { margin: 0 0 .8rem; font-size: 1rem; }
.field { width: 100%; background: #0006; border: 1px solid var(--gold-line); color: var(--text); border-radius: .7rem; padding: .55rem .7rem; }
textarea.field { min-height: 6rem; resize: vertical; }
label.lbl { display: block; font-size: 11px; font-weight: 700; color: var(--text-dim); margin: .4rem 0 .25rem; }
.row { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .4rem; }
.thumbs .t { aspect-ratio: 1; border-radius: .5rem; background: #000 center/cover; border: 1px solid var(--gold-line); position: relative; }
.thumbs .t button { position: absolute; inset: 0; background: #0000; border: 0; color: #f87171; opacity: 0; font-weight: 800; }
.thumbs .t:hover button { opacity: 1; background: #0009; }
.item-card { border: 1px solid var(--gold-line); border-radius: .8rem; padding: .7rem; margin-bottom: .5rem; }
.item-card.placeholder { border-color: #eab30866; }
.warn { font-size: 11px; color: #fbbf24; }
.ok { font-size: 11px; color: #34d399; }
.err { font-size: 11px; color: #f87171; }
.pin-gate { min-height: 100%; display: grid; place-items: center; padding: 2rem; }
.pin-box { width: min(360px, 92vw); text-align: center; }
.pin-box input { letter-spacing: .3em; text-align: center; font-size: 1.3rem; }

.progress-bar { height: 6px; background: #fff1; border-radius: 99px; overflow: hidden; }
.progress-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-b), var(--gold-c)); width: 0; }

.credits { max-width: 40rem; margin: 0 auto; padding: 2rem 1rem 5rem; line-height: 1.7; color: var(--text-dim); }
.credits h1 { color: var(--text); }
.credits a { color: var(--gold-b); }

kbd { border: 1px solid var(--gold-line); border-radius: 4px; padding: 0 .3rem; font-size: 11px; }

@media (max-width: 700px) {
  --cube-d: min(72vw, 320px);
  .brand strong { display: none; }
  .hostbar { gap: .3rem; }
  .gold-btn.lg { font-size: 1rem; }
}

.t { aspect-ratio: 1; border-radius: .5rem; background: #000 center/cover no-repeat; border: 1px solid var(--gold-line); position: relative; width: 56px; height: 56px; }
.master-speaker { font-size: 1.05rem; }
body.admin-open { overflow: auto; }
