/*
 * Super Bros - Modern Platform Fighter Styling
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800;900&family=JetBrains+Mono:wght@700&display=swap');

:root {
    --bg-dark: #090d16;
    --panel-bg: rgba(15, 23, 42, 0.75);
    --panel-border: rgba(255, 255, 255, 0.12);
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --accent-yellow: #facc15;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e1b4b 0%, #030712 100%);
}

#game-canvas {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    background-color: #000;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 30px;
    z-index: 10;
    backdrop-filter: blur(8px);
    background: rgba(3, 7, 18, 0.65);
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    padding: 14px 36px;
    border: 2px solid #f87171;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.8);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 24px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: #94a3b8;
}

#screen-title {
    justify-content: center;
    gap: 40px;
    background: radial-gradient(circle at center, rgba(30, 27, 75, 0.8) 0%, rgba(3, 7, 18, 0.95) 100%);
}

.title-logo-wrap {
    text-align: center;
}

.title-logo-wrap h1 {
    font-size: 5rem;
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(180deg, #ffffff 0%, #facc15 45%, #ef4444 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
    letter-spacing: 3px;
}

.title-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 6px;
    color: #38bdf8;
    text-shadow: 0 0 15px #0284c7;
    margin-top: -10px;
}

.title-action-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.controls-hint {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.screen-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--panel-border);
}

.screen-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #f8fafc;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    width: 100%;
    max-width: 1100px;
    margin: auto;
}

.mode-card {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 16px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mode-card:hover {
    transform: translateY(-8px);
    border-color: #60a5fa;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.35);
    background: rgba(30, 41, 59, 0.9);
}

.mode-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.mode-name {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.mode-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.css-main-area {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    gap: 20px;
    margin: auto;
}

.css-characters-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.char-card {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.char-card:hover {
    transform: scale(1.06);
    border-color: #facc15;
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.4);
}

.char-portrait-box {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    border: 2px solid #fff;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.char-name {
    font-size: 1rem;
    font-weight: 800;
    margin-top: 8px;
    text-align: center;
}

.char-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

.css-slots-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.slot-card {
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid var(--panel-border);
    border-radius: 12px;
    padding: 12px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.slot-card.active {
    border-color: #3b82f6;
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slot-tag {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    color: #fff;
}

.btn-toggle-slot {
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.slot-char-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 6px 0;
}

.cpu-level-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #facc15;
    font-weight: 700;
}

.cpu-slider {
    flex: 1;
    accent-color: #facc15;
}

.human-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #34d399;
}

.slot-empty {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin: auto;
}

.sss-stages-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 1100px;
    margin: auto;
}

.stage-card {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.stage-card:hover, .stage-card.selected {
    border-color: #38bdf8;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
    transform: scale(1.05);
}

.stage-thumb-box {
    width: 100%;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    margin-bottom: 8px;
}

.stage-name {
    font-size: 1rem;
    font-weight: 800;
}

.stage-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

#screen-match {
    background: transparent;
    pointer-events: none;
    padding: 20px;
}

.hud-top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud-timer-badge {
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid var(--panel-border);
    padding: 6px 20px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 900;
    color: #f8fafc;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.btn-hud-pause {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--panel-border);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.battle-hud-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.fighter-hud-card {
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-bottom: 5px solid #ef4444;
    border-radius: 12px;
    padding: 10px 16px;
    min-width: 180px;
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.fighter-hud-card.dead {
    opacity: 0.4;
}

.hud-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 800;
}

.hud-percent {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
    margin: 6px 0;
    transition: color 0.2s;
    text-shadow: 0 0 15px currentColor;
}

.pct-sign {
    font-size: 1.4rem;
    margin-left: 2px;
}

.hud-stocks {
    display: flex;
    gap: 6px;
}

.stock-pip {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #fff;
}

.final-smash-badge {
    margin-top: 5px;
    font-size: 0.65rem;
    font-weight: 900;
    color: #facc15;
    animation: pulseGlow 1s infinite alternate;
}

@keyframes pulseGlow {
    from { opacity: 0.7; transform: scale(0.96); }
    to { opacity: 1.0; transform: scale(1.04); }
}

.shake {
    animation: hudShake 0.2s ease-in-out;
}

@keyframes hudShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-4px, 3px); }
    50% { transform: translate(4px, -3px); }
    75% { transform: translate(-3px, -2px); }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-card {
    background: #0f172a;
    border: 2px solid var(--panel-border);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 900;
    text-align: center;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.victory-podium-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: auto;
}

.victory-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-shadow: 0 0 30px rgba(250, 204, 21, 0.6);
}

.stats-table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.95rem;
}

.stats-table th, .stats-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--panel-border);
    text-align: center;
}

.stats-table th {
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
}

.touch-controls-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 20;
}

.touch-dpad, .touch-actions {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.touch-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-btn:active {
    background: rgba(239, 68, 68, 0.8);
    transform: scale(0.92);
}

.training-controls-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--panel-border);
    padding: 6px 14px;
    border-radius: 10px;
    pointer-events: auto;
    z-index: 30;
}

.training-btn {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}
