@charset "UTF-8";
/**
 * ストーム素材キャッチミニゲーム - 専用スタイルシート
 * 
 * テーマ: トーラムオンラインの草原フィールド × 魔法ストーム
 * 特徴:
 * 1. 昼間の草原をイメージした爽やかなアウトドアカラーテーマ
 * 2. 320px幅モバイルデバイスでも絶対に崩れない完全スタック型レスポンシブ
 * 3. HUDは視認性重視の半透明黒パネルで明るい背景に対応
 */

:root {
    --bg-dark: #1a2e1a;             /* 草原の夜暗色 */
    --panel-bg: rgba(0, 20, 0, 0.80); /* 半透明の緑系ダークパネル */
    --neon-green: #00e676;          /* ストームを象徴するビビッドグリーン */
    --neon-gold: #ffd700;           /* 宝箱やゴールドストームの金光 */
    --neon-blue: #00bfff;           /* コアUIなどのライトブルー */
    --danger-red: #ff4a5a;          /* 爆弾やHP低下の危険赤 */
    --text-main: #f3f4f6;           /* 主テキスト色（読みやすさ重視の高コントラスト） */
    --text-muted: #9ca3af;          /* 補助テキスト用グレー */
    --border-glow: rgba(0, 255, 170, 0.3);
}

/* 全体基本スタイル (草原の空をイメージした明るいグラデーション背景) */
body {
    background: linear-gradient(180deg, #87ceeb 0%, #c8e8f5 35%, #4caf50 60%, #2e7d32 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Outfit', 'M PLUS Rounded 1c', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* 戻るナビゲーションバー (草原テーマ: 半透明の緑ガラス) */
.nav-header {
    width: 100%;
    max-width: 600px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 60, 0, 0.55);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid rgba(0, 200, 100, 0.5);
    box-sizing: border-box;
    z-index: 100;
}

.nav-header a {
    color: #e8ffe8;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.nav-header a:hover {
    color: var(--neon-green);
}

.nav-header .header-title {
    font-size: 0.85rem;
    color: #a8ffcc;
    font-weight: 900;
    letter-spacing: 1px;
}

/* メインコンテナ */
.game-container {
    width: 100%;
    max-width: 600px;
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

/* タイトルエリア */
.game-title-area {
    text-align: center;
    margin-bottom: 12px;
    cursor: pointer; /* 隠しタップ用のためのカーソル表示 */
    user-select: none;
}

.game-title-area h1 {
    font-size: 1.8rem;
    font-weight: 950;
    margin: 0;
    background: linear-gradient(135deg, #ffffff, var(--neon-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 255, 170, 0.4);
    letter-spacing: 1px;
}

.game-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 4px 0 0 0;
    letter-spacing: 0.5px;
}

/* ゲーム表示エリア (草原テーマ: 青空ベースに緑のボーダー) */
.canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; /* モバイルファーストのアスペクト比固定 */
    background: #87ceeb; /* Canvas描画前に見える空の青 */
    border: 3px solid rgba(50, 180, 100, 0.8);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.3),
        0 8px 32px rgba(0, 80, 0, 0.35),
        inset 0 0 10px rgba(0,0,0,0.15);
    overflow: hidden;
    touch-action: none; /* スマホのスクロールを防ぎ操作性を向上 */
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ゲームオーバー・スタートモーダル */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 17, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 24px;
    box-sizing: border-box;
}

.overlay-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-title {
    font-size: 2.2rem;
    font-weight: 950;
    color: var(--neon-green);
    text-shadow: 0 0 15px rgba(0, 255, 170, 0.6);
    margin-bottom: 8px;
    text-align: center;
}

.overlay-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: center;
    max-width: 80%;
}

/* アクションボタン */
.btn-neon {
    background: linear-gradient(135deg, var(--neon-green), #00cc88);
    color: #040711;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-weight: 900;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 255, 170, 0.4);
    transition: all 0.2s;
    text-shadow: none;
}

.btn-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 255, 170, 0.6);
}

.btn-neon:active {
    transform: translateY(1px);
}

/* スコア登録フォーム */
.score-submit-container {
    width: 100%;
    max-width: 320px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-name {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid var(--neon-green);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
    text-align: center;
    outline: none;
}

.input-name:focus {
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.4);
}

/* ゲーム説明・モバイル用仮想コントローラー */
.mobile-controls {
    display: none;
    width: 100%;
    max-width: 280px; /* 横幅を制限して中央寄りに配置 */
    margin: 20px auto 75px; /* 下部マージンを75pxに大幅強化し、AdSenseアンカー広告との誤タップ・接触を完全に防ぐ */
    grid-template-columns: 1fr 1fr;
    gap: 24px; /* 誤タップを防ぐ適切な隙間 */
    box-sizing: border-box;
}

.btn-dir {
    background: rgba(0, 50, 20, 0.55); /* 草原テーマに合わせた深緑のガラスデザイン */
    border: 2px solid rgba(0, 200, 100, 0.4);
    border-radius: 20px;
    color: #fff;
    padding: 16px 20px;
    font-size: 1.8rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.1s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-dir:active {
    background: rgba(0, 255, 170, 0.25);
    border-color: var(--neon-green);
    transform: scale(0.95);
}

/* ランキングセクション (草原テーマ: 深緑の半透明パネル) */
.ranking-section {
    width: 100%;
    background: rgba(0, 30, 5, 0.82);
    border: 2px solid rgba(0, 180, 80, 0.3);
    border-radius: 20px;
    padding: 20px;
    box-sizing: border-box;
    margin-top: 24px;
    box-shadow: 0 10px 30px rgba(0, 40, 0, 0.6);
}

.ranking-title {
    font-size: 1.25rem;
    font-weight: 900;
    margin: 0 0 15px 0;
    text-align: center;
    color: var(--neon-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ranking-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--neon-green);
    color: #040711;
    border-color: var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.2);
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.ranking-item:last-child {
    border-bottom: none;
}

.rank-num {
    width: 25px;
    font-weight: 900;
}

.rank-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 10px;
}

.rank-score {
    font-family: monospace;
    font-weight: 800;
    color: #00e676; /* ビビッドグリーン — 草原テーマの差し色 */
}

/* ゴールド、シルバー、ブロンズ賞 */
.rank-1 { color: var(--neon-gold); }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

/* 320px前後の極狭モバイル画面に対応するレスポンシブ設計 */
@media (max-width: 768px) {
    .mobile-controls {
        display: grid; /* タッチデバイスでは仮想ボタンを表示 */
    }
}

@media (max-width: 350px) {
    .game-title-area h1 {
        font-size: 1.4rem;
    }
    
    .nav-header {
        padding: 8px 12px;
    }
    
    .btn-dir {
        padding: 15px;
        font-size: 1.4rem;
    }

    .ranking-tabs {
        grid-template-columns: 1fr; /* タブボタンが詰まるのを防ぐために縦に並べる */
        gap: 6px;
    }

    .overlay-title {
        font-size: 1.6rem;
    }

    .overlay-desc {
        font-size: 0.8rem;
    }
}

/* Xシェアボタンの専用スタイル */
.btn-share-x {
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #333333 !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease;
}

.btn-share-x:hover {
    background: #111111 !important;
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px);
}

.btn-share-x:active {
    transform: translateY(1px);
}
