/* =========================================================
WORD MELT
HARITHA'S BOREDOM LAB — GAME 009
========================================================= */

: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,
input,
a {
font: inherit;
}

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

.game-shell {
position: relative;

width: 100vw;
height: 100vh;

min-height: 650px;

overflow: hidden;

background:
radial-gradient(
circle at 50% 48%,
rgba(75, 141, 255, 0.045),
transparent 44%
),
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 80%
);

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.75);

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
========================================================= */

.melt-intro {
position: absolute;

z-index: 10;

width:
min(
820px,
90vw
);

text-align: center;

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

.melt-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);
}

.melt-intro h1 {
margin: 0;

font-size:
clamp(
5rem,
13vw,
11rem
);

line-height: 0.75;

letter-spacing: -0.1em;

font-weight: 800;
}

.melt-intro h1 em {
color: transparent;

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

font-style: normal;

font-weight: 300;
}

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

font-size: 13px;

line-height: 1.9;

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

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

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

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);
}

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

.melt-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;
}

.melt-game.active {
opacity: 1;

visibility: visible;
}

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

.melt-status {
position: absolute;

top: 120px;

left: 40px;

font-family: monospace;

font-size: 8px;

letter-spacing: 0.2em;

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

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

margin-right: 8px;

color:
var(--game-blue);

font-size: 7px;
}

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

.melt-stats {
position: absolute;

top: 108px;

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.78);

font-variant-numeric:
tabular-nums;
}

/* =========================================================
WORD STAGE
========================================================= */

.word-stage {
width:
min(
850px,
88vw
);

min-height: 190px;

display: flex;

flex-direction: column;

align-items: center;

justify-content: center;

padding:
20px;

border-top:
1px solid
rgba(255, 255, 255, 0.08);

border-bottom:
1px solid
rgba(255, 255, 255, 0.08);

background:
rgba(255, 255, 255, 0.012);
}

.stage-label {
margin-bottom: 20px;

font-family: monospace;

font-size: 6px;

letter-spacing: 0.2em;

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

/* =========================================================
WORD
========================================================= */

.word-display {
min-height: 85px;

display: flex;

align-items: center;

justify-content: center;

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

font-size:
clamp(
3rem,
7vw,
6rem
);

font-weight: 300;

letter-spacing:
0.08em;

text-transform:
uppercase;

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

font-variant-numeric:
tabular-nums;

transition:
opacity 0.15s ease,
filter 0.15s ease,
transform 0.15s ease;
}

.word-display.melting {
filter:
blur(0.4px);

text-shadow:
0 8px 20px
rgba(75, 141, 255, 0.08);
}

.word-display.hidden-word {
color:
rgba(255, 255, 255, 0.12);

letter-spacing:
0.18em;
}

/* =========================================================
MELT PROGRESS
========================================================= */

.melt-progress {
position: relative;

width:
min(
600px,
75vw
);

height: 2px;

margin-top: 22px;

overflow: hidden;

background:
rgba(255, 255, 255, 0.07);
}

.melt-progress span {
position: absolute;

top: 0;
left: 0;
bottom: 0;

width: 100%;

transform-origin:
left center;

background:
var(--game-blue);

box-shadow:
0 0 15px
rgba(75, 141, 255, 0.25);

transition:
transform 0.08s linear;
}

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

.input-stage {
width:
min(
650px,
88vw
);

margin-top: 32px;

display: flex;

flex-direction: column;

align-items: center;
}

.input-label {
margin-bottom: 10px;

font-family: monospace;

font-size: 6px;

letter-spacing: 0.18em;

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

.input-wrapper {
width: 100%;

display: flex;

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

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

transition:
border-color 0.2s ease,
box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
border-color:
rgba(75, 141, 255, 0.5);

box-shadow:
0 0 30px
rgba(75, 141, 255, 0.05);
}

#wordInput {
min-width: 0;

flex: 1;

padding:
16px
18px;

border: 0;

outline: 0;

background:
transparent;

color:
#ffffff;

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

font-size: 15px;

letter-spacing:
0.08em;

text-transform:
uppercase;
}

#wordInput::placeholder {
color:
rgba(255, 255, 255, 0.16);
}

#submitButton {
flex: 0 0 auto;

min-width: 110px;

border: 0;

border-left:
1px solid
rgba(255, 255, 255, 0.1);

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

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

cursor: pointer;

font-family: monospace;

font-size: 7px;

letter-spacing: 0.16em;

transition:
background 0.2s ease,
color 0.2s ease;
}

#submitButton:hover {
background:
var(--game-blue);

color:
#ffffff;
}

#submitButton:disabled {
opacity: 0.35;

cursor: not-allowed;
}

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

.input-wrapper.correct {
border-color:
rgba(75, 141, 255, 0.8);

box-shadow:
0 0 30px
rgba(75, 141, 255, 0.12);
}

.input-wrapper.wrong {
animation:
inputWrong 0.3s ease;

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

@keyframes inputWrong {

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

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

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

}

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

.melt-message {
position: absolute;

bottom: 92px;

left: 50%;

transform:
translateX(-50%);

font-family: monospace;

font-size: 7px;

letter-spacing: 0.2em;

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

white-space: nowrap;

transition:
color 0.2s ease;
}

.melt-message.good {
color:
var(--game-blue);
}

.melt-message.warning {
color:
rgba(255, 255, 255, 0.75);
}

/* =========================================================
CONTINUE BUTTON
========================================================= */

.continue-button {
margin-top: 20px;

padding:
12px
18px;

display: none;

align-items: center;

gap: 15px;

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

background:
transparent;

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

cursor: pointer;

font-family: monospace;

font-size: 7px;

letter-spacing: 0.15em;
}

.continue-button.visible {
display: inline-flex;
}

.continue-button:hover {
border-color:
var(--game-blue);

color:
#ffffff;
}

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

font-size: 13px;
}

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

.melt-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;
}

.melt-result.active {
opacity: 1;

visibility: visible;

transform:
translateY(0);
}

.result-label {
display: block;

margin-bottom: 22px;

font-family: monospace;

font-size: 8px;

letter-spacing: 0.2em;

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

.melt-result h2 {
margin: 0;

font-size:
clamp(
3.8rem,
8vw,
7rem
);

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);

font-variant-numeric:
tabular-nums;
}

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

.melt-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);
}

/* =========================================================
ENTRY ANIMATION
========================================================= */

.melt-game.active
.word-stage {
animation:
wordStageEnter 0.55s ease both;
}

.melt-game.active
.input-stage {
animation:
inputStageEnter 0.55s ease 0.08s both;
}

@keyframes wordStageEnter {

from {
opacity: 0;


transform:
  scale(0.97);


}

to {
opacity: 1;


transform:
  scale(1);


}

}

@keyframes inputStageEnter {

from {
opacity: 0;


transform:
  translateY(10px);


}

to {
opacity: 1;


transform:
  translateY(0);


}

}

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

@media (max-width: 800px) {

.game-header {
height: 70px;


padding:
  0 20px;


}

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

.melt-status {
top: 96px;


left: 20px;


}

.melt-stats {
top: 90px;


right: 20px;

gap: 15px;


}

.word-stage {
width: 90vw;


min-height: 170px;


}

.melt-progress {
width: 75vw;
}

.input-stage {
width: 88vw;


margin-top: 25px;


}

.melt-message {
bottom: 88px;
}

.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: 550px) {

.melt-intro h1 {
font-size:
4.5rem;
}

.melt-intro p {
font-size: 12px;
}

.melt-stats {
gap: 10px;
}

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

.word-stage {
width: 92vw;


min-height: 150px;

padding: 12px;


}

.word-display {
font-size:
clamp(
2.2rem,
9vw,
4rem
);


letter-spacing:
  0.04em;


}

.stage-label {
margin-bottom: 12px;
}

.input-stage {
width: 92vw;
}

#wordInput {
padding:
14px;


font-size: 13px;


}

#submitButton {
min-width: 85px;


font-size: 6px;


}

.melt-message {
font-size: 6px;
}

.melt-result h2 {
font-size:
3.3rem;
}

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

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


padding: 8px;


}

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

}

@media (max-width: 400px) {

.melt-status {
top: 96px;


left: 50%;

transform:
  translateX(-50%);


}

.melt-stats {
top: 130px;


left: 50%;

right: auto;

transform:
  translateX(-50%);


}

.word-stage {
margin-top: 55px;
}

.melt-message {
bottom: 78px;
}

}

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

.input-wrapper.wrong,
.melt-game.active
.word-stage,
.melt-game.active
.input-stage {
animation: none;
}

}
