/* The Necromancer's Curse: a haunted-ruins board for a phone held upright. Everything is sized from #app (cqw / cqh). */
@font-face { font-family: Bebas; src: url(../assets/fonts/BebasNeue.ttf); font-display: swap; }
@font-face { font-family: Urb; font-weight: 400; src: url(../assets/fonts/Urbanist-400.ttf); font-display: swap; }
@font-face { font-family: Urb; font-weight: 600; src: url(../assets/fonts/Urbanist-600.ttf); font-display: swap; }
@font-face { font-family: Urb; font-weight: 700; src: url(../assets/fonts/Urbanist-700.ttf); font-display: swap; }

:root { --ink: #ecefe6; --soft: #a9b8a3; --gold: #f0c869; --rot: #8be04a; --blood: #e5484d; --cure: #5fe3a1; --night: #0b1410; --sq1: #e9e2cc; --sq2: #7d8f6c; }
html, body { height: 100%; margin: 0; background: #050806; }
body { font-family: Urb, system-ui, sans-serif; color: var(--ink); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; }
#app { position: relative; width: 100%; max-width: 520px; height: 100%; height: 100dvh; margin: 0 auto; container-type: size; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 40%, #1d2e22 0%, #0d1812 55%, #050806 100%); box-shadow: 0 0 60px rgba(0, 0, 0, .8); }
#screen, #overlay, #mist { position: absolute; inset: 0; }
#screen { z-index: 1; } #overlay { z-index: 10; } #overlay:empty { pointer-events: none; }

/* drifting graveyard mist behind everything. No blur filter or blend mode: on iPhone Safari a wide, blurred, animated layer made the pieces above it flicker. */
#mist { pointer-events: none; overflow: hidden; }
.mf { position: absolute; left: 0; width: 200%; height: 40%; background-repeat: repeat-x; background-size: 50% 100%; opacity: .55; animation: drift 50s linear infinite;
  background-image: radial-gradient(ellipse 40% 30% at 29% 50%, rgba(170, 220, 160, .28), transparent 70%), radial-gradient(ellipse 35% 24% at 74% 40%, rgba(200, 230, 200, .22), transparent 70%); }
.mf.m1 { top: 8%; } .mf.m2 { bottom: 4%; animation-duration: 74s; animation-direction: reverse; }
@keyframes drift { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .mf { animation: none; } }

.btn { border: 0; border-radius: 12px; padding: 11px 16px; font: 700 15px/1.2 Urb; color: var(--ink); background: #2a4733; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(#ffd96f, #e2a62c); color: #2e1f00; }
.btn.ghost { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .2); box-shadow: none; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.big { display: block; width: 100%; padding: 13px 18px 12px; text-align: left; border-radius: 16px; }
.btn.big b { display: block; font: 400 27px/1 Bebas; letter-spacing: .04em; }
.btn.big small { display: block; font: 600 13px/1.3 Urb; opacity: .85; margin-top: 3px; }
.btn.locked { background: rgba(255, 255, 255, .05); border: 1px dashed rgba(255, 255, 255, .25); color: #b9c3b4; }
.btn.locked b::after { content: " 🔒"; font-size: 20px; }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- title */
.title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 11px; overflow: auto; padding: max(18px, env(safe-area-inset-top)) 18px max(14px, env(safe-area-inset-bottom)); box-sizing: border-box; }
.brand { font: 700 13px Urb; letter-spacing: .3em; color: var(--gold); text-transform: uppercase; margin-top: 2px; }
.logo { font: 400 min(56px, 13cqw)/.9 Bebas; letter-spacing: .02em; text-align: center; color: #fff; text-shadow: 0 0 22px rgba(139, 224, 74, .35), 0 3px 0 #000; }
.logo span { display: block; color: var(--rot); }
.tag { margin: 0; text-align: center; color: var(--soft); font-size: 14px; max-width: 360px; }
.duel { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.duel img { width: min(70px, 16cqw); border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .6); }
.duel .vs { font: 400 26px Bebas; color: var(--blood); }
.btns { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.seg { display: flex; align-items: center; gap: 6px; font-weight: 700; justify-content: center; }
.seg span { color: var(--soft); margin-right: 4px; }
.seg button { border: 1.5px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); border-radius: 999px; padding: 7px 16px; font-weight: 700; }
.seg button.on { background: var(--gold); border-color: var(--gold); color: #2e1f00; }
.soft { color: var(--soft); } .lvl { font-size: 13px; text-align: center; margin: -4px 0 0; }
.promo { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 380px; box-sizing: border-box; padding: 10px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: rgba(0, 0, 0, .35); border: 1px solid rgba(240, 200, 105, .35); margin-top: auto; }
.promo img { flex: none; width: 76px; border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .6); transform: rotate(-3deg); }
.promo .pt { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 0; }
.promo small { font: 600 11.5px/1.2 Urb; color: var(--soft); } .promo b { font: 400 21px/1 Bebas; letter-spacing: .03em; } .promo em { font: 400 12.5px/1.3 Urb; color: var(--soft); font-style: normal; }
.promo .btn { margin-top: 4px; padding: 8px 12px; font-size: 14px; }
.promo.big { margin-top: 6px; } .promo.big img { width: min(32cqw, 120px); }

/* ---------------------------------------------------------------- the game */
.game { position: absolute; inset: 0; display: flex; flex-direction: column; padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)); box-sizing: border-box; gap: 8px; }
.bar { display: flex; align-items: center; gap: 8px; flex: none; }
.bar .who { flex: 1; min-width: 0; }
.bar .who b { display: block; font: 400 22px/1 Bebas; letter-spacing: .04em; }
.bar .who small { font-size: 12px; color: var(--soft); }
.chip { font: 700 12px Urb; padding: 5px 9px; border-radius: 999px; background: rgba(0, 0, 0, .4); border: 1px solid rgba(255, 255, 255, .15); white-space: nowrap; }
.chip.rit { color: #d7b4ff; border-color: rgba(190, 140, 255, .4); }
.board { position: relative; width: min(100cqw - 20px, 100cqh - 250px); aspect-ratio: 1; margin: 0 auto; flex: none; display: grid; grid-template: repeat(8, 1fr) / repeat(8, 1fr);
  border: 4px solid #3b2f1e; border-radius: 6px; box-shadow: 0 0 0 2px #0008, 0 14px 40px rgba(0, 0, 0, .7), 0 0 50px rgba(139, 224, 74, .12); }
.sq { position: relative; background: var(--sq1); }
.sq.dk { background: var(--sq2); }
.sq.last { box-shadow: inset 0 0 0 100px rgba(240, 200, 105, .28); }
.sq.fear::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(160, 90, 255, .16) 0 4px, transparent 4px 9px); pointer-events: none; }
.sq.sel { box-shadow: inset 0 0 0 100px rgba(95, 227, 161, .45); }
.sq.tgt::before { content: ""; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; margin: -15% 0 0 -15%; border-radius: 50%; background: rgba(20, 60, 30, .45); z-index: 3; pointer-events: none; }
.sq.tgt.cap::before { width: 86%; height: 86%; margin: -43% 0 0 -43%; background: transparent; border: 4px solid rgba(229, 72, 77, .8); box-sizing: border-box; }
.sq.tgt.act::before { width: 70%; height: 70%; margin: -35% 0 0 -35%; background: rgba(139, 224, 74, .35); border: 3px solid var(--rot); box-sizing: border-box; animation: pulse 1.2s ease-in-out infinite; }
.sq.check { box-shadow: inset 0 0 18px 6px rgba(229, 72, 77, .95); }
.sq.checker::after { content: ""; position: absolute; inset: 3%; border: 3px solid rgba(229, 72, 77, .95); border-radius: 16%; z-index: 4; pointer-events: none; animation: pulse 1s ease-in-out infinite; }
.coord { position: absolute; font: 700 9px Urb; opacity: .55; pointer-events: none; }
.coord.f { right: 3px; bottom: 1px; } .coord.r { left: 3px; top: 1px; }
.sq:not(.dk) .coord { color: #5e6f4f; } .sq.dk .coord { color: #e9e2cc; }
.pc { position: absolute; inset: 7%; z-index: 2; border-radius: 14%; overflow: hidden; box-shadow: 0 2px 5px rgba(0, 0, 0, .55); transition: transform .28s cubic-bezier(.2, .8, .3, 1); }
.pc img { width: 100%; height: 100%; display: block; pointer-events: none; }
.pc.b { box-shadow: 0 2px 6px rgba(0, 0, 0, .7), 0 0 0 1.5px rgba(139, 224, 74, .45); }
.shield { position: absolute; right: 2%; top: 2%; width: 30%; height: 30%; z-index: 4; pointer-events: none; filter: drop-shadow(0 1px 1px #000); }
.pc.rise { animation: rise .6s ease-out; } .pc.cured { animation: cure .7s ease-out; }
.flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; animation: flash .7s ease-out forwards; }
@keyframes pulse { 50% { transform: scale(.88); } }
@keyframes rise { 0% { transform: translateY(40%) scale(.4); opacity: 0; filter: brightness(2) hue-rotate(60deg); } 100% { transform: none; opacity: 1; } }
@keyframes cure { 0% { filter: brightness(2.2); transform: scale(1.15); } 100% { filter: none; transform: none; } }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

.info { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: 9px 12px; overflow: auto; }
.info .say { font-size: 14px; line-height: 1.35; min-height: 19px; }
.info .say.log { color: var(--gold); }
.info .pk { display: flex; gap: 10px; align-items: flex-start; }
.info .pk img { width: 44px; border-radius: 8px; flex: none; }
.info .pk b.nm { font: 400 19px/1 Bebas; letter-spacing: .04em; } .info .pk p b { color: #d7f5b6; } .info .pk p { margin: 2px 0 0; font-size: 13px; line-height: 1.32; color: #d6dccf; }
.info .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.think { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rot); margin-right: 6px; animation: pulse .8s ease-in-out infinite; }

/* ---------------------------------------------------------------- overlays */
.ov { position: absolute; inset: 0; background: rgba(3, 8, 5, .84); display: grid; place-items: center; padding: 16px; box-sizing: border-box; }
.panel { width: 100%; max-width: 420px; max-height: calc(100cqh - 32px); box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; padding: 18px; background: linear-gradient(#18271d, #0e1912);
  border: 1px solid rgba(240, 200, 105, .35); border-radius: 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.panel h2 { margin: 0; font: 400 32px/1 Bebas; letter-spacing: .04em; color: var(--gold); text-align: center; }
.panel .body { font-size: 15px; line-height: 1.45; overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; }
.panel .body p { margin: 0 0 9px; } .panel .body h3 { font: 400 20px/1 Bebas; letter-spacing: .05em; color: var(--gold); margin: 12px 0 6px; }
.panel.result { text-align: center; } .panel.result .promo { text-align: left; } .panel.result.won h2 { font-size: 46px; color: var(--rot); }
.ros { display: grid; gap: 6px; } .ro { display: flex; gap: 9px; align-items: flex-start; } .ro img { width: 38px; border-radius: 7px; flex: none; } .ro p { margin: 0; font-size: 13.5px; }
.ro b.n { font: 400 17px/1 Bebas; letter-spacing: .04em; display: block; }
.promos { display: flex; gap: 10px; justify-content: center; } .promos button { background: none; border: 0; padding: 0; } .promos img { width: 64px; border-radius: 10px; }
.unl { background: rgba(139, 224, 74, .15); border: 1px solid var(--rot); border-radius: 12px; padding: 8px 10px; color: #d8f7c0; font-weight: 700; font-size: 14px; }

/* ---------------------------------------------------------------- more games: title teaser */
.teaser { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 380px; box-sizing: border-box; margin-top: auto; padding: 12px 12px 12px 10px; border-radius: 16px; text-align: left; color: var(--ink);
  background: linear-gradient(135deg, rgba(240, 200, 105, .16), rgba(0, 0, 0, .35) 60%); border: 1px solid rgba(240, 200, 105, .55); box-shadow: 0 8px 24px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); }
.teaser:active { transform: translateY(1px); }
.teaser .fan { position: relative; flex: none; width: 112px; height: 50px; }
.teaser .fan img { position: absolute; left: 50%; top: 4px; width: 40px; height: 40px; margin-left: -20px; border-radius: 9px; box-shadow: 0 3px 8px rgba(0, 0, 0, .6);
  transform: translateX(calc(var(--i) * 6px)) rotate(calc(var(--i) * 5deg)); transform-origin: 50% 230%; }
.teaser .tt { flex: 1; min-width: 0; }
.teaser .tt b { display: block; font: 400 21px/1.02 Bebas; letter-spacing: .03em; color: var(--gold); }
.teaser .tt small { display: block; margin-top: 3px; font: 600 12px/1.3 Urb; color: var(--soft); }
.teaser .arr { flex: none; font: 400 34px/1 Urb; color: var(--gold); margin-top: -4px; }
@media (prefers-reduced-motion: no-preference) { .teaser .arr { animation: nudge 1.6s ease-in-out infinite; } }
@keyframes nudge { 50% { transform: translateX(4px); } }

/* ---------------------------------------------------------------- more games: the sheet */
.sheet { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: radial-gradient(120% 50% at 50% 0%, #22382a 0%, #0d1812 45%, #070c09 100%); }
.sh-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: max(8px, env(safe-area-inset-top)) 10px 8px 16px;
  background: rgba(8, 14, 10, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(240, 200, 105, .2); }
.sh-top span { font: 700 12px Urb; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); }
.sh-top .x { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(5, 10, 7, .75); font-size: 16px; backdrop-filter: blur(6px); }
.sh-in { padding: 18px 16px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; max-width: 460px; margin: 0 auto; }
.sheet .kick { margin: 0; text-align: center; font: 700 12px Urb; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.sheet h2 { margin: 0; text-align: center; font: 400 min(44px, 11cqw)/.95 Bebas; letter-spacing: .02em; color: #fff; text-shadow: 0 3px 0 #000; }
.sheet .intro { margin: -4px 0 4px; text-align: center; font-size: 14.5px; line-height: 1.45; color: var(--soft); }
.mg { border-radius: 18px; overflow: hidden; background: linear-gradient(#17261c, #0f1a13); border: 1px solid rgba(240, 200, 105, .28); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.mg .art { position: relative; aspect-ratio: 640 / 300; overflow: hidden; }
.mg .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, #17261c 100%); }
.mg .no, .mg .lv { position: absolute; top: 10px; z-index: 1; font: 700 12px Urb; padding: 5px 10px; border-radius: 999px; background: rgba(5, 10, 7, .72); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(4px); }
.mg .no { left: 10px; color: var(--gold); letter-spacing: .06em; text-transform: uppercase; } .mg .lv { right: 10px; color: #f3e6c0; }
.mg .mt { position: relative; z-index: 1; margin-top: -26px; padding: 0 14px 14px; }
.mg h3 { margin: 0; font: 400 30px/1 Bebas; letter-spacing: .03em; color: #fff; text-shadow: 0 2px 8px #000; }
.mg .tg { margin: 4px 0 12px; font-size: 13.5px; line-height: 1.4; color: var(--soft); }
.mg .pw { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .08); }
.mg .pw img { flex: none; width: 68px; height: 68px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, .6), 0 0 0 2px rgba(240, 200, 105, .5); }
.mg .pw p { margin: 0; }
.mg .is { font-size: 15px; line-height: 1.3; } .mg .is b { color: #fff; }
.mg .ab { margin-top: 5px !important; font-size: 13.5px; line-height: 1.42; color: #d6dccf; } .mg .ab b { color: var(--gold); }
.mcta { margin-top: 6px; padding: 18px 16px 16px; border-radius: 20px; text-align: center; border: 1.5px solid var(--gold);
  background: radial-gradient(120% 90% at 50% 0%, rgba(240, 200, 105, .22), rgba(0, 0, 0, .35) 70%); box-shadow: 0 0 40px rgba(240, 200, 105, .15); }
.mcta .k { margin: 0 0 14px; font: 400 26px/1.05 Bebas; letter-spacing: .03em; color: var(--gold); }
.mcta .bk { display: flex; gap: 14px; align-items: center; text-align: left; }
.mcta .bk img { flex: none; width: min(34cqw, 130px); border-radius: 4px; box-shadow: 0 10px 24px rgba(0, 0, 0, .7); transform: rotate(-3deg); }
.mcta .bk b { display: block; font: 400 30px/1 Bebas; letter-spacing: .03em; color: #fff; }
.mcta .bk em { display: block; font: 600 13px/1.3 Urb; font-style: normal; color: var(--gold); margin-top: 2px; }
.mcta ul { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.35; color: #d6dccf; }
.mcta li { position: relative; padding-left: 16px; margin-top: 4px; } .mcta li::before { content: "✓"; position: absolute; left: 0; color: var(--rot); font-weight: 700; }
.mcta .buy { display: block; margin-top: 16px; padding: 14px; font-size: 17px; text-decoration: none; border-radius: 14px; }
.sheet .back { align-self: center; }
