* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

html, body {
    touch-action: manipulation;
    overscroll-behavior: none;
}

body {
    background: radial-gradient(circle at center, #14172b 0%, #070913 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Press Start 2P', monospace, sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    padding: 12px 8px;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1024px;
}

/* Canvas Container (Responsive 16:9 Aspect Ratio) */
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 1024px;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 3px solid #384260;
    border-radius: 8px;
    box-shadow: 0 0 35px rgba(255, 60, 100, 0.25), 0 10px 40px rgba(0, 0, 0, 0.85);
    background-color: #000;
    overflow: hidden;
    touch-action: none;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ---------------------------------------------------------------------------
   CENTER MENU SCREENS (Mode Select & Character Select)
   --------------------------------------------------------------------------- */
.menu-screen {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 30, 0.94);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: scale(0.97);
}

.menu-screen.show {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.menu-header {
    position: relative;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.game-logo {
    font-family: 'Teko', sans-serif;
    font-size: 68px;
    font-weight: 700;
    letter-spacing: 5px;
    color: #facc15;
    text-shadow: 0 0 25px rgba(250, 204, 21, 0.7), 4px 4px 0 #000;
    line-height: 1;
    margin-bottom: 4px;
}

.char-select-title {
    font-family: 'Teko', sans-serif;
    font-size: 58px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #38bdf8;
    text-shadow: 0 0 25px rgba(56, 189, 248, 0.8), 3px 3px 0 #000;
    line-height: 1;
    margin-bottom: 4px;
}

.menu-subtitle {
    font-size: 11px;
    color: #cbd5e1;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #000;
}

.back-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    border: 2px solid #475569;
    color: #cbd5e1;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.back-btn:hover {
    background: #334155;
    color: #ffffff;
    border-color: #94a3b8;
}

/* Mode Selection Cards */
.mode-cards-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
    max-width: 920px;
}

.arcade-card {
    flex: 1;
    background: rgba(30, 41, 59, 0.75);
    border: 3px solid #475569;
    border-radius: 10px;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.arcade-card:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.4), 0 12px 30px rgba(0, 0, 0, 0.8);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 2px;
}

.card-title {
    font-family: 'Teko', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    line-height: 1;
}

.card-desc {
    font-size: 9px;
    color: #94a3b8;
    line-height: 1.6;
    min-height: 38px;
}

.card-badge {
    background: #0f172a;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    font-size: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    margin-top: auto;
}

/* ==========================================================================
   STREET FIGHTER CHARACTER SELECT SCREEN
   ========================================================================== */
#screen-char {
    padding: 12px 18px;
    justify-content: flex-start;
    gap: 6px;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.94) 0%, rgba(5, 8, 18, 0.98) 100%);
}

/* Header */
.sf-select-header {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.sf-header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sf-main-title {
    font-family: 'Teko', sans-serif;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #facc15;
    text-shadow: 0 0 20px rgba(250, 204, 21, 0.6), 3px 3px 0 #000;
    line-height: 0.95;
    margin: 0;
}

.sf-mode-badge-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sf-mode-indicator {
    background: #0f172a;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.sf-subtitle {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: #cbd5e1;
    letter-spacing: 1px;
}

/* Character Roster Grid (Top Slots) */
.sf-roster-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
    max-width: 980px;
    margin-top: 4px;
    margin-bottom: 20px;
}

.sf-roster-card {
    flex: 1;
    max-width: 188px;
    min-width: 172px;
    background: rgba(15, 23, 42, 0.88);
    border: 2px solid #334155;
    border-radius: 8px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sf-roster-card:hover {
    transform: translateY(-2px);
    border-color: #facc15;
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.3), 0 6px 15px rgba(0, 0, 0, 0.7);
}

.sf-roster-card.selected-p1 {
    border-color: #4ade80;
    background: rgba(22, 101, 52, 0.35);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.6), inset 0 0 12px rgba(74, 222, 128, 0.3);
}

.sf-roster-card.selected-p2 {
    border-color: #60a5fa;
    background: rgba(30, 58, 138, 0.35);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.6), inset 0 0 12px rgba(96, 165, 250, 0.3);
}

.sf-roster-card.selected-p1.selected-p2 {
    border-color: #facc15;
    box-shadow: 0 0 22px rgba(250, 204, 21, 0.7), inset 0 0 12px rgba(74, 222, 128, 0.3);
}

/* Floating Arcade Badges on Top Cards */
.sf-cursor-p1 {
    position: absolute;
    top: -6px;
    left: -4px;
    background: linear-gradient(180deg, #4ade80 0%, #15803d 100%);
    color: #ffffff;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #86efac;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
    z-index: 5;
    animation: sf-pulse-p1 1s infinite alternate;
}

.sf-cursor-p2 {
    position: absolute;
    top: -6px;
    right: -4px;
    background: linear-gradient(180deg, #60a5fa 0%, #1d4ed8 100%);
    color: #ffffff;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #93c5fd;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.8);
    z-index: 5;
    animation: sf-pulse-p2 1s infinite alternate;
}

@keyframes sf-pulse-p1 {
    0% { transform: scale(1); box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
    100% { transform: scale(1.08); box-shadow: 0 0 16px rgba(74, 222, 128, 1); }
}

@keyframes sf-pulse-p2 {
    0% { transform: scale(1); box-shadow: 0 0 8px rgba(96, 165, 250, 0.6); }
    100% { transform: scale(1.08); box-shadow: 0 0 16px rgba(96, 165, 250, 1); }
}

/* Roster Mini Portraits (Avatars) */
.sf-roster-card .char-portrait {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border: 2px solid #334155;
    border-radius: 8px;
    background-color: #0b1120;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sf-roster-card:hover .char-portrait {
    border-color: #facc15;
    transform: scale(1.06);
}

.sf-roster-card.selected-p1 .char-portrait {
    border-color: #06b6d4;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.75);
}

.sf-roster-card.selected-p2 .char-portrait {
    border-color: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.75);
}

.sf-card-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-align: left;
}

.sf-card-name {
    font-family: 'Teko', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.05;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sf-card-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    color: #facc15;
    letter-spacing: 0.5px;
}

/* Portrait Background Avatars */
.hero-portrait {
    background-image: url('AVATARS/NINJA.jpg');
    background-position: center center;
    background-size: cover;
}

.kenji-portrait {
    background-image: url('AVATARS/MARTIAL-HERO-2.jpg');
    background-position: center center;
    background-size: cover;
}

.samurai-portrait {
    background-image: url('AVATARS/SAMURAI.jpg');
    background-position: center 30%;
    background-size: cover;
}

.brawler-portrait {
    background-image: url('AVATARS/BRAWLER-GIRL.jpg');
    background-position: center 52%;
    background-size: cover;
}

.punk-portrait {
    background-image: url('AVATARS/enemy-punk.jpg');
    background-position: center center;
    background-size: cover;
}

/* ==========================================================================
   Street Fighter VS Stage (Showcase & Centerpiece)
   ========================================================================== */
.sf-vs-stage {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 980px;
    height: 275px;
    margin-bottom: 12px;
}

/* Left / Right Fighter Panels */
.sf-showcase-panel {
    flex: 1;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.9) 100%);
    border: 2px solid #334155;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
}

.sf-showcase-panel.p1-panel {
    border-color: #22c55e;
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.25), 0 8px 30px rgba(0, 0, 0, 0.7);
}

.sf-showcase-panel.p2-panel {
    border-color: #3b82f6;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.25), 0 8px 30px rgba(0, 0, 0, 0.7);
}

.sf-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.sf-player-badge {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 #000;
}

.p1-badge {
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    color: #ffffff;
    border: 1px solid #86efac;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.p2-badge {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: 1px solid #93c5fd;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.sf-select-key-hint {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: #94a3b8;
}

.sf-panel-body {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.sf-panel-body.reverse {
    flex-direction: row;
}

.text-right {
    text-align: right;
}

/* Fighter Spotlight Showcase Box */
.sf-spotlight-box {
    position: relative;
    width: 165px;
    height: 205px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    background: radial-gradient(circle at 50% 25%, rgba(30, 58, 138, 0.45) 0%, rgba(7, 10, 20, 0.95) 80%);
    border-radius: 10px;
    border: 2px solid #334155;
    overflow: hidden;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.85), 0 8px 25px rgba(0, 0, 0, 0.6);
}

.sf-spotlight-avatar {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    z-index: 2;
    transition: background-image 0.25s ease, transform 0.25s ease;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 74%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 74%, rgba(0, 0, 0, 0) 100%);
}

.sf-spotlight-avatar.p2-spotlight-avatar {
    transform: scaleX(-1);
}

.sf-spotlight-beam {
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.04) 60%, transparent 90%);
    clip-path: polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%);
    z-index: 1;
    pointer-events: none;
}

.sf-preview-pedestal {
    position: absolute;
    bottom: 8px;
    width: 125px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(74, 222, 128, 0.8) 0%, rgba(74, 222, 128, 0.35) 45%, transparent 75%);
    filter: blur(1.5px);
    z-index: 3;
}

.sf-preview-pedestal.p2-pedestal {
    background: radial-gradient(ellipse at center, rgba(96, 165, 250, 0.8) 0%, rgba(96, 165, 250, 0.35) 45%, transparent 75%);
}

/* Fighter Info & Stat Gauges */
.sf-details-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.sf-fighter-name {
    font-family: 'Teko', sans-serif;
    font-size: 34px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    line-height: 0.9;
    margin: 0;
    text-shadow: 2px 2px 0 #000;
}

.sf-fighter-style {
    font-family: 'Press Start 2P', monospace;
    font-size: 7.5px;
    color: #facc15;
    letter-spacing: 1px;
}

.sf-special-badge {
    display: inline-block;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #38bdf8;
    color: #38bdf8;
    font-size: 8px;
    padding: 3px 6px;
    border-radius: 4px;
    margin-top: 2px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.sf-stats-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

.sf-stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Press Start 2P', monospace;
    font-size: 6.5px;
}

.sf-stat-label {
    width: 26px;
    color: #94a3b8;
}

.sf-stat-val {
    width: 20px;
    color: #facc15;
    text-align: right;
}

.sf-stat-track {
    flex: 1;
    height: 6px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 3px;
    overflow: hidden;
}

.sf-stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.sf-stat-fill.spd-fill {
    background: linear-gradient(90deg, #38bdf8 0%, #3b82f6 100%);
}

.sf-stat-fill.cmb-fill {
    background: linear-gradient(90deg, #a855f7 0%, #ec4899 100%);
}

.sf-stat-fill.rng-fill {
    background: linear-gradient(90deg, #eab308 0%, #22c55e 100%);
}

/* ==========================================================================
   Center Arcade VS Emblem & Lock-in Button
   ========================================================================== */
.sf-vs-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 140px;
    flex-shrink: 0;
}

.sf-vs-lightning {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-vs-text {
    font-family: 'Teko', sans-serif;
    font-size: 72px;
    font-weight: 700;
    font-style: italic;
    color: #facc15;
    letter-spacing: 2px;
    line-height: 0.8;
    text-shadow: 
        0 0 15px rgba(234, 179, 8, 0.8),
        0 0 30px rgba(239, 68, 68, 0.6),
        3px 3px 0 #7f1d1d,
        5px 5px 0 #000000;
    animation: sf-vs-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes sf-vs-pulse {
    0% { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.7)); }
    100% { transform: scale(1.08) rotate(-3deg); filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.9)); }
}

.sf-fight-btn {
    width: 130px;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: linear-gradient(180deg, #fef08a 0%, #eab308 60%, #ca8a04 100%);
    border: 3px solid #ffffff;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 5px 0 #713f12, 0 0 25px rgba(234, 179, 8, 0.8);
    transition: all 0.15s ease;
}

.sf-fight-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #713f12, 0 0 35px rgba(234, 179, 8, 1);
    background: linear-gradient(180deg, #ffffff 0%, #facc15 60%, #eab308 100%);
}

.sf-fight-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #713f12, 0 0 15px rgba(234, 179, 8, 0.6);
}

.sf-fight-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 13px;
    color: #0f172a;
    font-weight: bold;
    letter-spacing: 1px;
}

.sf-fight-key {
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    color: #451a03;
    letter-spacing: 0.5px;
}

.sf-random-btn {
    background: #1e293b;
    border: 1px solid #475569;
    color: #cbd5e1;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sf-random-btn:hover {
    background: #334155;
    border-color: #facc15;
    color: #facc15;
}

/* Footer Navigation Bar */
.sf-select-footer-bar {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 4px;
}

.sf-guide-pill {
    font-family: 'Press Start 2P', monospace;
    font-size: 7.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sf-key {
    background: #1e293b;
    border: 1px solid #475569;
    color: #38bdf8;
    padding: 2px 5px;
    border-radius: 3px;
    box-shadow: 0 1px 0 #000;
}

/* ---------------------------------------------------------------------------
   IN-GAME TOP HUD
   --------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------
   AUTHENTIC STREET FIGHTER 6 IN-GAME HUD
   --------------------------------------------------------------------------- */
.hud, .sf6-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 12px 20px;
    pointer-events: none;
    z-index: 10;
    box-sizing: border-box;
}

/* Upper Screen Match Header */
.sf6-top-bar {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

/* SF6 Fighter Side (P1 / P2) */
.sf6-fighter-side {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.sf6-fighter-side.p2-side {
    justify-content: flex-end;
}

/* Street Fighter 6 Hex/Angled Portrait Box */
.sf6-portrait-box {
    position: relative;
    width: 58px;
    height: 58px;
    background: #090d16;
    border-radius: 8px;
    flex-shrink: 0;
    pointer-events: auto;
    transition: transform 0.2s ease;
}

.sf6-portrait-box.p1-portrait {
    border: 2.5px solid #00f0ff;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.65), inset 0 0 10px rgba(0, 0, 0, 0.85);
}

.sf6-portrait-box.p2-portrait {
    border: 2.5px solid #f97316;
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.65), inset 0 0 10px rgba(0, 0, 0, 0.85);
}

.sf6-portrait-img {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.sf6-tag-pill {
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Press Start 2P', monospace;
    font-size: 7.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

.sf6-tag-pill.p1-pill {
    background: #0284c7;
    color: #ffffff;
    border: 1px solid #7dd3fc;
}

.sf6-tag-pill.p2-pill {
    background: #ea580c;
    color: #ffffff;
    border: 1px solid #fdba74;
}

/* Fighter Meta & Information Column */
.sf6-meta-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 3px;
    min-width: 0;
}

.sf6-meta-column.reverse {
    align-items: flex-end;
}

.sf6-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    padding: 0 2px;
}

.sf6-name-row.reverse {
    justify-content: flex-end;
}

.sf6-name {
    font-family: 'Teko', sans-serif;
    font-size: 28px;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 2px;
    line-height: 0.9;
    text-transform: uppercase;
}

.p1-side .sf6-name {
    color: #ffffff;
    text-shadow: 2px 2px 0 #000, 0 0 14px rgba(56, 189, 248, 0.8);
}

.p2-side .sf6-name {
    color: #ffffff;
    text-shadow: 2px 2px 0 #000, 0 0 14px rgba(249, 115, 22, 0.8);
}

.sf6-archetype-banner {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    padding: 2.5px 7px;
    border-radius: 3px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.9);
    white-space: nowrap;
}

.p1-banner {
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.p2-banner {
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.5);
    box-shadow: 0 0 8px rgba(251, 146, 60, 0.3);
}

/* Combo Badge */
.combo-badge {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #facc15;
    text-shadow: 2px 2px 0 #000, 0 0 10px #f59e0b;
    font-weight: bold;
    min-height: 14px;
    transition: transform 0.1s ease;
}

.combo-badge.active {
    animation: comboPulse 0.25s infinite alternate;
}

@keyframes comboPulse {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

/* SF6 Skewed Health Bar */
.sf6-health-bar-wrap {
    width: 100%;
    height: 25px;
    transform: skewX(-14deg);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.85));
}

.sf6-health-bar-wrap.reverse {
    transform: skewX(14deg);
}

.sf6-health-bar-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #090d16;
    border: 2px solid #ffffff;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.95);
}

.sf6-health-bar-container.reverse {
    transform: scaleX(-1);
}

.sf6-health-lag {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
    transition: width 0.45s cubic-bezier(0.25, 1, 0.5, 1) 0.2s;
}

.sf6-health-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(180deg, #fef08a 0%, #eab308 45%, #b45309 100%);
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.85);
    transition: width 0.15s ease-out;
}

.sf6-health-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 42%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
}

/* SF6 Drive Gauge 6-Segment Block */
.sf6-drive-row {
    display: flex;
    gap: 3px;
    width: 100%;
    height: 9px;
    transform: skewX(-14deg);
    margin-top: 3px;
}

.sf6-drive-row.reverse {
    transform: skewX(14deg);
    justify-content: flex-end;
}

.sf6-drive-block {
    flex: 1;
    height: 100%;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 1.5px;
    transition: all 0.2s ease;
}

.sf6-drive-block.active {
    background: linear-gradient(180deg, #67e8f9 0%, #06b6d4 50%, #0891b2 100%);
    border-color: #a5f3fc;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.p2-side .sf6-drive-block.active {
    background: linear-gradient(180deg, #6ee7b7 0%, #10b981 50%, #047857 100%);
    border-color: #a7f3d0;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

/* SF6 Center Timer Bracket */
.sf6-center-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0 6px;
    pointer-events: auto;
    flex-shrink: 0;
}

.sf6-timer-bracket {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 86px;
    height: 58px;
    background: linear-gradient(180deg, #1e293b 0%, #090d16 100%);
    border: 3px solid #f8fafc;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.95), inset 0 0 10px rgba(255, 255, 255, 0.15);
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 12px), 0 12px);
}

.sf6-timer-display {
    font-family: 'Teko', sans-serif;
    font-size: 50px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
}

.sf6-timer-bracket.urgent .sf6-timer-display {
    color: #ef4444;
    text-shadow: 0 0 16px rgba(239, 68, 68, 0.95);
}

.sf6-timer-bracket.urgent {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.85);
    animation: urgentPulse 0.5s infinite alternate;
}

@keyframes urgentPulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.mini-menu-btn, .sf6-menu-btn {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #475569;
    color: #94a3b8;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    padding: 2.5px 7px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mini-menu-btn:hover, .sf6-menu-btn:hover {
    background: #334155;
    color: #ffffff;
    border-color: #cbd5e1;
}

/* 2v2 Allies Row Support */
.sf6-allies-container {
    position: absolute;
    top: 92px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.sf6-ally-unit {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 240px;
}

.sf6-ally-unit.reverse {
    justify-content: flex-end;
}

.sf6-ally-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sf6-ally-meta.text-right {
    align-items: flex-end;
}

/* Backward compatibility / 2v2 ally bars */
.hud-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.hud-avatar.sub-avatar {
    width: 34px;
    height: 34px;
    border-radius: 5px;
    border-color: #94a3b8;
    box-shadow: 0 0 8px rgba(148, 163, 184, 0.6);
}

.sub-name {
    font-size: 9px;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.health-bar-container {
    position: relative;
    width: 100%;
    height: 24px;
    background: #1e2230;
    border: 2px solid #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.mini-bar {
    height: 16px;
    border-width: 1.5px;
}

.health-bar-lag {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: #ef4444;
    transition: width 0.45s ease-out 0.2s;
}

.health-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(180deg, #86efac 0%, #22c55e 50%, #15803d 100%);
    transition: width 0.15s ease-out;
}

.ally-fill {
    background: linear-gradient(180deg, #bef264 0%, #84cc16 50%, #4d7c0f 100%);
    box-shadow: 0 0 8px rgba(132, 204, 22, 0.7);
}

.enemy-ally-fill {
    background: linear-gradient(180deg, #e879f9 0%, #c026d3 50%, #86198f 100%);
    box-shadow: 0 0 8px rgba(192, 38, 211, 0.7);
}

/* Announcer Overlay */
.announcer-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.72);
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.announcer-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.announcer-title {
    font-family: 'Teko', sans-serif;
    font-size: 76px;
    font-weight: 700;
    color: #fbbf24;
    text-transform: uppercase;
    text-shadow: 0 0 25px rgba(251, 191, 36, 0.9), 4px 4px 0 #000;
    letter-spacing: 4px;
    line-height: 1;
}

.announcer-subtitle {
    font-size: 16px;
    color: #ffffff;
    margin-top: 10px;
    text-shadow: 2px 2px 0 #000, 0 0 15px rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
}

.gameover-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.restart-btn, .menu-btn-alt {
    padding: 12px 24px;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.restart-btn {
    color: #0f172a;
    background: linear-gradient(180deg, #fef08a 0%, #eab308 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 6px 0 #854d0e, 0 0 20px rgba(234, 179, 8, 0.6);
}

.restart-btn:hover {
    transform: translateY(2px);
    box-shadow: 0 4px 0 #854d0e, 0 0 25px rgba(234, 179, 8, 0.9);
}

.menu-btn-alt {
    color: #ffffff;
    background: #1e293b;
    border: 3px solid #64748b;
    box-shadow: 0 6px 0 #0f172a;
}

.menu-btn-alt:hover {
    background: #334155;
    border-color: #94a3b8;
    transform: translateY(2px);
    box-shadow: 0 4px 0 #0f172a;
}

/* Controls Panel */
.controls-panel {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1024px;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid #334155;
    border-radius: 8px;
    padding: 12px 18px;
    gap: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.controls-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.shortcuts-col {
    flex: 1.1;
}

.controls-header {
    font-size: 10px;
    letter-spacing: 1px;
}

.p1-header {
    color: #4ade80;
}

.p2-header {
    color: #60a5fa;
}

.sys-header {
    color: #facc15;
}

.controls-keys {
    font-size: 9px;
    color: #94a3b8;
    line-height: 1.6;
}

.key-badge {
    display: inline-block;
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 4px;
    padding: 2px 5px;
    margin: 0 2px;
    font-size: 8px;
    font-weight: bold;
    box-shadow: 0 2px 0 #0f172a;
}

.touch-toggle-pill {
    margin-top: 6px;
    align-self: flex-start;
    background: #1e293b;
    border: 1px solid #475569;
    color: #cbd5e1;
    font-family: 'Press Start 2P', monospace;
    font-size: 7.5px;
    padding: 5px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.touch-toggle-pill:hover, .touch-toggle-pill:active {
    border-color: #38bdf8;
    color: #38bdf8;
}

/* ==========================================================================
   Mobile Virtual Touch Gamepad
   ========================================================================== */
.mobile-gamepad {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    display: none;
    align-items: flex-end;
    justify-content: space-between;
    padding: 16px 22px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* Auto-display on touch screens / mobile viewports, or when forced active */
@media (hover: none) and (pointer: coarse), (max-width: 950px) {
    .mobile-gamepad.active-mode {
        display: flex;
    }
}

.mobile-gamepad.forced-show {
    display: flex !important;
}

.mobile-gamepad.forced-hide {
    display: none !important;
}

.touch-cluster {
    display: flex;
    pointer-events: auto;
    align-items: center;
    gap: 12px;
}

.cluster-left {
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.touch-dpad-row {
    display: flex;
    gap: 10px;
}

.cluster-center {
    margin-bottom: 8px;
    gap: 8px;
    opacity: 0.85;
}

.cluster-right {
    flex-direction: row;
    align-items: flex-end;
    gap: 14px;
}

/* Touch Buttons Styling */
.touch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(30, 41, 59, 0.94) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 2.5px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    transition: transform 0.08s ease, border-color 0.08s ease;
}

.touch-btn:active, .touch-btn.btn-pressed {
    transform: scale(0.91);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), inset 0 0 12px rgba(255, 255, 255, 0.4);
    filter: brightness(1.35);
}

.touch-dir {
    width: 62px;
    height: 62px;
    border-color: #38bdf8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.3);
}

.touch-dir:active, .touch-dir.btn-pressed {
    border-color: #7dd3fc;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.85);
}

.touch-jump {
    width: 58px;
    height: 58px;
    border-color: #4ade80;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 15px rgba(74, 222, 128, 0.3);
}

.touch-jump:active, .touch-jump.btn-pressed {
    border-color: #86efac;
    box-shadow: 0 0 25px rgba(74, 222, 128, 0.85);
}

.action-strike {
    width: 72px;
    height: 72px;
    border-color: #f59e0b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.4);
    background: radial-gradient(circle at 35% 35%, rgba(120, 53, 15, 0.88) 0%, rgba(30, 20, 10, 0.96) 100%);
}

.action-strike:active, .action-strike.btn-pressed {
    border-color: #fbbf24;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.95);
}

.action-heavy {
    width: 64px;
    height: 64px;
    border-color: #ec4899;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 18px rgba(236, 72, 153, 0.4);
    background: radial-gradient(circle at 35% 35%, rgba(131, 24, 67, 0.88) 0%, rgba(30, 10, 20, 0.96) 100%);
    margin-bottom: 12px;
}

.action-heavy:active, .action-heavy.btn-pressed {
    border-color: #f472b6;
    box-shadow: 0 0 28px rgba(236, 72, 153, 0.95);
}

.touch-icon {
    font-size: 24px;
    line-height: 1;
    pointer-events: none;
}

.touch-tag {
    font-family: 'Press Start 2P', monospace;
    font-size: 6.5px;
    color: #e2e8f0;
    letter-spacing: 0.5px;
    margin-top: 2px;
    pointer-events: none;
}

/* Touch Quick Pills (Menu & Restart) */
.touch-pill-btn {
    background: rgba(15, 23, 42, 0.88);
    border: 1.5px solid #475569;
    color: #cbd5e1;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    touch-action: none;
    transition: all 0.15s ease;
}

.touch-pill-btn:active {
    background: #334155;
    border-color: #facc15;
    color: #facc15;
}

/* Mobile Top Header Fullscreen Buttons */
.mobile-top-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: rgba(15, 23, 42, 0.88);
    border: 1.5px solid #38bdf8;
    color: #38bdf8;
    font-size: 16px;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 60;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
}

.mobile-top-btn:active {
    transform: scale(0.92);
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.8);
}

.sf6-center-btn-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sf6-fullscreen-btn {
    font-size: 11px;
    padding: 3px 6px;
}

/* Orientation Hint & Enforcer for Portrait Mobile Screens */
.orientation-hint-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 95;
    display: none;
    pointer-events: auto;
    width: 90%;
    max-width: 380px;
}

.orientation-hint-overlay.show {
    display: block;
    animation: zoomInOrient 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.orientation-hint-box {
    background: rgba(10, 15, 30, 0.96);
    border: 2px solid #38bdf8;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 25px rgba(56, 189, 248, 0.4);
    padding: 16px 14px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    backdrop-filter: blur(12px);
}

.orientation-badge {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 1px;
}

.orientation-icon {
    font-size: 32px;
    margin: 2px 0;
    display: inline-block;
    animation: rotatePhone 2.2s infinite ease-in-out;
}

@keyframes rotatePhone {
    0%, 20% { transform: rotate(0deg); }
    50%, 70% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

.orientation-title {
    font-family: 'Teko', sans-serif;
    font-size: 24px;
    letter-spacing: 1.5px;
    color: #ffffff;
    margin: 0;
    line-height: 1;
}

.orientation-msg {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.35;
}

.orientation-btn-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 6px;
    margin-top: 6px;
}

.orientation-action-btn {
    width: 100%;
    padding: 9px 12px;
    border-radius: 6px;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
}

.orientation-action-btn.primary {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    border: 1.5px solid #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.orientation-action-btn.primary:active {
    transform: scale(0.97);
    background: #0369a1;
}

.orientation-action-btn.secondary {
    background: transparent;
    border: 1px solid #475569;
    color: #94a3b8;
    font-size: 7px;
}

.orientation-action-btn.secondary:active {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

@keyframes zoomInOrient {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ==========================================================================
   Responsive Tablet & Mobile Rules
   ========================================================================== */
@media (max-width: 950px) {
    body {
        padding: 4px;
    }

    .canvas-container {
        border-width: 2px;
        border-radius: 6px;
    }

    /* Mode Select Screen */
    .game-logo {
        font-size: 46px;
    }

    .mode-cards-container {
        gap: 10px;
    }

    .arcade-card {
        padding: 14px 10px;
        gap: 8px;
    }

    .card-icon {
        font-size: 28px;
    }

    .card-title {
        font-size: 22px;
    }

    .card-desc {
        font-size: 7px;
        line-height: 1.3;
    }

    /* Street Fighter Character Select Screen */
    .sf-select-header {
        margin-bottom: 6px;
    }

    .sf-game-title {
        font-size: 30px;
    }

    .sf-roster-container {
        gap: 6px;
        width: 100%;
        max-width: 100%;
        margin-bottom: 8px;
    }

    .sf-roster-card {
        flex: 1;
        min-width: 0 !important;
        max-width: none !important;
        height: 60px;
        padding: 4px 4px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 3px;
    }

    .sf-roster-card .char-portrait {
        width: 36px;
        height: 36px;
    }

    .sf-card-name {
        font-size: 12px;
        line-height: 1;
    }

    .sf-card-title {
        display: none;
    }

    .sf-vs-stage {
        height: 220px;
        gap: 8px;
    }

    .sf-showcase-panel {
        padding: 8px 10px;
    }

    .sf-fighter-name {
        font-size: 22px;
    }

    .sf-preview-box {
        width: 100px;
        height: 120px;
    }

    .sf-preview-box canvas {
        width: 100px;
        height: 115px;
    }

    .sf-showcase-avatar {
        width: 32px;
        height: 32px;
    }

    .sf-special-badge {
        font-size: 6px;
        padding: 2px 4px;
    }

    .sf-stat-row {
        font-size: 5.5px;
        gap: 4px;
    }

    .sf-vs-text {
        font-size: 32px;
    }

    .sf-fight-btn {
        padding: 8px 12px;
    }

    .sf-fight-label {
        font-size: 9px;
    }

    .sf-random-btn {
        font-size: 7px;
        padding: 4px 8px;
    }

    /* In-Game HUD */
    .hud, .sf6-hud {
        padding: 8px 14px;
    }

    .sf6-fighter-side {
        flex: 1;
        min-width: 0;
        gap: 6px;
    }

    .sf6-portrait-box {
        width: 48px;
        height: 48px;
    }

    .sf6-tag-pill {
        font-size: 6px;
        padding: 1px 4px;
        bottom: -6px;
    }

    .sf6-name {
        font-size: 20px;
    }

    .sf6-archetype-banner {
        font-size: 6px;
        padding: 1px 5px;
    }

    .sf6-health-bar-wrap {
        height: 20px;
    }

    .sf6-drive-row {
        height: 7px;
    }

    .sf6-timer-bracket {
        width: 66px;
        height: 48px;
    }

    .sf6-timer-display {
        font-size: 34px;
    }


    .fighter-hud {
        width: 280px;
    }

    .hud-avatar {
        width: 38px;
        height: 38px;
    }

    .fighter-info {
        font-size: 9px;
    }

    .timer-box {
        font-size: 24px;
        padding: 4px 8px;
    }

    /* Controls Panel */
    .controls-panel {
        flex-direction: column;
        gap: 8px;
        padding: 10px 14px;
    }
}

@media (max-width: 640px) {
    .menu-screen {
        padding: 8px;
    }

    .game-logo {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .menu-subtitle {
        font-size: 8px;
    }

    .mode-cards-container {
        flex-direction: column;
        gap: 6px;
        max-width: 280px;
    }

    .arcade-card {
        padding: 8px 12px;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }

    .card-icon {
        font-size: 22px;
        margin-bottom: 0;
    }

    .card-title {
        font-size: 16px;
    }

    .card-desc {
        display: none;
    }

    /* Character Select on Small Screen */
    .sf-game-title {
        font-size: 22px;
    }

    .sf-roster-container {
        gap: 4px;
        width: 100%;
        max-width: 100%;
        margin-bottom: 6px;
    }

    .sf-roster-card {
        flex: 1;
        min-width: 0 !important;
        max-width: none !important;
        height: 50px;
        padding: 3px 2px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 2px;
    }

    .sf-roster-card .char-portrait {
        width: 28px;
        height: 28px;
    }

    .sf-card-name {
        font-size: 9px;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .sf-card-title {
        display: none;
    }

    .sf-vs-stage {
        height: 180px;
        gap: 4px;
    }

    .sf-details-box {
        gap: 2px;
    }

    .sf-fighter-name {
        font-size: 16px;
    }

    .sf-fighter-style {
        font-size: 6px;
    }

    .sf-special-badge {
        display: none;
    }

    .sf-showcase-avatar {
        width: 24px;
        height: 24px;
    }

    .sf-preview-box {
        width: 75px;
        height: 95px;
    }

    .sf-preview-box canvas {
        width: 75px;
        height: 90px;
    }

    .sf-vs-center {
        width: 80px;
        gap: 6px;
    }

    .sf-vs-text {
        font-size: 24px;
    }

    .sf-fight-btn {
        padding: 6px 8px;
    }

    .sf-fight-label {
        font-size: 8px;
    }

    .sf-fight-key {
        display: none;
    }

    /* Small HUD */
    .hud, .sf6-hud {
        padding: 4px 6px;
    }

    .sf6-fighter-side {
        max-width: 170px;
        gap: 5px;
    }

    .sf6-portrait-box {
        width: 36px;
        height: 36px;
    }

    .sf6-tag-pill {
        font-size: 5px;
        padding: 1px 3px;
        bottom: -5px;
    }

    .sf6-name {
        font-size: 15px;
    }

    .sf6-archetype-banner {
        display: none;
    }

    .sf6-health-bar-wrap {
        height: 14px;
    }

    .sf6-drive-row {
        height: 5px;
        gap: 2px;
    }

    .sf6-timer-bracket {
        width: 50px;
        height: 36px;
        clip-path: none;
        border-radius: 4px;
        border-width: 2px;
    }

    .sf6-timer-display {
        font-size: 24px;
    }

    .sf6-center-hud {
        margin: 0 6px;
    }


    .fighter-hud {
        width: 170px;
    }

    .hud-avatar {
        width: 28px;
        height: 28px;
    }

    .fighter-info {
        font-size: 7px;
    }

    .timer-box {
        font-size: 18px;
        padding: 2px 6px;
    }

    .mini-menu-btn, .sf6-menu-btn {
        font-size: 6.5px;
        padding: 3px 6px;
    }

    /* Compact Mobile Touch Buttons */
    .touch-dir {
        width: 52px;
        height: 52px;
    }

    .touch-jump {
        width: 48px;
        height: 48px;
    }

    .action-strike {
        width: 60px;
        height: 60px;
    }

    .action-heavy {
        width: 52px;
        height: 52px;
        margin-bottom: 8px;
    }

    .touch-icon {
        font-size: 18px;
    }

    .touch-tag {
        font-size: 5px;
    }
}

/* =========================================================
   Mobile Landscape & True Fullscreen Console Mode
   ========================================================= */
@media (orientation: landscape) and (max-height: 600px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        background: #000 !important;
    }

    .game-wrapper {
        max-width: 100vw !important;
        width: 100vw !important;
        height: 100vh !important;
        gap: 0 !important;
        padding: 0 !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .canvas-container {
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        aspect-ratio: auto !important;
    }

    #game-canvas {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    /* Hide desktop controls hint panel in mobile landscape */
    .controls-panel {
        display: none !important;
    }

    /* Compact safe-area touch gamepad */
    .mobile-gamepad {
        padding: max(4px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
    }

    .touch-dir {
        width: 50px !important;
        height: 50px !important;
    }

    .touch-jump {
        width: 44px !important;
        height: 44px !important;
    }

    .action-strike {
        width: 56px !important;
        height: 56px !important;
    }

    .action-heavy {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 4px !important;
    }

    /* Menu and Character Select landscape compactness */
    .sf-char-select-screen {
        padding: 6px 12px !important;
        gap: 6px !important;
    }

    .sf-header-title {
        font-size: 16px !important;
        letter-spacing: 2px !important;
    }

    .sf-header-sub {
        display: none !important;
    }

    .sf-roster-row {
        height: 42px !important;
        gap: 4px !important;
    }

    .sf-roster-card {
        flex: 1 !important;
        min-width: 0 !important;
        height: 42px !important;
        padding: 2px 4px !important;
    }

    .sf-card-avatar {
        width: 22px !important;
        height: 22px !important;
    }

    .sf-card-name {
        font-size: 8px !important;
    }

    .sf-vs-stage {
        height: 135px !important;
        gap: 4px !important;
    }

    .sf-preview-box {
        width: 65px !important;
        height: 80px !important;
    }

    .sf-preview-box canvas {
        width: 65px !important;
        height: 75px !important;
    }

    .sf-fighter-name {
        font-size: 14px !important;
    }

    .sf-fighter-style {
        display: none !important;
    }

    .sf-fight-btn {
        padding: 4px 10px !important;
    }

    .sf-fight-label {
        font-size: 9px !important;
    }

    /* Mode Select Menu in landscape */
    .sf-mode-select-screen {
        padding: 10px 16px !important;
    }

    .sf-mode-title {
        font-size: 20px !important;
        margin-bottom: 2px !important;
    }

    .sf-mode-grid {
        gap: 8px !important;
        max-width: 520px !important;
    }

    .sf-mode-card {
        padding: 8px 10px !important;
        gap: 6px !important;
    }

    .sf-mode-card-icon {
        font-size: 18px !important;
    }

    .sf-mode-card-title {
        font-size: 12px !important;
    }

    .sf-mode-card-desc {
        display: none !important;
    }
}

/* Fullscreen API styles */
:fullscreen, :-webkit-full-screen {
    background: #000 !important;
}

:fullscreen .game-wrapper,
:-webkit-full-screen .game-wrapper {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    padding: 0 !important;
    gap: 0 !important;
}

:fullscreen .canvas-container,
:-webkit-full-screen .canvas-container {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    aspect-ratio: auto !important;
}

:fullscreen #game-canvas,
:-webkit-full-screen #game-canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

:fullscreen .controls-panel,
:-webkit-full-screen .controls-panel {
    display: none !important;
}