/*
 * Tank Battle 1990 — style.css
 * 深色复古主题，与 Tools Hub 站点一致；布局参考 game1（首屏即游戏 + 底部 SEO）
 */

:root {
    --primary: #00b4db;
    --danger: #ff6b6b;
    --success: #4cd137;
    --gold: #ffd700;
    --bg: #0a0a1a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    font-family: 'Segoe UI', sans-serif;
    color: white;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* --- 导航栏 --- */
.navbar {
    background: linear-gradient(135deg, #0d1321 0%, #1a1f3a 100%);
    border-bottom: 1px solid #1e2a45;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2rem;
}
.nav-brand {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-links-box { display: flex; align-items: center; gap: 1.5rem; }
.nav-links-box a {
    color: #8892a8;
    font-weight: 500;
    font-size: .95rem;
    text-decoration: none;
}
#lang-toggle {
    background: none;
    border: 1px solid #4fc3f7;
    color: #4fc3f7;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
}
#lang-menu {
    display: none;
    position: fixed;
    top: 70px;
    right: 20px;
    background: #1a2235;
    border: 1px solid #1e2a45;
    border-radius: 10px;
    padding: 8px 0;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
#lang-menu a {
    display: block;
    padding: 8px 20px;
    color: #8892a8;
    text-decoration: none;
    font-size: .9rem;
}
#lang-menu a:hover { color: #fff; }

/* --- 游戏区域：占满首屏 --- */
#game-area {
    width: 100%;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
}
#game-container {
    position: relative;
    width: 100%;
    max-width: 560px;
    height: calc(100vh - 60px);
    max-height: 720px;
    display: flex;
    flex-direction: column;
}
#canvas-wrapper {
    width: 100%;
    flex: 1 1 auto;
    position: relative;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}
#gameCanvas {
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    image-rendering: pixelated;
}

/* --- HUD --- */
#hud {
    position: absolute;
    top: 8px; left: 10px; right: 50px;
    display: flex;
    justify-content: space-between;
    gap: 6px;
    pointer-events: none;
    z-index: 5;
    font-size: .85rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,.9);
    color: #cfd8ff;
}
#sound-toggle {
    position: absolute;
    top: 6px; right: 8px;
    z-index: 15;
    background: rgba(0,0,0,.5);
    border-radius: 50%;
    width: 34px; height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    cursor: pointer;
}

/* --- 覆盖层（开始/结束/暂停）--- */
.overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, .88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    text-align: center;
    padding: 20px;
}
.overlay.hidden, .hidden { display: none !important; }
.overlay h1 {
    font-size: 2rem;
    margin: 0 0 12px;
    text-shadow: 0 3px 8px rgba(0,0,0,.9);
}
.overlay p { margin: 6px 0; }
.controls-hint {
    font-size: .82rem;
    color: #9aa4bf;
    line-height: 1.6;
}
.stats-box {
    background: rgba(255,255,255,.08);
    padding: 14px 26px;
    border-radius: 10px;
    margin-bottom: 16px;
}
.stats-box p { margin: 4px 0; }
.stats-box hr { border-color: rgba(255,255,255,.2); }
.gold { color: var(--gold); }

.overlay button {
    padding: 12px 36px;
    font-size: 1.05rem;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
}
.overlay button:hover { filter: brightness(1.15); }
#pauseScreen button { background: #334155; }
#pauseScreen { background: rgba(0,0,0,.6); }

/* --- 移动端控制 --- */
#mobile-controls {
    display: none;
    width: 100%;
    padding: 10px 18px 16px;
    background: rgba(13, 19, 33, .92);
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    z-index: 15;
    flex-shrink: 0;
}
.dpad {
    display: grid;
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(2, 56px);
    gap: 6px;
}
.dpad-mid { display: contents; }
.control-btn {
    background: rgba(255,255,255,.09);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    cursor: pointer;
    touch-action: manipulation;
}
.control-btn:active { background: rgba(0,212,255,.35); }
#btn-up { grid-column: 2; grid-row: 1; }
#btn-left { grid-column: 1; grid-row: 2; }
#btn-down { grid-column: 2; grid-row: 2; }
#btn-right { grid-column: 3; grid-row: 2; }
.fire-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.fire-col .control-btn { width: 64px; height: 64px; }
.fire-btn.big {
    width: 84px !important;
    height: 84px !important;
    border-radius: 50% !important;
    font-size: 1rem;
    font-weight: 800;
    color: #ff8787;
    border-color: rgba(255,107,107,.5) !important;
}
.fire-btn.big:active { background: rgba(255,107,107,.4); }

@media (pointer: coarse), (max-width: 700px) {
    #mobile-controls { display: flex; }
}

/* --- SEO 区块 --- */
.seo-section {
    max-width: 800px;
    margin: 24px auto 40px;
    padding: 0 16px;
}
.seo-card {
    background: #10162b;
    border: 1px solid #1e2a45;
    border-radius: 12px;
    padding: 22px 26px;
    line-height: 1.75;
    font-size: .95rem;
}
.seo-card h2 { margin-top: 0; color: #7dd3fc; }
.seo-card h3 { color: #a5b4fc; }
.seo-card li { margin: 4px 0; }
