/* Fun fonts from Google */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;700;900&display=swap');

/* ===== CSS Variables ===== */
:root {
    --ring-red: #c62828;
    --ring-blue: #1565c0;
    --accent-gold: #ffd54f;
    --accent-red: #ef5350;
    --text-light: #ffffff;
    --bg-dark: #1a1a1a;
    --bg-mid: #2d2d2d;
}

/* ===== Base Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ===== Page Background - Dark arena vibes ===== */
body {
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    justify-content: center;
    padding: 10px;
    color: var(--text-light);
}

/* ===== Game Container ===== */
.game-container {
    max-width: 640px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* ===== Header ===== */
header {
    text-align: center;
    width: 100%;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95em;
    margin-bottom: 6px;
    transition: opacity 0.2s;
}

.back-button:hover {
    opacity: 0.8;
}

h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8em;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

h1 .material-symbols-rounded {
    font-size: 36px;
    color: var(--accent-red);
}

.subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1em;
    margin-top: 2px;
}

/* ===== HUD (Health bars + Round) ===== */
.hud {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.health-container {
    flex: 1;
}

.fighter-name {
    font-family: 'Fredoka One', cursive;
    font-size: 0.85em;
    display: block;
    margin-bottom: 4px;
}

.player-health .fighter-name { color: #4fc3f7; }
.cpu-health .fighter-name { color: #ef5350; text-align: right; }

.health-bar {
    width: 100%;
    height: 16px;
    background: #333;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.health-fill.cpu {
    background: linear-gradient(90deg, #66BB6A, #4CAF50);
    float: right;
}

.health-fill.low {
    background: linear-gradient(90deg, #f44336, #ff7043) !important;
}

.round-info {
    text-align: center;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.round-label {
    font-size: 0.7em;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.round-number {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8em;
    color: var(--accent-gold);
    line-height: 1;
}

.round-timer {
    font-family: 'Fredoka One', cursive;
    font-size: 1em;
    color: rgba(255,255,255,0.7);
}

/* ===== Canvas ===== */
main {
    position: relative;
    width: 600px;
    max-width: 100%;
}

#game-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* ===== Combo Display ===== */
.combo-display {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4em;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 213, 79, 0.6);
    animation: comboPopIn 0.3s ease-out;
    text-align: center;
}

.combo-display.hidden {
    display: none;
}

#combo-count {
    font-size: 1.5em;
    color: #ff7043;
}

@keyframes comboPopIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== Overlays ===== */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 2em;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 10px;
}

.overlay .title-icon {
    font-size: 40px;
    color: var(--accent-red);
}

.overlay p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1em;
    text-align: center;
    padding: 0 20px;
}

.controls-hint {
    background: rgba(255,255,255,0.08);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85em;
    color: rgba(255,255,255,0.6);
}

/* ===== Difficulty Buttons ===== */
.difficulty-buttons {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 22px;
    border: none;
    border-radius: 14px;
    font-family: 'Fredoka One', cursive;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
}

.difficulty-btn:hover {
    transform: scale(1.08);
}

.difficulty-btn .material-symbols-rounded {
    font-size: 32px;
}

.difficulty-btn.easy {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.difficulty-btn.medium {
    background: linear-gradient(135deg, #FF9800, #FFB74D);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.difficulty-btn.hard {
    background: linear-gradient(135deg, #f44336, #EF5350);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

/* ===== Play Button ===== */
.play-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

/* ===== Instructions ===== */
.instructions {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.82em;
    text-align: center;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 8px;
}

.created-by {
    font-family: 'Fredoka One', cursive;
    font-size: 1.1em;
    padding: 8px 24px;
    color: #fff;
    background: linear-gradient(135deg, #E91E63, #FF4081);
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

.created-by .material-symbols-rounded {
    font-size: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 620px) {
    main { width: 100%; }
    h1 { font-size: 1.4em; }
    .difficulty-btn { padding: 10px 16px; font-size: 0.9em; }
    .hud { padding: 6px 10px; font-size: 0.85em; }
    .controls-hint { font-size: 0.75em; }
}
