/* =========================================================
   遊戲小窩 - 90年代懷舊復古暖色風格 (Retro 90s Theme)
   專為中老年與懷舊玩家量身打造：高對比、大字型、溫潤暖色、大按鍵
   ========================================================= */

:root {
    /* 暖色系基調 (溫暖茶褐、麥芽黃、古樸陶土、米白暖紙) */
    --bg-page: #FDF8F0;
    --bg-paper: #FFF7ED;
    --bg-wood-dark: #451A03;
    --bg-wood-mid: #78350F;
    --bg-wood-light: #92400E;
    --bg-card: #FFFAF2;
    --bg-crt-frame: #2D2018;

    --color-amber: #D97706;
    --color-gold: #F59E0B;
    --color-gold-light: #FDE68A;
    --color-crimson: #B91C1C;
    --color-sage: #15803D;

    --text-primary: #291B12;
    --text-muted: #6B4E3D;
    --text-gold: #B45309;
    --text-light: #FEF3C7;

    /* 90年代立體斜角凸起框 (Bevel 3D) */
    --border-bevel-light: #FFFBF0;
    --border-bevel-dark: #8C5329;
    --border-wood: 3px solid #78350F;

    /* 字型尺寸變數 (預設 Large 體貼老花) */
    --font-base: 19px;
    --font-title: 28px;
    --font-h1: 34px;
    --font-hud: 22px;
}

/* 長輩字體縮放切換模式 */
body.font-normal {
    --font-base: 16px;
    --font-title: 24px;
    --font-h1: 30px;
    --font-hud: 20px;
}

body.font-large {
    --font-base: 19px;
    --font-title: 28px;
    --font-h1: 36px;
    --font-hud: 24px;
}

body.font-huge {
    --font-base: 23px;
    --font-title: 34px;
    --font-h1: 42px;
    --font-hud: 28px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-page);
    background-image: 
        radial-gradient(#F5E6D3 15%, transparent 16%),
        radial-gradient(#F5E6D3 15%, transparent 16%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    color: var(--text-primary);
    font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "DFKai-SB", sans-serif;
    font-size: var(--font-base);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 頂部跑馬燈公告欄 (90年代經典風味) */
.retro-ticker-bar {
    background: #5C2406;
    color: #FDE68A;
    padding: 8px 16px;
    font-size: calc(var(--font-base) * 0.95);
    font-weight: bold;
    border-bottom: 3px solid #B45309;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ticker-tag {
    background: #DC2626;
    color: #FFFFFF;
    padding: 2px 10px;
    border-radius: 4px;
    margin-right: 12px;
    font-size: calc(var(--font-base) * 0.85);
    flex-shrink: 0;
    border: 1px outset #FFA39E;
}

.ticker-content {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}

.ticker-marquee {
    display: inline-block;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 網站頂部 Header */
.retro-header {
    background: linear-gradient(180deg, #78350F 0%, #451A03 100%);
    border-bottom: 5px solid #F59E0B;
    padding: 16px 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* 網站 Logo 與標題區 */
.site-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    cursor: pointer;
}

.brand-icon {
    width: 58px;
    height: 58px;
    background: #F59E0B;
    border: 3px outset #FEF08A;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.4);
}

.brand-titles h1 {
    color: #FFFBEB;
    font-size: var(--font-h1);
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0px #000, 3px 3px 0px #92400E;
    line-height: 1.2;
}

.brand-titles .subtitle {
    color: #FDE68A;
    font-size: calc(var(--font-base) * 0.95);
    font-weight: 500;
}

/* 頂部輔助操作工具列 (字體放大、聲音開關、長輩防迷路首頁鈕) */
.senior-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 90年代經典立體大按鍵 (Bevel Button) */
.retro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, #FFFBEB 0%, #FDE68A 100%);
    color: #451A03;
    font-family: inherit;
    font-size: var(--font-base);
    font-weight: bold;
    padding: 10px 18px;
    border: 3px outset #FFFBEB;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    box-shadow: 2px 3px 5px rgba(0,0,0,0.25);
    transition: transform 0.08s, filter 0.08s;
}

.retro-btn:hover {
    filter: brightness(1.08);
}

.retro-btn:active, .retro-btn.active {
    border-style: inset;
    transform: translate(2px, 2px);
    background: linear-gradient(180deg, #FDE68A 0%, #F59E0B 100%);
}

.retro-btn.btn-crimson {
    background: linear-gradient(180deg, #EF4444 0%, #B91C1C 100%);
    color: #FFFFFF;
    border-color: #FCA5A5;
}

.retro-btn.btn-green {
    background: linear-gradient(180deg, #22C55E 0%, #15803D 100%);
    color: #FFFFFF;
    border-color: #86EFAC;
}

.retro-btn.btn-wood {
    background: linear-gradient(180deg, #92400E 0%, #78350F 100%);
    color: #FFFBEB;
    border-color: #B45309;
}

.font-size-group {
    background: rgba(0, 0, 0, 0.25);
    padding: 4px;
    border-radius: 8px;
    display: flex;
    gap: 4px;
    border: 1px solid #92400E;
}

.font-size-group .retro-btn {
    padding: 6px 12px;
    font-size: calc(var(--font-base) * 0.9);
}

/* 主容器 */
.main-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px;
    flex: 1;
    width: 100%;
}

/* 宣傳大橫幅 (Hero Banner) */
.hero-banner-card {
    background: var(--bg-paper);
    border: 4px solid #78350F;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 4px 6px 0px rgba(120, 53, 15, 0.2);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.banner-img-wrapper {
    position: relative;
    height: 100%;
    min-height: 280px;
    background: #451A03;
    overflow: hidden;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.banner-text-wrapper {
    padding: 30px;
}

.banner-badge {
    display: inline-block;
    background: #DC2626;
    color: #FFFFFF;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: calc(var(--font-base) * 0.85);
    margin-bottom: 12px;
    border: 1px outset #FFA39E;
}

.banner-title {
    font-size: var(--font-title);
    color: #451A03;
    margin-bottom: 12px;
    line-height: 1.3;
}

.banner-desc {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: var(--font-base);
}

.banner-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.feature-pill {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #F59E0B;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: calc(var(--font-base) * 0.85);
    font-weight: bold;
}

/* 分區標題 (木質復古牌匾) */
.section-plaque {
    background: linear-gradient(90deg, #78350F 0%, #92400E 50%, #78350F 100%);
    color: #FFFBEB;
    padding: 12px 24px;
    border: 3px outset #B45309;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 2px 4px 6px rgba(0,0,0,0.2);
}

.section-plaque h2 {
    font-size: var(--font-title);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 遊戲選擇網格 (Game Grid) */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
    margin-bottom: 36px;
}

/* 復古遊戲卡片 (Game Card) */
.retro-game-card {
    background: var(--bg-card);
    border: 3px outset #D97706;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 3px 5px 0px rgba(120, 53, 15, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.retro-game-card:hover {
    transform: translateY(-4px);
    box-shadow: 4px 8px 0px rgba(120, 53, 15, 0.35);
}

.card-thumb-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    background: #2D2018;
    overflow: hidden;
    border-bottom: 3px solid #78350F;
}

.card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.retro-game-card:hover .card-thumb {
    transform: scale(1.05);
}

.card-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #DC2626;
    color: #FFF;
    font-size: 13px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px outset #FFA39E;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.4);
}

.card-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: calc(var(--font-title) * 0.85);
    color: #451A03;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-desc {
    color: var(--text-muted);
    font-size: calc(var(--font-base) * 0.95);
    margin-bottom: 16px;
    flex: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FEF3C7;
    border: 1px inset #FDE68A;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: calc(var(--font-base) * 0.85);
    font-weight: bold;
    color: #92400E;
}

/* 遊戲遊玩區域模態/畫面 (Game Room) */
.game-play-arena {
    display: none;
    margin-bottom: 30px;
}

.game-play-arena.active {
    display: block;
}

.crt-cabinet {
    background: #3B2A1E;
    border: 8px ridge #8C5329;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,0,0,0.8);
    padding: 20px;
    margin: 0 auto;
    max-width: 900px;
}

.cabinet-header {
    background: #20150F;
    border: 2px inset #5C3A21;
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.cabinet-title {
    color: #FDE68A;
    font-size: var(--font-title);
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

/* 街機主螢幕顯示框 */
.screen-housing {
    position: relative;
    background: #0D0B0A;
    border: 6px inset #453023;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow: hidden;
}

.screen-housing canvas {
    display: block;
    max-width: 100%;
    height: auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    image-rendering: pixelated;
    border-radius: 4px;
}

/* 復古 CRT 玻璃掃描線 */
.crt-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    opacity: 0.6;
}

/* 遊戲即時數據顯示 HUD */
.cabinet-hud {
    display: flex;
    justify-content: space-around;
    background: #20150F;
    border: 2px inset #5C3A21;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.hud-item {
    text-align: center;
}

.hud-label {
    color: #FBBF24;
    font-size: calc(var(--font-base) * 0.85);
    font-weight: bold;
}

.hud-value {
    color: #FEF3C7;
    font-size: var(--font-hud);
    font-weight: bold;
    font-family: monospace, sans-serif;
    letter-spacing: 1px;
}

/* 操作說明引導框 */
.game-instructions-card {
    background: #FFFBEB;
    border: 2px solid #D97706;
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 14px;
    font-size: calc(var(--font-base) * 0.95);
    color: #78350F;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* 溫馨留言板與懷舊茶水間 (Community / Guestbook) */
.nostalgia-board {
    background: var(--bg-paper);
    border: 3px solid #78350F;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 4px 6px 0px rgba(120, 53, 15, 0.2);
    margin-bottom: 30px;
}

.board-messages-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.message-item {
    background: #FFFBEB;
    border-left: 5px solid #F59E0B;
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.06);
}

.message-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    color: #92400E;
    margin-bottom: 6px;
    font-size: calc(var(--font-base) * 0.9);
}

.message-text {
    color: #451A03;
    font-size: var(--font-base);
}

.board-input-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.board-input-box input {
    font-family: inherit;
    font-size: var(--font-base);
    padding: 10px 14px;
    border: 2px solid #B45309;
    border-radius: 6px;
    background: #FFFFFF;
    color: #451A03;
    flex: 1;
    min-width: 200px;
}

/* 網頁頁腳 Footer */
.retro-footer {
    background: #3B1B06;
    border-top: 4px solid #F59E0B;
    color: #FDE68A;
    padding: 24px 16px;
    text-align: center;
    font-size: calc(var(--font-base) * 0.9);
    margin-top: auto;
}

.footer-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.retro-web-badge {
    background: #1E120A;
    color: #34D399;
    border: 2px outset #5C3A21;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
}

/* 通用結果彈出視窗 (Modal) */
.result-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.result-modal-backdrop.active {
    display: flex;
}

.result-modal-card {
    background: #FFF7ED;
    border: 6px ridge #B45309;
    border-radius: 14px;
    padding: 30px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    animation: popIn 0.25s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-title {
    font-size: var(--font-h1);
    color: #B91C1C;
    margin-bottom: 12px;
}

.modal-msg {
    font-size: var(--font-base);
    color: #451A03;
    margin-bottom: 20px;
}

.modal-score-box {
    background: #FEF3C7;
    border: 2px inset #FDE68A;
    border-radius: 8px;
    padding: 12px;
    font-size: var(--font-title);
    color: #92400E;
    font-weight: bold;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
