/* ============================================
   パフォーマンスラボ 共通スタイル
   ぱぱん式ブランドに準拠したデザイン
   ============================================ */

/* ---------- リセット・基本設定 ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* カラーパレット */
    --bg-gradient-start: #e0f7fa;
    --bg-gradient-end:   #f3e5f5;
    --card-bg:           rgba(255, 255, 255, 0.95);
    --accent:            #ff9800;
    --accent-dark:       #e65100;
    --primary:           #5c6bc0;
    --primary-dark:      #3949ab;
    --success:           #66bb6a;
    --danger:            #ef5350;
    --text-main:         #333;
    --text-sub:          #777;

    /* ゲーム別カラー */
    --game1-color: #ff7043; /* スターフラッシュ：オレンジ系 */
    --game2-color: #26c6da; /* 定規キャッチ：シアン系 */
    --game3-color: #ab47bc; /* 色と文字：パープル系 */
    --game4-color: #26a69a; /* アニマル追跡：ティール系 */
    --game5-color: #ec407a; /* シャッターチャンス：ピンク系 */

    --border-radius-main: 28px;
    --border-radius-btn:  50px;
    --card-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

body {
    font-family: "UD Digital Kyokasho-tai-R", "Hiragino Kaku Gothic ProN",
                 "Helvetica Neue", Arial, Meiryo, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16px;
    touch-action: manipulation;
    color: var(--text-main);
}

/* ---------- メインコンテナ ---------- */
#labo-container {
    width: 100%;
    max-width: 560px;
    background: var(--card-bg);
    border-radius: var(--border-radius-main);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    position: relative;
    min-height: 80vh;
}

/* ---------- ヘッダー ---------- */
#labo-header {
    background: linear-gradient(135deg, var(--primary) 0%, #7986cb 100%);
    color: white;
    padding: 14px 20px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#labo-header .header-title {
    font-size: 1.05rem;
    font-weight: bold;
    line-height: 1.3;
}

#labo-header .header-sub {
    font-size: 0.75rem;
    opacity: 0.85;
}

/* ---------- プログレスバー ---------- */
#progress-bar-wrap {
    padding: 10px 20px 0;
    background: linear-gradient(135deg, var(--primary) 0%, #7986cb 100%);
}

.step-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.step-label {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.8);
    text-align: center;
    flex: 1;
}

.step-label.active {
    color: #fff;
    font-weight: bold;
}

#progress-bar-bg {
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

#progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

/* ---------- シーン共通 ---------- */
.scene {
    display: none;
    padding: 24px 22px 28px;
    animation: fadeIn 0.35s ease;
}

.scene.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- キャラクターナビ ---------- */
.character-nav {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.character-nav img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
}

.speech-bubble {
    background: #e3f2fd;
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-main);
    position: relative;
    flex: 1;
}

/* ---------- タイトル系 ---------- */
.scene-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: var(--primary);
    margin-bottom: 6px;
}

.scene-title-sub {
    font-size: 0.85rem;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: 20px;
}

/* ---------- ゲームカード一覧（タイトル画面） ---------- */
.game-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.game-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f5f5f5;
    border-radius: 16px;
    padding: 12px 16px;
}

.game-card-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.game-card-info {
    flex: 1;
}

.game-card-name {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--text-main);
}

.game-card-desc {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-top: 2px;
}

.game-card-ability {
    font-size: 0.72rem;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ---------- ボタン共通 ---------- */
.btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: var(--border-radius-btn);
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(0,0,0,0.18);
    transition: transform 0.08s, box-shadow 0.08s;
    font-family: inherit;
    touch-action: manipulation;
}

.btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.18);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.btn-success {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
}

.btn-ghost {
    background: transparent;
    color: var(--text-sub);
    box-shadow: none;
    font-size: 0.88rem;
    padding: 10px;
}

.btn-ghost:active {
    transform: none;
    box-shadow: none;
}

/* ---------- カウントダウン ---------- */
#countdown-display {
    font-size: 5rem;
    font-weight: bold;
    text-align: center;
    color: var(--primary);
    padding: 40px 0;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ---------- ゲームプレイエリア ---------- */
#game-area {
    min-height: 300px;
    position: relative;
}

/* ゲームタイトルバナー */
.game-banner {
    background: linear-gradient(135deg, var(--game1-color) 0%, #bf360c 100%);
    border-radius: 16px;
    color: white;
    padding: 12px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-banner.g2 { background: linear-gradient(135deg, var(--game2-color) 0%, #00838f 100%); }
.game-banner.g3 { background: linear-gradient(135deg, var(--game3-color) 0%, #6a1b9a 100%); }
.game-banner.g4 { background: linear-gradient(135deg, var(--game4-color) 0%, #00695c 100%); }
.game-banner.g5 { background: linear-gradient(135deg, var(--game5-color) 0%, #880e4f 100%); }

.game-banner-icon { font-size: 1.8rem; }
.game-banner-text { flex: 1; }
.game-banner-name { font-size: 1rem; font-weight: bold; }
.game-banner-ability { font-size: 0.72rem; opacity: 0.85; }

/* タイマーバー */
.timer-bar-wrap {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 16px;
}

.timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #29b6f6, #0288d1);
    border-radius: 5px;
    transition: width 0.1s linear;
}

/* ---------- フラッシュフィードバック ---------- */
#feedback-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    border-radius: var(--border-radius-main);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 50;
}

#feedback-overlay.show {
    opacity: 1;
}

#feedback-overlay.correct {
    color: #2e7d32;
    background: rgba(200, 230, 201, 0.7);
}

#feedback-overlay.wrong {
    color: #c62828;
    background: rgba(255, 205, 210, 0.7);
}

/* ---------- リザルト画面 ---------- */
#result-scene .radar-wrap {
    max-width: 320px;
    margin: 0 auto 20px;
}

.result-ability-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.result-ability-item {
    background: #f5f5f5;
    border-radius: 14px;
    padding: 10px 12px;
    text-align: center;
}

.result-ability-label {
    font-size: 0.72rem;
    color: var(--text-sub);
    margin-bottom: 4px;
}

.result-ability-score {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--primary);
}

/* ---------- ホームボタン ---------- */
.home-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.88rem;
    border-bottom: 1px dotted var(--text-sub);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- レスポンシブ調整 ---------- */
@media (max-width: 400px) {
    .scene-title { font-size: 1.3rem; }
    .btn { font-size: 1rem; padding: 14px; }
}
