/* Grand Theft Flag · Palm Haven */
:root {
  --pink: #ff4fa3;
  --teal: #2dd4bf;
  --sun: #ffb347;
  --ink: #0b0b12;
  --hud: rgba(12, 10, 24, 0.62);
  --bebas: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --mono: "Share Tech Mono", ui-monospace, Menlo, Consolas, monospace;
  --ui: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0b12; color: #fff; font-family: var(--ui); }
body.game-page { overflow: hidden; user-select: none; -webkit-user-select: none; }
#game, #game canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
button { font: inherit; cursor: pointer; }
kbd { font-family: var(--bebas); }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.6); }
#hud.show { opacity: 1; }
.bars { position: absolute; top: 18px; left: 22px; display: grid; gap: 6px; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; font-size: 12px; border: 1.5px solid rgba(255,255,255,.7); }
.bar > div { width: 150px; height: 9px; background: rgba(0,0,0,.45); border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #2dd4bf, #67e8f9); transition: width .2s; }
.bar.eye span { background: linear-gradient(90deg, #a78bfa, #c084fc); width: 0; }
#help { position: absolute; top: 76px; left: 22px; max-width: 360px; padding: 12px 14px; background: rgba(8, 6, 18, .78); border-left: 3px solid var(--pink); font-size: 14px; line-height: 1.45; opacity: 0; transform: translateX(-12px); transition: .3s; text-shadow: none; }
#help.show { opacity: 1; transform: none; }
#help b { color: #fde68a; }
#help .cash { color: #4ade80; font-size: 20px; font-family: var(--bebas); letter-spacing: 1px; }
.topright { position: absolute; top: 14px; right: 24px; text-align: right; }
#stars { font-size: 28px; letter-spacing: 2px; line-height: 1; }
#stars span { color: rgba(255,255,255,.18); -webkit-text-stroke: 1px rgba(255,255,255,.35); transition: color .2s; }
#stars.active span { -webkit-text-stroke: 1.2px #ef4444; }
#stars span.on { color: #fff; -webkit-text-stroke: 1px #fff; }
#stars span.on.dim { color: rgba(255,255,255,.3); }
#money { font-family: var(--bebas); font-size: 34px; letter-spacing: 1px; margin-top: 2px; color: #f8fafc; }
#radio-name { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); font-family: var(--bebas); font-size: 30px; letter-spacing: 3px; color: #fde047; opacity: 0; transition: opacity .3s; }
#radio-name.show { opacity: 1; }
#minimap { position: absolute; left: 22px; bottom: 22px; width: 230px; height: 135px; border-radius: 12px; border: 2px solid rgba(255,255,255,.8); box-shadow: 0 6px 20px rgba(0,0,0,.35); background: #7cc4e4; }
#zone { position: absolute; left: 22px; bottom: 166px; width: 230px; padding: 4px 8px; text-align: center; background: rgba(40, 36, 70, .82); border: 1.5px solid rgba(255,255,255,.4); border-radius: 6px; font-size: 15px; font-weight: 600; opacity: 0; transition: opacity .4s; text-shadow: none; }
#zone.show { opacity: 1; }
#phone-btn { pointer-events: auto; position: absolute; left: 262px; bottom: 22px; width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); background: rgba(0,0,0,.55); font-size: 20px; }
#phone-badge { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--pink); display: none; box-shadow: 0 0 8px var(--pink); }
#phone-badge.show { display: block; }
#objective { position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%); max-width: min(780px, 60vw); text-align: center; font-size: 21px; font-weight: 600; color: #fff; opacity: 0; }
#objective.show { animation: obj 0.6s ease forwards; }
#objective b { color: #f9a8d4; }
@keyframes obj { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
#speed { position: absolute; right: 26px; bottom: 24px; font-family: var(--bebas); font-size: 54px; line-height: 1; opacity: 0; transition: opacity .3s; }
#speed small { font-size: 18px; margin-left: 4px; opacity: .8; }
#speed.show { opacity: 1; }
#toast { position: absolute; bottom: 92px; right: 24px; display: flex; flex-direction: column-reverse; gap: 8px; width: 330px; }
.toast { position: relative; background: rgba(226, 232, 240, .86); color: #0f172a; border-radius: 14px; padding: 10px 12px 10px 58px; min-height: 54px; animation: tin .35s ease; text-shadow: none; font-size: 13.5px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0,0,0,.25); backdrop-filter: blur(6px); }
.toast::before { content: ""; position: absolute; left: 10px; top: 50%; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, transparent 8px, currentColor 8px 11px, transparent 12px), #1e1b4b; color: #f472b6; }
.toast b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1px; filter: brightness(.7) saturate(1.5); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .6s; }
@keyframes tin { from { opacity: 0; transform: translateX(30px); } }
#prompt { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; opacity: 0; transition: opacity .15s; margin: -14px 0 0 -14px; white-space: nowrap; }
#prompt.show { opacity: 1; }
#prompt kbd { width: 28px; height: 28px; border-radius: 50%; background: #f8fafc; color: #111; display: grid; place-items: center; font-size: 18px; box-shadow: 0 0 0 3px rgba(0,0,0,.35); text-shadow: none; }
#prompt span { font-size: 17px; font-weight: 600; }
#waypoint { position: absolute; left: 0; top: 0; margin: -22px 0 0 -40px; width: 80px; text-align: center; opacity: 0; transition: opacity .2s; }
#waypoint.show { opacity: 1; }
#waypoint b { display: block; width: 26px; height: 26px; margin: 0 auto 3px; border-radius: 50%; border: 3px solid #f472b6; box-shadow: 0 0 10px #f472b6, inset 0 0 6px #f472b6; }
#waypoint span { font-family: var(--bebas); font-size: 20px; letter-spacing: 1px; }
#bigtext { position: absolute; top: 34%; left: 0; right: 0; text-align: center; opacity: 0; transform: scale(1.15); transition: opacity .4s, transform .4s; }
#bigtext.show { opacity: 1; transform: none; }
#bigtext h2 { margin: 0; font-family: var(--bebas); font-size: clamp(56px, 9vw, 120px); letter-spacing: 6px; line-height: 1; }
#bigtext p { margin: 6px 0 0; font-size: 18px; font-weight: 600; }
#bigtext.passed h2 { color: #fde047; text-shadow: 0 4px 0 #000, 0 0 30px rgba(253, 224, 71, .6); }
#bigtext.wanted h2 { color: #f87171; text-shadow: 0 4px 0 #000, 0 0 30px rgba(248, 113, 113, .7); }
#bigtext.wasted h2 { color: #e5e7eb; text-shadow: 0 4px 0 #000, 0 0 30px rgba(0,0,0,.9); }
#bigtext.show.wasted::before { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: -1; }
#click-hint { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.6); padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .3s; text-shadow: none; }
#click-hint.show { opacity: .9; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .6s; }
#redout { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s; background: radial-gradient(ellipse at center, rgba(190, 18, 60, .35), rgba(120, 6, 30, .75)); mix-blend-mode: multiply; }
body.dead #redout { opacity: 1; }
body.dead #game canvas { filter: grayscale(1) contrast(1.15) brightness(.9); transition: filter .5s; }
#zone small { font-size: 10px; letter-spacing: 2px; opacity: .7; }
#fade.show { opacity: 1; }

/* ---------------- subtitles ---------------- */
#dialog { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(900px, 86vw); text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s; cursor: pointer; }
#dialog.show { opacity: 1; pointer-events: auto; }
#dialog p { display: inline; margin: 0; padding: 6px 12px; background: rgba(0,0,0,.45); font-size: clamp(18px, 2.1vw, 26px); font-weight: 600; line-height: 1.6; box-decoration-break: clone; -webkit-box-decoration-break: clone; text-shadow: 0 2px 3px #000; }
#dialog p b { font-weight: 800; }
#dialog #dialog-text b { color: #fde68a; }
#dialog small { display: block; margin-top: 10px; font-size: 12px; opacity: .7; letter-spacing: 2px; }

/* ---------------- overlays ---------------- */
.overlay { position: fixed; inset: 0; display: none; place-items: center; background: rgba(5, 4, 14, .55); backdrop-filter: blur(4px); z-index: 20; }
.overlay.show { display: grid; }
.overlay header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.overlay header button, #poster-close { background: none; border: 0; color: inherit; font-size: 20px; opacity: .7; }

/* phone */
#phone { position: fixed; right: 30px; bottom: 30px; width: 340px; height: min(640px, 82vh); border-radius: 38px; background: linear-gradient(160deg, #f8fafc, #e7ecf3 60%, #dfe7ef); color: #0f172a; border: 8px solid #f1f5f9; box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 0 2px #cbd5e1; padding: 16px 12px 12px; display: none; flex-direction: column; z-index: 25; }
#phone.show { display: flex; animation: up .3s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.ph-top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; opacity: .7; padding: 0 12px 10px; }
#phone nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 10px; }
.ph-tab { background: none; border: 0; color: #334155; font-size: 10.5px; font-weight: 700; display: grid; justify-items: center; gap: 4px; padding: 0; }
.ph-tab::before { content: ""; width: 44px; height: 44px; border-radius: 50%; background: #e2e8f0 center/22px no-repeat; box-shadow: 0 2px 6px rgba(15,23,42,.18); }
.ph-tab[data-tab="msgs"]::before { background-color: #38bdf8; background-image: radial-gradient(circle at 35% 50%, #fff 3px, transparent 4px), radial-gradient(circle at 50% 50%, #fff 3px, transparent 4px), radial-gradient(circle at 65% 50%, #fff 3px, transparent 4px); background-size: 100% 100%; }
.ph-tab[data-tab="heist"]::before { background-color: #111827; background-image: linear-gradient(45deg, transparent 40%, #facc15 40% 60%, transparent 60%); background-size: 60% 60%; }
.ph-tab[data-tab="tags"]::before { background-color: #f472b6; background-image: radial-gradient(circle, #fff 5px, transparent 6px), radial-gradient(circle at 70% 30%, #fde68a 4px, transparent 5px); background-size: 100% 100%; }
.ph-tab[data-tab="ride"]::before { background-color: #1e1b4b; background-image: radial-gradient(circle at 50% 45%, transparent 7px, #f472b6 7px 10px, transparent 11px); background-size: 100% 100%; }
.ph-tab[data-tab="help"]::before { background-color: #94a3b8; background-image: radial-gradient(circle, #f8fafc 4px, transparent 5px), conic-gradient(#f8fafc 0 10%, transparent 10% 25%, #f8fafc 25% 35%, transparent 35% 50%, #f8fafc 50% 60%, transparent 60% 75%, #f8fafc 75% 85%, transparent 85%); background-size: 100% 100%, 26px 26px; }
.ph-tab.active::before { box-shadow: 0 0 0 3px #ec4899, 0 2px 8px rgba(236,72,153,.4); }
#phone-body { flex: 1; overflow-y: auto; padding: 4px 4px 10px; font-size: 13px; line-height: 1.45; user-select: text; -webkit-user-select: text; }
#phone-body::-webkit-scrollbar { width: 6px; } #phone-body::-webkit-scrollbar-thumb { background: #3b3558; border-radius: 3px; }
.msg { background: #ffffff; border-radius: 14px; padding: 9px 11px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.msg b { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.msg p { margin: 3px 0 0; color: #1e293b; word-break: break-word; }
.msg b { filter: brightness(.75) saturate(1.4); }
.piece { display: flex; gap: 10px; background: #ffffff; border-radius: 14px; padding: 10px; margin-bottom: 8px; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.piece.done { border-color: #16a34a; }
.pn { flex: 0 0 28px; height: 28px; border-radius: 50%; background: #e2e8f0; color: #334155; display: grid; place-items: center; font-weight: 800; }
.piece.done .pn { color: #fff; }
.piece.done .pn { background: #16a34a; }
.pt { flex: 1; min-width: 0; }
.pt b { display: block; }
.pt span { color: #64748b; font-size: 12px; }
.pt a { display: inline-block; margin-top: 5px; color: #db2777; font-weight: 700; text-decoration: none; }
.pt textarea, .notes textarea { width: 100%; margin-top: 6px; background: #0f172a; color: #a7f3d0; border: 0; border-radius: 8px; font: 11px/1.4 var(--mono); padding: 6px; resize: vertical; min-height: 54px; word-break: break-all; }
.notes { display: block; font-size: 12px; color: #64748b; }
.notes textarea { min-height: 90px; color: #fde68a; }
.ryde h4 { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: #1e1b4b; }
.ryde-btn { display: flex; gap: 10px; align-items: center; width: 100%; margin-top: 7px; padding: 11px 12px; border-radius: 14px; border: 0; background: #ffffff; color: #0f172a; font-weight: 700; text-align: left; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.ryde-btn:hover { background: #fdf2f8; }
.dim { color: #94a3b8; } .small { font-size: 11px; }
.tags { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tags img { width: 100%; border-radius: 8px; background: #2a2545; cursor: zoom-in; }
.tags img.big { position: fixed; left: 50%; top: 50%; width: min(92vw, 900px); transform: translate(-50%, -50%); z-index: 50; box-shadow: 0 0 0 100vmax rgba(0,0,0,.75); cursor: zoom-out; }
.tag-missing { aspect-ratio: 2/1; border-radius: 8px; border: 2px dashed #3b3558; display: grid; place-items: center; text-align: center; color: #64748b; font-weight: 700; }
.keys { width: 100%; border-collapse: collapse; }
.keys td { padding: 5px 4px; border-bottom: 1px solid #e2e8f0; }
.keys td:first-child { font-family: var(--bebas); font-size: 16px; color: #db2777; width: 40%; }
.ph-btn { display: block; width: 100%; margin-top: 10px; padding: 10px; border-radius: 12px; border: 0; background: #1e293b; color: #fff; font-weight: 700; }
.ph-btn.danger { background: #fee2e2; color: #991b1b; }
#phone-body .dim { color: #64748b; }
.tag-missing { border-color: #cbd5e1 !important; color: #94a3b8 !important; }
.ph-home { text-align: center; font-size: 11px; opacity: .45; padding-top: 6px; }

/* terminal */
.term { width: min(820px, 94vw); background: #020a05; border: 2px solid #14532d; border-radius: 10px; box-shadow: 0 0 60px rgba(34, 197, 94, .25), inset 0 0 80px rgba(34,197,94,.06); padding: 16px 20px; font-family: var(--mono); color: #4ade80; }
.term header { border-bottom: 1px solid #14532d; padding-bottom: 8px; letter-spacing: 1px; }
#term-status { margin: 12px 0; font-size: 15px; }
#term-status span { color: #fde047; }
#term-status .good, .good { color: #86efac; }
#term-cols { display: flex; justify-content: center; gap: 10px; margin: 10px 0 14px; }
.tcol { width: 64px; border: 2px solid #14532d; border-radius: 8px; overflow: hidden; background: #03140a; transition: border-color .15s, background .15s; }
.tcol.active { border-color: #22c55e; box-shadow: 0 0 18px rgba(34,197,94,.45); }
.tcol.locked { border-color: #86efac; background: #052e16; }
.tcol.wrong { border-color: #ef4444; background: #2a0606; }
.tcell { height: 34px; display: grid; place-items: center; font-size: 22px; color: #166534; cursor: pointer; }
.tcol.active .tcell { color: #22c55e; }
.tcell.mid { background: rgba(34,197,94,.12); color: #bbf7d0 !important; font-size: 28px; font-weight: 700; }
.tcol.locked .tcell.mid { color: #fff !important; text-shadow: 0 0 10px #86efac; }
.tcell.tried { text-decoration: line-through; opacity: .45; }
#term-log { font-size: 13px; min-height: 120px; color: #22c55e; opacity: .9; }
#term-log .hint { color: #fde047; }
#term-log .good { color: #bbf7d0; }
#term-log .bad { color: #f87171; }
#term-audit { display: none; margin: 10px 0; }
#term-audit.show { display: block; }
#term-audit textarea { width: 100%; height: 120px; background: #000; color: #a7f3d0; border: 1px solid #14532d; font: 12px/1.4 var(--mono); padding: 8px; word-break: break-all; user-select: text; }

/* keypad */
.kp { width: 300px; background: linear-gradient(#4b5563, #1f2937); border-radius: 18px; padding: 16px; border: 3px solid #111827; box-shadow: 0 20px 60px rgba(0,0,0,.6); font-family: var(--mono); }
#kp-display { margin: 12px 0 6px; background: #021a0c; color: #4ade80; font-size: 32px; text-align: center; padding: 10px; border-radius: 8px; letter-spacing: 4px; box-shadow: inset 0 0 12px #000; }
#kp-msg { text-align: center; font-size: 12px; color: #d1d5db; min-height: 18px; margin-bottom: 10px; }
#kp-msg.bad { color: #fca5a5; } #kp-msg.good { color: #86efac; }
.kp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kp-grid button { height: 54px; border-radius: 10px; border: 0; background: linear-gradient(#e5e7eb, #9ca3af); color: #111; font: 700 22px var(--mono); box-shadow: 0 3px 0 #374151; }
.kp-grid button:active { transform: translateY(2px); box-shadow: 0 1px 0 #374151; }
.kp-grid .c { background: linear-gradient(#fca5a5, #dc2626); color: #fff; font-size: 16px; }
.kp-grid .ok { background: linear-gradient(#86efac, #16a34a); color: #fff; font-size: 16px; }
.kp-note { font-size: 10px; text-align: center; color: #9ca3af; margin: 10px 0 0; }

/* laptop */
.laptop { width: min(900px, 94vw); max-height: 86vh; display: flex; flex-direction: column; background: #0d1117; border: 2px solid #30363d; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 70px rgba(0,0,0,.7); }
.laptop header { background: #161b22; padding: 10px 14px; font-family: var(--mono); color: #8b949e; }
#zero-code { flex: 1; margin: 0; overflow: auto; padding: 14px 18px; font: 13px/1.5 var(--mono); color: #e6edf3; white-space: pre; user-select: text; -webkit-user-select: text; }
#zero-code .c { color: #8b949e; } #zero-code .k { color: #ff7b72; } #zero-code .todo { color: #fde047; background: rgba(253,224,71,.12); }
.laptop footer { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; background: #161b22; font-size: 13px; color: #8b949e; }
.laptop footer a { color: #58a6ff; font-weight: 700; text-decoration: none; }

/* gear */
.gear { width: min(760px, 94vw); background: rgba(14, 12, 26, .95); border-radius: 14px; padding: 18px; border: 1px solid #2a2545; }
.gear header { font-family: var(--bebas); font-size: 28px; letter-spacing: 3px; }
#gear-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.gear-card { text-align: left; background: #1a1730; border: 2px solid #2a2545; border-radius: 12px; padding: 14px; color: #e2e8f0; display: grid; gap: 6px; }
.gear-card:hover { border-color: #f472b6; }
.gear-card b { font-size: 16px; } .gear-card span { font-size: 12.5px; color: #94a3b8; }
.gear-card em { font-style: normal; font-family: var(--bebas); letter-spacing: 2px; color: #f9a8d4; font-size: 18px; }
.gear-card.owned { border-color: #16a34a; } .gear-card.owned em { color: #86efac; }
.gear-ico { height: 64px; border-radius: 8px; background: #0f0d1c center/50px no-repeat; }
.gi-mask { background-image: radial-gradient(circle at 50% 60%, #dc2626 0 18px, transparent 19px); }
.gi-laptop { background-image: linear-gradient(#22c55e, #22c55e); background-size: 54px 32px; }
.gi-scanner { background-image: radial-gradient(circle, #fde047 0 6px, transparent 7px), linear-gradient(#475569, #475569); background-size: 100% 100%, 26px 44px; }
.gear .sub { text-align: center; color: #94a3b8; margin: 0; font-size: 14px; }

/* flyers */
#poster-paper { width: min(420px, 88vw); min-height: 520px; padding: 34px 30px; color: #1f2937; font-family: "Permanent Marker", "Comic Sans MS", cursive; box-shadow: 0 30px 80px rgba(0,0,0,.6); transform: rotate(-1.5deg); position: relative; }
#poster-paper::before { content: ""; position: absolute; top: 10px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #dc2626; box-shadow: 0 2px 3px rgba(0,0,0,.4); }
#poster-paper h3 { margin: 10px 0 18px; font-size: 32px; text-align: center; line-height: 1.1; }
#poster-paper p { margin: 4px 0; font-size: 20px; }
#poster-close { position: fixed; top: 24px; right: 30px; font-size: 28px; color: #fff; }
.atm { font-family: var(--ui); color: #ecfeff; text-align: center; }
.atm h3 { font-family: var(--bebas) !important; letter-spacing: 3px; }
.atm button { margin: 16px 0; padding: 14px 20px; border-radius: 10px; border: 0; background: #ecfeff; color: #0f766e; font-weight: 800; }
.atm button:disabled { opacity: .5; cursor: default; }

/* full map */
#bigmap { flex-direction: column; }
#bigmap.show { display: flex; align-items: center; justify-content: center; }
#bigmap canvas { width: min(86vw, 86vh); height: min(86vw, 86vh); border-radius: 12px; border: 3px solid rgba(255,255,255,.5); box-shadow: 0 20px 80px rgba(0,0,0,.6); }
#bigmap p { font-family: var(--bebas); letter-spacing: 4px; margin: 10px 0 0; opacity: .8; }

/* title + loading */
#title { background: radial-gradient(ellipse at 50% 120%, rgba(255, 120, 80, .55), transparent 60%), linear-gradient(180deg, rgba(20, 8, 50, .75), rgba(255, 79, 163, .35) 60%, rgba(255, 179, 71, .45)); backdrop-filter: blur(2px); text-align: center; align-content: center; gap: 10px; }
#title.show { display: grid; }
.logo { display: grid; line-height: .9; transform: rotate(-4deg); }
.logo .l1 { font-family: var(--bebas); font-size: clamp(40px, 7vw, 92px); letter-spacing: 6px; color: #fff; text-shadow: 4px 4px 0 #111; }
.logo .l2 { font-family: "Monoton", var(--bebas); font-size: clamp(70px, 14vw, 190px); color: #fff; background: linear-gradient(90deg, #ff4fa3, #ffb347, #2dd4bf); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(4px 5px 0 #111); }
.logo .l3 { font-family: var(--bebas); font-size: clamp(22px, 3.2vw, 40px); letter-spacing: 14px; color: #fde68a; text-shadow: 2px 2px 0 #111; }
.tag { font-size: 18px; font-weight: 600; margin: 16px 0 4px; text-shadow: 0 2px 4px #000; }
#play { justify-self: center; margin: 8px 0; padding: 14px 64px; border: 0; border-radius: 999px; background: #fff; color: #111; font-family: var(--bebas); font-size: 34px; letter-spacing: 6px; box-shadow: 0 6px 0 #111, 0 0 40px rgba(255, 79, 163, .7); transition: transform .15s; }
#play:hover { transform: translateY(-2px) scale(1.03); }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; max-width: 760px; margin: 10px auto; font-size: 14px; text-shadow: 0 1px 3px #000; }
.controls b { font-family: var(--bebas); font-size: 18px; color: #fde68a; letter-spacing: 1px; }
#title .small { opacity: .85; font-size: 13px; }
#title code { background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 4px; }
#loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: #0b0b12; z-index: 30; transition: opacity .6s; }
#loading.done { opacity: 0; pointer-events: none; }
.spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #2a2545; border-top-color: var(--pink); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; background: #0b0b12; z-index: 40; margin: 0; }

/* ---------------- PHPD records page (Worker-rendered) ---------------- */
body.phpd-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #0b1b3a, #0f172a 60%, #1e1b4b); padding: 24px; font-family: var(--ui); }
.phpd { width: min(720px, 100%); background: #0b1220; border: 1px solid #1e3a8a; border-radius: 14px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.phpd header { display: flex; gap: 14px; align-items: center; border-bottom: 1px solid #1e3a8a; padding-bottom: 14px; margin-bottom: 14px; }
.phpd header h1 { margin: 0; font-family: var(--bebas); letter-spacing: 3px; font-size: 32px; color: #dbeafe; }
.phpd header p { margin: 0; color: #93c5fd; font-size: 13px; }
.badge { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(#facc15, #a16207); color: #1e3a8a; display: grid; place-items: center; font-size: 30px; }
.rec .row { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px dashed #1e293b; align-items: center; }
.rec .row.top { align-items: flex-start; }
.rec .row > span { width: 90px; color: #64748b; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.rec code, .rec pre { margin: 0; font: 13px/1.5 var(--mono); color: #e2e8f0; white-space: pre-wrap; word-break: break-all; }
.rec .ok { color: #4ade80; } .rec .bad { color: #f87171; }
.rec .stars { color: #facc15; letter-spacing: 3px; }
.rec .note { color: #94a3b8; font-size: 13px; line-height: 1.5; }
.phpd .back { color: #93c5fd; display: inline-block; margin-top: 14px; }

@media (max-width: 720px) {
  #minimap { width: 160px; height: 94px; }
  #zone { width: 160px; bottom: 122px; }
  #phone-btn { left: 192px; }
  #objective { font-size: 15px; bottom: 130px; max-width: 90vw; }
  #toast { width: 240px; }
  #phone { right: 10px; left: 10px; width: auto; }
  #gear-list { grid-template-columns: 1fr; }
  .tcol { width: 34px; } .tcell { font-size: 16px; height: 28px; } .tcell.mid { font-size: 20px; }
}

/* ---------------- Nexora SQL console ---------------- */
.sqlbox { width: min(820px, 94vw); background: #061018; border: 2px solid #164a63; border-radius: 10px; box-shadow: 0 0 60px rgba(45, 180, 220, .25), inset 0 0 80px rgba(45,180,220,.05); padding: 16px 20px; font-family: var(--mono); color: #7fe3ff; }
.sqlbox header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #164a63; padding-bottom: 8px; letter-spacing: 1px; }
.sqlbox header button { background: none; border: 0; color: inherit; font-size: 20px; opacity: .7; }
.sqlhint { font-size: 13px; color: #9fd8e8; line-height: 1.5; }
.sqlhint code { background: #0c2130; color: #a7f3d0; padding: 1px 6px; border-radius: 4px; }
.sqlrow { display: flex; align-items: center; gap: 4px; margin: 10px 0; flex-wrap: wrap; }
.sqlrow .pre { color: #64b5c8; font-size: 15px; }
#sqli-in { flex: 1; min-width: 180px; background: #0b1a24; color: #e6fbff; border: 1px solid #164a63; border-radius: 6px; padding: 9px 10px; font: 14px var(--mono); }
#sqli-run { background: linear-gradient(#2bb6ff, #1676c0); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 700; letter-spacing: 1px; }
#sqli-query { background: #000; color: #5ad1ff; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; margin: 6px 0; min-height: 18px; user-select: text; }
#sqli-out { max-height: 46vh; overflow: auto; user-select: text; }
.sqlwaf { background: #2a0606; color: #ff9a9a; border-left: 3px solid #ef4444; padding: 10px 12px; border-radius: 6px; }
.sqlflag { background: #06220f; color: #86efac; border: 1px solid #16a34a; padding: 12px; border-radius: 8px; font-size: 16px; margin-bottom: 10px; word-break: break-all; }
.sqltab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sqltab th { text-align: left; color: #5ad1ff; border-bottom: 1px solid #164a63; padding: 5px 8px; }
.sqltab td { border-bottom: 1px solid #0c2130; padding: 5px 8px; color: #cfeef7; word-break: break-all; }

/* ---------------- T.H.E. district overlays ---------------- */
.the-ov .the-x, .the-ov header button { background: none; border: 0; color: inherit; font-size: 20px; opacity: .7; cursor: pointer; }
.the-paper { position: relative; width: min(440px, 90vw); background: #fdf6e3; color: #2b2116; padding: 30px 30px 24px; font-family: "Courier New", ui-monospace, monospace; box-shadow: 0 30px 80px rgba(0,0,0,.6); transform: rotate(-1deg); }
.the-paper .the-x { position: absolute; top: 8px; right: 10px; color: #2b2116; }
.the-paper h3 { margin: 0; font-family: var(--bebas); letter-spacing: 4px; font-size: 30px; color: #7f1d1d; }
.the-paper .the-sub { font-size: 12px; opacity: .7; margin: 2px 0 14px; }
.the-paper .the-big { font-size: 18px; font-weight: 700; margin: 10px 0; }
.the-paper .the-big span { font-size: 13px; font-weight: 400; }
.the-trip { font-family: "Permanent Marker", cursive; font-size: 24px; color: #1e3a8a; transform: rotate(-2deg); margin: 16px 0; }
.the-bookbox { width: min(620px, 94vw); max-height: 94vh; overflow: auto; background: #f7efdc; color: #2b2116; border-radius: 6px 12px 12px 6px; box-shadow: inset 18px 0 30px -18px rgba(0,0,0,.35), 0 30px 80px rgba(0,0,0,.6); padding: 18px 26px; font-family: Georgia, "Times New Roman", serif; }
.the-bookbox header, .the-bookbox footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.the-btitle { font-style: italic; opacity: .8; }
.the-lines { margin: 16px 0; padding-left: 34px; line-height: 1.9; font-size: 17px; }
.the-lines li::marker { color: #a16207; font-size: 12px; }
.the-bookbox footer button { background: #2b2116; color: #f7efdc; border: 0; border-radius: 6px; padding: 6px 12px; }
.the-filmbox { width: min(560px, 94vw); max-height: 94vh; display: flex; flex-direction: column; background: #0b0f14; color: #cbd5e1; border: 1px solid #1e293b; border-radius: 10px; overflow: hidden; box-shadow: 0 0 60px rgba(148, 197, 255, .25); }
.the-filmbox header, .the-filmbox footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13px; }
.the-filmbox img { display: block; width: 100%; min-height: 0; flex: 1 1 auto; max-height: 74vh; object-fit: contain; background: #000; }
.the-filmbox a { color: #93c5fd; font-weight: 700; text-decoration: none; white-space: nowrap; }
.the-codebox { width: min(560px, 94vw); background: #07131c; color: #bfe9ff; border: 2px solid #164a63; border-radius: 10px; padding: 16px 18px; font-family: var(--mono); }
.the-codebox header { display: flex; justify-content: space-between; border-bottom: 1px solid #164a63; padding-bottom: 8px; letter-spacing: 1px; }
.the-cdesc { font-size: 13.5px; line-height: 1.5; }
.the-crow { display: flex; gap: 8px; }
.the-cin { flex: 1; background: #0b1a24; color: #e6fbff; border: 1px solid #164a63; border-radius: 6px; padding: 9px 10px; font: 14px var(--mono); }
.the-cgo { background: linear-gradient(#22c55e, #15803d); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 700; }
.the-cout { margin-top: 12px; }
.the-bad { background: #2a0606; color: #ff9a9a; border-left: 3px solid #ef4444; padding: 10px 12px; border-radius: 6px; }
.the-good { color: #a7f3d0; margin-bottom: 8px; }
.the-flag { background: #06220f; color: #86efac; border: 1px solid #16a34a; padding: 12px; border-radius: 8px; font-size: 16px; word-break: break-all; user-select: text; }

/* ---------------- Malaysia tasks ---------------- */
#speed em { display: block; font-style: normal; font-size: 15px; letter-spacing: 2px; color: #4ade80; text-align: right; }
.my-hoist { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); width: min(560px, 94vw); z-index: 22; display: none; }
.my-hoist.show { display: block; }
.my-card { background: rgba(8, 10, 24, .86); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 14px 18px; color: #fff; backdrop-filter: blur(6px); }
.my-card h3 { margin: 0 0 4px; font-family: var(--bebas); letter-spacing: 3px; font-size: 26px; color: #facc15; }
.my-card p { margin: 4px 0; font-size: 14px; }
.my-card kbd { background: #f8fafc; color: #111; border-radius: 4px; padding: 0 6px; font-weight: 700; }
.my-beat { position: relative; height: 26px; margin: 12px 0 8px; border-radius: 13px; background: linear-gradient(90deg, #CC0001 0 50%, #010066 50% 100%); overflow: hidden; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.my-line { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: #FFCC00; box-shadow: 0 0 10px #FFCC00; }
.my-marker { position: absolute; top: 3px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff; }
.my-progress { height: 8px; border-radius: 4px; background: rgba(255,255,255,.15); overflow: hidden; }
.my-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #facc15, #fde68a); transition: width .3s; }
.my-status { color: #fde68a; min-height: 20px; }
.my-btns { display: flex; gap: 8px; justify-content: flex-end; }
.my-btns button { border: 0; border-radius: 8px; padding: 8px 18px; font-weight: 800; }
.my-pull { background: #facc15; color: #111; }
.my-quit { background: rgba(255,255,255,.12); color: #fff; }
.my-flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 40; }
.my-flash.on { animation: myflash .45s ease-out; }
@keyframes myflash { 0% { opacity: .95; } 100% { opacity: 0; } }
.my-saman { position: relative; width: min(460px, 92vw); background: #fffdf5; color: #1f2937; border-radius: 8px; padding: 22px 22px 16px; font-family: var(--ui); box-shadow: 0 30px 80px rgba(0,0,0,.6); border-top: 8px solid #1e3a8a; }
.my-saman .my-x { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; background: none; border: 0; border-radius: 6px; color: #1f2937; cursor: pointer; }
.my-saman .my-x:hover { background: #f1f5f9; }
.my-saman .my-x .myds-ico { width: 22px; height: 22px; margin: 0; }
.my-saman-head { display: flex; flex-direction: column; margin-bottom: 10px; }
.my-saman-head b { font-family: var(--bebas); letter-spacing: 3px; font-size: 26px; color: #1e3a8a; }
.my-saman-head b .myds-ico { color: #CC0001; vertical-align: -0.12em; }
.my-saman-head span { font-size: 12px; color: #6b7280; }
.my-saman table { width: 100%; border-collapse: collapse; font-size: 14px; }
.my-saman td { border-bottom: 1px dashed #d1d5db; padding: 6px 4px; vertical-align: top; }
.my-saman td:first-child { color: #6b7280; width: 38%; }
.my-saman-foot { font-size: 12.5px; color: #374151; margin: 10px 0 6px; font-style: italic; }
.my-calib { background: #06220f; color: #86efac; border: 1px solid #16a34a; border-radius: 8px; padding: 10px; font-family: var(--mono); font-size: 13px; word-break: break-all; user-select: text; }

/* ---------------- Negaraku karaoke ---------------- */
.ngr { position: fixed; inset: 0; z-index: 24; display: none; pointer-events: none; }
.ngr.show { display: block; }
.ngr-consent { pointer-events: auto; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(470px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 0 0 20px;
  background: radial-gradient(120% 70% at 50% 0%, rgba(1, 0, 102, .62), rgba(1, 0, 102, 0) 62%), linear-gradient(180deg, #0d1230 0%, #080a1a 100%);
  border: 1px solid rgba(255, 204, 0, .26); border-radius: 22px; color: #e8ecf5; box-shadow: 0 40px 110px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .07); animation: ngrIn .28s cubic-bezier(.2, .8, .2, 1); }
.ngr-consent::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, transparent, #FFCC00 30%, #FFCC00 70%, transparent); opacity: .85; }
@keyframes ngrIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
.ngr-head { text-align: center; padding: 18px 28px 0; }
.ngr-jata { display: block; width: 104px; height: 104px; margin: -6px auto -12px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); }
.ngr-kicker { display: inline-flex; align-items: center; gap: 2px; margin: 4px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #FFCC00; }
.ngr-kicker .my-flagico { height: 11px; margin-right: 8px; vertical-align: 0; }
.ngr-consent h3 { margin: 2px 0 6px; font-family: var(--bebas); font-weight: 400; font-size: 46px; line-height: 1; letter-spacing: 7px; color: #fff; text-shadow: 0 2px 18px rgba(255, 204, 0, .18); }
.ngr-lead { margin: 0 auto; max-width: 36ch; font-size: 14px; line-height: 1.55; color: #b8c2d6; }
.ngr-facts { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 24px 0; padding: 0; }
.ngr-facts li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 6px 10px; border-radius: 12px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .08); text-align: center; }
.ngr-facts .myds-ico { width: 20px; height: 20px; margin: 0 0 3px; color: #FFCC00; }
.ngr-facts b { font-size: 13px; color: #fff; }
.ngr-facts span { font-size: 11.5px; color: #8e9ab3; }
.ngr-privacy { display: flex; gap: 10px; align-items: flex-start; margin: 12px 24px 0; padding: 12px 14px; border-radius: 12px; background: rgba(16, 185, 129, .08); border: 1px solid rgba(16, 185, 129, .3); }
.ngr-privacy .myds-ico { width: 18px; height: 18px; margin: 1px 0 0; color: #34d399; flex: none; }
.ngr-privacy p { margin: 0; font-size: 12.5px; line-height: 1.5; color: #c9f2e1; }
.ngr-privacy b { color: #ecfdf5; }
.ngr-actions { display: grid; gap: 10px; margin: 16px 24px 0; }
.ngr-actions button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 54px; padding: 8px 16px; border-radius: 13px; font: inherit; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.ngr-actions button span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.ngr-actions button b { font-size: 15px; font-weight: 700; }
.ngr-actions button small { font-size: 12px; font-weight: 500; opacity: .82; }
.ngr-actions button:focus-visible { outline: 2px solid #FFCC00; outline-offset: 2px; }
.ngr-actions button:active { transform: translateY(1px); }
.ngr-mic { border: 0; color: #fff; background: linear-gradient(180deg, #e0121a 0%, #CC0001 55%, #a50001 100%); box-shadow: 0 12px 26px rgba(204, 0, 1, .34), inset 0 1px 0 rgba(255, 255, 255, .22); }
.ngr-mic .myds-ico { width: 22px; height: 22px; margin: 0; color: #FFCC00; }
.ngr-mic:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(204, 0, 1, .42), inset 0 1px 0 rgba(255, 255, 255, .22); }
.ngr-hold { color: #e2e8f0; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); }
.ngr-hold:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .24); }
.ngr-hold kbd { min-width: 64px; padding: 5px 8px; border-radius: 7px; background: #f8fafc; color: #0f172a; font: 700 11px var(--mono, monospace); letter-spacing: .08em; box-shadow: 0 3px 0 #94a3b8; }
.ngr-cancel { min-height: 40px !important; border: 0; background: none; color: #8e9ab3; font-weight: 600 !important; }
.ngr-cancel:hover { color: #fff; }
.ngr-msg { margin: 10px 24px 0; text-align: center; font-size: 13px; color: #fde68a; min-height: 0; }
.ngr-msg:empty { display: none; }
@media (max-width: 420px) { .ngr-consent h3 { font-size: 38px; letter-spacing: 5px; } .ngr-kicker { font-size: 10px; letter-spacing: .11em; white-space: nowrap; } .ngr-kicker .my-flagico { margin-right: 6px; } .ngr-facts { margin: 14px 16px 0; } .ngr-privacy, .ngr-actions, .ngr-msg { margin-left: 16px; margin-right: 16px; } .ngr-head { padding: 14px 18px 0; } }
.ngr-stage { position: absolute; left: 0; right: 0; bottom: 6vh; text-align: center; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.ngr-top { display: flex; justify-content: center; gap: 18px; align-items: center; font-size: 13.5px; margin-bottom: 10px; }
.ngr-top kbd { background: #f8fafc; color: #111; border-radius: 4px; padding: 0 6px; text-shadow: none; }
.ngr-live { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; margin-right: 6px; box-shadow: 0 0 8px #ef4444; animation: ngrlive 1.2s infinite; }
@keyframes ngrlive { 50% { opacity: .35; } }
.ngr-dots i { display: inline-block; width: 10px; height: 10px; margin: 0 2px; border-radius: 50%; background: rgba(255,255,255,.22); }
.ngr-dots i.now { background: #facc15; }
.ngr-dots i.ok { background: #22c55e; }
.ngr-dots i.miss { background: #ef4444; }
.ngr-cue { font-size: 16px; color: #fde68a; min-height: 22px; margin: 4px 0; }
.ngr-line { --p: 0%; margin: 6px auto; font-family: var(--bebas); font-size: clamp(40px, 6.5vw, 84px); letter-spacing: 3px; line-height: 1.05; min-height: 1.05em;
  background: linear-gradient(90deg, #facc15 0 var(--p), #ffffff var(--p) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.75)); }
.ngr-next { font-size: 20px; opacity: .65; min-height: 26px; margin: 0; }
.ngr-meter { width: 220px; height: 8px; margin: 14px auto 0; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; }
.ngr-meter span { display: block; height: 100%; width: 0; background: #94a3b8; transition: width .06s; }
.ngr-meter.on span { background: #22c55e; }
.ngr-hint { font-size: 12px; opacity: .6; margin-top: 8px; }
body.ngr-on #objective, body.ngr-on #help, body.ngr-on #toast, body.ngr-on #waypoint, body.ngr-on #prompt, body.ngr-on #zone { opacity: 0 !important; transition: opacity .4s; }
.my-flagico { height: .78em; width: auto; aspect-ratio: 2 / 1; vertical-align: -0.04em; margin-right: .4em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.35); }
#help .my-flagico { height: 1.1em; vertical-align: -0.2em; }
/* MYDS icons (inline svg, follow the text colour) and the Jata Negara */
.myds-ico { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin-right: .35em; flex: none; }
#help .myds-ico { color: #fde68a; }
.ngr-top b .myds-ico { width: 1em; height: 1em; margin-right: .2em; vertical-align: -0.15em; }
