/* =========================================================
   STAGE
========================================================= */
.stage.active{
  animation:stageIn .28s ease-out;
}
@keyframes stageIn{
  from{opacity:0;transform:translateY(6px);}
  to{opacity:1;transform:none;}
}
/* =========================================================
   GENERIC ROW
========================================================= */
.generic-row{
  position:relative;
  width:min(650px,100%);
  min-height:42px;
  margin:0 auto 14px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.generic-wrap{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.generic-text{
  margin:0;
  text-align:center;
  color:rgba(234,255,247,.72);
  font-size:.86rem;
  font-weight:500;
}
.audio-box{
  position:absolute;
  right:0;
  top:50%;
  transform:translateY(-50%);
}
/* =========================================================
   ROUND METER
========================================================= */
.meter-row{
  width:min(650px,100%);
  margin:0 auto 10px;
  display:flex;
  align-items:center;
  gap:10px;
}
.meter-track{
  flex:1;
  height:7px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.07);
}
.meter-fill{
  height:100%;
  border-radius:999px;
  transition:width .45s cubic-bezier(.22,1,.36,1);
}
.round-fill{
  background:linear-gradient(90deg,#087f55,#34d399,#a7f3d0);
}
.combo-badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:4px 11px;
  border-radius:999px;
  border:1px solid rgba(52,211,153,.28);
  background:rgba(11,31,23,.85);
  font-size:.78rem;
  font-weight:800;
  color:rgba(234,255,247,.7);
  white-space:nowrap;
  transition:all .2s ease;
}
.combo-flame{
  font-size:.9rem;
  line-height:1;
}
.combo-badge.live{
  border-color:#fbbf24;
  color:#fde68a;
  background:rgba(120,53,15,.35);
  box-shadow:0 0 18px rgba(251,191,36,.28);
  animation:comboPulse .9s infinite alternate;
}
@keyframes comboPulse{
  from{transform:scale(1);}
  to{transform:scale(1.06);}
}
/* =========================================================
   TIMER
========================================================= */
.timer-track{
  width:min(650px,100%);
  height:4px;
  margin:0 auto 14px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.06);
}
.timer-fill{
  height:100%;
  width:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#34d399,#a7f3d0);
  transition:width 1s linear,background .3s ease;
}
.timer-fill.warn{
  background:linear-gradient(90deg,#f59e0b,#fde68a);
}
.timer-fill.danger{
  background:linear-gradient(90deg,#ef4444,#fca5a5);
}
/* =========================================================
   QUESTION
========================================================= */
#instruction-start,
#instruction{
  width:100%;
  text-align:center;
}
.instruction-block{
  width:100%;
}
.instruction-one{
  position:relative;
  width:min(650px,100%);
  min-height:60px;
  margin:22px auto 0;
  padding:0 62px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.instruction-one .instruction-text{
  width:100%;
  margin:0;
  color:var(--text);
  font-size:clamp(1.5rem,4.4vw,2.1rem);
  font-weight:800;
  line-height:1.25;
}
.instruction-two{
  width:100%;
  margin:8px 0 0;
}
.instruction-two .instruction-text{
  display:block;
  width:100%;
  margin:0;
  color:rgba(234,255,247,.86);
  font-size:clamp(1.05rem,3vw,1.3rem);
  font-weight:600;
  line-height:1.3;
}
.instruction-timer{
  position:absolute;
  right:0;
  top:50%;
  transform:translateY(-50%);
  min-width:46px;
  padding:5px 8px;
  border:1px solid rgba(52,211,153,.3);
  border-radius:9px;
  background:rgba(11,31,23,.95);
  color:var(--green);
  font-size:.95rem;
  font-weight:800;
  text-align:center;
}
.instruction-timer.hot{
  color:#fbbf24;
  border-color:rgba(251,191,36,.55);
  animation:tickPulse .55s infinite alternate;
}
@keyframes tickPulse{
  from{transform:translateY(-50%) scale(1);}
  to{transform:translateY(-50%) scale(1.08);}
}
.task-name-chip{
  display:inline-block;
  margin:14px auto 0;
  padding:5px 12px;
  border-radius:999px;
  border:1px solid rgba(139,92,246,.35);
  background:rgba(139,92,246,.1);
  color:var(--purple-light);
  font-size:.66rem;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.rule-helper-banner{
  width:100%;
  margin:0 auto 6px;
  padding:7px 14px;
  border-radius:9px;
  border:1px solid rgba(139,92,246,.3);
  background:rgba(139,92,246,.09);
  color:rgba(234,255,247,.78);
  font-size:.78rem;
  font-weight:500;
  line-height:1.5;
  text-align:center;
}
/* =========================================================
   CIPHER
========================================================= */
.cipher-board{
  width:min(650px,100%);
  margin:16px auto 6px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
}
.cipher-tiles{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
}
.cipher-tile{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:64px;
  padding:8px 12px;
  border:1.5px solid rgba(52,211,153,.45);
  border-radius:12px;
  background:rgba(16,41,32,.92);
  box-shadow:0 6px 18px rgba(0,0,0,.28);
  transition:transform .18s ease;
}
.cipher-tile:hover{
  transform:translateY(-3px);
}
.cipher-tile-emoji{
  font-size:2.1rem;
  line-height:1.1;
}
.cipher-tile-letter{
  margin-top:6px;
  padding:1px 9px;
  border:1px dashed rgba(52,211,153,.5);
  border-radius:7px;
  background:rgba(52,211,153,.14);
  color:var(--green);
  font-size:1.05rem;
  font-weight:900;
}
.cipher-tile.hidden-letter .cipher-tile-letter{
  color:rgba(234,255,247,.35);
  background:rgba(255,255,255,.05);
  border-color:rgba(234,255,247,.2);
}
.cipher-key{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:5px;
  width:100%;
  max-width:620px;
  padding:9px 10px;
  border:1px solid rgba(52,211,153,.14);
  border-radius:10px;
  background:rgba(11,18,16,.72);
}
.cipher-key-title{
  width:100%;
  text-align:center;
  font-size:.6rem;
  font-weight:800;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(234,255,247,.4);
  margin-bottom:2px;
}
.cipher-key-chip{
  display:inline-flex;
  align-items:center;
  gap:3px;
  padding:2px 7px;
  border-radius:6px;
  background:rgba(16,41,32,.9);
  font-size:.9rem;
  font-weight:600;
  color:rgba(234,255,247,.66);
}
.cipher-key-chip b{
  color:var(--green);
  font-weight:800;
}
/* =========================================================
   DUAL TASK
========================================================= */
.dual-board{
  width:min(560px,100%);
  margin:18px auto;
  border:1px solid rgba(52,211,153,.3);
  border-radius:14px;
  background:rgba(16,41,32,.55);
  overflow:hidden;
}
.dual-grid{
  display:grid;
  grid-template-columns:74px repeat(4,minmax(0,1fr));
  align-items:stretch;
}
.dual-grid+.dual-grid{
  border-top:1px solid rgba(52,211,153,.14);
}
.dual-corner,
.dual-row-label{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:6px 4px;
  font-size:.58rem;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:rgba(234,255,247,.42);
  background:rgba(11,18,16,.9);
}
.dual-head .dual-pos{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:6px 0;
  font-size:.85rem;
  font-weight:900;
  color:var(--green);
  background:rgba(52,211,153,.08);
}
.dual-cell{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:62px;
  padding:6px 2px;
  border-left:1px solid rgba(52,211,153,.14);
  font-size:1.9rem;
  font-weight:800;
  color:#fff;
}
.dual-cell.num{
  font-size:1.7rem;
}
/* =========================================================
   CLUES
========================================================= */
.clue-box{
  width:min(650px,100%);
  margin:16px auto;
  padding:14px 18px;
  border:1px solid rgba(139,92,246,.3);
  border-left:3px solid var(--purple);
  border-radius:12px;
  background:rgba(16,25,22,.85);
  text-align:left;
}
.clue-box-title{
  font-size:.62rem;
  font-weight:800;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(234,255,247,.42);
  margin-bottom:8px;
}
.clue{
  position:relative;
  padding:6px 0 6px 20px;
  font-size:1rem;
  font-weight:500;
  line-height:1.45;
  color:#e6fff5;
}
.clue::before{
  content:"\25B8";
  position:absolute;
  left:2px;
  top:6px;
  color:var(--green);
}
/* =========================================================
   OPTIONS
========================================================= */
.opt-grid{
  width:min(650px,100%);
  max-width:650px;
  margin:20px auto 70px;
  display:grid;
  gap:12px;
  grid-template-columns:repeat(4,minmax(0,1fr));
}
#game{
  padding-bottom:70px;
}
.opt-btn{
  width:100%;
  min-height:88px;
  padding:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1.5px solid rgba(52,211,153,.22);
  border-radius:14px;
  background:rgba(16,41,32,.72);
  color:var(--text);
  font-family:var(--font);
  font-size:1.7rem;
  font-weight:300;
  line-height:1;
  text-align:center;
  cursor:pointer;
  transition:transform .12s ease,border-color .15s ease,background .15s ease,box-shadow .15s ease;
}
.opt-btn:hover:not(:disabled){
  transform:translateY(-3px);
  border-color:rgba(52,211,153,.7);
  background:rgba(16,41,32,.95);
  box-shadow:0 10px 24px rgba(52,211,153,.12);
}
.opt-btn:disabled{
  cursor:default;
}
.opt-btn.correct{
  border-color:var(--green);
  color:#fff;
  background:linear-gradient(150deg,rgba(52,211,153,.3),rgba(6,78,59,.6));
  box-shadow:0 0 0 2px rgba(52,211,153,.35),0 10px 28px rgba(52,211,153,.25);
  animation:pop .32s cubic-bezier(.2,1.6,.4,1);
}
.opt-btn.wrong{
  border-color:#f87171;
  color:#fff;
  background:linear-gradient(150deg,rgba(248,113,113,.24),rgba(76,5,25,.55));
  animation:shake .34s ease;
}
@keyframes pop{
  0%{transform:scale(.94);}
  55%{transform:scale(1.05);}
  100%{transform:scale(1);}
}
@keyframes shake{
  0%,100%{transform:translateX(0);}
  20%{transform:translateX(-7px);}
  45%{transform:translateX(6px);}
  70%{transform:translateX(-4px);}
}
/* =========================================================
   RESULT
========================================================= */
.result-message{
  margin-top:20px;
  text-align:center;
}
.result-main-message{
  font-size:clamp(1.15rem,3.2vw,1.5rem);
  font-weight:800;
  line-height:1.35;
  color:#fff;
}
.result-secondary-message{
  margin-top:7px;
  font-size:.95rem;
  font-weight:300;
  line-height:1.55;
  color:var(--muted);
}
.result-metrics{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
  width:100%;
  max-width:520px;
  margin:22px auto 0;
}
.metric{
  padding:12px 8px;
  border-radius:12px;
  border:1px solid rgba(52,211,153,.18);
  background:rgba(11,18,16,.7);
  text-align:center;
}
.metric-value{
  font-size:1.35rem;
  font-weight:900;
  color:var(--green);
  line-height:1;
}
.metric-label{
  margin-top:6px;
  font-size:.6rem;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:rgba(234,255,247,.42);
}

.result-bottom-text{
  margin:18px auto 0;
  width:min(520px,100%);
  padding:14px 16px;
  border:1px solid rgba(139,92,246,.4);
  border-radius:12px;
  background:rgba(139,92,246,.12);
  font-size:1rem;
  font-weight:600;
  line-height:1.45;
  color:var(--text);
  text-align:center;
}
.next-day-message{
  margin-top:8px;
  font-size:.85rem;
  font-weight:300;
  line-height:1.55;
  color:var(--muted);
  text-align:center;
}
.info-card li strong{
  color:var(--text);
  font-weight:700;
}
/* =========================================================
   RESPONSIVE
========================================================= */
@media(max-width:650px){
  .header{padding:10px 12px;}
  .header-name{font-size:.88rem;}
  .generic-text{font-size:.78rem;padding:0 44px;}
  .instruction-one{min-height:50px;padding:0 50px;margin-top:16px;}
  .instruction-one .instruction-text{font-size:1.4rem;}
  .instruction-timer{min-width:40px;font-size:.8rem;}
  .instruction-two .instruction-text{font-size:1rem;}
  .opt-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    margin:16px auto 26px;
  }
  .result-metrics{
    grid-template-columns:repeat(2,1fr);
  }
}