/* style.css — polished dark layout, responsive, share-ready */

:root{
  --bg-1: #040404;
  --bg-2: #0b0b0c;
  --card: rgba(255,255,255,0.026);
  --muted: rgba(255,255,255,0.66);
  --accent: rgba(255,255,255,0.08);
  --danger: #ff6b6b;
  --success: #6ee7b7;
  --glass: 14px;
  --radius: 18px;
  --max-width: 920px;
  --shadow: 0 40px 120px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.02);
  --stat-bg: rgba(255,255,255,0.03);
  --touch-padding: 14px;
}

/* accessibility: reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }
html,body { height:100%; margin:0; }
body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: radial-gradient( circle at 10% 10%, var(--bg-2) 0%, var(--bg-1) 60%);
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding: 28px;
}

/* main card */
#game {
  width: min(var(--max-width), 94%);
  padding: 32px 38px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass));
  transition: transform .22s ease, opacity .22s ease;
  text-align:center;
  min-height: 320px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  max-width: var(--max-width);
}

/* top stats row */
.stats{
  display:flex;
  gap:12px;
  justify-content:center;
  margin-bottom:12px;
  flex-wrap:wrap;
}
.stat{
  background: var(--stat-bg);
  padding:8px 14px;
  border-radius: 10px;
  font-size:13px;
  opacity:0.95;
  border:1px solid rgba(255,255,255,0.02);
  min-width:86px;
  text-align:center;
}

/* progress */
.progress{
  font-size:13px;
  color:var(--muted);
  margin-bottom:10px;
}

/* headline */
h2{
  font-weight:600;
  margin:10px 0 20px;
  font-size:22px;
}

/* choices */
.choices{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
  margin-top:6px;
  margin-bottom:18px;
  max-width:760px;
}
.choice-btn{
  width:100%;
  text-align:center;
  background: rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.06);
  padding:var(--touch-padding);
  border-radius:10px;
  cursor:pointer;
  color: #fff;
  font-size:15px;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
  outline: none;
  min-height:48px;
}
.choice-btn:hover{ transform: translateY(-4px); background: rgba(255,255,255,0.06) }
.choice-btn:active{ transform: translateY(-1px) }
.choice-btn[aria-pressed="true"]{ box-shadow: 0 8px 30px rgba(255,255,255,0.02) }

/* timer */
.timer{ margin-top:6px; font-weight:600; color:var(--muted) }

/* pulse / shake helpers */
.pulse{ animation: pulse 0.8s infinite; color: var(--danger) }
@keyframes pulse { 0%{ transform:scale(1) } 50%{ transform:scale(1.04) } 100%{ transform:scale(1) } }
.shake{ animation: shake 0.24s ease; }
@keyframes shake { 0%{ transform:translateX(0) } 25%{ transform:translateX(-6px)} 50%{ transform:translateX(6px)} 75%{ transform:translateX(-4px)} 100%{ transform:translateX(0)} }

/* result */
.result-tier{ margin-top:10px; color:var(--muted) }
.share-row{ margin-top:18px; display:flex; gap:10px; justify-content:center; flex-wrap:wrap }
.share-btn{ background:transparent; border:1px solid rgba(255,255,255,0.06); padding:8px 12px; border-radius:8px; color:var(--muted); cursor:pointer; font-size:13px; text-decoration:none }
.share-btn:hover{ color:#fff; border-color: rgba(255,255,255,0.12) }

/* leaderboard */
.leaderboard{
  margin-top:18px;
  text-align:left;
  width:100%;
  max-width:720px;
}
.lb-title{ font-weight:600; margin-bottom:8px; color:var(--muted); font-size:13px }
.lb-list{ display:flex; gap:6px; flex-direction:column; }
.lb-item{
  display:flex; justify-content:space-between; gap:12px; padding:8px 10px; background: rgba(255,255,255,0.02);
  border-radius:8px; font-size:13px; border:1px solid rgba(255,255,255,0.02);
}

/* global popup */
#global-container{ position:fixed; bottom:22px; right:22px; z-index:9999; pointer-events:none; display:flex; flex-direction:column; gap:10px; align-items:flex-end }
.global-popup{
  background: #0b0b0c; border:1px solid rgba(255,255,255,0.03);
  color:#fff; padding:10px 14px; border-radius:10px; font-size:13px;
  transform:translateX(120%); opacity:0; transition: transform .5s cubic-bezier(.2,.9,.3,1), opacity .3s;
  pointer-events:auto;
}
.global-popup.show{ transform:translateX(0); opacity:1 }

/* copy helpers & tiny badges */
.badge{ display:inline-block; padding:4px 8px; border-radius:8px; font-size:12px; color:var(--muted); background: rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.02) }

/* responsive adjustments */
@media (max-width:720px){
  body{ padding:14px; }
  #game{ padding:20px; border-radius:14px; min-height:360px; }
  .choice-btn{ padding:16px; font-size:16px; min-height:56px; }
  h2{ font-size:18px }
  .stat{ font-size:12px; padding:6px 10px }
  .leaderboard{ max-width:100% }
}
