/* Hood Math Games — shared styles
   Page shell: circa-2006 "urban edutainment portal" (light, glossy, cluttered).
   Game internals: dark, embedded like a Flash game (tokens below stay dark on purpose). */
/* SerenityOS pixel-art emoji (BSD-2, see assets/fonts/SerenityOS-Emoji-LICENSE.txt).
   unicode-range limits it to emoji codepoints, so it's safe to append to every stack. */
@font-face {
  font-family: "SerenityOS Emoji";
  src: url("../assets/fonts/SerenityOS-Emoji.ttf");
  font-display: block;
  unicode-range: U+00A9, U+00AE, U+200D, U+203C, U+2049, U+20E3, U+2122, U+2139, U+2194-2199, U+21A9-21AA, U+231A-231B, U+2328, U+2388, U+23CF, U+23E9-23F3, U+23F8-23FA, U+24C2, U+25AA-25AB, U+25B6, U+25C0, U+25FB-25FE, U+2600-27EF, U+2934-2935, U+2B00-2BFF, U+3030, U+303D, U+3297, U+3299, U+1F000-1F64F, U+1F680-1F6FF, U+1F774-1F77F, U+1F7D5-1F7FF, U+1F80C-1F80F, U+1F848-1F84F, U+1F85A-1F85F, U+1F888-1F88F, U+1F8AE-1F8FF, U+1F90C-1FAFF, U+FE0E-FE0F;
}
:root {
  --bg: #0b0b0f;
  --bg-2: #15151d;
  --card: #1c1c27;
  --ink: #f4f1ea;
  --muted: #a39f95;
  --gold: #f5c518;
  --gold-2: #ffdd57;
  --green: #35d07f;
  --red: #ff4d5a;
  --purple: #8b5cf6;
  --radius: 6px;
  --shadow: 0 4px 12px rgba(0,0,0,.4);
  --font-display: "Impact", "Arial Black", "Arial Narrow", sans-serif, "SerenityOS Emoji";
  --font-body: Verdana, Tahoma, Geneva, Arial, sans-serif, "SerenityOS Emoji";
  /* page (light) tokens */
  --pg-bg: #0f1116;
  --pg-paper: #181a21;
  --pg-ink: #e6e3dc;
  --pg-muted: #9a978f;
  --pg-link: #7cc6ff;
  --pg-visited: #c4a6ff;
  --pg-blue: #1e4d9b;
  --pg-blue-2: #3a78d1;
  --pg-orange: #ff8a00;
  --pg-line: #2c3040;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--pg-bg) repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 2px, rgba(0,0,0,0) 2px 8px);
  color: var(--pg-ink);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--pg-link); text-decoration: underline; }
a:visited { color: var(--pg-visited); }
a:hover { color: #ffd23f; }
.game a, .overlay a { color: var(--gold); }
.wrap { max-width: none; margin: 0 0 20px; padding: 0 0 12px; background: var(--pg-paper); border: 1px solid #2c3040; border-left: 0; border-right: 0; box-shadow: 0 0 14px rgba(0,0,0,.6); }

/* ---- header ---- */
header.site {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px 8px;
  background: linear-gradient(#3f6fb8 0%, #1e4d9b 48%, #163b7a 52%, #0f2a58 100%);
  border-bottom: 3px solid var(--pg-orange);
  color: #fff;
}
.logo { font-family: "Arial Black", Impact, sans-serif, "SerenityOS Emoji"; font-style: italic; font-size: 30px; letter-spacing: -1px; text-decoration: none; color: #fff; line-height: 1; text-shadow: 2px 2px 0 #0b2a5c, 3px 3px 4px rgba(0,0,0,.5); }
.logo:visited, .logo:hover { color: #fff; }
.logo span { color: #ffd23f; }
.logo small { display: block; font-family: var(--font-body); font-style: normal; font-size: 10px; letter-spacing: 1px; color: #dbe6ff; font-weight: bold; margin-top: 3px; text-shadow: none; }
.hdr-right { text-align: right; font-size: 10px; color: #dbe6ff; }
.hdr-right .online { color: #b7ff9a; font-weight: bold; }
.hdr-right form { margin-top: 4px; }
.hdr-right input[type=text] { font: 11px Verdana, sans-serif; padding: 2px 4px; border: 1px solid #0b2a5c; width: 130px; background: #0f1116; color: #e6e3dc; }
.hdr-right button, .go { font: bold 11px Verdana, sans-serif; padding: 2px 8px; border: 1px solid #7a4a00; background: linear-gradient(#ffd23f, #f0a000); color: #3a2400; cursor: pointer; }
nav.top { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; background: linear-gradient(#2a2f3c, #1c2029 50%, #14171e 51%, #1c2029); border-bottom: 1px solid #000; border-top: 1px solid #3a4152; padding: 5px 12px; font-size: 11px; font-weight: bold; }
nav.top a { margin: 0 4px; text-decoration: none; color: #9ec5ff; }
nav.top a:hover { text-decoration: underline; color: #ffd23f; }
nav.top .sep { color: #555; }
nav.top .r { margin-left: auto; font-weight: normal; }
.badge { display: inline-block; background: #d00; color: #fff; font-size: 10px; font-weight: bold; padding: 1px 6px; border: 1px solid #700; vertical-align: middle; }
.new { display: inline-block; background: #ff2a2a; color: #ffff66; font: bold 10px/1 Arial, sans-serif; padding: 2px 4px; border: 1px solid #900; transform: rotate(-4deg); margin-left: 4px; vertical-align: middle; }
.hot { display: inline-block; background: #ff8a00; color: #fff; font: bold 10px/1 Arial, sans-serif; padding: 2px 4px; border: 1px solid #a05000; margin-left: 4px; vertical-align: middle; }
.stars { color: #f39c12; letter-spacing: -1px; font-size: 12px; }
.stars small { color: var(--pg-muted); letter-spacing: 0; font-size: 10px; margin-left: 4px; }

/* ---- layout ---- */
.cols { display: flex; gap: 12px; padding: 10px 12px 0; align-items: flex-start; }
.side { flex: 0 0 190px; }
.main { flex: 1; min-width: 0; }
@media (max-width: 760px) { .cols { flex-direction: column; } .side { flex: none; width: 100%; order: 2; } .main { order: 1; width: 100%; } }
.box { border: 1px solid var(--pg-line); background: #1e2029; margin-bottom: 10px; font-size: 11px; }
.box h4 { margin: 0; padding: 4px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #fff; background: linear-gradient(#4b7fd0, #1e4d9b); border-bottom: 1px solid #0b2a5c; }
.box h4.org { background: linear-gradient(#ffa040, #e06a00); border-color: #8a4000; }
.box h4.gray { background: linear-gradient(#999, #666); border-color: #444; }
.box .in { padding: 6px 8px; }
.box ol { margin: 0; padding-left: 20px; }
.box li { margin: 2px 0; }
.box input[type=email], .box input[type=text] { width: 100%; font: 11px Verdana, sans-serif; padding: 3px; border: 1px solid #444; background: #0f1116; color: #e6e3dc; margin-bottom: 4px; }
.box .tiny { font-size: 9px; color: var(--pg-muted); }
.ad { border: 1px dashed #4a4f5e; background: repeating-linear-gradient(45deg, #1c1f27 0 6px, #22262f 6px 12px); color: #8a8f9c; text-align: center; padding: 20px 8px; font-size: 11px; }
.ad b { display: block; font-size: 13px; color: #c9ccd4; }
.ad.tall { height: 240px; display: flex; flex-direction: column; justify-content: center; }
.counter { display: inline-block; background: #000; color: #4cff4c; font: bold 16px "Courier New", monospace; letter-spacing: 3px; padding: 2px 6px; border: 2px inset #555; }
.poll label { display: block; margin: 2px 0; }
.medals { display: flex; gap: 6px; flex-wrap: wrap; }
.medal { flex: 1; text-align: center; font-size: 9px; color: #c9ccd4; border: 1px solid #444; padding: 4px 2px; background: linear-gradient(#2a2f3c, #1c2029); }
.medal span { display: block; font-size: 18px; }

/* ---- hero / featured ---- */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; border: 1px solid #5a4d1a; background: linear-gradient(#26231a, #1c1a12); padding: 10px 14px; margin-bottom: 12px; position: relative; }
.hero::before { content: "★ FEATURED ★"; position: absolute; top: -1px; left: -1px; background: #d00; color: #fff; font: bold 10px Verdana, sans-serif; padding: 2px 8px; }
.hero-txt { flex: 1 1 320px; min-width: 0; }
.hero-car { flex: 1 1 260px; max-width: 420px; margin: 0 auto; text-align: center; }
.hero-car svg.donk { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); animation: donk-bounce 3.2s ease-in-out infinite; }
.hero-car .caption { font-size: 10px; color: var(--pg-muted); margin-top: 2px; }
.hero-car .caption em { color: #ffd23f; font-style: normal; font-weight: bold; }
@keyframes donk-bounce { 0%, 100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-5px) rotate(-.6deg); } 60% { transform: translateY(2px) rotate(.4deg); } }
@media (prefers-reduced-motion: reduce) { .hero-car svg.donk { animation: none; } }
.hero h1 { font-family: "Arial Black", Impact, sans-serif, "SerenityOS Emoji"; font-size: 26px; line-height: 1.1; margin: 8px 0 8px; color: #fff; text-shadow: 2px 2px 0 #000; }
.hero h1 em { font-style: normal; color: #ffd23f; }
.hero p { font-size: 12px; color: #d6d3cc; margin: 0 0 10px; }

/* ---- buttons (glossy) ---- */
.btn {
  display: inline-block; font: bold 13px Verdana, Tahoma, sans-serif; color: #fff; padding: 6px 16px; cursor: pointer; text-decoration: none;
  background: linear-gradient(#ff6a6a, #d40000 50%, #b00000 51%, #d40000); border: 1px solid #700; border-radius: 4px;
  text-shadow: 0 -1px 0 rgba(0,0,0,.5); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(0,0,0,.4);
}
.btn:visited, .btn:hover { color: #fff; }
.btn:hover { background: linear-gradient(#ff8080, #e00000 50%, #c00000 51%, #e00000); }
.btn:active { box-shadow: inset 0 2px 4px rgba(0,0,0,.5); transform: translateY(1px); }
.btn.secondary { background: linear-gradient(#4a5060, #2e3340 50%, #232734 51%, #2e3340); color: #eee; border-color: #111; text-shadow: 0 -1px 0 #000; }
.btn.secondary:hover { background: linear-gradient(#5a6070, #3a3f4c 50%, #2c3040 51%, #3a3f4c); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.game .btn { font-family: Verdana, sans-serif, "SerenityOS Emoji"; }

/* ---- game grid (portal cards) ---- */
.section-title { font: bold 13px Verdana, sans-serif; text-transform: uppercase; color: #fff; background: linear-gradient(#4b7fd0, #1e4d9b); padding: 4px 8px; margin: 14px 0 8px; border: 1px solid #0b2a5c; }
.section-title small { font-weight: normal; font-size: 10px; color: #dbe6ff; margin-left: 8px; text-transform: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.card {
  background: linear-gradient(#232733, #1a1d26); border: 1px solid #3a4152; padding: 8px 10px 10px; text-decoration: none; color: var(--pg-ink);
  display: flex; flex-direction: column; gap: 4px; box-shadow: 1px 1px 4px rgba(0,0,0,.5); cursor: pointer;
}
.card:visited { color: var(--pg-ink); }
.card:hover { border-color: #f90; background: linear-gradient(#2c2a22, #24211a); }
.card .icon { font-size: 34px; line-height: 1; float: left; margin: 0 8px 0 0; }
.card h3 { margin: 0; font: bold 14px "Trebuchet MS", Verdana, sans-serif; color: var(--pg-link); text-decoration: underline; }
.card:hover h3 { color: #ffd23f; }
.card p { margin: 2px 0 0; color: #c9c6bf; font-size: 11px; line-height: 1.4; }
.card .meta { margin-top: auto; font-size: 10px; color: var(--pg-muted); }
.card .plays { font-size: 10px; color: var(--pg-muted); }
.card .play { align-self: flex-start; margin-top: 4px; }
.disclaimer { background: #2a2410; border: 1px solid #8a6d00; padding: 6px 8px; font-size: 11px; color: #ffd98a; margin: 10px 0; }
.sponsored { border-top: 1px solid var(--pg-line); margin: 16px 12px 0; padding-top: 6px; }
.sponsored h5 { margin: 0 0 6px; font-size: 10px; color: #777; text-transform: uppercase; letter-spacing: 1px; }
.sponsored .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.sponsored .ad { padding: 8px; }
.sponsored .ad small { color: #999; }

/* ---- game page bits ---- */
.gamebar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0 5px 12px; padding: 5px 8px; border: 1px solid var(--pg-line); background: linear-gradient(#232733, #1a1d26); font-size: 11px; }
.gamebar .r { margin-left: auto; color: var(--pg-muted); }
.crumbs { font-size: 10px; color: var(--pg-muted); padding: 6px 12px 0; }
.page { padding: 0 12px; }
.game-title-bar { margin: 12px 5px 0; background: linear-gradient(#4b7fd0, #1e4d9b); color: #fff; font: bold 12px Verdana, sans-serif; padding: 4px 8px; border: 1px solid #0b2a5c; border-bottom: 0; }
.game-title-bar span { float: right; font-weight: normal; font-size: 10px; color: #dbe6ff; }

/* ---- footer ---- */
footer.site { margin: 20px 12px 0; padding-top: 8px; border-top: 1px solid var(--pg-line); color: #8a8f9c; font-size: 10px; text-align: center; line-height: 1.6; }
footer.site a { color: #9ec5ff; }
footer.site .legal { font-size: 9px; color: #6b707c; margin-top: 4px; }
footer.site .badges { margin-top: 6px; }
footer.site .badges span { display: inline-block; border: 1px solid #444; background: linear-gradient(#2a2f3c, #1c2029); font: bold 8px Verdana, sans-serif; color: #c9ccd4; padding: 2px 5px; margin: 0 2px; }

/* Game shell */
.game { background: var(--bg-2); color: var(--ink); border-radius: 3px; box-shadow: inset 0 0 0 1px #000, 0 0 0 4px #3a4152, 0 0 0 5px #0a0c10, 2px 3px 10px rgba(0,0,0,.6); padding: 22px; margin: 14px 5px 10px; }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.game-head h1 { font-family: var(--font-display); font-size: clamp(28px, 5vw, 44px); margin: 0; text-transform: uppercase; }
.game-head h1 span { color: var(--gold); }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--card); padding: 8px 14px; border-radius: 10px; font-weight: 800; font-size: 14px; }
.stat b { color: var(--gold); }
.stat.streak b { color: var(--green); }
.stat.hearts b { color: var(--red); letter-spacing: 2px; }
.prompt { font-size: clamp(20px, 3.5vw, 30px); font-weight: 800; margin: 14px 0; min-height: 1.4em; }
.prompt .big { font-family: var(--font-display); font-size: clamp(40px, 8vw, 72px); color: var(--gold); letter-spacing: 2px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.choice {
  background: var(--card); color: var(--ink); border: 2px solid transparent; border-radius: 12px; padding: 18px 12px;
  font-size: 22px; font-weight: 800; cursor: pointer; transition: transform .06s, border-color .1s, background .1s;
}
.choice:hover { border-color: var(--gold); }
.choice:active { transform: scale(.97); }
.choice.right { background: var(--green); color: #052; border-color: var(--green); }
.choice.wrong { background: var(--red); color: #fff; border-color: var(--red); }
.answer-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
input.answer {
  flex: 1; min-width: 160px; font-size: 24px; font-weight: 800; padding: 12px 16px; border-radius: 12px;
  border: 2px solid #333; background: var(--card); color: var(--ink); outline: none;
}
input.answer:focus { border-color: var(--gold); }
.feedback { min-height: 1.6em; margin-top: 12px; font-weight: 800; font-size: 18px; }
.feedback.good { color: var(--green); }
.feedback.bad { color: var(--red); }
.timer-bar { height: 8px; background: #2a2a38; border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.timer-bar > div { height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), var(--gold), var(--red)); transition: width .1s linear; }
.overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.82); border-radius: var(--radius); display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; text-align: center; padding: 24px; gap: 12px; z-index: 5; overflow-y: auto;
}
/* auto margins center the content when it fits and let it scroll (instead of leaking out both ends) when it doesn't */
.overlay > :first-child { margin-top: auto; }
.overlay > :last-child { margin-bottom: auto; }
.overlay > * { flex-shrink: 0; }
.overlay h2 { font-family: var(--font-display); font-size: clamp(32px, 6vw, 60px); margin: 0; text-transform: uppercase; color: var(--gold); }
.overlay p { color: #ddd; max-width: 480px; margin: 0; }
.game { position: relative; }
.hidden { display: none !important; }
.money-pile { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.bill { background: #2f7d4a; color: #d8ffe4; font-family: var(--font-display); font-size: 22px; padding: 10px 14px; border-radius: 6px; border: 2px solid #9fe0b3; min-width: 74px; text-align: center; box-shadow: 0 3px 0 #1c4d2c; }
.coin { background: #b9b9b9; color: #222; font-weight: 900; font-size: 13px; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 3px solid #e8e8e8; box-shadow: 0 3px 0 #777; }
.coin.penny { background: #b87333; color: #fff; border-color: #e0a06f; box-shadow: 0 3px 0 #7a4a1c; }
.dice { display: flex; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.die { width: 72px; height: 72px; background: #fff; color: #111; border-radius: 12px; display: grid; place-items: center; font-size: 40px; font-weight: 900; box-shadow: 0 6px 0 #999; }
.die.small { width: 52px; height: 52px; font-size: 28px; }
.vs { align-self: center; font-family: var(--font-display); font-size: 28px; color: var(--muted); }
.story { background: var(--card); border-left: 4px solid var(--gold); padding: 14px 16px; border-radius: 8px; font-size: 18px; line-height: 1.5; }
.leaderboard { margin-top: 18px; font-size: 14px; color: var(--muted); }
.leaderboard b { color: var(--gold); }
kbd { background: #2a2a38; padding: 2px 6px; border-radius: 4px; font-size: 12px; border: 1px solid #444; }
@media (max-width: 600px) { .game { padding: 16px; } nav.top a { margin-left: 10px; } }

/* --- action / puzzle additions --- */
canvas.stage { display: block; width: min(100%, calc((100vh - 170px) * var(--ar, 1.7778))); height: auto; max-width: none; margin: 0 auto; background: #0e0e15; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); touch-action: none; }
.dpad { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; justify-content: center; margin-top: 12px; }
.dpad button { height: 48px; font-size: 20px; background: var(--card); color: var(--ink); border: 1px solid #333; border-radius: 10px; cursor: pointer; }
.dpad button:active { background: var(--gold); color: #111; }
.dpad .blank { visibility: hidden; }
.holes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px auto 0; max-width: 520px; }
.hole { aspect-ratio: 1; background: var(--card); border-radius: 14px; display: grid; place-items: center; font-size: clamp(34px, 8vw, 60px); cursor: pointer; user-select: none; border: 2px solid transparent; position: relative; overflow: hidden; }
.hole .who, .hole .tag { transition: transform .12s, opacity .12s; transform: translateY(160%); opacity: 0; }
.hole.up .who, .hole.up .tag { transform: translateY(0); opacity: 1; }
.hole.hit { border-color: var(--green); }
.hole.oops { border-color: var(--red); background: rgba(255,77,90,.2); }
.hole .tag { position: absolute; bottom: 6px; left: 0; right: 0; font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; letter-spacing: .5px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
@media (min-width: 560px) { .cards { grid-template-columns: repeat(6, 1fr); } }
.mcard { aspect-ratio: 3/4; perspective: 600px; cursor: pointer; }
.mcard .inner { position: relative; width: 100%; height: 100%; transition: transform .35s; transform-style: preserve-3d; }
.mcard.flip .inner { transform: rotateY(180deg); }
.mcard .face { position: absolute; inset: 0; border-radius: 10px; display: grid; place-items: center; backface-visibility: hidden; font-size: clamp(28px, 6vw, 44px); }
.mcard .back { background: linear-gradient(135deg, #2a1f4d, #3a2a0a); border: 2px solid rgba(245,197,24,.4); font-family: var(--font-display); color: var(--gold); font-size: 22px; }
.mcard .front { background: var(--card); transform: rotateY(180deg); border: 2px solid #333; }
.mcard.done .front { border-color: var(--green); opacity: .55; }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; min-height: 60px; }
.tile { background: var(--gold); color: #111; font-family: var(--font-display); font-size: 28px; width: 52px; height: 56px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 #a67f00; user-select: none; border: 0; }
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 #a67f00; }
.tile.used { visibility: hidden; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; min-height: 60px; }
.slot { width: 52px; height: 56px; border-radius: 8px; border: 2px dashed #444; display: grid; place-items: center; font-family: var(--font-display); font-size: 28px; color: var(--ink); background: var(--card); cursor: pointer; }
.slot.filled { border-style: solid; border-color: var(--gold); }
.simon { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 420px; margin: 14px auto 0; }
.pad { aspect-ratio: 1; border-radius: 16px; border: 0; cursor: pointer; font-size: clamp(36px, 8vw, 64px); opacity: .55; transition: opacity .08s, transform .08s; display: grid; place-items: center; }
.pad.lit, .pad:active { opacity: 1; transform: scale(.97); }
.pad[data-i="0"] { background: #ff4d5a; } .pad[data-i="1"] { background: #35d07f; } .pad[data-i="2"] { background: #f5c518; } .pad[data-i="3"] { background: #8b5cf6; }
.pad:disabled { cursor: default; }

/* ---- embedded inside The Block ---- */
html.embed body { background: #0b0b0f; }
html.embed .wrap { max-width: none; margin: 0; border: 0; box-shadow: none; background: #0b0b0f; padding: 6px; }
html.embed header.site, html.embed nav.top, html.embed .crumbs, html.embed .game-title-bar, html.embed .gamebar, html.embed .wrap > .ad, html.embed footer.site { display: none !important; }
html.embed .game { margin: 0; box-shadow: none; border-radius: 0; }

/* ---- game pop-up (index) ---- */
#playModal { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.82); display: flex; flex-direction: column; }
#playModal .bar { background: linear-gradient(#3f6fb8, #1e4d9b); color: #fff; font: bold 13px Verdana, sans-serif; padding: 6px 12px; display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--pg-orange); }
#playModal .bar small { font-weight: normal; color: #dbe6ff; font-size: 11px; }
#playModal .bar .sp { flex: 1; }
#playModal .bar a { color: #fff; font-size: 11px; }
#playModal iframe { flex: 1; width: 100%; border: 0; background: #0b0b0f; }

.logo-badge { position: absolute; left: 10px; top: 8px; width: 200px; height: 45px; pointer-events: none; opacity: .92; z-index: 3; }
.game .game-head h1 { display: none; }
.game > .game-head { justify-content: flex-end; min-height: 40px; padding-left: 210px; }
@media (max-width: 600px) { .logo-badge { width: 140px; height: 32px; } .game > .game-head { padding-left: 150px; min-height: 30px; } }

/* ---- in-window game UI: HUD/feedback/pads overlay the canvas instead of sitting above/below it ---- */
.stagebox { position: relative; margin: 0 auto; max-width: 100%; }
.stagebox > canvas.stage { display: block; margin: 0 auto; }
.stagebox > .game-head { position: absolute; top: 8px; left: 10px; right: 10px; margin: 0; z-index: 3; pointer-events: none; align-items: flex-start; }
.stagebox > .game-head button, .stagebox > .game-head a { pointer-events: auto; }
.stagebox > .game-head h1 { font-size: 22px; text-shadow: 0 2px 4px #000, 0 0 12px rgba(0,0,0,.8); }
.stagebox .stat { background: rgba(0,0,0,.62); padding: 5px 10px; font-size: 13px; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.stagebox > .timer-bar { position: absolute; top: 46px; left: 170px; right: 10px; z-index: 3; margin: 0; pointer-events: none; }
.stagebox > .feedback { position: absolute; top: 44px; left: 10px; right: 10px; margin: 0; text-align: center; z-index: 3; pointer-events: none; text-shadow: 0 2px 4px #000, 0 0 10px #000; font-size: 16px; }
.stagebox > .timer-bar ~ .feedback { top: 62px; }
.stagebox > .pads, .stagebox > .dpad { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 4; margin: 0; }
.stagebox > .pads button, .stagebox > .dpad button { opacity: .7; }
.overlay .howto { font-size: 12px; color: var(--muted); max-width: 680px; margin: 2px 0 10px; }

.stagebox > .game-head { justify-content: flex-end; }

/* ---- shared shell: banner ads top/bottom, skyscrapers left/right, leave button inside the game window ---- */
.ad.banner { margin: 6px 5px 0; padding: 8px; }
.ad.banner.bottom { margin: 0 5px 10px; }
/* note: don't name anything wrapping the game 'ad*' — ad blockers hide it (learned the hard way) */
.midrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 0 5px; }
.midrow .ad.sky { width: 160px; min-height: 600px; margin: 14px 0 0; padding: 8px; display: flex; flex-direction: column; justify-content: center; position: sticky; top: 8px; }
.midrow .game { margin-left: 0; margin-right: 0; }
.midcol { min-width: 0; }
@media (max-width: 1100px) { .midrow .ad.sky { display: none; } }
.leave-btn { position: absolute; top: 8px; right: 10px; z-index: 6; background: linear-gradient(#e94b5a, #b3121f); color: #fff; font: bold 12px Verdana, sans-serif; text-decoration: none; padding: 6px 10px; border-radius: 6px; border: 1px solid #7a0c15; box-shadow: 0 1px 3px rgba(0,0,0,.6); }
.leave-btn:hover { filter: brightness(1.1); }
.game.has-leave .stagebox > .game-head { right: 150px; }
.game.has-leave > .game-head { padding-right: 140px; }
.stagebox > .game-head h1 { display: none; }

/* ---- mobile ---- */
button, .btn, .pads button { touch-action: manipulation; }
@media (max-width: 700px) {
  header.site { padding: 8px 10px; }
  .logo { font-size: 20px; letter-spacing: 0; }
  .logo small { font-size: 7px; letter-spacing: .5px; }
  .hdr-right { display: none; }
  nav.top { font-size: 12px; padding: 4px 6px; }
  nav.top a { margin: 0 3px; }
  .ad.banner { padding: 6px; font-size: 10px; margin: 4px 4px 0; }
  .ad.banner b { font-size: 10px; }
  .game-title-bar { font-size: 12px; padding: 5px 8px; }
  .game-title-bar span { display: none; }
  .midrow { padding: 0 4px; gap: 0; }
  .game { padding: 8px; margin: 8px 0; }
  .game-head { gap: 6px; margin-bottom: 8px; }
  .game-head h1 { font-size: 22px; }
  .stat { padding: 4px 8px; font-size: 12px; }
  .stagebox .stat { font-size: 10px; padding: 3px 6px; }
  .stagebox > .game-head { top: 4px; left: 4px; right: 4px; }
  .stagebox > .feedback { font-size: 12px; top: 34px; }
  .stagebox > .timer-bar { top: 30px; left: 4px; right: 4px; }
  .game.has-leave .stagebox > .game-head { right: 4px; padding-right: 96px; }
  .game.has-leave > .game-head { padding-right: 96px; }
  .leave-btn { top: 4px; right: 4px; font-size: 11px; padding: 5px 8px; }
  /* overlays (start / game over / customizer / perks) go full-screen and scroll on phones */
  .overlay { position: fixed; inset: 0; border-radius: 0; overflow-y: auto; justify-content: flex-start; padding: max(16px, 5vh) 12px 24px; gap: 10px; z-index: 50; }
  .overlay h2 { font-size: 30px; }
  .overlay p { font-size: 13px; }
  .overlay .howto { font-size: 11px; }
  .overlay.hm-souls > .hm-death { width: calc(100% + 24px); margin: 0 -12px 4px; }
  .gamebar { font-size: 11px; padding: 6px 8px; }
  .gamebar .r { display: block; float: none; margin-top: 4px; }
  .page { padding: 8px; }
  .gamelist { columns: 1 !important; }
  .sponsored .row { grid-template-columns: 1fr 1fr; }
}
/* portrait phones: touch pads under the canvas (a 16:9 canvas is too short to cover), plus a rotate hint */
@media (orientation: portrait) and (max-width: 700px) {
  .stagebox > .pads, .stagebox > .dpad { position: static; margin: 6px 0 0; }
  .stagebox > .pads button, .stagebox > .dpad button { opacity: 1; }
  .game.has-leave .stagebox::after { content: '↻ Rotate your phone for a bigger game'; display: block; text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0 0; }
}
/* landscape phones: let the game window fill the screen height (page scrolls to it) */
@media (max-height: 500px) {
  canvas.stage { width: min(100%, calc((100vh - 8px) * var(--ar, 1.7778))); }
  .game { padding: 6px; }
  .midrow { padding: 0 2px; }
}
@media (hover: none) and (pointer: coarse) { .stagebox .pads button small { display: none; } }

/* ---- Souls-style death banner (HM.deathBanner) ---- */
.hm-death { position: absolute; inset: 0; z-index: 60; pointer-events: none; display: flex; align-items: center; justify-content: center; opacity: 0; animation: hmDeathIn .5s ease-out forwards; }
.hm-death.out { animation: hmDeathOut .7s ease-in forwards; }
.hm-death .band { width: 100%; padding: 26px 0 30px; background: linear-gradient(90deg, rgba(90,0,0,0) 0%, rgba(110,0,0,.88) 12%, rgba(110,0,0,.88) 88%, rgba(90,0,0,0) 100%); box-shadow: 0 0 40px rgba(0,0,0,.6); text-align: center; }
.hm-death .txt { font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif, "SerenityOS Emoji"; font-size: clamp(34px, 8vw, 88px); letter-spacing: .12em; color: #e9d7a3; text-shadow: 0 0 18px rgba(255,120,80,.55), 0 2px 2px #000; animation: hmDeathText 3.2s ease-out forwards; }
.hm-death .sub { font: 14px/1.4 Verdana, sans-serif; color: #f1d9d9; margin-top: 6px; letter-spacing: .05em; opacity: .9; }
@keyframes hmDeathIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes hmDeathOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes hmDeathText { 0% { transform: scale(.92); letter-spacing: .06em; } 100% { transform: scale(1.06); letter-spacing: .2em; } }
/* death banner mounted inside a game-over overlay */
.overlay.hm-souls > .hm-death { position: static; inset: auto; width: calc(100% + 48px); margin: -12px -24px 4px; opacity: 1; animation: hmDeathIn .5s ease-out forwards; }
.overlay.hm-souls > h2 { display: none; }
.overlay.hm-souls > :not(.hm-death) { transition: opacity .7s ease; }
.overlay.hm-souls.hm-wait > :not(.hm-death) { opacity: 0; pointer-events: none; }

