/* ==============================
   main.css (FULL OPTIMIZED)
   ============================== */

:root{
  --bg:#000;
  --panel:#0f0f0f;
  --panel2:#141414;
  --white:#fff;
  --black:#000;
  --green:#1db954;
  --red:#ff2d2d;

  --radius:18px;
  --radius2:22px;

  --gap:18px;
  --gap2:22px;

  --shadow:0 18px 50px rgba(0,0,0,.55);
  --stroke:1px solid rgba(255,255,255,.12);
}

/* ===== RESET ===== */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:radial-gradient(ellipse at 50% 20%,#151515 0%,#050505 45%,#000 100%);
  color:var(--white);
}

/* ===== OVERLAYS ===== */
.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.92);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
}
.overlay.is-active{ display:flex; }

.overlay-box{
  text-align:center;
  padding:30px 20px;
}
.overlay-box h1{
  margin:0 0 18px;
  font-weight:900;
  line-height:1.05;
  font-size:clamp(34px,6vw,64px);
}
.overlay-box button{
  appearance:none;
  border:0;
  border-radius:999px;
  padding:14px 38px;
  font-weight:900;
  font-size:22px;
  background:var(--green);
  color:#000;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(0,0,0,.35);
}
.overlay-box button:hover{ filter:brightness(1.05); }
.overlay-box button:active{ transform:translateY(1px); }

/* ===== TOP BAR ===== */
.topbar{
  position:sticky;
  top:0;
  z-index:40;
  height:54px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;
  background:linear-gradient(to bottom,rgba(0,0,0,.85),rgba(0,0,0,.25));
  border-bottom:1px solid rgba(255,255,255,.10);
  backdrop-filter:blur(10px);
}

.exit-btn{
  width:40px;
  height:40px;
  border:0;
  border-radius:999px;
  background:transparent;
  color:#fff;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  opacity:.95;
}
.exit-btn:hover{ opacity:1; }

.score{
  font-weight:900;
  letter-spacing:.5px;
  font-size:18px;
  text-transform:uppercase;
}
#scoreValue{ 
  font-weight:900;
}

/* ===== GAME WRAPPER ===== */
.game{
  padding:16px;
  min-height:calc(100vh - 54px);
}

/* ===== QUESTION ===== */
.question-wrapper{
  width:100%;
  display:flex;
  justify-content:center;
}

.question-box{
  width:min(900px,100%);
  padding:18px 18px 16px;
  border-radius:var(--radius2);
  background:rgba(0,0,0,.35);
  border:var(--stroke);
  box-shadow:var(--shadow);
}

#questionText{
  margin:0 0 12px;
  font-weight:900;
  text-align:center;
  font-size:clamp(22px,4.2vw,44px);
}

/* Timer */
.timer-bar{
  height:16px;
  border-radius:999px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  overflow:hidden;
}
.timer-fill{
  height:100%;
  width:100%;
  border-radius:999px;
  background:var(--green);
  transition:width .18s linear;
}

/* ===== PANELS ===== */
.panels{
  margin-top:16px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:var(--gap);
  align-items:stretch;
}

#hangImg,#homeImg{
  width:100%;
  aspect-ratio:1/1;
  object-fit:contain;
  background:#fff;
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 14px 40px rgba(0,0,0,.45);
}

/* ===== OPTIONS ===== */
.options{
  margin-top:16px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:var(--gap);
}

.option{
  position:relative;
  width:100%;
  aspect-ratio:1/.80;
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.05);
  box-shadow:0 12px 34px rgba(0,0,0,.45);
  cursor:pointer;
  overflow:hidden;
  padding:10px;
}

.option img{
  width:100%;
  height:100%;
  object-fit:contain;
  background:#fff;
  border-radius:calc(var(--radius) - 6px);
}

.option:focus{ outline:none; }
.option:focus-visible{
  box-shadow:0 0 0 3px rgba(29,185,84,.35),0 12px 34px rgba(0,0,0,.45);
}
.option:hover{ filter:brightness(1.03); }
.option:active{ transform:translateY(1px); }

.option.correct{
  box-shadow:0 0 0 3px rgba(29,185,84,.55),0 12px 34px rgba(0,0,0,.45);
}
.option.wrong{
  box-shadow:0 0 0 3px rgba(255,45,45,.55),0 12px 34px rgba(0,0,0,.45);
}

/* ===== DESKTOP ===== */
@media (min-width:900px){

  .exit-btn{
    background:rgba(255,45,45,.18);
    border:1px solid rgba(255,45,45,.35);
    color:var(--red);
  }

  body{ overflow:hidden; }

  .game{
    height:calc(100vh - 54px);
    padding:22px;
    display:grid;
    grid-template-columns:440px 1fr;
    grid-template-rows:auto 1fr;
    gap:26px;
    align-items:start;
  }

  .panels{
    margin:0;
    grid-column:1;
    grid-row:1 / span 2;
    grid-template-columns:1fr;
    gap:18px;
    align-content:start;
  }

  .question-wrapper{
    grid-column:2;
    grid-row:1;
    justify-content:center;
  }

  .question-box{ width:min(980px,100%); }

  .options{
    grid-column:2;
    grid-row:2;
    width:min(980px,100%);
    margin:0 auto;
    gap:22px;
    align-content:start;
    justify-content:center;
  }

  .option{ padding:10px; }

  #questionText{ text-align:left; }
}

/* ===== SMALL DEVICES ===== */
@media (max-width:420px){
  .game{ padding:12px; }
  .question-box{ padding:16px; }
  .timer-bar{ height:14px; }
  .panels,.options{ gap:12px; }
}
