/* ===== Lab Panic (ラボパニック) ===== */
:root {
  --game-accent: #B5DDC9;
}

body { overflow-x: hidden; }
.top-bar { display: flex; align-items: center; justify-content: space-between; padding: .5rem 1rem; background: var(--surface); border-bottom: 3px solid var(--color-coral); box-shadow: var(--shadow-sm); }
.top-bar .title { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.top-bar .title a { color: var(--text-muted); }
.top-bar .title span { color: var(--text); font-weight: 900; }
.icon-btn { background: var(--surface2); border: 2px solid var(--surface2); color: var(--text-muted); width: 30px; height: 30px; border-radius: 50%; font-size: .8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit; font-weight: 700; }
.game-page { max-width: 600px; margin: 0 auto; padding: .5rem .75rem; display: flex; flex-direction: column; gap: .6rem; min-height: calc(100vh - 48px); }
.setup-section { background: var(--surface); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.setup-section h4 { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: .5rem; font-weight: 700; }
.options-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.option-group { display: flex; flex-direction: column; gap: .25rem; }
.option-group label { font-size: .7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.option-pills { display: flex; gap: .25rem; flex-wrap: wrap; }
.option-pill { padding: .25rem .6rem; font-size: .75rem; border-radius: 999px; border: 2px solid var(--surface2); background: var(--surface); color: var(--text-muted); cursor: pointer; font-family: inherit; font-weight: 600; transition: all .15s; }
.option-pill.selected { background: var(--color-coral); color: #5A3A3A; border-color: transparent; }
.start-btn { margin-top: .8rem; width: 100%; padding: .7rem; font-size: 1.1rem; border-radius: 999px; background: var(--color-coral); color: #5A3A3A; box-shadow: 0 4px 14px rgba(181,221,201,.5); border: none; font-family: inherit; font-weight: 700; cursor: pointer; }
.start-btn:active { transform: scale(.97); }
.phase-section { background: var(--surface); border-radius: var(--radius); padding: 1.2rem 1rem; box-shadow: var(--shadow); text-align: center; }
.round-counter { font-size: .7rem; color: var(--text-muted); font-weight: 600; margin-bottom: .3rem; }

/* Experiment card */
.experiment-card { background: linear-gradient(135deg, var(--game-accent), #9dcfb8); border: 2px solid var(--game-accent); border-radius: 16px; padding: 1rem; margin: .5rem 0; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; position: relative; overflow: hidden; }
.experiment-card .exp-icon { font-size: 2.5rem; }
.experiment-card .exp-question { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.6; }
.experiment-card .exp-category { position: absolute; top: .5rem; right: .6rem; font-size: .6rem; font-weight: 700; color: #3a7a5e; background: rgba(255,255,255,.7); padding: .1rem .5rem; border-radius: 999px; }

/* Experiment visual (CSS animations) */
.exp-visual { width: 100%; min-height: 80px; display: flex; align-items: center; justify-content: center; gap: 1rem; position: relative; }
.exp-visual .item { display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: .7rem; font-weight: 600; color: var(--text-muted); }
.exp-visual .item .emoji { font-size: 2rem; animation: expBounce 1.2s ease-in-out infinite; }
.exp-visual .item:nth-child(2) .emoji { animation-delay: .2s; }
.exp-visual .item:nth-child(3) .emoji { animation-delay: .4s; }
.exp-visual .vs { font-size: 1.2rem; font-weight: 900; color: #3a7a5e; }
@keyframes expBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Explain box */
.explain-box { background: linear-gradient(135deg, #e8f5ef, #d5ede4); border: 2px solid var(--game-accent); border-radius: 12px; padding: .7rem .8rem; margin-top: .5rem; text-align: left; }
.explain-box .explain-label { font-size: .65rem; font-weight: 900; color: #3a7a5e; text-transform: uppercase; margin-bottom: .2rem; }
.explain-box .explain-text { font-size: .8rem; color: var(--text); line-height: 1.6; }

/* Choice grid */
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; margin: .6rem 0; }
.choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.choice-grid .choice-btn { padding: .6rem .4rem; font-size: .9rem; font-weight: 700; border-radius: 14px; border: 3px solid var(--surface2); background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; transition: all .15s; text-align: center; line-height: 1.3; }
.choice-grid .choice-btn:active { transform: scale(.96); }
.choice-grid .choice-btn.selected { border-color: var(--game-accent); background: linear-gradient(135deg, var(--game-accent), #9dcfb8); color: #5A3A3A; }
.choice-grid .choice-btn.correct { border-color: #10b981; background: #10b981; color: #fff; }
.choice-grid .choice-btn.wrong { border-color: #ef4444; background: #fef2f2; color: #ef4444; opacity: .6; }

/* Slider input */
.slider-area { margin: .5rem 0; }
.slider-value { font-size: 2rem; font-weight: 900; color: #3a7a5e; margin: .3rem 0; min-height: 2.5rem; }
.slider-unit { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.slider-input { width: 90%; max-width: 300px; margin: .3rem 0; accent-color: var(--game-accent); }
.number-input { width: 160px; padding: .5rem; font-size: 1.5rem; font-weight: 900; text-align: center; border-radius: 14px; border: 3px solid var(--game-accent); font-family: inherit; outline: none; }
.number-input:focus { border-color: #3a7a5e; box-shadow: 0 0 0 3px rgba(181,221,201,.4); }
.predict-timer { font-size: .75rem; color: var(--primary); font-weight: 700; margin-top: .3rem; }
.predict-submit { margin-top: .5rem; padding: .5rem 2rem; font-size: 1rem; border-radius: 999px; background: var(--color-coral); color: #5A3A3A; border: none; font-weight: 700; cursor: pointer; font-family: inherit; }

/* Result */
.result-answer { font-size: 2rem; font-weight: 900; color: #3a7a5e; margin: .5rem 0; }
.result-bar { position: relative; height: 8px; background: var(--surface2); border-radius: 4px; margin: 1.5rem .5rem; }
.result-marker { position: absolute; top: 50%; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; }
.result-marker .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.result-marker .name { font-size: .55rem; font-weight: 700; margin-top: .2rem; white-space: nowrap; }
.result-marker .val { font-size: .5rem; color: var(--text-muted); }
.answer-line { position: absolute; top: -12px; bottom: -12px; width: 3px; background: var(--game-accent); transform: translateX(-50%); border-radius: 2px; }
.answer-label { position: absolute; top: -24px; transform: translateX(-50%); font-size: .6rem; color: #3a7a5e; font-weight: 900; white-space: nowrap; }

.result-section { text-align: center; }
.result-icon { font-size: 3rem; margin-bottom: .3rem; }
.result-title { font-size: 1.2rem; font-weight: 900; margin-bottom: .3rem; }
.result-details { font-size: .8rem; color: var(--text-muted); line-height: 1.8; text-align: left; }
.result-details strong { color: var(--text); }
.next-btn { margin-top: .6rem; padding: .6rem 2rem; font-size: 1rem; border-radius: 999px; }

.score-section { background: var(--surface); border-radius: var(--radius); padding: .5rem .8rem; box-shadow: var(--shadow); }
.score-section h4 { font-size: .7rem; color: var(--text-muted); margin-bottom: .3rem; text-transform: uppercase; font-weight: 700; }
.score-list { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.score-item { font-size: .8rem; display: flex; gap: .3rem; align-items: center; }
.score-item .name { font-weight: 700; }
.score-item .pts { color: #3a7a5e; font-weight: 700; }
.log-section { background: var(--surface); border-radius: var(--radius); padding: .5rem .8rem; box-shadow: var(--shadow); }
.log-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.log-header h4 { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.clear-log-btn { background: var(--surface2); border: 2px solid var(--surface2); color: var(--text-muted); border-radius: 8px; padding: .15rem .5rem; font-size: .65rem; cursor: pointer; font-family: inherit; font-weight: 600; }
.log-entry { display: flex; justify-content: space-between; padding: .25rem 0; border-bottom: 1px solid var(--surface2); font-size: .75rem; }
.log-entry:last-child { border-bottom: none; }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(90,58,58,.3); backdrop-filter: blur(4px); z-index: 100; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.show { display: flex; }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; max-width: 400px; width: 100%; max-height: 80vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-lg); }
.modal-box h3 { margin-bottom: .8rem; font-weight: 900; }
.modal-box ul { margin: 0 0 0 1.2rem; line-height: 1.8; font-size: .85rem; color: var(--text-muted); }
.modal-close { position: absolute; top: .5rem; right: .8rem; background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
@media (max-width: 480px) { .experiment-card .exp-question { font-size: .9rem; } .number-input { font-size: 1.2rem; width: 130px; } }
