:root {
    --bg-dark: #080a14;
    --bg-card: #0f1424;
    --bg-card-alt: #161c33;
    --primary: #00ff66;
    --secondary: #ffe600;
    --accent: #ccff00;
    --purple-glow: #00ffaa;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-glow: rgba(0, 255, 102, 0.35);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.5;
}

body {
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}

/* TYPOGRAPHY */
h1, h2, h3, h4, .brand-logo, .btn {
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

/* HEADER & NAV */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(8, 10, 20, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glow);
    padding-top: env(safe-area-inset-top);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: #fff;
    font-weight: 900;
    font-size: 1.3rem;
}

.logo-text {
    background: linear-gradient(90deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s, text-shadow 0.2s;
    padding: 0.4rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.7);
}

.nav-link.highlight {
    color: var(--secondary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--primary);
    position: relative;
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--primary);
    left: 0;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.8rem;
    border-radius: 4px;
    border: 2px solid transparent;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00cc52);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.4);
}

.btn-primary:hover, .btn-primary:active {
    background: #00ff66;
    box-shadow: 0 0 25px rgba(0, 255, 102, 0.8);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover, .btn-secondary:active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px rgba(0, 255, 102, 0.3);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.4rem;
}

/* HERO SECTION */
.hero-section {
    position: relative;
    padding: 8rem 1.5rem 4rem;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.grid-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 102, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 102, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.28;
}

.glow-1 { top: 10%; left: 15%; width: 320px; height: 320px; background: var(--primary); }
.glow-2 { bottom: 15%; right: 10%; width: 380px; height: 380px; background: var(--secondary); }
.glow-3 { top: 40%; right: 40%; width: 250px; height: 250px; background: var(--accent); }

.hero-container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

.badge-tag {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    background: rgba(255, 230, 0, 0.15);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-radius: 2px;
}

.brand-title {
    font-size: 3.5rem;
    line-height: 1;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: linear-gradient(180deg, #ffffff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 255, 102, 0.3);
}

.hero-tagline {
    font-size: 1.8rem;
    color: var(--secondary);
    font-weight: 800;
    margin-bottom: 1.2rem;
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.4);
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 550px;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-frame {
    position: relative;
    border: 2px solid var(--border-glow);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.9);
    background: #000;
}

.hero-artwork {
    width: 100%;
    height: auto;
    display: block;
}

.frame-scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    animation: scan 4s infinite linear;
}

@keyframes scan {
    0% { top: 0%; }
    50% { top: 98%; }
    100% { top: 0%; }
}

/* GAME SECTION & CANVAS SHELL */
.game-section {
    padding: 3rem 1rem;
    background: #050711;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header-tag {
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 2px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
}

.game-shell-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.game-shell {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    background: #000;
    border: 2px solid var(--border-glow);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 35px rgba(0, 255, 102, 0.25);
    touch-action: none;
}

.game-shell:fullscreen,
.game-shell:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    aspect-ratio: auto;
    border: none;
    border-radius: 0;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 25;
    background: rgba(15, 20, 36, 0.85);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fullscreen-btn:hover, .fullscreen-btn:active {
    background: var(--primary);
    color: #000;
}

/* PORTRAIT ORIENTATION WARNING BANNER */
.portrait-warning {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 10, 20, 0.95);
    z-index: 30;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.rotate-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: rotatePulse 2s infinite ease-in-out;
}

@keyframes rotatePulse {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(90deg) scale(1.15); }
    100% { transform: rotate(0deg) scale(1); }
}

.rotate-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.rotate-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 320px;
}

/* OVERLAYS */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 10, 20, 0.93);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.game-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    max-width: 480px;
    width: 100%;
    max-height: 95%;
    overflow-y: auto;
    padding: 1.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.85);
}

.title-logo .sub {
    display: block;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--secondary);
    letter-spacing: 3px;
}

.title-logo .main {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 15px rgba(0, 255, 102, 0.6);
}

.overlay-content .tagline {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.overlay-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.overlay-heading {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.alert-text { color: var(--secondary); }
.victory-text { color: var(--accent); }
.victory-sub { color: var(--primary); margin-bottom: 1rem; }

.score-summary {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.2rem;
}

.score-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.nickname-input-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.nickname-input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.nickname-input-group input {
    width: 100%;
    padding: 0.6rem;
    background: #080a14;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-align: center;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nickname-input-group input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 12px rgba(255, 230, 0, 0.4);
}

/* MOBILE TOUCH CONTROLS (OVERLAYED INSIDE GAME SHELL FOR FULLSCREEN & PHONE PLAY) */
.mobile-controls {
    display: none;
    position: absolute;
    bottom: 14px;
    left: 0;
    width: 100%;
    padding: 0 18px;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 8;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    pointer-events: none;
}

.mobile-controls.active-touch {
    display: flex;
}

.dpad-cluster, .action-cluster {
    pointer-events: auto;
}

.dpad-cluster {
    position: relative;
    width: 140px;
    height: 140px;
    background: rgba(8, 10, 20, 0.55);
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 102, 0.4);
    backdrop-filter: blur(6px);
}

.touch-btn {
    background: rgba(15, 20, 36, 0.88);
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-family: var(--font-heading);
    font-weight: bold;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
    transition: transform 0.05s ease, background-color 0.1s ease;
}

.touch-btn.touch-active, .touch-btn:active {
    background: var(--primary);
    color: #000;
    transform: scale(0.92);
}

.dpad-up { position: absolute; top: 4px; left: 46px; width: 48px; height: 42px; }
.dpad-down { position: absolute; bottom: 4px; left: 46px; width: 48px; height: 42px; }
.dpad-left { position: absolute; top: 46px; left: 4px; width: 42px; height: 48px; }
.dpad-right { position: absolute; top: 46px; right: 4px; width: 42px; height: 48px; }

.action-cluster {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    width: 180px;
    background: rgba(8, 10, 20, 0.55);
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(0, 255, 102, 0.4);
    backdrop-filter: blur(6px);
}

.action-cluster .touch-btn {
    padding: 0.7rem 0.2rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.action-blast { border-color: var(--primary); color: var(--primary); }
.action-boost { border-color: var(--secondary); color: var(--secondary); }
.action-missile { border-color: var(--accent); color: var(--accent); }
.action-special { border-color: var(--purple-glow); color: var(--purple-glow); }

.action-blast.touch-active { background: var(--primary); color: #000; }
.action-boost.touch-active { background: var(--secondary); color: #000; }
.action-missile.touch-active { background: var(--accent); color: #000; }
.action-special.touch-active { background: var(--purple-glow); color: #000; }

/* CONTENT SECTIONS */
.content-section {
    padding: 5rem 1.5rem;
}

.alt-bg {
    background: var(--bg-card);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.small-container {
    max-width: 800px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2rem;
    border-radius: 6px;
    transition: transform 0.2s, border-color 0.2s;
}

.alt-bg .card {
    background: var(--bg-card-alt);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.card-title {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 1rem;
    color: var(--text-muted);
}

/* SCOREBOARD */
.scoreboard-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.scoreboard-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    text-align: left;
}

.scoreboard-table th, .scoreboard-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scoreboard-table th {
    font-family: var(--font-heading);
    color: var(--primary);
    font-size: 0.9rem;
}

.scoreboard-table td {
    font-size: 1.1rem;
}

.scoreboard-table tr:hover {
    background: rgba(0, 255, 102, 0.03);
}

/* ABOUT CARD */
.about-card {
    background: var(--bg-card-alt);
    padding: 2.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
    font-size: 1.2rem;
    line-height: 1.8;
}

.about-card p {
    margin-bottom: 1rem;
}

.about-card p:last-child {
    margin-bottom: 0;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    width: 100%;
    max-width: 440px;
    border-radius: 6px;
    padding: 1.8rem;
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.2);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 650px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 255, 102, 0.2);
    padding-bottom: 0.8rem;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.legal-modal-body {
    overflow-y: auto;
    text-align: left;
    padding-right: 0.5rem;
}

.legal-modal-body h4 {
    color: var(--primary);
    margin: 1.2rem 0 0.4rem;
    font-size: 1.05rem;
}

.legal-modal-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.legal-link {
    color: var(--primary);
    text-decoration: underline;
}

/* TOGGLE SWITCH */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #222;
    transition: .3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }

/* COOKIE BANNER */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 20, 36, 0.96);
    border-top: 1px solid var(--border-glow);
    padding: 1.2rem 1.5rem;
    padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
    z-index: 150;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.8);
}

.cookie-banner.hidden { display: none; }

.cookie-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.cookie-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 700px;
}

.cookie-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* FOOTER */
.site-footer {
    background: #04050a;
    border-top: 1px solid rgba(0, 255, 102, 0.15);
    padding: 3.5rem 1.5rem 0;
    margin-top: auto;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--primary);
    font-size: 1.3rem;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-corp-ownership {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-mail-link, .footer-info-list a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
}

.footer-mail-link:hover, .footer-info-list a:hover {
    text-decoration: underline;
}

.footer-heading {
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--primary);
    padding-bottom: 0.4rem;
    display: inline-block;
}

.footer-info-list {
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-info-list li strong {
    color: #fff;
}

.footer-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s;
}

.footer-text-btn:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer-bottom {
    background: #020306;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.2rem 1.5rem;
    padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
}

.footer-bottom-container {
    text-align: center;
}

.footer-copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* RESPONSIVE LAYOUT FOR PHONES, TABLETS & DESKTOPS */
@media (max-width: 990px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-description {
        margin: 0 auto 2rem;
    }

    .hero-cta-group {
        justify-content: center;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    .site-header {
        padding: 0.4rem 0;
    }

    .nav-toggle { display: block; }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border-glow);
        display: none;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9);
    }

    .nav-menu.active { display: flex; }

    .hero-section {
        padding: 6.5rem 1rem 3rem;
    }

    .brand-title { font-size: 2.5rem; }
    .hero-tagline { font-size: 1.4rem; }

    .game-section {
        padding: 1.5rem 0.5rem;
    }

    .game-shell {
        border-radius: 4px;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-buttons {
        justify-content: center;
        width: 100%;
    }

    .cookie-buttons .btn {
        flex: 1;
        min-width: 90px;
    }

    .about-card {
        padding: 1.5rem;
        font-size: 1.05rem;
    }

    .overlay-content {
        padding: 1.2rem;
    }

    .title-logo .main {
        font-size: 1.8rem;
    }
}

/* PORTRAIT MOBILE SPECIFIC ORIENTATION ADJUSTMENTS */
@media screen and (max-width: 900px) and (orientation: portrait) {
    .portrait-warning {
        display: flex;
    }

    .game-shell {
        aspect-ratio: 4 / 3;
    }

    .dpad-cluster {
        width: 115px;
        height: 115px;
    }

    .dpad-up { top: 2px; left: 38px; width: 38px; height: 34px; }
    .dpad-down { bottom: 2px; left: 38px; width: 38px; height: 34px; }
    .dpad-left { top: 38px; left: 2px; width: 34px; height: 38px; }
    .dpad-right { top: 38px; right: 2px; width: 34px; height: 38px; }

    .action-cluster {
        width: 145px;
        gap: 0.4rem;
        padding: 6px;
    }

    .action-cluster .touch-btn {
        padding: 0.5rem 0.1rem;
        font-size: 0.7rem;
    }
}

/* LANDSCAPE MOBILE & SMALL DEVICE OPTIMIZATIONS */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .site-header {
        position: absolute;
    }

    .game-section {
        padding: 0.5rem 0;
    }

    .game-shell-wrapper {
        max-width: 100%;
    }

    .game-shell {
        aspect-ratio: 16 / 9;
        max-height: 98vh;
        border-radius: 0;
    }

    .dpad-cluster {
        width: 110px;
        height: 110px;
    }

    .dpad-up { top: 2px; left: 36px; width: 36px; height: 32px; }
    .dpad-down { bottom: 2px; left: 36px; width: 36px; height: 32px; }
    .dpad-left { top: 36px; left: 2px; width: 32px; height: 36px; }
    .dpad-right { top: 36px; right: 2px; width: 32px; height: 36px; }

    .action-cluster {
        width: 140px;
        gap: 0.35rem;
        padding: 5px;
    }

    .action-cluster .touch-btn {
        padding: 0.4rem 0.1rem;
        font-size: 0.65rem;
    }

    .overlay-content {
        padding: 0.8rem 1.2rem;
        max-height: 90vh;
    }

    .title-logo .main {
        font-size: 1.5rem;
    }

    .overlay-content .tagline {
        margin-bottom: 0.8rem;
    }

    .nickname-input-group {
        margin-bottom: 0.8rem;
    }

    .overlay-buttons {
        gap: 0.4rem;
    }

    .btn-large {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
}