/* =========================================================
TYPEWRONG
HARITHA'S BOREDOM LAB — GAME 005
========================================================= */

:root {
--game-bg: #03050a;
--game-surface: #080b12;

--game-text: #ffffff;
--game-muted: rgba(255, 255, 255, 0.4);
--game-faint: rgba(255, 255, 255, 0.18);

--game-blue: #4b8dff;
--game-blue-soft: rgba(75, 141, 255, 0.14);

--game-border: rgba(255, 255, 255, 0.1);
}

/* =========================================================
RESET
========================================================= */

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

html,
body {
margin: 0;

width: 100%;
min-height: 100%;

background:
var(--game-bg);

color:
var(--game-text);

font-family:
Arial,
Helvetica,
sans-serif;
}

body {
overflow: hidden;
}

button,
textarea,
a {
font: inherit;
}

/* =========================================================
SHELL
========================================================= */

.game-shell {
position: relative;

width: 100vw;
height: 100vh;

min-height: 650px;

overflow: hidden;

background:
radial-gradient(
circle at 50% 50%,
rgba(75, 141, 255, 0.04),
transparent 42%
),
var(--game-bg);
}

/* =========================================================
BACKGROUND GRID
========================================================= */

.game-shell::before {
content: "";

position: absolute;

inset: 0;

background-image:
linear-gradient(
rgba(255, 255, 255, 0.022) 1px,
transparent 1px
),
linear-gradient(
90deg,
rgba(255, 255, 255, 0.022) 1px,
transparent 1px
);

background-size:
60px 60px;

mask-image:
radial-gradient(
ellipse at center,
black 5%,
transparent 78%
);

pointer-events: none;
}

/* =========================================================
SCANLINES
========================================================= */

.game-shell::after {
content: "";

position: absolute;

inset: 0;

background:
repeating-linear-gradient(
to bottom,
transparent 0,
transparent 5px,
rgba(255, 255, 255, 0.01) 6px
);

opacity: 0.35;

pointer-events: none;
}

/* =========================================================
HEADER
========================================================= */

.game-header {
position: absolute;

z-index: 30;

top: 0;
left: 0;
right: 0;

height: 82px;

padding:
0 35px;

display: flex;

align-items: center;

justify-content: space-between;

border-bottom:
1px solid
var(--game-border);

background:
rgba(3, 5, 10, 0.72);

backdrop-filter:
blur(15px);
}

.game-brand {
display: flex;

align-items: center;

gap: 12px;

color: #ffffff;

text-decoration: none;

font-family: monospace;

font-size: 8px;

letter-spacing: 0.15em;
}

.brand-mark {
width: 34px;
height: 34px;

display: grid;

place-items: center;

border:
1px solid
rgba(255, 255, 255, 0.25);

font-size: 9px;

font-weight: 800;

letter-spacing: -0.08em;
}

.game-header-info {
position: absolute;

left: 50%;

transform:
translateX(-50%);

display: flex;

align-items: center;

gap: 12px;

font-family: monospace;

font-size: 7px;

letter-spacing: 0.16em;

color:
rgba(255, 255, 255, 0.3);
}

.separator {
color:
var(--game-blue);
}

.exit-game {
color:
rgba(255, 255, 255, 0.4);

text-decoration: none;

font-family: monospace;

font-size: 8px;

letter-spacing: 0.16em;

transition:
color 0.2s ease;
}

.exit-game:hover {
color: #ffffff;
}

/* =========================================================
MAIN
========================================================= */

.game-main {
position: relative;

z-index: 5;

width: 100%;
height: 100%;

display: grid;

place-items: center;
}

/* =========================================================
INTRO
========================================================= */

.typing-intro {
position: absolute;

z-index: 10;

width:
min(
750px,
90vw
);

text-align: center;

transition:
opacity 0.5s ease,
transform 0.5s ease,
visibility 0.5s ease;
}

.typing-intro.hidden {
opacity: 0;

transform:
translateY(-25px);

visibility: hidden;

pointer-events: none;
}

.game-label {
display: block;

margin-bottom: 28px;

font-family: monospace;

font-size: 8px;

letter-spacing: 0.22em;

color:
var(--game-blue);
}

.typing-intro h1 {
margin: 0;

font-size:
clamp(
5rem,
14vw,
12rem
);

line-height: 0.75;

letter-spacing: -0.1em;

font-weight: 800;
}

.typing-intro h1 em {
color: transparent;

-webkit-text-stroke:
1px
rgba(255, 255, 255, 0.4);

font-style: normal;

font-weight: 300;
}

.typing-intro p {
margin:
38px
auto
0;

font-size: 13px;

line-height: 1.9;

color:
var(--game-muted);
}

/* =========================================================
START BUTTON
========================================================= */

.start-button {
min-width: 180px;

margin-top: 40px;

padding:
17px
25px;

display: inline-flex;

align-items: center;

justify-content: center;

gap: 25px;

border:
1px solid
rgba(255, 255, 255, 0.22);

background: transparent;

color: #ffffff;

cursor: pointer;

font-family: monospace;

font-size: 8px;

letter-spacing: 0.18em;

transition:
background 0.25s ease,
border-color 0.25s ease,
transform 0.25s ease;
}

.start-button span {
color:
var(--game-blue);

font-size: 15px;

transition:
transform 0.25s ease;
}

.start-button:hover {
background:
var(--game-blue);

border-color:
var(--game-blue);

transform:
translateY(-3px);
}

.start-button:hover span {
color: #ffffff;

transform:
translateX(5px);
}

/* =========================================================
TYPING GAME
========================================================= */

.typing-game {
position: absolute;

inset: 0;

display: flex;

flex-direction: column;

align-items: center;

justify-content: center;

opacity: 0;

visibility: hidden;

transition:
opacity 0.5s ease,
visibility 0.5s ease;
}

.typing-game.active {
opacity: 1;

visibility: visible;
}

/* =========================================================
STATUS
========================================================= */

.typing-status {
position: absolute;

top: 125px;

left: 50%;

transform:
translateX(-50%);

font-family: monospace;

font-size: 8px;

letter-spacing: 0.2em;

color:
rgba(255, 255, 255, 0.42);

white-space: nowrap;
}

.typing-status::before {
content: "●";

margin-right: 8px;

color:
var(--game-blue);

font-size: 7px;
}

/* =========================================================
STATS
========================================================= */

.typing-stats {
position: absolute;

top: 112px;

right: 40px;

display: flex;

gap: 28px;
}

.stat {
display: flex;

flex-direction: column;

align-items: flex-end;

gap: 5px;
}

.stat span {
font-family: monospace;

font-size: 6px;

letter-spacing: 0.17em;

color:
rgba(255, 255, 255, 0.22);
}

.stat strong {
font-family: monospace;

font-size: 17px;

font-weight: 400;

color:
rgba(255, 255, 255, 0.75);
}

/* =========================================================
SENTENCE
========================================================= */

.sentence-container {
width:
min(
900px,
86vw
);

margin-bottom: 35px;
}

.sentence-label {
display: block;

margin-bottom: 18px;

font-family: monospace;

font-size: 7px;

letter-spacing: 0.18em;

color:
rgba(255, 255, 255, 0.25);
}

.sentence {
min-height: 100px;

padding:
30px;

border-top:
1px solid
var(--game-border);

border-bottom:
1px solid
var(--game-border);

font-family:
"Courier New",
Courier,
monospace;

font-size:
clamp(
17px,
2.2vw,
25px
);

line-height: 1.65;

letter-spacing: 0.015em;

color:
rgba(255, 255, 255, 0.28);
}

.sentence .correct {
color:
rgba(255, 255, 255, 0.9);
}

.sentence .current {
position: relative;

color:
#ffffff;
}

.sentence .current::after {
content: "";

position: absolute;

right: -2px;

top: 4px;

width: 2px;

height: 1.1em;

background:
var(--game-blue);

animation:
cursorBlink 0.8s
infinite;
}

.sentence .incorrect {
color:
#ffffff;

text-decoration:
underline;

text-decoration-color:
var(--game-blue);

text-decoration-thickness:
2px;
}

@keyframes cursorBlink {

0%,
45% {
opacity: 1;
}

46%,
100% {
opacity: 0;
}

}

/* =========================================================
INPUT
========================================================= */

.typing-input-container {
width:
min(
900px,
86vw
);

position: relative;
}

.typing-input {
width: 100%;

min-height: 110px;

padding:
20px
22px;

resize: none;

border:
1px solid
rgba(255, 255, 255, 0.12);

outline: none;

background:
rgba(255, 255, 255, 0.025);

color:
#ffffff;

font-family:
"Courier New",
Courier,
monospace;

font-size: 16px;

line-height: 1.6;

caret-color:
var(--game-blue);

transition:
border-color 0.25s ease,
background 0.25s ease;
}

.typing-input::placeholder {
color:
rgba(255, 255, 255, 0.2);
}

.typing-input:focus {
border-color:
rgba(75, 141, 255, 0.55);

background:
rgba(75, 141, 255, 0.025);
}

.typing-input.error {
border-color:
rgba(255, 255, 255, 0.5);

animation:
inputError 0.25s ease;
}

@keyframes inputError {

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

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

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

}

/* =========================================================
INPUT FOOTER
========================================================= */

.input-footer {
display: flex;

justify-content: space-between;

padding:
9px 2px 0;
}

.input-footer span,
.input-footer strong {
font-family: monospace;

font-size: 6px;

letter-spacing: 0.14em;

font-weight: 400;
}

.input-footer span {
color:
rgba(255, 255, 255, 0.2);
}

.input-footer strong {
color:
rgba(255, 255, 255, 0.38);
}

/* =========================================================
MESSAGE
========================================================= */

.typing-message {
position: absolute;

bottom: 82px;

left: 50%;

transform:
translateX(-50%);

font-family: monospace;

font-size: 7px;

letter-spacing: 0.2em;

color:
rgba(255, 255, 255, 0.22);

white-space: nowrap;

transition:
color 0.2s ease;
}

.typing-message.warning {
color:
var(--game-blue);
}

.typing-message.error {
color:
rgba(255, 255, 255, 0.8);
}

/* =========================================================
RESULT
========================================================= */

.typing-result {
position: absolute;

z-index: 15;

width:
min(
750px,
90vw
);

text-align: center;

opacity: 0;

visibility: hidden;

transform:
translateY(25px);

transition:
opacity 0.5s ease,
transform 0.5s ease,
visibility 0.5s ease;
}

.typing-result.active {
opacity: 1;

visibility: visible;

transform:
translateY(0);
}

.result-label {
display: block;

margin-bottom: 25px;

font-family: monospace;

font-size: 8px;

letter-spacing: 0.2em;

color:
var(--game-blue);
}

.typing-result h2 {
margin: 0;

font-size:
clamp(
4rem,
9vw,
8rem
);

line-height: 0.85;

letter-spacing: -0.08em;

font-weight: 800;
}

/* =========================================================
RESULT SCORE
========================================================= */

.result-score {
max-width: 650px;

margin:
45px
auto
0;

display: grid;

grid-template-columns:
repeat(3, 1fr);

border-top:
1px solid
var(--game-border);

border-bottom:
1px solid
var(--game-border);
}

.result-score > div {
min-height: 90px;

padding:
15px;

display: flex;

flex-direction: column;

align-items: center;

justify-content: center;

gap: 8px;

border-right:
1px solid
var(--game-border);
}

.result-score > div:last-child {
border-right: 0;
}

.result-score span {
font-family: monospace;

font-size: 6px;

letter-spacing: 0.16em;

color:
rgba(255, 255, 255, 0.25);
}

.result-score strong {
font-family: monospace;

font-size: 23px;

font-weight: 400;

color:
rgba(255, 255, 255, 0.82);
}

/* =========================================================
RESULT MESSAGE
========================================================= */

.typing-result p {
margin:
30px
auto
0;

font-size: 13px;

color:
var(--game-muted);
}

/* =========================================================
RESULT ACTIONS
========================================================= */

.result-actions {
display: flex;

justify-content: center;

gap: 10px;

margin-top: 40px;
}

.result-button {
min-width: 150px;

padding:
15px
20px;

border:
1px solid
rgba(255, 255, 255, 0.17);

background: transparent;

color:
rgba(255, 255, 255, 0.65);

text-decoration: none;

cursor: pointer;

font-family: monospace;

font-size: 7px;

letter-spacing: 0.15em;

transition:
background 0.25s ease,
border-color 0.25s ease,
color 0.25s ease;
}

.result-button:hover,
.result-button.primary {
color: #ffffff;

border-color:
var(--game-blue);
}

.result-button.primary:hover {
background:
var(--game-blue);
}

/* =========================================================
FOOTER
========================================================= */

.game-footer {
position: absolute;

z-index: 30;

left: 35px;
right: 35px;
bottom: 22px;

display: flex;

align-items: center;

justify-content: space-between;

font-family: monospace;

font-size: 6px;

letter-spacing: 0.15em;

color:
rgba(255, 255, 255, 0.18);
}

/* =========================================================
GAME ENTRY
========================================================= */

.typing-game.active
.sentence-container {
animation:
sentenceEnter 0.5s ease;
}

.typing-game.active
.typing-input-container {
animation:
inputEnter 0.55s ease 0.08s both;
}

@keyframes sentenceEnter {

from {
opacity: 0;


transform:
  translateY(12px);


}

to {
opacity: 1;


transform:
  translateY(0);


}

}

@keyframes inputEnter {

from {
opacity: 0;


transform:
  translateY(15px);


}

to {
opacity: 1;


transform:
  translateY(0);


}

}

/* =========================================================
RESPONSIVE
========================================================= */

@media (max-width: 800px) {

.game-header {
height: 70px;


padding:
  0 20px;


}

.game-header-info {
display: none;
}

.typing-status {
top: 102px;
}

.typing-stats {
top: 100px;


right: 20px;

gap: 15px;


}

.sentence-container {
width: 90vw;


margin-bottom: 25px;


}

.sentence {
min-height: 90px;


padding: 20px;

font-size: 16px;


}

.typing-input-container {
width: 90vw;
}

.typing-input {
min-height: 100px;


font-size: 15px;


}

.typing-message {
bottom: 82px;
}

.game-footer {
left: 20px;
right: 20px;
}

.game-footer span:nth-child(2) {
display: none;
}

.result-actions {
flex-direction: column;


align-items: center;


}

.result-button {
width: 200px;
}

}

@media (max-width: 520px) {

.typing-stats {
gap: 9px;
}

.stat strong {
font-size: 13px;
}

.stat span {
font-size: 5px;
}

.sentence {
font-size: 14px;


line-height: 1.7;


}

.typing-input {
min-height: 90px;


font-size: 14px;


}

.typing-result h2 {
font-size: 3.5rem;
}

.result-score {
margin-top: 30px;
}

.result-score > div {
min-height: 70px;


padding: 8px;


}

.result-score strong {
font-size: 17px;
}

}

@media (max-width: 380px) {

.typing-stats {
position: absolute;


top: 145px;

left: 50%;

right: auto;

transform:
  translateX(-50%);


}

.typing-status {
top: 105px;
}

.sentence-container {
margin-top: 55px;
}

}

@media (prefers-reduced-motion: reduce) {

.sentence .current::after {
animation: none;
}

.typing-game.active
.sentence-container,
.typing-game.active
.typing-input-container,
.typing-input.error {
animation: none;
}

}
