@font-face {
    font-family: 'VCRFont';
    src: url('./HomeVideo-BLG6G.ttf') format('truetype');
}

#hasteOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    font-family: 'VCRFont';
    font-size: 64px;
    letter-spacing: 4px;
    
    pointer-events: none;
    opacity: 0;
    display: none;

    color: red;
    text-shadow: 0 0 12px rgba(255, 0, 0, 0.7);
}

/* ---------- PRE-GAME STATE ---------- */
body.pre-game .wordBuffer {
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.6s ease;
}

body.pre-game .timeLimit {
    transform: translateY(-150%);
    opacity: 0;
    transition: all 0.6s ease;
}

/* ---------- IN-GAME STATE ---------- */
body.in-game .wordBuffer {
    left: 24.8vw;
    top: 2.1vh;
    transform: translateX(0);
    transition: all 0.6s ease;
}

body.in-game .timeLimit {
    transform: translateY(0);
    opacity: 1;
    transition: all 0.6s ease;
}

.boom-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255,0,0,0.8) 0%, rgba(0,0,0,0.9) 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 999;
}

.boom-flash.active {
    opacity: 1;
}

.status {
    position: fixed;
    top: 1vh;
    left: 1vw;

    display: flex;
    flex-direction: column;
    justify-content: start;
    font-family: "Lato", sans-serif;
    font-size: clamp(36px, 6vw, 48px);
}

.status p {
    margin: 2px;
}

.wordBuffer {
    position: fixed;
    outline: 3px solid blue;

    width: 27.5vw;
    height: auto;

    left: 24.8vw;
    top: 2.1vh;

    display: grid;
    grid-template-columns: repeat(var(--word-length, 7), 1fr);
    gap: 6px;
    padding: 8px;
}

body.bomb-hit {
    animation: screenFlash 0.3s ease;
}

@keyframes screenFlash {
    0% { background: #000; }
    50% { background: rgb(255, 0, 0); }
    100% { background: #000; }
}

.bufferLetter {
    background: #222;
    color: white;

    font-family: "Lato", sans-serif;
    font-size: clamp(20px, 3vw, 48px);

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 6px;

    width: 100%;
    aspect-ratio: 1 / 1;

    min-width: 0;   /* CRITICAL */
    min-height: 0;  /* CRITICAL */
}

.bufferLetter.correct {
    background: green;
}

.bufferLetter.misplaced {
    background: goldenrod;
}

.bufferLetter.absent {
    background: #444;
}


.timeLimit {
    position: fixed;
    outline: 3px solid red;
    width: 23vw;
    height: 12vh;
    left: 55vw;
    top: 2.1vh;
    will-change: transform;

    text-align: center;
    font-family: "Lato", sans-serif;
    font-size: clamp(18px, 4vw, 72px);

    display: flex;
    align-items: center;
    justify-content: center;
}


#clock-icon {
    display: inline-block;
    transform-origin: center;
}


.lives {
    position: fixed;
    outline: 3px solid pink;
    width: 15vw;
    height: 12vh;
    left: 80vw;
    top: 2.1vh;

    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    font-size: clamp(24px, 4vw, 40px);
}
.heart.dead {
    opacity: 0.2;
}

.previousWords {
    outline: 3px solid aqua;
    position: fixed;
    width: 39vw;
    height: 50vh;
    left: 29vw;
    top: 18vh;

    display: grid;
    grid-template:
    20%
    20%
    20%
    20%
    20%
    / 20% 20% 20% 20% 20%;
}

.historyLetter {
    color: black;
}

.historyLetter.correct {
    background: greenyellow;
}
.historyLetter.misplaced {
    background: gold;
}
.historyLetter.absent {
    background: #444;
    color: white;
}
.bufferLetter.reveal {
    animation: flip 0.4s ease forwards;
}

@keyframes flip {
    0%   { transform: rotateX(0deg);  }
    50%  { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg);  }
}



.letterBoard {
    position: fixed;
    left: 70vw;
    top: 35vh;

    width: 28vw;
    height: 90px;

    display: grid;
    grid-template-columns: repeat(26, 1fr);
    grid-template-rows: 1fr 1fr;

    gap: 2px;
    padding: 6px;

    outline: 3px solid rgb(0, 255, 47);
    border-radius: 8px;
    box-sizing: border-box;
    
}

.lb-col {
    display: contents;
}
.lb-proximity {
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;

    font-family: "Lato", sans-serif;
    font-weight: 700;
    font-size: clamp(14px, 1.5vw, 18px);

    color: #eee;
    background: #222;
    border-radius: 4px;
}


.lb-proximity.bomb {
    color: #ff4d4d;
}
.lb-letter {
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;

    font-family: "Lato", sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 1.4vw, 18px);

    color: #aaa;
    background: #1a1a1a;
    border-radius: 4px;
}

.LetterBoard.damage {
    background: rgba(120, 0, 0, 0.35);
    box-shadow: 0 0 24px rgba(120, 0, 0, 0.6) inset;
}

.historyRow {
    display: flex;
    align-items: center;
    justify-content: center;

    font-family: "Lato", sans-serif;
    font-weight: 700;

    font-size: clamp(20px, 2.5vw, 24px);
    color: black;

    background: #eee;
    border-radius: 8px;

    height: 50%;

    aspect-ratio: 1 / 1;
}

.keyboard {
    position: fixed;
    top: 75vh;
    left: 0;
    right: 0;
    color: black;

    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.key.correct {
    background: green;
}

.key.present {
    background: goldenrod;
}

.key.absent {
    background: #444;
    color: white;
}

.row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.key {
    flex: 0 1 auto;
    width: min(150px, 3vw);
    height: min(150px, 3vw);
    aspect-ratio: 1 / 1;
    font-family: "Lato", sans-serif;
    font-size: clamp(12px, 2vw, 24px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flagBtn {
    position: fixed;
    top: 75vh;
    left: 15vw;
    width: min(225px, 9vw);
    height: min(300px, 6vh);
    max-width: 450px;
    max-height: 200px;
    aspect-ratio: 3 / 1;
    font-family: "Lato", sans-serif;
    font-size: clamp(12px, 2vw, 36px);
}
.key.flagged {
    outline: 3px solid red;
}
.key.bomb-tripped {
    background: #5a0f0f;
    color: #fff;
    box-shadow: inset 0 0 12px rgba(255, 0, 0, 0.6);
}

.key.bomb-disabled {
    background: #2b0000;
    opacity: 0.6;
}


.key.bomb-wrong {
    animation: shake 0.3s;
}


.guessBtn {
    position: fixed;
    top: 82vh;
    left: 15vw;
    width: min(225px, 9vw);
    height: min(300px, 6vh);
    max-width: 450px;
    max-height: 200px;
    aspect-ratio: 3 / 1;
    font-family: "Lato", sans-serif;
    font-size: clamp(6px, 1.8vw, 36px);
}

.flagBtn.active-flag {
    background: green;
    color: white;
}

.guessBtn.active-guess {
    background: orange;
    color: black;
}

@keyframes pulse {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

.flag-mode .key,
.guess-mode .key {
    animation: pulse 0.6s ease-in-out infinite;
}


.removeLetter {
    position: fixed;
    top: 75vh;
    left: 75vw;
    width: min(150px, 6vw);
    height: min(200px, 5vh);
    max-width: 450px;
    max-height: 200px;
    aspect-ratio: 3 / 1;
    font-family: "Lato", sans-serif;
    font-size: clamp(6px, 4vw, 20px);
}

.enterWord {
    position: fixed;
    top: 82vh;
    left: 75vw;
    width: min(300px, 6vw);
    height: min(250px, 8vh);
    max-width: 450px;
    max-height: 250px;
    aspect-ratio: 2 / 1;
    font-family: "Lato", sans-serif;
    font-size: clamp(18px, 4vw, 36px);
}
