/* デザインシステムと共通変数（シニア向け文字拡大・高コントラスト） */
:root {
    --bg-color: #FDFBF7; /* 共通ベージュ背景 */
    --panel-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    --accent-color: #E8834A; /* 共通メインオレンジ */
    --accent-hover: #d2723c;
    --correct-color: #5B9E6E;
    --error-color: #ef4444;
    --font-sans: 'Hiragino Maru Gothic ProN', 'BIZ UDPGothic', 'Meiryo', sans-serif;
    --shadow-premium: 0 6px 20px rgba(232, 131, 74, 0.1);
}

/* 全体設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 共通固定ナビゲーションバー */
/* グローバルナビ（他ゲームと共通） */
.g-nav {
    position: fixed; top: 0; left: 0; right: 0; height: 52px;
    background: #E8834A; display: flex; align-items: center;
    padding: 0 16px; z-index: 100; gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.g-nav-arrow { color: white; font-size: 1.5rem; text-decoration: none; line-height: 1; }
.g-nav-title { color: white; font-size: 1rem; font-weight: bold; text-decoration: none;
    font-family: 'Hiragino Maru Gothic ProN', 'BIZ UDPGothic', 'Meiryo', sans-serif; }

/* アプリ容器 */
#app-container {
    flex: 1;
    margin-top: 52px; /* 固定ヘッダー分 */
    padding: 24px 16px;
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* カードスタイル */
.game-card {
    background: var(--panel-bg);
    border: 3.5px solid rgba(232, 131, 74, 0.25);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-premium);
}

.header-panel {
    border-color: var(--accent-color);
    text-align: center;
}

.game-title {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 6px;
    font-weight: bold;
}

.game-instruction {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* メインゲームエリア */
#game-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    #game-main {
        grid-template-columns: 1fr;
    }
}

/* お会計ボード */
.bill-panel {
    grid-column: 1 / -1;
    background: #FFFBF0;
    border-color: var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bill-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-secondary);
}

.bill-amount {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--accent-color);
}

.item-list {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: right;
}

/* お支払い皿 */
.tray-panel {
    border-color: var(--correct-color);
    background: #F4FAF5;
}

.tray-title, .wallet-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--text-secondary);
    border-bottom: 2px dashed rgba(0,0,0,0.1);
    padding-bottom: 6px;
}

.tray-amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--correct-color);
    margin-bottom: 12px;
}

/* コインレイアウト */
.coin-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 120px;
    align-content: flex-start;
}

/* コインスタイル */
.coin {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: transform 0.1s, box-shadow 0.1s;
    border: 3px solid rgba(0,0,0,0.1);
}

.coin:active {
    transform: scale(0.9);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 硬貨ごとの色分け（視覚補助） */
.coin-500 { background: #E5C158; color: #4A3B12; } /* 五百円: 金色 */
.coin-100 { background: #C0C0C0; color: #333333; } /* 百円: 銀色 */
.coin-50  { background: #D9D9D9; color: #333333; border-style: dashed; } /* 五十円: 穴あき表現 */
.coin-10  { background: #D27D2D; color: #ffffff; } /* 十円: 銅色 */

/* フッター */
#game-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
}

.action-btn {
    flex: 1;
    font-size: 1.4rem;
    font-weight: bold;
    padding: 16px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.1s;
}

.action-btn:active {
    transform: scale(0.97);
}

.reset-btn {
    background: #E0E0E0;
    color: #333333;
}

.submit-btn {
    background: var(--accent-color);
    color: #ffffff;
}

/* モーダル */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #ffffff;
    border: 4px solid var(--accent-color);
    border-radius: 24px;
    padding: 32px;
    width: 90%;
    max-width: 460px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.modal-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--correct-color);
    margin-bottom: 12px;
}

.modal-message {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-btn {
    font-size: 1.3rem;
    font-weight: bold;
    padding: 14px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    background: var(--accent-color);
    color: #ffffff;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 10px rgba(232, 131, 74, 0.25);
}

.modal-btn.secondary-btn {
    background: #f0f0f0;
    color: #333333;
    box-shadow: none;
}

.hidden {
    display: none !important;
}
