:root {
    --bg-color: #050510;
    --accent-gold: #facc15;
    --accent-purple: #a855f7;
    --accent-primary: #00f2ff;
    --accent-secondary: #ff00e5;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-gold: 0 0 10px rgba(250, 204, 21, 0.55), 0 0 22px rgba(250, 204, 21, 0.32);
    --neon-shadow: 0 0 10px rgba(0, 242, 255, 0.5), 0 0 20px rgba(0, 242, 255, 0.3);
    --neon-pink: 0 0 10px rgba(255, 0, 229, 0.5), 0 0 20px rgba(255, 0, 229, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
}

.hub-back {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 50;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    color: var(--accent-gold);
    border: 1px solid rgba(250, 204, 21, 0.5);
    border-radius: 50px;
    padding: 8px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    box-shadow: var(--neon-gold);
    transition: all 0.25s ease;
}

.hub-back:hover {
    color: var(--bg-color);
    background: var(--accent-gold);
    transform: translateY(-1px);
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.38;
    animation: blob-move 18s infinite alternate;
}

.blob-1 {
    width: 420px;
    height: 420px;
    background: var(--accent-gold);
    top: -100px;
    left: -80px;
    opacity: 0.28;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-purple);
    bottom: -120px;
    right: -80px;
    animation-delay: -6s;
    opacity: 0.22;
}

.blob-3 {
    width: 320px;
    height: 320px;
    background: var(--accent-primary);
    top: 35%;
    left: 40%;
    opacity: 0.15;
    animation-delay: -11s;
}

@keyframes blob-move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(70px, 40px) scale(1.08); }
}

.game-container {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    z-index: 1;
}

.hud {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 14px 18px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    gap: 10px;
}

.score-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 4px;
    text-align: center;
}

.value {
    font-family: 'Space Mono', monospace;
    font-size: 1.45rem;
    font-weight: 700;
}

.p1-score .value {
    color: var(--accent-primary);
    text-shadow: var(--neon-shadow);
}

.p2-score .value {
    color: var(--accent-secondary);
    text-shadow: var(--neon-pink);
}

.brand-hub {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 6px;
}

.brand {
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.35em;
    background: linear-gradient(90deg, var(--accent-gold), #fde68a, var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.35));
}

.round-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.42);
}

.round-timer {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
    transition: color 0.3s, text-shadow 0.3s;
}

.round-timer.timer-urgent {
    color: #ef4444;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.9), 0 0 24px rgba(239, 68, 68, 0.5);
    animation: timer-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes timer-pulse {
    from { transform: scale(1); }
    to   { transform: scale(1.12); }
}

.round-dots {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.round-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.round-dots.won-1 .round-dot:nth-child(1),
.round-dots.won-2 .round-dot:nth-child(1),
.round-dots.won-2 .round-dot:nth-child(2) {
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.p1-score .round-dots { color: var(--accent-primary); }
.p2-score .round-dots { color: var(--accent-secondary); }

.canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 600 / 660;
    max-height: min(85vh, 660px);
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(250, 204, 21, 0.22);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(250, 204, 21, 0.04);
}

.canvas-wrapper.pressure {
    animation: pressure-pulse 0.8s infinite alternate;
    border-color: rgba(239, 68, 68, 0.65);
}

@keyframes pressure-pulse {
    0% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.25); }
    100% { box-shadow: 0 0 55px rgba(239, 68, 68, 0.55); }
}

#pacman-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 16, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 32px;
    transition: opacity 0.28s ease;
    z-index: 10;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay h1,
.overlay h2 {
    font-size: clamp(1.6rem, 6vw, 2.6rem);
    margin-bottom: 16px;
    letter-spacing: 0.28em;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.overlay p {
    color: rgba(255, 255, 255, 0.74);
    margin-bottom: 14px;
    font-size: 0.98rem;
    line-height: 1.55;
    max-width: 420px;
}

.controls-desc {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    border: 1px dashed rgba(250, 204, 21, 0.35);
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 22px !important;
}

.dual-scores {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 8px;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 22px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-label {
    font-size: 0.75rem;
    font-weight: 900;
    margin-bottom: 4px;
    opacity: 0.55;
}

.score-box span:last-child {
    font-family: 'Space Mono', monospace;
    font-size: 2.2rem;
    font-weight: 700;
}

.p1-color span:last-child {
    color: var(--accent-primary);
    text-shadow: var(--neon-shadow);
}

.p2-color span:last-child {
    color: var(--accent-secondary);
    text-shadow: var(--neon-pink);
}

button {
    background: transparent;
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--neon-gold);
}

button:hover {
    background: var(--accent-gold);
    color: var(--bg-color);
    transform: scale(1.05);
}

.controls-hint {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    opacity: 0.42;
    font-size: 0.78rem;
    letter-spacing: 2px;
}
