* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    font-family: system-ui, -apple-system, sans-serif;
    overflow: hidden;
    transition: background 0.4s, color 0.4s;
}

body.theme-ocean {
    background: #060e1a;
    color: #c0d8f0;
}

body.theme-battle {
    background: #0a0e06;
    color: #b8c8a0;
}

body.theme-sky {
    background: #0a1628;
    color: #a0c8e8;
}

header {
    padding: 1rem;
    text-align: center;
    width: 100%;
}

h1 {
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.6;
}

nav {
    margin-top: 0.3rem;
}

nav a {
    color: inherit;
    text-decoration: none;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.3;
    transition: opacity 0.3s;
    margin: 0 0.4rem;
    cursor: pointer;
}

nav a:hover {
    opacity: 0.6;
}

nav a.active {
    opacity: 0.7;
}

/* ========== Views ========== */
#tank, #arena, #sky {
    display: none;
    position: relative;
    width: 94vw;
    max-width: 1200px;
    height: calc(100vh - 6rem);
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
}

#tank.active, #arena.active, #sky.active {
    display: block;
}

/* ========== Fish Tank ========== */
#tank {
    background: linear-gradient(180deg, #0b1a30 0%, #0d2240 40%, #0f2a50 100%);
    border: 1px solid rgba(100, 160, 220, 0.15);
}

.sandy-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, #2a1f0e 0%, #3d2e16 40%, #4a3820 100%);
    border-radius: 0 0 11px 11px;
}

/* Seaweed plants */
.plant {
    position: absolute;
    bottom: 30px;
    width: 8px;
    border-radius: 4px;
    animation: sway 3s ease-in-out infinite;
    transform-origin: bottom center;
}

.plant::before,
.plant::after {
    content: '';
    position: absolute;
    width: 8px;
    border-radius: 4px;
    background: inherit;
}

.plant-1 {
    left: 12%;
    height: 80px;
    background: #1a5c3a;
}

.plant-1::before {
    height: 55px;
    bottom: 10px;
    left: 8px;
    transform: rotate(12deg);
}

.plant-1::after {
    height: 40px;
    bottom: 5px;
    left: -8px;
    transform: rotate(-8deg);
}

.plant-2 {
    right: 18%;
    height: 100px;
    background: #16704a;
    animation-delay: -1s;
}

.plant-2::before {
    height: 70px;
    bottom: 15px;
    left: 9px;
    transform: rotate(10deg);
}

.plant-2::after {
    height: 50px;
    bottom: 8px;
    left: -9px;
    transform: rotate(-14deg);
}

.plant-3 {
    left: 55%;
    height: 65px;
    background: #1a5c3a;
    animation-delay: -2s;
}

.plant-3::before {
    height: 45px;
    bottom: 8px;
    left: 7px;
    transform: rotate(15deg);
}

.plant-3::after {
    height: 35px;
    bottom: 4px;
    left: -7px;
    transform: rotate(-10deg);
}

@keyframes sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* Fish */
.fish {
    position: absolute;
    pointer-events: none;
    transition: none;
}

.fish-body {
    position: relative;
    width: 100%;
    height: 100%;
}

.fish svg {
    width: 100%;
    height: 100%;
    display: block;
}

.fish .fin {
    animation: fin-wave 0.6s ease-in-out infinite alternate;
    transform-origin: 70% 50%;
}

@keyframes fin-wave {
    0% { transform: rotate(-8deg) scaleY(0.9); }
    100% { transform: rotate(8deg) scaleY(1.1); }
}

.fish .tail {
    animation: tail-wave 0.4s ease-in-out infinite alternate;
    transform-origin: 100% 50%;
}

@keyframes tail-wave {
    0% { transform: rotate(-12deg); }
    100% { transform: rotate(12deg); }
}

/* Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(180, 220, 255, 0.4), rgba(100, 160, 220, 0.1));
    border: 1px solid rgba(150, 200, 240, 0.2);
    pointer-events: none;
    animation: rise linear forwards;
}

@keyframes rise {
    0% {
        transform: translateX(0) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateX(15px) scale(1.05);
        opacity: 0.5;
    }
    100% {
        transform: translateX(-10px) scale(1.1);
        opacity: 0;
    }
}

/* ========== Battle Arena ========== */
#arena {
    background: linear-gradient(180deg, #111a0a 0%, #1a2610 40%, #1e2e14 100%);
    border: 1px solid rgba(100, 140, 80, 0.15);
}

.muddy-ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(180deg, #2e1f0a 0%, #3a2810 40%, #4a3418 100%);
    border-radius: 0 0 11px 11px;
}

.mound {
    position: absolute;
    bottom: 40px;
    border-radius: 50% 50% 0 0;
    background: linear-gradient(180deg, #2a1e0c 0%, #3a2810 100%);
}

.mound-1 { left: 8%; width: 120px; height: 28px; }
.mound-2 { right: 15%; width: 160px; height: 22px; }
.mound-3 { left: 48%; width: 90px; height: 18px; }

/* Tank vehicles */
.tank {
    position: absolute;
    pointer-events: none;
}

.tank svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Projectile */
.projectile {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #ffe060, #ff8800);
    box-shadow: 0 0 6px 2px rgba(255, 160, 0, 0.5);
    pointer-events: none;
}

/* Explosion */
.explosion {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 200, 50, 0.9), rgba(255, 100, 20, 0.6), transparent 70%);
    animation: explode 0.4s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Destroyed tank smoke */
.destroy-smoke {
    position: absolute;
    pointer-events: none;
    animation: smoke-up 1s ease-out forwards;
}

@keyframes smoke-up {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -80px) scale(2);
        opacity: 0;
    }
}

/* Dust */
.dust {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(160, 130, 80, 0.5), rgba(120, 100, 60, 0.15));
    pointer-events: none;
    animation: dust-rise linear forwards;
}

@keyframes dust-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-30px) scale(1.3);
        opacity: 0;
    }
}

/* ========== Fighter Sky ========== */
#sky {
    background: linear-gradient(180deg, #1a3a5c 0%, #2a5a8a 40%, #3a70a0 100%);
    border: 1px solid rgba(120, 180, 240, 0.15);
}

.cloud {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    pointer-events: none;
}

.cloud-1 { top: 12%; left: 10%; width: 180px; height: 60px; border-radius: 60px; }
.cloud-2 { top: 35%; right: 12%; width: 220px; height: 50px; border-radius: 50px; }
.cloud-3 { top: 65%; left: 40%; width: 150px; height: 45px; border-radius: 45px; }

/* Fighter planes */
.plane {
    position: absolute;
    pointer-events: none;
}

.plane svg {
    width: 100%;
    height: 100%;
    display: block;
}

.plane .propeller {
    animation: spin 0.1s linear infinite;
    transform-origin: 100px 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Missile */
.missile {
    position: absolute;
    width: 10px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #ff8800, #ffe060);
    box-shadow: 0 0 8px 2px rgba(255, 160, 0, 0.6);
    pointer-events: none;
}

/* Contrail */
.contrail {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), rgba(200, 220, 240, 0.1));
    pointer-events: none;
    animation: contrail-fade linear forwards;
}

@keyframes contrail-fade {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ========== Hint ========== */
.hint {
    padding: 0.6rem;
    font-size: 0.75rem;
    opacity: 0.35;
    letter-spacing: 0.08em;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
    h1 {
        font-size: 1rem;
    }

    #tank, #arena, #sky {
        width: 98vw;
        height: calc(100vh - 5rem);
        border-radius: 8px;
    }

    .sandy-bottom {
        height: 30px;
        border-radius: 0 0 7px 7px;
    }

    .muddy-ground {
        height: 35px;
        border-radius: 0 0 7px 7px;
    }

    .plant-1 { height: 60px; }
    .plant-2 { height: 75px; }
    .plant-3 { height: 50px; }

    .mound-1 { width: 80px; height: 20px; }
    .mound-2 { width: 110px; height: 16px; }
    .mound-3 { width: 60px; height: 14px; }
}
