/* ===== 8-BIT PORTFOLIO — metekamil.com ===== */
:root {
  --bg: #0a0a12;
  --panel: #12121f;
  --panel2: #171728;
  --ink: #d8f8d8;
  --dim: #7a9a7a;
  --green: #39ff6a;
  --cyan: #2de2e6;
  --magenta: #ff3864;
  --yellow: #ffd319;
  --purple: #791e94;
  --px: 4px;
  --font-pixel: 'Press Start 2P', monospace;
  --font-term: 'VT323', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-term);
  font-size: 22px;
  line-height: 1.45;
  overflow-x: hidden;
}

/* ===== CRT overlay ===== */
.crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.crt::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45) 100%);
}

/* ===== Background canvas ===== */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; image-rendering: pixelated; }

/* ===== Boot screen ===== */
#boot {
  position: fixed; inset: 0; z-index: 10000; background: #000;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 2rem; cursor: pointer; transition: opacity .4s steps(4);
}
#boot.off { opacity: 0; pointer-events: none; }
html:not(.js) #boot { display: none; } /* no JS: never trap the page behind the boot screen */
#boot-text {
  font-family: var(--font-term); font-size: 26px; color: var(--green);
  white-space: pre-wrap; width: min(640px, 90vw); min-height: 40vh;
  text-shadow: 0 0 8px rgba(57,255,106,.6);
}
#press-start {
  font-family: var(--font-pixel); font-size: 24px; color: var(--yellow);
  animation: blink 1s steps(2) infinite;
}
#boot-skip { font-family: var(--font-term); color: #444; font-size: 18px; position: absolute; bottom: 24px; }
.hidden { display: none; }

@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1.1s steps(2) infinite; }

/* ===== VS screen (SF2 style) ===== */
#vs {
  position: fixed; inset: 0; z-index: 9999; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2.2rem;
  background:
    repeating-linear-gradient(115deg, rgba(255,211,25,.05) 0 24px, transparent 24px 48px),
    radial-gradient(ellipse at center, #2a1140 0%, #0a0a12 75%);
  transition: opacity .35s steps(4);
}
#vs.off { opacity: 0; pointer-events: none; }
#vs.hidden { display: none; }
.vs-round {
  font-family: var(--font-pixel); font-size: clamp(16px, 3.5vw, 28px); color: var(--yellow);
  text-shadow: 3px 3px 0 var(--magenta), 6px 6px 0 #000;
  animation: vs-drop .4s steps(4) both;
}
.vs-wrap { display: flex; align-items: center; gap: clamp(1.5rem, 6vw, 4rem); }
.vs-fighter { display: flex; flex-direction: column; align-items: center; gap: .7rem; animation: vs-slide-l .35s steps(5) both; }
.vs-fighter:last-child { animation-name: vs-slide-r; }
.vs-face {
  width: clamp(110px, 20vw, 180px); height: clamp(110px, 20vw, 180px);
  image-rendering: pixelated; object-fit: cover;
  border: var(--px) solid var(--yellow); box-shadow: 6px 6px 0 #000;
  background: #000;
}
.vs-q {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-pixel); font-size: clamp(48px, 9vw, 90px); color: var(--cyan);
  animation: blink 1s steps(2) infinite;
}
.vs-name { font-family: var(--font-pixel); font-size: clamp(12px, 2.4vw, 18px); color: var(--ink); text-shadow: 2px 2px 0 #000; }
.vs-hp { width: clamp(110px, 20vw, 180px); height: 14px; border: 3px solid #fff; background: #5a0000; padding: 2px; }
.vs-hp-fill { height: 100%; width: 100%; background: linear-gradient(180deg, #ffe14d, #d9a400); }
.vs-mid {
  font-family: var(--font-pixel); font-size: clamp(30px, 7vw, 64px); color: var(--magenta);
  text-shadow: 4px 4px 0 #000; animation: vs-pulse .5s steps(3) infinite alternate;
}
.vs-fight {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-pixel); font-size: clamp(40px, 10vw, 100px); color: var(--yellow);
  text-shadow: 5px 5px 0 var(--magenta), 10px 10px 0 #000;
  background: rgba(0,0,0,.35);
  animation: vs-fight-zoom .45s steps(5) both;
}
.vs-fight.hidden { display: none; }
@keyframes vs-drop { from { transform: translateY(-60px); opacity: 0; } }
@keyframes vs-slide-l { from { transform: translateX(-40vw); } }
@keyframes vs-slide-r { from { transform: translateX(40vw); } }
@keyframes vs-pulse { from { transform: scale(1); } to { transform: scale(1.18); } }
@keyframes vs-fight-zoom { from { transform: scale(3.2); opacity: 0; } }

/* ===== Header ===== */
header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .7rem 1.2rem;
  background: rgba(10,10,18,.92);
  border-bottom: var(--px) solid var(--purple);
}
.logo {
  font-family: var(--font-pixel); font-size: 18px; color: var(--green);
  text-decoration: none; text-shadow: 3px 3px 0 var(--purple);
}
nav { display: flex; gap: 1.2rem; flex-wrap: wrap; flex: 1; }
nav a {
  font-family: var(--font-pixel); font-size: 10px; color: var(--dim);
  text-decoration: none; padding: 6px 4px;
}
nav a:hover { color: var(--yellow); }
nav a:hover::before { content: '▶'; margin-right: 4px; color: var(--magenta); }
.coins { font-family: var(--font-pixel); font-size: 12px; color: var(--yellow); cursor: pointer; user-select: none; }
button.coins { background: none; border: none; padding: 0; }
#music-toggle.on { color: var(--green); animation: blink 1.6s steps(2) infinite; }
.coins:active { transform: translateY(2px); }

/* ===== Hero ===== */
.hero { min-height: 88vh; display: flex; flex-direction: column; justify-content: center; padding: 3rem 1.5rem 1rem; }
.hero-inner {
  display: flex; gap: 3rem; align-items: center; justify-content: center;
  flex-wrap: wrap; max-width: 1000px; margin: 0 auto;
}
.avatar-frame { position: relative; text-align: center; }
#avatar {
  width: 325px; height: 325px; image-rendering: pixelated;
  border: var(--px) solid var(--green);
  box-shadow: 0 0 0 var(--px) #000, 8px 8px 0 var(--purple), 0 0 32px rgba(57,255,106,.25);
  background: #000; display: block;
}
#avatar-src { display: none; }
.avatar-caption { font-size: 19px; color: var(--dim); margin-top: 12px; letter-spacing: 2px; }
.p1 { font-family: var(--font-pixel); color: var(--magenta); font-size: 18px; margin-bottom: 1.2rem; animation: blink 2s steps(2) infinite; }
h1 {
  font-family: var(--font-pixel); font-size: clamp(32px, 6.2vw, 55px); color: var(--ink);
  text-shadow: 4px 4px 0 var(--purple), 8px 8px 0 rgba(0,0,0,.6);
  margin-bottom: 1.2rem;
}
.typewriter { font-family: var(--font-term); font-size: 35px; color: var(--cyan); min-height: 48px; }
.cursor { animation: blink .8s steps(2) infinite; color: var(--cyan); }
.badges { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.4rem 0; }
.badge {
  font-size: 21px; border: 2px solid var(--dim); padding: 4px 13px; color: var(--ink);
  background: rgba(0,0,0,.4);
}
.hero-cta { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: .8rem; }
.btn {
  font-family: var(--font-pixel); font-size: 13px; color: #000;
  background: var(--green); text-decoration: none; padding: 15px 22px;
  border: 3px solid #000; box-shadow: 4px 4px 0 #000;
  transition: transform .05s steps(1), box-shadow .05s steps(1);
}
.btn:hover { transform: translate(2px,2px); box-shadow: 2px 2px 0 #000; }
.btn:active { transform: translate(4px,4px); box-shadow: 0 0 0 #000; }
.btn-alt { background: var(--cyan); }
.scroll-hint { text-align: center; font-size: 18px; color: var(--dim); margin-top: 3rem; animation: bob 1.4s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ===== Ticker ===== */
.ticker { overflow: hidden; border-top: var(--px) solid var(--purple); border-bottom: var(--px) solid var(--purple); background: #000; }
.ticker-track {
  display: inline-block; white-space: nowrap; padding: 10px 0;
  font-family: var(--font-pixel); font-size: 12px; color: var(--yellow);
  animation: ticker 30s linear infinite;
}
@keyframes ticker { from { transform: translateX(100vw); } to { transform: translateX(-100%); } }

/* ===== Panels ===== */
.panel {
  max-width: 960px; margin: 4rem auto; padding: 2rem;
  background: rgba(18,18,31,.88);
  border: var(--px) solid var(--purple);
  box-shadow: 8px 8px 0 rgba(0,0,0,.5);
}
h2 { font-family: var(--font-pixel); font-size: clamp(14px, 3vw, 20px); color: var(--yellow); margin-bottom: 1.6rem; text-shadow: 3px 3px 0 rgba(0,0,0,.7); }
h2 .sub { font-family: var(--font-term); font-size: 20px; color: var(--dim); text-shadow: none; }
.h-icon { color: var(--magenta); margin-right: 6px; }

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .5s steps(5), transform .5s steps(5); }
.js .reveal.in { opacity: 1; transform: none; }

/* ===== Bio ===== */
.dialog p { margin-bottom: 1rem; font-size: 23px; }
.dialog strong { color: var(--cyan); }
.powerup {
  border: 3px dashed var(--yellow); padding: 1rem; background: rgba(255,211,25,.06);
  color: var(--ink);
}
.code { color: var(--green); background: #000; padding: 2px 8px; }

/* ===== Stats ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.2rem 2rem; }
.stat label { font-family: var(--font-pixel); font-size: 10px; color: var(--ink); display: block; margin-bottom: 8px; }
.bar { height: 22px; background: #000; border: 3px solid var(--dim); padding: 3px; }
.fill {
  height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--green) 0 12px, #1fbf4e 12px 16px);
  transition: width 1.2s steps(12);
}
.f-ai { background: repeating-linear-gradient(90deg, var(--magenta) 0 12px, #c72a4e 12px 16px); }

/* ===== Quest log ===== */
.timeline { display: flex; flex-direction: column; gap: 1.4rem; }
.quest { display: flex; gap: 1.4rem; align-items: flex-start; }
.q-date {
  font-family: var(--font-pixel); font-size: 10px; color: var(--magenta);
  min-width: 120px; text-align: right; padding-top: 6px;
}
.q-body { border-left: var(--px) solid var(--purple); padding-left: 1.2rem; padding-bottom: .4rem; }
.q-body h3 { font-family: var(--font-pixel); font-size: 12px; color: var(--cyan); margin-bottom: .5rem; }
.q-body p { font-size: 21px; color: var(--ink); }

/* ===== Character select (all fighters visible) ===== */
.cab { position: relative; }
.cab-loc { font-family: var(--font-pixel); font-size: 8px; color: var(--magenta); padding: .7rem 1rem 0; }

/* ===== Arcade cabinets ===== */
.cab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.cab {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--panel2); border: var(--px) solid var(--dim);
  padding: 0 0 1rem; transition: transform .08s steps(2);
}
.cab:hover { transform: translateY(-6px); border-color: var(--green); box-shadow: 0 0 24px rgba(57,255,106,.25); }
.cab-marquee {
  font-family: var(--font-pixel); font-size: 11px; text-align: center; padding: 10px 6px;
  background: linear-gradient(180deg, var(--purple), #4a1260); color: var(--yellow);
  border-bottom: var(--px) solid #000; text-shadow: 2px 2px 0 #000;
}
.cab-screen {
  font-size: 64px; text-align: center; padding: 1.4rem 0; background: #000;
  border-bottom: var(--px) solid #000; text-shadow: 0 0 24px rgba(45,226,230,.8);
}
.cab-screen.dim { filter: grayscale(1) brightness(.5); }
.cab p { font-size: 19px; padding: .9rem 1rem .4rem; color: var(--ink); }
.cab-status { font-family: var(--font-pixel); font-size: 9px; padding: .4rem 1rem 0; }
.cab-status.on { color: var(--green); }
.cab-status.irl { color: var(--cyan); }
.cab-status.wait { color: var(--yellow); animation: blink 1.4s steps(2) infinite; }

/* ===== MK-TV (retro sets, click-to-play) ===== */
.tv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.8rem; }
.tv-set {
  background: linear-gradient(180deg, #221a35, #171226);
  border: var(--px) solid var(--dim); padding: 1rem 1rem .8rem;
  box-shadow: 8px 8px 0 rgba(0,0,0,.5);
}
.tv-screen {
  position: relative; aspect-ratio: 16 / 9; background: #000;
  border: var(--px) solid #000; overflow: hidden; cursor: pointer;
}
.tv-screen img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(1.05); display: block; }
.tv-screen::after { /* CRT scanlines over the idle screen */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
}
.tv-screen:hover img { filter: saturate(1.1) contrast(1.1); }
.tv-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tv-screen.playing { cursor: default; }
.tv-screen.playing::after { display: none; } /* let the real video shine */
.tv-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-pixel); font-size: 13px; color: #fff;
  background: var(--magenta); border: 3px solid #000; padding: 12px 16px;
  box-shadow: 4px 4px 0 #000; animation: blink 1.4s steps(2) infinite;
  pointer-events: none;
}
.tv-screen:hover .tv-play { background: var(--green); color: #000; animation: none; }
.tv-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: .8rem; gap: .8rem; }
.tv-label { font-family: var(--font-pixel); font-size: 10px; color: var(--yellow); }
.tv-knobs { display: flex; gap: 8px; }
.tv-knobs span { width: 14px; height: 14px; background: #000; border: 3px solid var(--dim); border-radius: 50%; }

/* ===== Trophies ===== */
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.trophy { border: var(--px) solid var(--dim); padding: 1.2rem; background: var(--panel2); }
.trophy:hover { border-color: var(--yellow); }
.t-icon { font-size: 42px; margin-bottom: .6rem; }
.trophy h3 { font-family: var(--font-pixel); font-size: 10px; color: var(--yellow); margin-bottom: .6rem; line-height: 1.6; }
.trophy p { font-size: 19px; }
.trophy .attr { color: var(--dim); }

/* ===== Contact ===== */
.contact { text-align: center; }
.go-row { display: flex; align-items: center; justify-content: center; gap: 1.6rem; flex-wrap: wrap; }
.go-row canvas { image-rendering: pixelated; animation: bob 1.2s steps(2) infinite; }
.go-row canvas:last-child { animation-delay: .6s; }
.gameover {
  font-family: var(--font-pixel); font-size: clamp(22px, 5vw, 40px); color: var(--magenta);
  text-shadow: 4px 4px 0 rgba(0,0,0,.8); margin-bottom: 1rem;
}
.continue { color: var(--green); }
#countdown { color: var(--yellow); }
.contact p { font-size: 23px; margin: 1rem 0 1.6rem; }
.contact-links { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }

/* ===== Footer ===== */
footer {
  text-align: center; padding: 2rem 1rem 3rem; color: var(--dim); font-size: 18px;
  display: flex; flex-direction: column; gap: .6rem;
}
footer .hint { font-family: var(--font-pixel); font-size: 9px; color: #333; letter-spacing: 3px; }

/* ===== Konami rainbow mode ===== */
body.rainbow { animation: hue 4s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  nav { gap: .7rem; }
  nav a { font-size: 8px; }
  .q-date { min-width: 84px; font-size: 8px; }
  #avatar { width: 250px; height: 250px; }
  .panel { margin: 2.5rem .8rem; padding: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .blink, .p1, .scroll-hint, body.rainbow { animation: none !important; }
  html { scroll-behavior: auto; }
}
