/* ============ MEME FIGHTERS — flame edition (palette from the logo) ============ */
:root {
  --bg: #120705;
  --panel: #1f0f08;
  --panel2: #2a1409;
  --line: #4a2410;
  --gold: #ffd23f;
  --orange: #ff8c1a;
  --red: #e3342f;
  --deepred: #8c1a12;
  --text: #ffe9d0;
  --dim: #b8926e;
  --green: #3ddc55;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Rubik", sans-serif;
  overflow-x: hidden;
}
.mono { font-family: "Press Start 2P", monospace; }
.display { font-family: "Bangers", cursive; letter-spacing: 2px; }
img { image-rendering: pixelated; }

/* film grain / heat shimmer */
.crt {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---------- nav ---------- */
.nav-wrap { position: sticky; top: 0; z-index: 40; background: rgba(18,7,5,.94); backdrop-filter: blur(8px); border-bottom: 2px solid var(--orange); }
.nav { max-width: 1150px; margin: 0 auto; display: flex; align-items: center; gap: 22px; padding: 12px 20px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-img { height: 46px; width: auto; filter: drop-shadow(0 2px 8px rgba(227,52,47,.5)); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--dim); text-decoration: none; font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; }
.nav-links a:hover { color: var(--gold); }
.btn-x { color: var(--text); text-decoration: none; font-size: 18px; padding: 6px 11px; border: 2px solid var(--line); border-radius: 8px; }
.btn-x:hover { border-color: var(--gold); }
.btn-buy { font-family: "Bangers", cursive; font-size: 20px; letter-spacing: 2px; color: #1a0a04; background: linear-gradient(180deg, var(--gold), var(--orange)); text-decoration: none; padding: 8px 20px 6px; border-radius: 8px; border: 2px solid #00000055; box-shadow: 0 0 20px rgba(255,140,26,.5); cursor: pointer; }
.btn-buy:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(255,210,63,.6); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 64px 20px 30px; }
.hero-art { position: relative; padding: 84px 20px 64px; overflow: hidden; }
.hero-art-bg { position: absolute; inset: 0; background: url("images/hero-art.png") center 30%/cover no-repeat; image-rendering: pixelated; }
.hero-art-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,7,5,.85) 0%, rgba(18,7,5,.45) 45%, rgba(18,7,5,.96) 100%); }
.hero-inner { position: relative; z-index: 2; }
.attract { color: var(--orange); font-size: 12px; letter-spacing: 2px; }
.blink { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-logo { max-width: min(560px, 88vw); margin: 22px auto 6px; display: block; filter: drop-shadow(0 6px 34px rgba(227,52,47,.55)); }
.hero-sub { color: var(--text); font-size: 19px; line-height: 1.6; margin: 16px auto 26px; max-width: 640px; text-shadow: 0 2px 10px #000; }
.hero-cta { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; }
.btn-solid { font-family: "Bangers", cursive; font-size: 26px; letter-spacing: 3px; background: linear-gradient(180deg, var(--red), var(--deepred)); color: #ffe9d0; text-decoration: none; padding: 12px 30px 9px; border-radius: 10px; border: 2px solid #00000066; box-shadow: 0 0 26px rgba(227,52,47,.55); cursor: pointer; }
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(255,140,26,.65); }

/* CA pill */
.ca-pill { display: inline-flex; align-items: center; gap: 10px; background: rgba(31,15,8,.92); border: 2px solid var(--line); border-radius: 10px; padding: 12px 16px; color: var(--text); cursor: pointer; font-size: 11px; }
.ca-pill.center { margin: 26px auto 0; display: flex; width: fit-content; }
.ca-tag { color: var(--gold); }
.ca-value { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-hint { color: var(--dim); font-size: 9px; }
.ca-pill.copied { border-color: var(--gold); }

/* ---------- section headings ---------- */
.h2 { font-family: "Bangers", cursive; font-size: clamp(38px, 6vw, 62px); letter-spacing: 3px; text-align: center;
  background: linear-gradient(180deg, var(--gold) 20%, var(--orange) 55%, var(--red) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(2px 3px 0 #3a0d05); margin-bottom: 26px; }

/* ---------- about ---------- */
.about { padding: 70px 20px 20px; max-width: 860px; margin: 0 auto; }
.about p { color: var(--text); font-size: 17.5px; line-height: 1.8; margin-bottom: 18px; }
.about b { color: var(--gold); font-weight: 600; }
.about-badges { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.badge { font-size: 9px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 999px; color: var(--orange); background: var(--panel); }

/* ---------- fighters ---------- */
.fighters { padding: 60px 20px 30px; max-width: 1150px; margin: 0 auto; }
.fighter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.f-card { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; }
.f-card:hover { transform: translateY(-5px); border-color: var(--orange); box-shadow: 0 10px 34px rgba(227,52,47,.3); }
.f-card h3 { font-family: "Bangers", cursive; font-size: 27px; letter-spacing: 2px; color: var(--gold); }
.f-title { color: var(--orange); font-size: 9px; margin: 6px 0 10px; }
.f-card p { color: var(--dim); font-size: 14px; line-height: 1.55; }
.f-move { margin-top: 10px; padding-bottom: 4px; color: var(--green) !important; font-size: 8px !important; line-height: 1.6 !important; }
.art-card { padding: 0 0 18px; overflow: hidden; }
.f-art { width: 100%; aspect-ratio: 1; overflow: hidden; margin-bottom: 12px; border-bottom: 2px solid var(--line); }
.f-art img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform .25s; display: block; }
.art-card:hover .f-art img { transform: scale(1.07); }
.art-card h3, .art-card .f-title, .art-card p { padding: 0 14px; }
.more-soon { text-align: center; color: var(--dim); font-size: 10px; margin-top: 24px; letter-spacing: 1px; }

/* ---------- story promo ---------- */
.story-promo { position: relative; margin: 60px 0 0; padding: 90px 20px; overflow: hidden; border-top: 2px solid var(--orange); border-bottom: 2px solid var(--orange); }
.story-bg { position: absolute; inset: 0; background: url("images/enter-bg.png") center/cover no-repeat; image-rendering: pixelated; filter: brightness(.5); }
.story-inner { position: relative; z-index: 2; max-width: 740px; margin: 0 auto; text-align: center; }
.story-tag { color: var(--orange); font-size: 11px; margin: 12px 0 18px; }
.story-copy { color: var(--text); font-size: 17.5px; line-height: 1.75; text-shadow: 0 2px 8px #000; }
.story-row { display: flex; align-items: center; justify-content: center; gap: 34px; margin-top: 32px; }
.story-shadow { height: 130px; image-rendering: pixelated; filter: drop-shadow(0 0 20px rgba(255,140,26,.55)); }

/* ---------- roadmap ---------- */
.roadmap { padding: 70px 20px; max-width: 900px; margin: 0 auto; }
.phase { display: flex; gap: 22px; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 24px 26px; margin-bottom: 16px; align-items: flex-start; }
.phase-num { font-family: "Bangers", cursive; font-size: 44px; line-height: 1; color: var(--red); min-width: 54px; text-shadow: 2px 2px 0 #3a0d05; }
.phase h3 { font-family: "Bangers", cursive; font-size: 24px; letter-spacing: 2px; color: var(--gold); margin-bottom: 8px; }
.phase p { color: var(--dim); font-size: 15px; line-height: 1.65; }
.phase.now { border-color: var(--orange); box-shadow: 0 0 24px rgba(255,140,26,.2); }
.phase .tag { display: inline-block; font-size: 8px; padding: 5px 10px; border-radius: 999px; margin-left: 10px; vertical-align: middle; }
.tag-live { background: rgba(61,220,85,.15); color: var(--green); border: 1px solid var(--green); }
.tag-soon { background: rgba(255,210,63,.12); color: var(--gold); border: 1px solid var(--gold); }
.tag-plan { background: rgba(184,146,110,.12); color: var(--dim); border: 1px solid var(--line); }

/* ---------- how to buy ---------- */
.howto { padding: 40px 20px 70px; max-width: 720px; margin: 0 auto; }
.buy-steps { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.buy-steps li { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 16px 18px; color: var(--dim); font-size: 15.5px; }
.buy-steps b { font-family: "Bangers", cursive; color: var(--red); margin-right: 12px; font-size: 22px; letter-spacing: 1px; }

/* ---------- footer ---------- */
.footer { border-top: 2px solid var(--orange); padding: 30px 20px 40px; text-align: center; }
.foot-links { display: flex; gap: 22px; justify-content: center; margin-bottom: 16px; }
.foot-links a { color: var(--dim); text-decoration: none; font-size: 11px; }
.foot-links a:hover { color: var(--gold); }
.foot-note { color: #7d5c42; font-size: 12.5px; max-width: 540px; margin: 0 auto; line-height: 1.6; }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--gold); color: #1a0a04; padding: 12px 20px; border-radius: 10px; font-size: 11px; transition: transform .25s; z-index: 60; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============ fullscreen game modal ============ */
.game-modal { position: fixed; inset: 0; z-index: 100; background: #0a0503; display: flex; flex-direction: column; }
.game-modal[hidden] { display: none; }
.gm-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #120705; border-bottom: 2px solid var(--orange); }
.gm-logo { height: 38px; width: auto; }
.gm-actions { display: flex; gap: 10px; }
.gm-btn { font-size: 10px; padding: 10px 14px; background: var(--panel); color: var(--text); border: 2px solid var(--line); border-radius: 8px; cursor: pointer; }
.gm-btn:hover { border-color: var(--gold); }
.gm-close { color: var(--red); }
.gm-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; overflow: hidden; padding: 10px; }
.gm-stage #game { max-width: min(100%, 1200px); max-height: calc(100vh - 210px); width: auto; height: auto; aspect-ratio: 16/9; border: 3px solid #000; border-radius: 10px; background: #0a0503; display: block; }

/* select overlay — compact strip so the center preview stays visible */
.select-overlay { position: absolute; inset: 0; top: auto; bottom: 0; max-height: 46%; overflow-y: auto; background: linear-gradient(180deg, transparent, rgba(10,5,3,.55) 10%, rgba(10,5,3,.95) 40%); padding: 26px 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.select-overlay[hidden] { display: none; }
.mode-row { display: flex; gap: 10px; justify-content: center; }
.mode-btn { font-size: 10px; padding: 10px 16px; background: var(--panel); color: var(--dim); border: 2px solid var(--line); border-radius: 8px; cursor: pointer; }
.mode-btn.active { color: #1a0a04; background: var(--orange); border-color: var(--orange); box-shadow: 0 0 16px rgba(255,140,26,.5); }
.mode-locked { opacity: .45; cursor: not-allowed; position: relative; filter: saturate(.4); }
.mode-soon { display: block; font-size: 6px; color: var(--gold); margin-top: 4px; letter-spacing: 1px; }

/* main menu (enter scene) — overlays the canvas itself: the inner box mirrors the
   canvas aspect-fit sizing (aspect-ratio transfers the max-height cap to width) */
.menu-overlay { position: absolute; inset: 0; padding: 10px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.menu-overlay[hidden] { display: none; }
.menu-inner { width: 100%; max-width: min(100%, 1200px); max-height: calc(100vh - 210px); aspect-ratio: 16/9; container-type: inline-size; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: clamp(6px, 1.2cqw, 12px); padding-bottom: 1.8%; }
.menu-banner { pointer-events: auto; color: var(--gold); font-size: clamp(6px, 1cqw, 8px); letter-spacing: 1px; text-align: center; line-height: 1.8; background: rgba(10,5,3,.78); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; text-shadow: 0 2px 0 #000; }
.menu-btns { pointer-events: auto; display: flex; gap: clamp(6px, 1cqw, 12px); flex-wrap: wrap; justify-content: center; }
.menu-btn { font-size: clamp(7px, 1.6cqw, 11px); padding: clamp(8px, 1.4cqw, 13px) clamp(10px, 1.8cqw, 18px); white-space: nowrap; background: rgba(18,7,5,.88); color: var(--text); border: 2px solid var(--line); border-radius: 10px; cursor: pointer; transition: transform .12s, border-color .12s; box-shadow: 0 4px 0 rgba(0,0,0,.55); }
.menu-btn:hover, .menu-btn.focused { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 0 14px rgba(255,210,63,.45), 0 4px 0 rgba(0,0,0,.55); }
#menu-start { background: linear-gradient(180deg, var(--red), var(--deepred)); border-color: #00000066; color: #ffe9d0; box-shadow: 0 0 18px rgba(227,52,47,.5), 0 4px 0 rgba(0,0,0,.55); }
#menu-wallet { border-color: var(--orange); color: var(--orange); }

/* username row */
.lb-username { display: flex; gap: 10px; align-items: center; font-size: 9px; color: var(--dim); }
.lb-username[hidden] { display: none; }
.lb-username input { font-family: "Press Start 2P", monospace; font-size: 10px; padding: 10px 12px; background: #120705; color: var(--gold); border: 2px solid var(--line); border-radius: 8px; width: 200px; outline: none; }
.lb-username input:focus { border-color: var(--gold); }

/* leaderboard */
.lb-status { color: var(--orange); font-size: 9px; }
.lb-table { border-collapse: collapse; font-size: 10px; min-width: min(560px, 88vw); }
.lb-table th { color: var(--gold); border-bottom: 2px solid var(--line); padding: 8px 14px; text-align: left; font-size: 9px; }
.lb-table td { color: var(--text); border-bottom: 1px solid #2a1409; padding: 9px 14px; }
.lb-table tr.me td { color: var(--gold); background: rgba(255,140,26,.08); }
.lb-empty { color: var(--dim) !important; text-align: center !important; }
.lb-note { color: var(--dim); font-size: 8px; }
.lb-actions { display: flex; gap: 12px; }
.diff-row { margin-top: 2px; }
.diff-label { color: var(--dim); font-size: 8px; align-self: center; margin-right: 4px; }
.diff-btn { font-size: 8px; padding: 8px 12px; background: var(--panel); color: var(--dim); border: 2px solid var(--line); border-radius: 8px; cursor: pointer; }
.diff-btn.active { color: #08140b; background: var(--green); border-color: var(--green); box-shadow: 0 0 12px rgba(61,220,85,.45); }

/* roster select strip */
.roster { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.fighter-card { width: 86px; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 6px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform .12s, border-color .12s, box-shadow .12s; }
.fighter-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.fighter-card img { width: 56px; height: 56px; object-fit: contain; }
.fc-name { font-family: "Press Start 2P", monospace; font-size: 7px; color: var(--gold); }
.fc-title { font-size: 8px; color: var(--dim); text-align: center; }
.fighter-card.kbd-focus { border-color: var(--gold); box-shadow: 0 0 18px rgba(255,210,63,.65); transform: translateY(-3px) scale(1.06); }
.fighter-card.p1-pick { border-color: var(--green); box-shadow: 0 0 16px rgba(61,220,85,.5); }
.fighter-card.p2-pick { border-color: var(--red); box-shadow: 0 0 16px rgba(227,52,47,.5); }
.fighter-card.champion .fc-name { color: var(--orange); }
.fighter-card.locked { cursor: default; opacity: .5; filter: saturate(.3); }
.fighter-card.locked:hover { transform: none; border-color: var(--line); }
.fighter-card.locked .fc-name { color: var(--dim); }

/* controls overlay */
.controls-overlay { position: absolute; inset: 0; z-index: 8; background: rgba(10,5,3,.95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 30px; }
.controls-overlay[hidden] { display: none; }
.controls-overlay h3 { font-family: "Bangers", cursive; color: var(--gold); font-size: 34px; letter-spacing: 3px; text-shadow: 2px 2px 0 #3a0d05; }
.ctl-grid { display: grid; grid-template-columns: auto 1fr; gap: 16px 22px; font-size: 11px; line-height: 1.8; max-width: 640px; }
.ctl-grid b { color: var(--orange); text-align: right; }
.ctl-grid span { color: var(--text); }

/* touch controls */
.touch-controls { display: flex; justify-content: space-between; user-select: none; -webkit-user-select: none; width: 100%; max-width: 1100px; padding: 10px 6px 4px; }
.touch-controls[hidden] { display: none; }
.tc-left, .tc-right { display: flex; gap: 8px; }
.tc-btn { width: 58px; height: 58px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); color: var(--text); font-size: 20px; font-weight: 800; touch-action: none; }
.tc-btn.atk { background: #33150c; border-color: var(--red); color: var(--red); }
.tc-btn.sp { background: #16321c; border-color: var(--green); color: var(--green); }
.tc-btn:active { transform: scale(.92); }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .phase { flex-direction: column; gap: 8px; }
}
