/* =========================================================
MEMORY LEAK
HARITHA'S BOREDOM LAB — GAME 004
========================================================= */

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

--tile-size: 125px;
}

/* =========================================================
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.045),
transparent 40%
),
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 10%,
transparent 78%
);

pointer-events: none;
}

/* =========================================================
SCAN EFFECT
========================================================= */

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

position: absolute;

inset: 0;

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

pointer-events: none;

opacity: 0.35;
}

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

.memory-intro {
position: absolute;

z-index: 10;

width:
min(
700px,
90vw
);

text-align: center;

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

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

.memory-intro h1 {
margin: 0;

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

line-height: 0.75;

letter-spacing: -0.1em;

font-weight: 800;
}

.memory-intro h1 em {
color: transparent;

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

font-style: normal;

font-weight: 300;
}

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

font-size: 13px;

line-height: 1.9;

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

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

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

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

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

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

.memory-game.active {
opacity: 1;

visibility: visible;
}

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

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

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

margin-right: 8px;

color:
var(--game-blue);

font-size: 7px;
}

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

.memory-score {
position: absolute;

top: 125px;

right: 45px;

display: flex;

flex-direction: column;

align-items: flex-end;

gap: 5px;
}

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

font-size: 6px;

letter-spacing: 0.17em;

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

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

font-size: 18px;

font-weight: 400;

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

/* =========================================================
MEMORY BOARD
========================================================= */

.memory-board {
position: relative;

width:
calc(
var(--tile-size) * 3
+ 24px
);

height:
calc(
var(--tile-size) * 3
+ 24px
);

display: grid;

grid-template-columns:
repeat(3, var(--tile-size));

grid-template-rows:
repeat(3, var(--tile-size));

gap: 12px;
}

/* =========================================================
MEMORY TILE
========================================================= */

.memory-tile {
position: relative;

width: var(--tile-size);

height: var(--tile-size);

padding: 0;

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

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

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

cursor: pointer;

font-family: monospace;

font-size: 8px;

letter-spacing: 0.1em;

transition:
background 0.18s ease,
border-color 0.18s ease,
transform 0.18s ease,
color 0.18s ease,
box-shadow 0.18s ease;
}

.memory-tile::before {
content: "";

position: absolute;

top: 8px;
left: 8px;

width: 5px;
height: 5px;

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

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

.memory-tile:hover {
border-color:
rgba(75, 141, 255, 0.5);

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

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

transform:
translateY(-2px);
}

/* =========================================================
ACTIVE TILE
========================================================= */

.memory-tile.active {
border-color:
var(--game-blue);

background:
var(--game-blue-soft);

color:
#ffffff;

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

transform:
scale(0.96);
}

.memory-tile.active::after {
content: "";

position: absolute;

inset: 10px;

border:
1px solid
rgba(75, 141, 255, 0.35);

pointer-events: none;
}

/* =========================================================
CORRECT TILE
========================================================= */

.memory-tile.correct {
border-color:
rgba(255, 255, 255, 0.65);

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

color: #ffffff;

animation:
correctTile 0.22s ease;
}

@keyframes correctTile {

0% {
transform:
scale(0.92);
}

100% {
transform:
scale(1);
}

}

/* =========================================================
WRONG TILE
========================================================= */

.memory-tile.wrong {
border-color:
rgba(255, 255, 255, 0.65);

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

animation:
wrongTile 0.3s ease;
}

@keyframes wrongTile {

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

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

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

}

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

.memory-instruction {
position: absolute;

bottom: 105px;

left: 50%;

transform:
translateX(-50%);

font-family: monospace;

font-size: 7px;

letter-spacing: 0.2em;

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

transition:
color 0.25s ease;
}

.memory-instruction.highlight {
color:
var(--game-blue);
}

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

.memory-progress {
position: absolute;

bottom: 70px;

left: 50%;

transform:
translateX(-50%);

width: 220px;

height: 2px;

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

overflow: hidden;
}

.memory-progress span {
display: block;

width: 0%;

height: 100%;

background:
var(--game-blue);

transition:
width 0.15s linear;
}

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

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

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

.memory-result h2 {
margin: 0;

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

line-height: 0.85;

letter-spacing: -0.08em;

font-weight: 800;
}

.memory-result h2 em {
color: transparent;

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

font-style: normal;

font-weight: 300;
}

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

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

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: 85px;

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: 22px;

font-weight: 400;

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

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

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

.memory-game.active .memory-board {
animation:
boardEnter 0.55s ease;
}

@keyframes boardEnter {

from {
opacity: 0;


transform:
  scale(0.94);


}

to {
opacity: 1;


transform:
  scale(1);


}

}

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

@media (max-width: 700px) {

:root {
--tile-size: 92px;
}

.game-header {
height: 70px;


padding:
  0 20px;


}

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

.memory-intro h1 {
font-size:
clamp(
4rem,
18vw,
7rem
);
}

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

.memory-status {
top: 105px;
}

.memory-score {
top: 100px;


right: 20px;


}

.memory-board {
gap: 8px;


width:
  calc(
    var(--tile-size) * 3
    \+ 16px
  );

height:
  calc(
    var(--tile-size) * 3
    \+ 16px
  );


}

.memory-tile {
font-size: 7px;
}

.memory-instruction {
bottom: 95px;
}

.memory-progress {
bottom: 62px;
}

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

:root {
--tile-size: 78px;
}

.game-shell {
min-height: 560px;
}

.memory-intro h1 {
font-size: 4rem;
}

.memory-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 (prefers-reduced-motion: reduce) {

.memory-game.active .memory-board,
.memory-tile.correct,
.memory-tile.wrong {
animation: none;
}

}
