:root{
  --bg:#0b0f1a;
  --panel:rgba(10,14,25,.78);
  --stroke:rgba(255,255,255,.18);
  --text:#f4f6ff;
  --muted:rgba(244,246,255,.78);
  --btn:rgba(255,255,255,.10);
  --btn2:rgba(255,255,255,.16);
  --shadow:0 20px 60px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}

#app{height:100%}

.screen{
  display:none;
  height:100%;
  width:100%;
}
.screen.active{display:block}

#screen-start{
  background: url("assets/start.png") center/cover no-repeat;
  position:relative;
}
.start-overlay{
  position:absolute; inset:0;
  background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.18) 45%, rgba(0,0,0,0) 70%);
  display:flex;
  align-items:center;
  padding: clamp(18px, 4vw, 56px);
}
.menu{
  width:min(360px, 86vw);
  background: rgba(10, 14, 25, .35);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.menu .btn{width:100%; margin: 10px 0}
.small-note{margin-top:8px; color:rgba(255,255,255,.55); font-size:12px}

.btn{
  border:1px solid rgba(255,255,255,.16);
  background: var(--btn);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 18px;
  cursor:pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{background: var(--btn2)}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: rgba(255, 210, 120, .20);
  border-color: rgba(255, 210, 120, .35);
}

.panel{
  width:min(720px, 92vw);
  margin: 48px auto;
  background: var(--panel);
  border:1px solid var(--stroke);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel h1{margin: 4px 0 16px; font-size: 28px}
.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255,255,255,.14);
}
.row:last-of-type{border-bottom:none}
.row label{color: var(--muted)}
.row input,.row select{
  width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: var(--text);
}
.row.buttons{border-bottom:none; justify-content:flex-end}
.row.buttons .btn{width:auto}
.hint{margin-top:12px; color:rgba(255,255,255,.72); font-size: 13px; line-height:1.6}

.quiz-wrap{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
  background: radial-gradient(1200px 700px at 30% 20%, rgba(120,140,255,.14), transparent 55%),
              radial-gradient(900px 500px at 70% 80%, rgba(255,210,120,.10), transparent 60%),
              var(--bg);
}
.quiz-top{
  width:min(820px, 94vw);
  display:flex;
  justify-content:space-between;
  color:rgba(255,255,255,.80);
  margin-bottom: 12px;
  font-size: 14px;
}
.card{
  width:min(820px, 94vw);
  background: var(--panel);
  border:1px solid var(--stroke);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.question-label{color:rgba(255,255,255,.70); font-size:12px; letter-spacing:.12em; text-transform:uppercase}
.question{font-size: 42px; margin: 10px 0 16px; font-weight: 700}
.choices{display:grid; grid-template-columns: 1fr 1fr; gap: 12px}
.choice{
  text-align:left;
  padding: 14px 14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor:pointer;
  font-size: 18px;
}
.choice:hover{background: rgba(255,255,255,.12)}
.choice.correct{border-color: rgba(110,255,170,.42); background: rgba(110,255,170,.16)}
.choice.wrong{border-color: rgba(255,120,120,.46); background: rgba(255,120,120,.16)}
.quiz-bottom{display:flex; justify-content:flex-end; margin-top: 16px}

.panel.result{margin-top: 70px; text-align:center}
.result-text{font-size:18px; margin: 10px 0 18px; color: rgba(255,255,255,.86)}

.popup{
  position:fixed; inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 50;
}
.popup.hidden{display:none}
.popup-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(2px);
}
.popup-card{
  position:relative;
  width: min(1080px, 92vw);  /* 1.5x feel */
  max-height: min(80vh, 720px);
  background: rgba(10,14,25,.92);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.popup-card video{
  width:100%;
  height:auto;
  max-height: calc(80vh - 52px);
  border-radius: 12px;
  background:black;
}

.popup-card img{
  display:block;
  max-width: 100%;
  max-height: calc(80vh - 52px);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 12px;
  background: transparent;
}

.popup-close{
  position:absolute;
  top: 8px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-size: 26px;
  cursor:pointer;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.72);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.92);
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 80;
}
.toast.hidden{display:none}

@media (max-width: 640px){
  .choices{grid-template-columns: 1fr}
  .question{font-size: 34px}
}


/* ===== Two-column quiz layout with side image ===== */
.quiz-layout{
  width:min(1200px, 96vw);
  display:flex;
  gap:24px;
  align-items:stretch;
}
.quiz-image{
  flex: 0 0 40%;
  background: url("assets/quiz_side.png") center/cover no-repeat;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow);
  min-height: 520px;
}
.quiz-area{ flex: 1; }
@media (max-width: 900px){
  .quiz-layout{ flex-direction:column; }
  .quiz-image{ height:260px; min-height:260px; }
}


/* ===== Punish Caption ===== */
.punish-caption{
  position:absolute;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  font-size:64px;
  font-weight:900;
  color:#ffdddd;
  text-shadow:0 0 20px rgba(255,0,0,0.6),
              0 0 40px rgba(255,0,0,0.4);
  pointer-events:none;
  letter-spacing:4px;
}
.punish-caption.hidden{
  display:none;
}


.btn.danger{border-color:#b33;color:#b33}
.btn.danger:hover{background:rgba(179,51,51,.08)}


/* Gallery */
.gallery-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin: 14px 0 4px;
}
.gallery-list .btn{
  width:100%;
  text-align:left;
}
