/* =========================================================
DON'T TOUCH RED
HARITHA'S BOREDOM LAB — GAME 008
========================================================= */

: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-red: #ff3158;

--game-blue-soft: rgba(75, 141, 255, 0.14);
--game-red-soft: rgba(255, 49, 88, 0.12);

--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,
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.035),
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 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-red);
}

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

.red-intro {
position: absolute;

z-index: 10;

width:
min(
850px,
90vw
);

text-align: center;

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

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

.red-intro h1 {
margin: 0;

font-size:
clamp(
4rem,
11vw,
10rem
);

line-height: 0.77;

letter-spacing: -0.1em;

font-weight: 800;
}

.red-intro h1 em {
color: transparent;

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

font-style: normal;

font-weight: 300;
}

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

font-size: 13px;

line-height: 1.9;

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

.red-intro p strong {
color:
rgba(255, 255, 255, 0.85);
}

/* =========================================================
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-red);

font-size: 15px;

transition:
transform 0.25s ease;
}

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

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

transform:
translateY(-3px);
}

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

transform:
translateX(5px);
}

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

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

.red-game.active {
opacity: 1;

visibility: visible;
}

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

.red-status {
position: absolute;

top: 120px;

left: 40px;

font-family: monospace;

font-size: 8px;

letter-spacing: 0.2em;

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

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

margin-right: 8px;

color:
var(--game-blue);

font-size: 7px;
}

.red-status.danger::before {
color:
var(--game-red);
}

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

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

/* =========================================================
INSTRUCTION
========================================================= */

.red-instruction {
position: absolute;

top: 145px;

left: 50%;

transform:
translateX(-50%);

display: flex;

align-items: center;

gap: 12px;

font-family: monospace;

font-size: 6px;

letter-spacing: 0.16em;

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

.red-instruction strong {
color:
var(--game-red);

font-weight: 400;
}

/* =========================================================
TILE ARENA
========================================================= */

.tile-arena {
position: relative;

width:
min(
720px,
84vw
);

height:
min(
500px,
55vh
);

padding: 10px;

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

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

box-shadow:
0 0 80px
rgba(75, 141, 255, 0.025);

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

.tile-arena.danger {
border-color:
rgba(255, 49, 88, 0.2);

box-shadow:
0 0 80px
rgba(255, 49, 88, 0.05);
}

/* =========================================================
TILE GRID
========================================================= */

.tile-grid {
width: 100%;
height: 100%;

display: grid;

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

grid-template-rows:
repeat(4, 1fr);

gap: 7px;
}

.safe-tile,
.red-tile {
position: relative;

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

cursor: pointer;

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

.safe-tile {
background:
rgba(75, 141, 255, 0.055);

border-color:
rgba(75, 141, 255, 0.08);
}

.safe-tile:hover {
background:
rgba(75, 141, 255, 0.14);

border-color:
rgba(75, 141, 255, 0.28);

transform:
scale(0.97);
}

.safe-tile:active {
transform:
scale(0.92);
}

.red-tile {
background:
rgba(255, 49, 88, 0.1);

border-color:
rgba(255, 49, 88, 0.18);

cursor:
crosshair;
}

.red-tile:hover {
background:
rgba(255, 49, 88, 0.16);

border-color:
rgba(255, 49, 88, 0.35);
}

/* =========================================================
TILE MARKER
========================================================= */

.safe-tile::after {
content: "";

position: absolute;

top: 50%;
left: 50%;

width: 4px;
height: 4px;

border-radius: 50%;

transform:
translate(
-50%,
-50%
);

background:
rgba(75, 141, 255, 0.35);

opacity: 0;

transition:
opacity 0.15s ease;
}

.safe-tile:hover::after {
opacity: 1;
}

/* =========================================================
RED WARNING
========================================================= */

.red-tile.warning {
animation:
redPulse 0.5s ease
infinite alternate;
}

@keyframes redPulse {

from {
background:
rgba(255, 49, 88, 0.07);
}

to {
background:
rgba(255, 49, 88, 0.2);
}

}

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

.red-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.22);

white-space: nowrap;

transition:
color 0.2s ease;
}

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

.red-message.danger {
color:
var(--game-red);
}

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

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

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

.red-result h2 {
margin: 0;

font-size:
clamp(
3.5rem,
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
========================================================= */

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

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

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

.red-game.active
.tile-arena {
animation:
arenaEnter 0.55s ease both;
}

@keyframes arenaEnter {

from {
opacity: 0;


transform:
  scale(0.97);


}

to {
opacity: 1;


transform:
  scale(1);


}

}

/* =========================================================
GAME OVER FLASH
========================================================= */

.game-shell.game-over {
animation:
gameOverFlash 0.45s ease;
}

@keyframes gameOverFlash {

0% {
background:
var(--game-bg);
}

35% {
background:
rgba(255, 49, 88, 0.08);
}

100% {
background:
var(--game-bg);
}

}

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

@media (max-width: 800px) {

.game-header {
height: 70px;


padding:
  0 20px;


}

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

.red-status {
top: 96px;


left: 20px;


}

.red-stats {
top: 90px;


right: 20px;

gap: 15px;


}

.red-instruction {
top: 145px;
}

.tile-arena {
width: 90vw;


height: 50vh;

padding: 7px;


}

.tile-grid {
gap: 5px;
}

.red-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) {

.red-intro h1 {
font-size:
4.1rem;
}

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

.red-stats {
gap: 10px;
}

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

.tile-arena {
width: 92vw;


height: 47vh;


}

.tile-grid {
grid-template-columns:
repeat(4, 1fr);


grid-template-rows:
  repeat(5, 1fr);

gap: 4px;


}

.red-instruction {
font-size: 5px;


gap: 8px;


}

.red-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) {

.red-stats {
top: 132px;


left: 50%;

right: auto;

transform:
  translateX(-50%);


}

.red-status {
top: 98px;


left: 50%;

transform:
  translateX(-50%);


}

.red-instruction {
top: 172px;
}

.tile-arena {
margin-top: 35px;


height: 43vh;


}

.red-message {
bottom: 78px;
}

}

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

.red-tile.warning,
.red-game.active
.tile-arena,
.game-shell.game-over {
animation: none;
}

}
