@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
    /* Colors */
    --color-bg: #111;
    --color-text: #fff;
    --color-accent-gameover: #ff0055;
    --color-accent-win: #00ff88;
    --color-accent-welcome: #ffcc00;
    --color-accent-pause: #0099ff;
    --color-modal-bg: #00000066;
    --color-backdrop: #00000080;
    --color-border: #fff;
    --color-btn-hover: #ffffff1f;

    /* Fonts */
    --font-pixel: 'Press Start 2P', cursive;
    --font-mono: 'VT323', monospace;

    /* Effects */
    --blur-intensity: 10px;
    --shadow-glow: 0 0 20px #ffffff33;
    --shadow-text: 2px 2px 0px #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-mono);
    width: 100vw;
    height: 100dvh;
    padding: 1rem;
}

/* Game Container */

.game-container {
    position: relative;
    width: 448px;
    height: 440px;
    margin: 3rem auto 0 auto;
}

canvas {
    position: absolute;
    width: 100%;
}

#canvas {
    border: 1px solid var(--color-border);
    border-bottom: transparent;
    mask: linear-gradient(#fff 95%, transparent);
    background: url("./Assets/bg.webp");
    z-index: 1;
}

#pointsCanvas {
    z-index: 2;
    background-color: transparent;
}

/* Modal System */
dialog {
    background: var(--color-modal-bg);
    border: 3px solid var(--color-border);
    padding: 2.5rem;
    color: var(--color-text);
    text-align: center;
    max-width: 450px;
    width: 90%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(3px);
}

dialog::backdrop {
    background-color: var(--color-backdrop);
    backdrop-filter: blur(var(--blur-intensity));
}

dialog h1 {
    font-family: var(--font-pixel);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-accent-gameover);
    text-shadow: var(--shadow-text);
}

/* Contextual Colors */
dialog.win h1 {
    color: var(--color-accent-win);
}

dialog.welcome h1 {
    color: var(--color-accent-welcome);
}

dialog.pause h1 {
    color: var(--color-accent-pause);
}

dialog p {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

/* Stats and Lists Container */
.stats,
.controls-grid {
    border-top: 1px solid #ffffff33;
    border-bottom: 1px solid #ffffff33;
    padding: 1.5rem 0;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats span {
    font-size: 1.6rem;
}

/* Controls Redesign */
.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
}

.control-keys {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
    filter: drop-shadow(0 0 2px #ffffff80);
}

.control-label {
    font-size: 1.2rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.pause-info {
    font-size: 1.1rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Buttons */
.modal-btn {
    font-family: var(--font-pixel);
    background: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-border);
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.85rem;
    outline: none;
}

.modal-btn:hover,
.modal-btn:focus {
    background: var(--color-btn-hover);
    transform: scale(1.01);
    box-shadow: 0 0 5px var(--color-border);
}

.modal-btn:active {
    transform: scale(0.95);
}

/* Header (only for mobile) */
.game-header {
    width: 100%;
    height: fit-content;
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    justify-content: flex-end;
    align-items: center;
}

#pause-btn {
    width: 4em;
    height: 4em;
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
}

#pause-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Game Controls */
.game-control-section {
    margin-top: 1rem;
    width: 100%;
    height: fit-content;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    display: none;
}

.game-control-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 50%;
}

.game-control-btn {
    width: 5em;
    height: 5em;
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
}

.game-control-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pressed {
    filter: brightness(0.5);
}

/* Credits Section */
.credits-section {
    margin-top: 1rem;
}

/* Footer */
.web-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: 100%;
    height: fit-content;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: var(--color-backdrop);
    backdrop-filter: blur(3px);
}

.web-footer p,
a {
    font-size: 0.9em;
    color: #fff;
    text-decoration: none;
}

.web-footer a {
    text-decoration: underline;
}

@media (max-width: 868px) {
    .game-header {
        display: flex;
    }

    .game-control-section {
        display: flex;
    }
}

@media (max-width: 465px) {
    .game-container {
        width: 100%;
        height: 350px;
    }

    .game-control-section {
        margin-top: 3.5rem;
    }
}

@media (max-width: 780px) {
    .game-control-buttons {
        width: 70%;
    }
}

@media (max-width: 575px) {
    .game-control-buttons {
        width: 80%;
    }
}