@font-face {
    font-family: 'SanzuFont';
    src: url('fonts/comic_sans_regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #111;
    font-family: 'SanzuFont', 'Comic Sans MS', cursive;
    color: #111;
}

canvas {
    display: block;
    width: 100vw !important;
    height: 100vh !important;
}


#ui {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    color: #111;
    padding: clamp(10px, 2vw, 20px) clamp(12px, 2.5vw, 24px);
    border-radius: 10px;
    border: 2px solid #111;
    z-index: 10;
    width: clamp(200px, 42vw, 340px);
    text-align: center;
    opacity: 1;
    transition: opacity 0.15s ease;
    pointer-events: auto;
}

#ui.hidden {
    opacity: 0;
    pointer-events: none;
}


#score-chip {
    position: fixed;
    top: clamp(8px, 2vw, 20px);
    right: clamp(8px, 2vw, 20px);
    background: #111;
    color: #fff;
    font-family: 'SanzuFont', 'Comic Sans MS', cursive;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: bold;
    padding: clamp(6px, 1.2vw, 12px) clamp(10px, 2vw, 20px);
    border-radius: 8px;
    z-index: 20;
    pointer-events: none;
    letter-spacing: 0.02em;
}

h1 {
    margin: 0 0 clamp(6px, 1.2vw, 12px) 0;
    font-size: clamp(1.1rem, 3.5vw, 2rem);
    text-align: center;
    color: #111;
    border-bottom: 2px solid #111;
    padding-bottom: clamp(4px, 0.8vw, 8px);
}

p {
    font-size: clamp(0.7rem, 2vw, 1.1rem);
    text-align: center;
    margin: clamp(4px, 1vw, 10px) 0;
    color: #444;
    line-height: 1.3;
}

#restart {
    display: none;
    font-family: 'SanzuFont', 'Comic Sans MS', cursive;
    font-size: clamp(1rem, 3vw, 1.5rem);
    padding: clamp(6px, 1.2vw, 10px) clamp(12px, 2.5vw, 20px);
    margin: clamp(6px, 1.2vw, 10px) auto 0;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    pointer-events: all;
    transition: background 0.2s, color 0.2s;
}

#restart:hover,
#restart:active {
    background: #fff;
    color: #111;
    outline: 2px solid #111;
}

#loading {
    position: fixed;
    bottom: clamp(10px, 2vw, 18px);
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    font-family: 'SanzuFont', 'Comic Sans MS', cursive;
    font-size: clamp(0.6rem, 1.8vw, 0.85rem);
    padding: 5px 14px;
    border-radius: 20px;
    z-index: 100;
    letter-spacing: 0.03em;
    opacity: 0.85;
}

#ui a.gh-link {
    display: block;
    text-align: center;
    font-size: clamp(0.65rem, 1.8vw, 0.9rem);
    color: #555;
    text-decoration: none;
    margin-top: clamp(6px, 1.2vw, 10px);
    border-top: 1px solid #ddd;
    padding-top: clamp(5px, 1vw, 8px);
    word-break: break-all;
}

#ui a.gh-link:hover { color: #111; }


#mute-btn {
    position: fixed;
    bottom: clamp(10px, 2vw, 18px);
    right: clamp(10px, 2vw, 18px);
    background: #111;
    border: none;
    border-radius: 50%;
    width: clamp(36px, 6vw, 48px);
    height: clamp(36px, 6vw, 48px);
    cursor: pointer;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
    transition: opacity 0.2s;
}
#mute-btn:hover { opacity: 1; }
#mute-btn img {
    width: 55%;
    height: 55%;
    object-fit: contain;
}


.gameover-title {
    font-size: clamp(1.4rem, 5vw, 2rem) !important;
    color: #111 !important;
    font-weight: bold;
}

.gameover-sub {
    font-size: clamp(0.7rem, 2vw, 1rem) !important;
    color: #555 !important;
}
