body {
    margin: 0;
    background-color: #101820;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
}

.game-shell {
    position: relative;
    width: min(95vw, 1280px);
    margin: 20px auto;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    background-color: #78c8e8;
    border: 2px solid white;
    box-sizing: border-box;
    image-rendering: pixelated;
}

.mode-menu {
    position: absolute;
    inset: 2px;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 56px);
    box-sizing: border-box;
    background: linear-gradient(rgba(8, 18, 28, .48), rgba(8, 18, 28, .7));
}

.mode-panel {
    width: min(680px, 100%);
    padding: clamp(24px, 5vw, 54px);
    box-sizing: border-box;
    border: 2px solid rgba(255,255,255,.28);
    border-radius: 8px;
    background: rgba(15, 23, 42, .88);
    box-shadow: 0 10px 0 rgba(0,0,0,.2), 0 20px 45px rgba(0,0,0,.3);
}

.mode-eyebrow, .mode-prompt { margin: 0; letter-spacing: .12em; font-weight: 700; }
.mode-eyebrow { color: #cbd5e1; font-size: clamp(12px, 2vw, 18px); }
.mode-panel h1 { margin: 10px 0 22px; color: #fff; font-size: clamp(34px, 7vw, 70px); letter-spacing: .08em; }
.mode-prompt { margin-bottom: 24px; color: #94a3b8; font-size: 13px; }
.training-settings { margin: 0 auto 24px; max-width: 460px; padding: 14px 16px; border: 1px solid rgba(56,189,248,.45); border-radius: 5px; background: rgba(8, 47, 73, .48); text-align: left; }
.training-settings h2 { margin: 0 0 12px; color: #7dd3fc; font-size: 13px; letter-spacing: .12em; text-align: center; }
.training-settings label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; color: #e2e8f0; font-size: 13px; }
.training-settings input, .training-settings select { width: 160px; box-sizing: border-box; padding: 7px 8px; border: 1px solid #38bdf8; border-radius: 3px; color: #e2e8f0; background: #0f172a; font: inherit; }
.settings-error { min-height: 16px; margin: 8px 0 0; color: #fca5a5; font-size: 12px; text-align: center; }
.mode-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mode-button, .menu-button { border: 2px solid currentColor; border-radius: 5px; color: #fff; background: rgba(255,255,255,.08); font: inherit; font-weight: 800; cursor: pointer; transition: transform .12s ease, background .12s ease; }
.mode-button { min-height: 96px; padding: 16px 10px; display: flex; flex-direction: column; justify-content: center; gap: 8px; letter-spacing: .08em; }
.mode-button span { font-size: clamp(16px, 3vw, 25px); }
.mode-button small { font-size: 12px; letter-spacing: .16em; }
.human-button { color: #4ade80; }
.training-button { color: #38bdf8; }
.mode-button:hover, .mode-button:focus-visible, .menu-button:hover, .menu-button:focus-visible { transform: translateY(-2px); background: rgba(255,255,255,.18); outline: none; }
.menu-button { position: absolute; top: 14px; left: 14px; z-index: 2; padding: 7px 12px; font-size: 12px; letter-spacing: .12em; color: #fff; background: rgba(15, 23, 42, .78); }
.mode-menu[hidden], .menu-button[hidden] { display: none; }
@media (max-width: 560px) { .mode-actions { grid-template-columns: 1fr; } .mode-button { min-height: 72px; } }
