/* ============================================
   KEYSMASH.IT - Retro Gaming Aesthetic
   ============================================ */

/* CSS Variables */
:root {
    /* Colors - Retro Neon */
    --primary: #ff0080;
    --primary-glow: rgba(255, 0, 128, 0.5);
    --secondary: #00ffff;
    --secondary-glow: rgba(0, 255, 255, 0.5);
    --accent: #ffff00;
    --accent-glow: rgba(255, 255, 0, 0.5);
    --success: #00ff00;
    --success-glow: rgba(0, 255, 0, 0.5);
    --warning: #ff8800;
    --danger: #ff0000;
    --legendary: #ffd700;
    --legendary-glow: rgba(255, 215, 0, 0.5);

    /* Background */
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 35, 0.9);
    --bg-card-hover: rgba(30, 30, 50, 0.95);
    --bg-input: rgba(10, 10, 20, 0.8);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --text-muted: #606080;

    /* Fonts */
    --font-pixel: 'Press Start 2P', cursive;
    --font-retro: 'VT323', monospace;
    --font-mono: 'Space Mono', monospace;

    /* Sizing */
    --border-radius: 8px;
    --border-radius-lg: 16px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-retro);
    font-size: 18px;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.1) 0px,
            rgba(0, 0, 0, 0.1) 1px,
            transparent 1px,
            transparent 2px);
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, var(--primary-glow) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, var(--secondary-glow) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(100, 0, 150, 0.2) 0%, transparent 60%);
    z-index: -1;
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Falling Keys Animation Container */
.falling-keys-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.falling-key {
    position: absolute;
    font-family: var(--font-pixel);
    font-size: 24px;
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary-glow);
    animation: keyFall linear forwards;
    opacity: 0.8;
}

@keyframes keyFall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 0.8;
    }

    100% {
        transform: translateY(100vh) rotate(var(--rotation, 360deg));
        opacity: 0;
    }
}

/* Main Container */
.main-container {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    padding: 0px 20px;
    margin-bottom: 20px;
}

.logo-container {
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-key {
    font-size: 48px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.logo-text {
    font-family: var(--font-pixel);
    font-size: clamp(24px, 6vw, 42px);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: 2px;
}

.logo-dot {
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
}

.tagline {
    font-family: var(--font-retro);
    font-size: 24px;
    color: var(--text-secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-family: var(--font-pixel);
    font-size: 20px;
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary-glow);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Content */
.content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Intro Section - Compact */
.intro-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    border: 1px solid rgba(255, 0, 128, 0.3);
    box-shadow: 0 0 30px rgba(255, 0, 128, 0.1);
}

.intro-title {
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 15px;
    text-align: center;
}

.intro-steps {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin-bottom: 15px;
    justify-content: center;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    border-bottom: 3px solid var(--primary);
    transition: transform 0.3s ease, border-color 0.3s ease;
    flex: 1;
    max-width: 180px;
    text-align: center;
}

.step:hover {
    transform: translateY(-5px);
    border-bottom-color: var(--secondary);
}

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

.step-text {
    font-size: 14px;
    line-height: 1.3;
}

.step-text strong {
    display: block;
    color: var(--accent);
    font-family: var(--font-pixel);
    font-size: 11px;
    margin-bottom: 4px;
}

.intro-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

.intro-description em {
    color: var(--primary);
    font-style: normal;
}

/* Smash Section */
.smash-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.smash-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent 0deg,
            rgba(0, 255, 255, 0.1) 60deg,
            transparent 120deg);
    animation: rotate 10s linear infinite;
    z-index: -1;
}

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

.smash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.smash-title {
    font-family: var(--font-pixel);
    font-size: 16px;
    color: var(--secondary);
    text-shadow: 0 0 20px var(--secondary-glow);
    animation: flicker 2s infinite;
}

@keyframes flicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }

    52% {
        opacity: 1;
    }

    54% {
        opacity: 0.9;
    }
}

.smash-meter {
    position: relative;
    width: 200px;
    height: 30px;
    background: var(--bg-input);
    border-radius: 15px;
    border: 2px solid var(--secondary);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transition: width 0.1s ease;
    box-shadow: 0 0 20px var(--secondary-glow);
}

.meter-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-pixel);
    font-size: 10px;
    color: var(--text-primary);
    text-shadow: 0 0 5px black;
}

/* Encouragement Section */
.encouragement {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.1), rgba(0, 255, 255, 0.1));
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.encouragement.pulse {
    animation: encouragePulse 0.5s ease;
}

@keyframes encouragePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

.encouragement-icon {
    font-size: 28px;
    min-width: 40px;
    text-align: center;
}

.encouragement-text {
    font-size: 18px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Input Container */
.input-container {
    position: relative;
    margin-bottom: 20px;
}

.smash-input {
    width: 100%;
    height: 150px;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 20px;
    background: var(--bg-input);
    color: var(--accent);
    border: 3px solid rgba(255, 255, 0, 0.3);
    border-radius: var(--border-radius);
    resize: none;
    outline: none;
    transition: all 0.3s ease;
}

.smash-input::placeholder {
    color: var(--text-muted);
    font-size: 16px;
}

.smash-input:focus {
    border-color: var(--accent);
    box-shadow:
        0 0 30px var(--accent-glow),
        inset 0 0 30px rgba(255, 255, 0, 0.05);
}

.smash-input.smashing {
    animation: shake 0.1s infinite;
    border-color: var(--primary);
    box-shadow:
        0 0 50px var(--primary-glow),
        inset 0 0 30px rgba(255, 0, 128, 0.1);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-2px);
    }

    75% {
        transform: translateX(2px);
    }
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.smash-input:focus+.input-glow {
    opacity: 1;
    box-shadow: 0 0 60px var(--accent-glow);
}

/* Comment Section */
.comment-section {
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.comment-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.comment-label {
    display: block;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.comment-input {
    width: 100%;
    padding: 15px;
    font-family: var(--font-mono);
    font-size: 16px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    outline: none;
    transition: all 0.3s ease;
}

.comment-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 20px;
    font-family: var(--font-pixel);
    font-size: 14px;
    background: linear-gradient(135deg, var(--primary), #ff4500);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:disabled {
    background: linear-gradient(135deg, #333, #444);
    cursor: not-allowed;
    opacity: 0.5;
}

.submit-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px var(--primary-glow);
}

.submit-btn:not(:disabled):active {
    transform: translateY(0);
}

.btn-loading {
    display: none;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-loading {
    display: inline;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 70%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* Validation Message */
.validation-message {
    margin-top: 15px;
    padding: 15px;
    border-radius: var(--border-radius);
    font-size: 16px;
    text-align: center;
    display: none;
}

.validation-message.error {
    display: block;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.validation-message.success {
    display: block;
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

/* Results Section */
.results-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-title {
    font-family: var(--font-pixel);
    font-size: 18px;
    color: var(--success);
}

.new-smash-btn {
    padding: 12px 24px;
    font-family: var(--font-pixel);
    font-size: 12px;
    background: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-smash-btn:hover {
    background: var(--secondary);
    color: var(--bg-dark);
}

/* Achievements Section */
.achievements-section {
    margin-bottom: 25px;
}

.achievements-title {
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--legendary);
    margin-bottom: 15px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.achievement-card:hover {
    transform: translateY(-2px);
}

.achievement-icon {
    font-size: 28px;
    min-width: 40px;
    text-align: center;
}

.achievement-content {
    flex: 1;
}

.achievement-title {
    font-family: var(--font-pixel);
    font-size: 10px;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Achievement Types */
.achievement-info {
    border-color: var(--secondary);
}

.achievement-info .achievement-title {
    color: var(--secondary);
}

.achievement-success {
    border-color: var(--success);
}

.achievement-success .achievement-title {
    color: var(--success);
}

.achievement-neutral {
    border-color: var(--text-muted);
}

.achievement-neutral .achievement-title {
    color: var(--text-secondary);
}

.achievement-legendary {
    border-color: var(--legendary);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 100, 0, 0.1));
    animation: legendaryPulse 2s ease-in-out infinite;
}

.achievement-legendary .achievement-title {
    color: var(--legendary);
    text-shadow: 0 0 10px var(--legendary-glow);
}

@keyframes legendaryPulse {

    0%,
    100% {
        box-shadow: 0 0 10px var(--legendary-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--legendary-glow);
    }
}

/* Your Smash Display */
.your-smash {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid var(--accent);
}

.smash-display {
    font-family: var(--font-mono);
    font-size: 24px;
    color: var(--accent);
    word-break: break-all;
    margin-bottom: 10px;
}

.smash-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Timing Stats */
.timing-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.timing-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timing-label {
    font-size: 12px;
    color: var(--text-muted);
}

.timing-value {
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--secondary);
}

/* Fun Stats Section */
.fun-stats-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.1), rgba(0, 255, 255, 0.1));
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.fun-stats-title {
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 15px;
    text-align: center;
}

.fun-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.fun-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    transition: transform 0.2s ease;
}

.fun-stat:hover {
    transform: scale(1.02);
}

.fun-stat.favorite-key {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 100, 0, 0.2));
    border: 1px solid var(--legendary);
}

.fun-stat-icon {
    font-size: 24px;
}

.fun-stat-content {
    flex: 1;
}

.fun-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.fun-stat-value {
    font-size: 14px;
    color: var(--text-primary);
}

.fun-stat-value.big-key {
    font-family: var(--font-pixel);
    font-size: 20px;
    color: var(--legendary);
    text-shadow: 0 0 10px var(--legendary-glow);
}

.key-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--bg-input);
    border: 1px solid var(--secondary);
    border-radius: 4px;
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--secondary);
    margin-right: 4px;
}

/* Matches */
.matches-container {
    margin-top: 20px;
}

.matches-title {
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 20px;
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-card {
    background: var(--bg-card-hover);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.match-card:hover {
    transform: translateX(5px);
    border-color: var(--primary);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.match-similarity {
    font-family: var(--font-pixel);
    font-size: 16px;
    color: var(--success);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.timing-similarity {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.timing-high {
    background: rgba(255, 215, 0, 0.2);
    color: var(--legendary);
    border: 1px solid var(--legendary);
}

.timing-medium {
    background: rgba(0, 255, 0, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.timing-low {
    background: rgba(0, 255, 255, 0.2);
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.match-country {
    font-size: 14px;
    color: var(--text-secondary);
}

.match-country .flag {
    font-size: 20px;
    margin-right: 5px;
}

.match-smash {
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--secondary);
    word-break: break-all;
    margin-bottom: 10px;
}

.match-timing-stats {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.match-comment {
    padding: 15px;
    background: rgba(255, 0, 128, 0.1);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary);
    font-style: italic;
    color: var(--text-primary);
}

.match-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
}

.no-matches {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.no-matches p:first-child {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Feed Section */
.feed-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feed-title {
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.feed-list::-webkit-scrollbar {
    width: 8px;
}

.feed-list::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 4px;
}

.feed-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.feed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.feed-item:hover {
    background: rgba(0, 0, 0, 0.4);
}

.feed-smash {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 15px;
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.feed-country {
    font-size: 18px;
}

.feed-comment-indicator {
    opacity: 0.7;
}

.feed-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-note {
    font-size: 12px;
    margin-top: 10px;
    opacity: 0.7;
}

.footer-links {
    margin-top: 15px;
}

.footer-link {
    color: var(--secondary);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s ease;
}

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

/* Privacy Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    border: 2px solid var(--primary);
    box-shadow: 0 0 50px var(--primary-glow);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-title {
    font-family: var(--font-pixel);
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 25px;
    text-align: center;
}

.modal-body {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.modal-body p {
    margin-bottom: 12px;
}

.modal-body ul {
    margin: 10px 0 20px 20px;
    padding: 0;
}

.modal-body li {
    margin-bottom: 8px;
}

.modal-body strong {
    color: var(--text-primary);
}

.modal-section-title {
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--secondary);
    margin-top: 20px;
    margin-bottom: 10px;
}

.abuse-email {
    text-align: center;
    font-size: 18px;
    margin: 15px 0;
}

.abuse-email a {
    color: var(--accent);
    text-decoration: none;
}

.abuse-email a:hover {
    text-decoration: underline;
}

.modal-footer-text {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 25px;
    opacity: 0.7;
}

.modal-btn {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-family: var(--font-pixel);
    font-size: 12px;
    background: linear-gradient(135deg, var(--primary), #ff4500);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--primary-glow);
}

/* Modal responsive */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        margin: 10px;
    }

    .modal-title {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .modal-body {
        font-size: 13px;
    }

    .modal-section-title {
        font-size: 10px;
    }

    .modal-btn {
        font-size: 10px;
        padding: 12px;
    }
}

/* Country flag helper */
.country-flag {
    font-size: 1.5em;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 768px) {

    /* Main container */
    .main-container {
        padding: 10px;
    }

    /* Header */
    .header {
        padding: 10px 10px;
        margin-bottom: 10px;
    }

    .logo {
        gap: 10px;
    }

    .logo-key {
        font-size: 32px;
    }

    .logo-text {
        font-size: 20px;
    }

    .tagline {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .logo-container {
        margin-bottom: 15px;
    }

    /* Stats bar - horizontal but compact */
    .stats-bar {
        flex-direction: row;
        justify-content: space-around;
        gap: 5px;
        padding: 10px 5px;
    }

    .stat {
        flex: 1;
        min-width: 0;
    }

    .stat-value {
        font-size: 12px;
    }

    .stat-label {
        font-size: 8px;
        letter-spacing: 0;
    }

    /* Content spacing */
    .content {
        gap: 15px;
    }

    /* Intro card - more compact */
    .intro-card {
        padding: 15px;
    }

    .intro-title {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .intro-steps {
        flex-direction: column;
        gap: 10px;
    }

    .step {
        flex-direction: row;
        max-width: none;
        padding: 10px;
        border-left: 3px solid var(--primary);
        border-bottom: none;
        text-align: left;
    }

    .step:hover {
        transform: translateX(5px);
    }

    .step-icon {
        font-size: 24px;
        min-width: 35px;
    }

    .step-text {
        font-size: 13px;
    }

    .step-text strong {
        font-size: 10px;
        display: inline;
        margin-right: 5px;
    }

    .intro-description {
        font-size: 13px;
        line-height: 1.4;
    }

    /* Smash card */
    .smash-card {
        padding: 15px;
    }

    .smash-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        margin-bottom: 12px;
    }

    .smash-title {
        font-size: 12px;
    }

    .smash-meter {
        width: 100%;
        height: 25px;
    }

    .meter-text {
        font-size: 9px;
    }

    /* Encouragement */
    .encouragement {
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .encouragement-icon {
        font-size: 22px;
        min-width: 30px;
    }

    .encouragement-text {
        font-size: 14px;
        line-height: 1.3;
    }

    /* Input */
    .smash-input {
        height: 120px;
        padding: 12px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .smash-input::placeholder {
        font-size: 13px;
    }

    /* Comment */
    .comment-label {
        font-size: 13px;
    }

    .comment-input {
        padding: 12px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Submit button */
    .submit-btn {
        padding: 16px;
        font-size: 11px;
    }

    /* Results */
    .results-card {
        padding: 15px;
    }

    .results-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        margin-bottom: 15px;
    }

    .results-title {
        font-size: 14px;
    }

    .new-smash-btn {
        padding: 10px 20px;
        font-size: 10px;
        width: 100%;
    }

    /* Achievements */
    .achievements-section {
        margin-bottom: 15px;
    }

    .achievements-title {
        font-size: 11px;
    }

    .achievements-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

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

    .achievement-icon {
        font-size: 20px;
        min-width: 28px;
    }

    .achievement-title {
        font-size: 8px;
    }

    .achievement-desc {
        font-size: 11px;
    }

    /* Your smash display */
    .your-smash {
        padding: 12px;
        margin-bottom: 15px;
    }

    .smash-display {
        font-size: 16px;
    }

    .smash-meta {
        font-size: 12px;
    }

    /* Timing stats */
    .timing-stats {
        margin-top: 10px;
        padding-top: 10px;
        gap: 10px;
    }

    .stats-row {
        gap: 15px;
    }

    .timing-value {
        font-size: 12px;
    }

    .timing-label {
        font-size: 10px;
    }

    /* Fun stats */
    .fun-stats-section {
        margin-top: 15px;
        padding: 12px;
    }

    .fun-stats-title {
        font-size: 10px;
        margin-bottom: 10px;
    }

    .fun-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .fun-stat {
        padding: 8px;
        gap: 6px;
    }

    .fun-stat-icon {
        font-size: 18px;
    }

    .fun-stat-label {
        font-size: 9px;
    }

    .fun-stat-value {
        font-size: 11px;
    }

    .fun-stat-value.big-key {
        font-size: 16px;
    }

    .key-badge {
        padding: 2px 5px;
        font-size: 10px;
        margin-right: 2px;
    }

    /* Matches */
    .matches-title {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .matches-list {
        gap: 10px;
    }

    .match-card {
        padding: 12px;
    }

    .match-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 8px;
    }

    .match-similarity {
        font-size: 13px;
    }

    .match-country {
        font-size: 12px;
    }

    .match-country .flag {
        font-size: 16px;
    }

    .match-smash {
        font-size: 14px;
    }

    .match-timing-stats {
        font-size: 10px;
        padding: 6px 10px;
    }

    .match-comment {
        padding: 10px;
        font-size: 13px;
    }

    .match-time {
        font-size: 10px;
    }

    .no-matches {
        padding: 25px;
    }

    .no-matches p:first-child {
        font-size: 18px;
    }

    /* Feed */
    .feed-card {
        padding: 15px;
    }

    .feed-title {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .feed-list {
        max-height: 200px;
        gap: 6px;
    }

    .feed-item {
        padding: 8px 10px;
    }

    .feed-smash {
        font-size: 13px;
    }

    .feed-meta {
        gap: 6px;
        font-size: 10px;
    }

    .feed-country {
        font-size: 14px;
    }

    /* Footer */
    .footer {
        padding: 25px 15px;
        font-size: 12px;
    }

    .footer-note {
        font-size: 10px;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 380px) {
    .logo-text {
        font-size: 16px;
    }

    .tagline {
        font-size: 12px;
    }

    .stat-value {
        font-size: 10px;
    }

    .stat-label {
        font-size: 7px;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .fun-stats-grid {
        grid-template-columns: 1fr;
    }

    .smash-title {
        font-size: 10px;
    }

    .submit-btn {
        font-size: 10px;
        padding: 14px;
    }
}

/* Animations for new elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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