* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --navy: #0a1430; --navy2: #101f45; --navy3: #16295c;
  --gold: #e8b64c; --gold2: #f6d784; --gold3: #b8860b;
  --white: #fdf9ef; --ink: #f5efdf;
}
html, body { height: 100%; }
body {
  font-family: 'Heebo', sans-serif; direction: rtl; background: var(--navy); color: var(--ink);
  min-height: 100vh; overflow-x: hidden;
  background-image: radial-gradient(ellipse at 50% -10%, #1c2f66 0%, var(--navy) 60%);
}
button { font-family: inherit; cursor: pointer; }
.screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 18px 16px 40px; }
.hidden { display: none !important; }

/* sparks */
.spark { position: fixed; border-radius: 50%; background: var(--gold2); opacity: .7; pointer-events: none; z-index: 0; animation: floatUp linear infinite; }
@keyframes floatUp { from { transform: translateY(105vh) scale(1); opacity: 0; } 15% { opacity: .8; } to { transform: translateY(-5vh) scale(.4); opacity: 0; } }

/* top bar */
.topbar { width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; z-index: 2; }
.topbar .home-btn { background: rgba(232,182,76,.14); border: 1px solid rgba(232,182,76,.5); color: var(--gold2); border-radius: 999px; padding: 8px 14px; font-size: 15px; }
.score-chip { background: linear-gradient(135deg, #2a3f7d, #16295c); border: 1px solid var(--gold); color: var(--gold2); border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 700; box-shadow: 0 0 14px rgba(232,182,76,.25); }

/* hero */
.hero-img { width: 100%; max-width: 460px; border-radius: 22px; border: 2px solid rgba(232,182,76,.65); box-shadow: 0 12px 45px rgba(0,0,0,.55), 0 0 30px rgba(232,182,76,.18); }
h1 { font-size: 30px; text-align: center; color: var(--gold2); margin: 18px 0 6px; font-weight: 800; text-shadow: 0 2px 14px rgba(232,182,76,.35); }
.subtitle { text-align: center; font-size: 18px; color: var(--ink); opacity: .95; margin-bottom: 20px; line-height: 1.5; }
.big-btn {
  background: linear-gradient(135deg, var(--gold2), var(--gold) 55%, var(--gold3));
  color: #231a04; font-size: 21px; font-weight: 800; border: none; border-radius: 999px;
  padding: 16px 42px; box-shadow: 0 6px 24px rgba(232,182,76,.4); transition: transform .15s;
}
.big-btn:active { transform: scale(.96); }
.ghost-btn { background: transparent; border: 1.5px solid rgba(232,182,76,.55); color: var(--gold2); border-radius: 999px; padding: 10px 22px; font-size: 16px; margin-top: 12px; }

/* menu cards */
.cards { width: 100%; max-width: 520px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; z-index: 2; }
.card {
  position: relative; border-radius: 20px; overflow: hidden; border: 1.5px solid rgba(232,182,76,.55);
  box-shadow: 0 8px 26px rgba(0,0,0,.45); background: var(--navy2); padding: 0; text-align: right;
}
.card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.card .card-label { position: absolute; inset-inline: 0; bottom: 0; padding: 26px 12px 10px; background: linear-gradient(to top, rgba(6,11,28,.94), transparent); }
.card .card-label b { color: var(--gold2); font-size: 17px; display: block; }
.card .card-label span { color: var(--ink); font-size: 12.5px; opacity: .85; }
.wide-card { grid-column: 1 / -1; }
.wide-card img { aspect-ratio: 2.4/1; }

/* generic panel */
.panel { width: 100%; max-width: 560px; background: rgba(16,31,69,.82); border: 1px solid rgba(232,182,76,.4); border-radius: 20px; padding: 18px; z-index: 2; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.panel h2 { color: var(--gold2); font-size: 22px; margin-bottom: 8px; text-align: center; }
.panel p { line-height: 1.65; font-size: 16px; }
.center { text-align: center; }

/* riddle */
.riddle-img { width: 100%; border-radius: 16px; border: 1.5px solid rgba(232,182,76,.6); display: block; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.progress-note { color: var(--gold2); font-size: 14px; margin-bottom: 10px; opacity: .9; }
.answer-box { margin-top: 14px; background: rgba(232,182,76,.12); border: 1px dashed var(--gold); border-radius: 14px; padding: 14px; }
.answer-box b { color: var(--gold2); font-size: 19px; display: block; margin-bottom: 6px; }
.row-btns { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.btn { background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #231a04; border: none; border-radius: 14px; font-size: 17px; font-weight: 700; padding: 13px 22px; }
.btn.secondary { background: rgba(232,182,76,.14); color: var(--gold2); border: 1px solid rgba(232,182,76,.5); }

/* trivia */
.timer-wrap { width: 100%; height: 10px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; margin: 10px 0 16px; }
.timer-bar { height: 100%; background: linear-gradient(90deg, var(--gold3), var(--gold2)); border-radius: 999px; transition: width 1s linear; }
.timer-num { font-size: 15px; color: var(--gold2); font-weight: 700; }
.q-text { font-size: 20px; font-weight: 700; line-height: 1.5; margin: 6px 0 16px; text-align: center; }
.opts { display: grid; gap: 10px; }
.opt { background: rgba(255,255,255,.06); border: 1.5px solid rgba(232,182,76,.35); color: var(--ink); border-radius: 14px; padding: 14px 16px; font-size: 17px; text-align: right; line-height: 1.4; }
.opt.correct { background: rgba(46,160,67,.35); border-color: #4caf50; }
.opt.wrong { background: rgba(198,40,40,.3); border-color: #e05252; }
.opt:disabled { cursor: default; }
.explain { margin-top: 14px; background: rgba(232,182,76,.1); border-right: 3px solid var(--gold); border-radius: 10px; padding: 12px 14px; font-size: 15px; line-height: 1.6; }

/* who am i */
.concept-card { width: 100%; background: linear-gradient(160deg, #1c2f66, #0d1a3e); border: 2px solid var(--gold); border-radius: 22px; padding: 40px 16px; text-align: center; box-shadow: 0 0 40px rgba(232,182,76,.2); }
.concept-word { font-size: 34px; font-weight: 800; color: var(--gold2); text-shadow: 0 2px 18px rgba(232,182,76,.4); }
.diff-chip { display: inline-block; margin-top: 10px; font-size: 13px; padding: 4px 14px; border-radius: 999px; border: 1px solid rgba(232,182,76,.6); color: var(--gold2); }
.big-timer { font-size: 52px; font-weight: 800; color: var(--gold2); text-align: center; text-shadow: 0 0 20px rgba(232,182,76,.5); }

/* family vote */
.names-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; max-height: 44vh; overflow-y: auto; overflow-x: hidden; padding: 6px 2px 2px 8px; }
.name-btn { background: rgba(255,255,255,.06); border: 1.5px solid rgba(232,182,76,.35); color: var(--ink); border-radius: 12px; padding: 12px 8px; font-size: 16px; position: relative; }
.name-btn .votes { position: absolute; top: -7px; left: 2px; background: var(--gold); color: #231a04; font-size: 12px; font-weight: 800; border-radius: 999px; min-width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.result-bar { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.result-bar .nm { width: 92px; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-bar .bar { flex: 1; height: 22px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.result-bar .fill { height: 100%; background: linear-gradient(90deg, var(--gold3), var(--gold2)); border-radius: 999px; transition: width .6s; }
.result-bar .cnt { width: 26px; color: var(--gold2); font-weight: 700; font-size: 14px; }
.winner-note { text-align: center; color: var(--gold2); font-weight: 700; margin-top: 10px; font-size: 16px; }

/* name setup */
.name-edit-row { display: flex; gap: 8px; margin: 6px 0; }
.name-edit-row input { flex: 1; background: rgba(255,255,255,.07); border: 1px solid rgba(232,182,76,.4); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 16px; font-family: inherit; }
.name-edit-row button { background: rgba(198,40,40,.25); color: #ff9d9d; border: 1px solid rgba(224,82,82,.5); border-radius: 10px; padding: 0 14px; font-size: 18px; }
.add-row input { flex: 1; background: rgba(255,255,255,.07); border: 1px dashed rgba(232,182,76,.5); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 16px; font-family: inherit; }

/* titles */
.title-card { background: linear-gradient(135deg, rgba(232,182,76,.16), rgba(232,182,76,.05)); border: 1px solid rgba(232,182,76,.55); border-radius: 14px; padding: 12px 16px; margin: 8px 0; display: flex; justify-content: space-between; align-items: center; }
.title-card .t { color: var(--gold2); font-weight: 800; font-size: 16px; }
.title-card .w { font-size: 16px; }

/* finale */
.finale-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.finale-table td { padding: 10px 8px; border-bottom: 1px solid rgba(232,182,76,.25); font-size: 16px; }
.finale-table td:last-child { text-align: left; color: var(--gold2); font-weight: 700; }
.menorah { margin: 20px auto 8px; width: 300px; max-width: 86vw; display: block; }
.flame { transform-origin: center bottom; opacity: 0; }
.flame.lit { opacity: 1; animation: flick 1.1s ease-in-out infinite alternate; }
@keyframes flick { from { transform: scaleY(.92) rotate(-1.5deg); } to { transform: scaleY(1.08) rotate(1.5deg); } }
.glow { opacity: 0; transition: opacity 1s; }
.glow.lit { opacity: .9; }
.finale-line { text-align: center; font-size: 20px; color: var(--gold2); font-weight: 700; line-height: 1.6; margin-top: 10px; text-shadow: 0 2px 14px rgba(232,182,76,.3); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
