/* Play layer. Loaded after each game's own <style>.
   Look built for an 8-year-old on a phone or a laptop:
   one type, one press, one obvious action. Worlds stay different. */

.door-game,
.ant-sim,
.robot-game,
.mine-game,
.arena-game {
    --play: ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif;
    --ink: #f6f3ec;
    --muted: #b7b3c4;
    --press: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 3px 0 rgba(0, 0, 0, 0.35);
}

body:has(.door-game) .breadcrumb,
body:has(.ant-sim) .breadcrumb,
body:has(.robot-game) .breadcrumb,
body:has(.mine-game) .breadcrumb,
body:has(.arena-game) .container {
    display: none;
}

/* ---- Door Quest: lantern room, not a green SaaS button ---- */
.door-game {
    font-family: var(--play);
}

.door-game .title-screen.screen.active {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    max-width: 440px;
    margin: 28px auto 8px;
    padding: 28px 22px 22px;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(255, 196, 87, 0.16), transparent 55%),
        #17151c;
    border: 1px solid rgba(255, 196, 87, 0.28);
    border-radius: 22px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

.door-game .title-screen h1,
.door-game .title-screen p,
.door-game .title-screen .high-score-display {
    flex: 1 0 100%;
    margin: 0;
}

.door-game .title-screen h1 {
    font-family: var(--play);
    font-size: clamp(2.4rem, 8vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.95;
    color: #ffd56a;
    background: none;
    -webkit-text-fill-color: #ffd56a;
    animation: none;
}

.door-game .title-screen p {
    font-size: 1.15rem;
    color: var(--muted);
    margin-top: 8px;
}

.door-game .high-score-display {
    font-size: 0.95rem;
    color: #ffd56a;
    margin: 4px 0 8px;
}

.door-game .game-btn {
    font-family: var(--play);
    min-height: 52px;
    border-radius: 14px;
    border: 0;
    box-shadow: var(--press);
    letter-spacing: 0.01em;
}

.door-game .title-screen .game-btn {
    flex: 1 0 100%;
    max-width: 280px;
    margin: 0;
}

.door-game .title-screen .shop-btn,
.door-game .title-screen .challenge-btn {
    flex: 1 1 120px;
    max-width: 160px;
    min-height: 46px;
    font-size: 0.95rem;
}

.door-game .game-btn:hover,
.door-game .game-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.door-game .game-stats {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 10px 14px;
}

.door-game .message {
    font-family: var(--play);
    font-size: 1.25rem;
}

/* ---- Ant Colony: a terrarium, not an admin dashboard ---- */
.ant-sim {
    font-family: var(--play);
}

.ant-sim .play-lead {
    color: #c5d7b4;
    font-size: 1.05rem;
    margin: 4px 0 0;
}

.ant-sim .sim-status {
    display: inline-flex;
    margin: 0 0 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(123, 234, 36, 0.1);
    color: #d7f5b0;
    font-size: 0.95rem;
}

.ant-sim .panel {
    border-radius: 18px;
    border-color: rgba(123, 234, 36, 0.18);
    background: rgba(12, 18, 14, 0.72);
}

.ant-sim canvas#anthill {
    border-radius: 14px;
    width: 100%;
    height: auto;
}

.ant-sim .sim-btn {
    font-family: var(--play);
    border-radius: 12px;
    min-height: 42px;
    border-width: 0;
    box-shadow: var(--press);
}

.ant-sim .ai-thinking,
.ant-sim .ai-decision {
    font-family: var(--play);
    line-height: 1.45;
}

/* ---- Robot Destroyer: poster start, readable HUD ---- */
.robot-game .rg-start {
    background:
        radial-gradient(80% 60% at 50% 40%, rgba(54, 199, 242, 0.18), transparent 60%),
        rgba(6, 10, 18, 0.88);
}

.robot-game .rg-start button {
    font-family: var(--play);
    font-weight: 800;
    letter-spacing: -0.02em;
    border-radius: 16px;
    min-height: 64px;
    min-width: 220px;
    box-shadow: var(--press);
}

.robot-game #hud,
.robot-game .rg-stat,
.robot-game .rg-stat-label {
    font-family: var(--play);
    letter-spacing: 0.04em;
}

.robot-game #hud {
    gap: 8px;
}

.robot-game .rg-stat {
    border-radius: 14px;
    min-width: 84px;
}

/* ---- Mine Escape: one job, then the keys ---- */
.mine-game #blocker {
    font-family: var(--play);
    padding: 88px 20px 32px;
    overflow: auto;
    background:
        radial-gradient(70% 50% at 50% 20%, rgba(224, 122, 61, 0.2), transparent 55%),
        #100c09;
}

.mine-game #blocker h1 {
    font-family: var(--play);
    font-size: clamp(2.6rem, 9vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    text-shadow: none;
    animation: none;
    color: #ffb088;
    margin-bottom: 12px;
}

.mine-game #blocker .play-lead {
    max-width: 28rem;
    text-align: center;
    color: #f3e7df;
    font-size: 1.2rem;
    line-height: 1.45;
    margin: 0 0 18px;
}

.mine-game #blocker .play-keys {
    color: #9a8d84;
    font-size: 0.92rem;
    max-width: 26rem;
    text-align: center;
    margin: 0;
}

.mine-game #blocker .start-btn,
.mine-game .restart-btn {
    font-family: var(--play);
    letter-spacing: 0;
    border-radius: 16px;
    min-height: 56px;
    box-shadow: var(--press);
}

.mine-game #blocker .start-btn:hover {
    transform: translateY(1px);
}

.mine-game #hud {
    font-family: var(--play);
    top: 76px;
    border-radius: 16px;
    border-left: 0;
    border: 1px solid rgba(255, 176, 136, 0.35);
}

/* ---- Battle Arena: a card, not a second horror title ---- */
.arena-game {
    font-family: var(--play);
}

.arena-game * {
    font-family: inherit;
}

.arena-game #arena-menu {
    font-family: var(--play);
    justify-content: flex-start;
    padding: 84px 16px 28px;
    overflow: auto;
    background:
        radial-gradient(60% 40% at 50% 0%, rgba(255, 107, 53, 0.16), transparent 60%),
        rgba(12, 12, 16, 0.94);
    color: var(--ink);
}

.arena-game #arena-menu h1 {
    font-family: var(--play);
    font-size: clamp(2.4rem, 8vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    text-shadow: none;
    color: #ffb088;
    margin-bottom: 4px;
}

.arena-game #arena-menu .subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    margin-bottom: 16px;
}

.arena-game #mode-select,
.arena-game #diff-select {
    width: min(440px, 100%);
    gap: 8px;
}

.arena-game .mode-btn,
.arena-game .diff-btn,
.arena-game .team-btn {
    font-family: var(--play);
    min-height: 44px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #24242c;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d9d4cc;
}

.arena-game .mode-btn.active,
.arena-game .diff-btn.active {
    background: #ffb088;
    border-color: #ffb088;
    color: #1a120e;
}

.arena-game .menu-btn {
    font-family: var(--play);
    width: min(440px, 100%);
    min-height: 54px;
    border-radius: 16px;
    letter-spacing: 0;
    box-shadow: var(--press);
    margin-top: 8px;
}

.arena-game .menu-btn:hover {
    transform: translateY(1px);
}

.arena-game #server-browser,
.arena-game #custom-server-section {
    width: min(440px, 100%);
}

.arena-game .server-entry {
    border-radius: 14px;
}

.arena-game #arena-menu .controls-hint {
    color: #8d8680;
    font-size: 0.9rem;
    max-width: 28rem;
    text-align: center;
    line-height: 1.4;
}

.arena-game #arena-hud {
    font-family: var(--play);
    bottom: 16px;
    left: 16px;
    border-radius: 16px;
    border-left: 0;
    border: 1px solid rgba(255, 176, 136, 0.35);
}

.door-game .tutorial-card,
.ant-sim .tutorial-card {
    font-family: var(--play);
    background: #17151c;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.door-game .tutorial-title,
.ant-sim .tutorial-title {
    font-family: var(--play);
    color: #f6f3ec;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
}

.door-game .tutorial-text,
.ant-sim .tutorial-text {
    font-size: 1.05rem;
}

.door-game .tutorial-btn,
.ant-sim .tutorial-btn {
    font-family: var(--play);
    min-height: 48px;
    min-width: 120px;
    border: 0;
    border-radius: 14px;
}

@media (prefers-reduced-motion: reduce) {
    .door-game .title-screen h1,
    .mine-game #blocker h1,
    .robot-game .robot {
        animation: none !important;
    }
}
