/* TIGERS WORLD — UI design system
   Warm dusk palette inspired by Ibadan laterite, campus greens and evening light. */
:root {
  --ink: #0d1117;
  --ink-2: #161b24;
  --panel: rgba(16, 20, 28, 0.78);
  --panel-solid: #141923;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef1f5;
  --muted: #9aa3b2;
  --accent: #f0a04b;      /* laterite amber */
  --accent-2: #e2703a;
  --green: #4cc38a;
  --blue: #58a6ff;
  --red: #ff6b6b;
  --violet: #a78bfa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: 'Sora', var(--font);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: var(--text); }
kbd { font-family: var(--font); font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.12); border: 1px solid var(--line-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.glass { background: var(--panel); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid var(--line); }

#world-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; touch-action: none; }

/* ---------------------------------------------------------------- boot */
.boot { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(1200px 600px at 50% 110%, #3a2316 0%, #12151c 55%, #0b0d12 100%); transition: opacity .8s ease; }
.boot.done { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; width: min(440px, 86vw); }
.brand-mark { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 40px rgba(240,160,75,.35); }
.brand-mark span { font-family: var(--display); font-weight: 800; font-size: 30px; color: #1b0f06; }
.boot-title { font-family: var(--display); font-size: 30px; margin: 0 0 6px; letter-spacing: -.02em; }
.boot-sub { color: var(--muted); font-size: 13px; margin: 0 0 26px; }
.boot-sub b { color: var(--text); }
.boot-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s ease; }
.boot-status { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* ---------------------------------------------------------------- creator */
.creator { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: 1fr 420px; background: radial-gradient(900px 600px at 30% 60%, #2d2a24 0%, #12151c 70%); }
.creator-preview { position: relative; }
.creator-preview canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.creator-hint { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); }
.creator-panel { margin: 20px; border-radius: 22px; padding: 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.creator-panel h2 { font-family: var(--display); margin: 6px 0 4px; font-size: 26px; letter-spacing: -.02em; }
.creator-panel p { margin: 0; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { background: rgba(255,255,255,.05); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px; outline: none; transition: border-color .2s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field select option { background: var(--panel-solid); }
.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt-group > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.opt-row { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; outline: 1px solid var(--line-2); transition: transform .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: #fff; }
.chip { padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; background: rgba(255,255,255,.06); border: 1px solid var(--line); transition: all .15s; }
.chip:hover { border-color: var(--line-2); }
.chip.on { background: var(--accent); color: #1b0f06; border-color: var(--accent); font-weight: 600; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13px; background: rgba(255,255,255,.08); border: 1px solid var(--line-2); transition: transform .12s, background .2s, opacity .2s; white-space: nowrap; }
.btn:hover { background: rgba(255,255,255,.13); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1b0f06; border: 0; }
.btn-primary:hover { background: linear-gradient(135deg, #f5b265, #ea8550); }
.btn-green { background: var(--green); color: #052012; border: 0; }
.btn-danger { background: rgba(255,107,107,.14); color: #ffb3b3; border-color: rgba(255,107,107,.3); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn-lg { padding: 14px 20px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; position: relative; transition: background .2s; }
.icon-btn:hover { background: rgba(255,255,255,.1); }

/* ---------------------------------------------------------------- HUD (Clean CODM / GTA Minimal Tactical Layout) */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }
.minimap { position: absolute; left: 14px; top: 14px; width: 122px; height: 122px; border-radius: 50%; overflow: hidden; cursor: pointer; box-shadow: 0 10px 28px rgba(0,0,0,.45); padding: 0; border: 2px solid rgba(255,255,255,.18); z-index: 15; }
.minimap canvas { width: 100%; height: 100%; display: block; }
.minimap-label { position: absolute; bottom: 8px; left: 10px; right: 10px; text-align: center; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.82); text-shadow: 0 1px 4px #000; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hud-top { position: absolute; top: 14px; left: 146px; right: 14px; display: flex; align-items: center; gap: 8px; pointer-events: none; z-index: 15; }
.hud-top > * { pointer-events: auto; }
.identity-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; text-align: left; }
.identity-chip b { display: block; font-size: 12.5px; letter-spacing: -.01em; }
.identity-chip small { display: none; }
.avatar-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); flex: none; }
.location-crumb { display: none; }
.hud-top-right { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.pill { display: flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 999px; font-size: 11.5px; color: var(--muted); }
.pill b { color: var(--text); font-variant-numeric: tabular-nums; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(76,195,138,.2); }
.badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent-2); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

/* Tigers World XP Coin HUD Pill */
.xp-chip { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid rgba(240,160,75,.38); background: rgba(20,16,10,.78); position: relative; transition: transform .14s, border-color .2s; }
.xp-chip:hover { transform: translateY(-1px); border-color: var(--accent); }
.xp-coin-icon { color: #fbbf24; font-size: 13px; }
.xp-chip b { color: #fef3c7; font-family: var(--display); font-variant-numeric: tabular-nums; }
.xp-unit { font-size: 10px; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.xp-claim-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse 1.2s infinite; }

.xp-hero { border-radius: 16px; padding: 18px; margin-bottom: 14px; background: linear-gradient(135deg, rgba(240,160,75,.22), rgba(167,139,250,.08)); border: 1px solid rgba(240,160,75,.35); }
.xp-big { font-family: var(--display); font-size: 28px; font-weight: 800; color: #fef3c7; display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.xp-big i { color: #fbbf24; font-size: 22px; }
.xp-big small { font-size: 13px; color: var(--accent); letter-spacing: .08em; }

/* Tactical Phone / Command Drawer (opened via top-right grip button or Tab) */
.hud-drawer { position: absolute; top: 62px; right: 14px; width: min(350px, calc(100vw - 28px)); max-height: calc(100dvh - 80px); overflow-y: auto; border-radius: 20px; padding: 14px; box-shadow: 0 22px 60px rgba(0,0,0,.6); background: rgba(13, 17, 24, 0.92); border: 1px solid var(--line-2); z-index: 28; animation: riseDrawer .18s ease; }
@keyframes riseDrawer { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 4px; }
.btn-xs { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }

.interact-prompt { position: absolute; left: 50%; bottom: 42px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 15px 8px 9px; border-radius: 999px; background: rgba(11,15,21,.84); border: 1px solid rgba(240,160,75,.4); font-size: 13px; font-weight: 600; backdrop-filter: blur(10px); animation: rise .16s ease; box-shadow: 0 8px 24px rgba(0,0,0,.45); max-width: 72vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.interact-prompt kbd { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--accent); color: #1b0f06; border: 0; font-weight: 800; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 6px); } }

.dock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; }
.dock button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 4px; border-radius: 13px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text); font-size: 10.5px; font-weight: 600; transition: background .18s, border-color .18s; position: relative; width: auto; }
.dock button i { font-size: 16px; color: var(--accent); }
.dock button:hover { background: rgba(255,255,255,.1); border-color: var(--line-2); }
.dock button.on { background: rgba(240,160,75,.18); border-color: var(--accent); color: var(--accent); }

.chat-toggle { width: 38px; height: 38px; border-radius: 50%; }
.chat-box { position: absolute; left: 68px; bottom: calc(18px + var(--safe-b)); width: min(340px, 44vw); z-index: 26; }
.chat-box input { width: 100%; padding: 10px 14px; border-radius: 999px; background: rgba(13,17,23,.9); border: 1px solid var(--accent); outline: none; font-size: 13px; }

.toast-stack { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 12px; background: rgba(13,17,23,.9); border: 1px solid var(--line-2); font-size: 13px; box-shadow: var(--shadow); animation: toastIn .25s ease; display: flex; gap: 9px; align-items: center; max-width: 80vw; }
.toast.good i { color: var(--green); } .toast.bad i { color: var(--red); } .toast.info i { color: var(--blue); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

.nameplates { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.nameplate { position: absolute; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; will-change: transform; }
.nameplate .np-name { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: rgba(13,17,23,.6); color: #fff; }
.nameplate .np-name.player { background: rgba(240,160,75,.85); color: #1b0f06; }
.nameplate .np-name.npc { background: rgba(13,17,23,.45); color: rgba(255,255,255,.8); font-weight: 500; }
.nameplate .np-say { display: block; margin: 0 auto 4px; max-width: 220px; white-space: normal; font-size: 12px; padding: 7px 10px; border-radius: 12px; background: #fff; color: #111; box-shadow: 0 4px 14px rgba(0,0,0,.3); }

/* ---------------------------------------------------------------- sheet / panels */
.sheet { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100vw - 24px)); z-index: 30; border-radius: 22px; background: rgba(15,19,27,.94); border: 1px solid var(--line); backdrop-filter: blur(20px); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: sheetIn .28s cubic-bezier(.2,.8,.2,1); }
.sheet.wide { width: min(880px, calc(100vw - 24px)); }
@keyframes sheetIn { from { opacity: 0; transform: translateX(24px); } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 20px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-family: var(--display); margin: 4px 0 0; font-size: 22px; letter-spacing: -.02em; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.sheet-body::-webkit-scrollbar { width: 6px; } .sheet-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.05); margin-bottom: 14px; }
.tabs button { flex: 1; padding: 8px; border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: rgba(255,255,255,.1); color: var(--text); }
.section-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.card { border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); padding: 14px; margin-bottom: 10px; }
.card.click { cursor: pointer; transition: border-color .2s, background .2s; }
.card.click:hover { border-color: var(--line-2); background: rgba(255,255,255,.06); }
.card h3 { margin: 0 0 4px; font-size: 15px; font-family: var(--display); font-weight: 600; }
.card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--muted); }
.tag.green { background: rgba(76,195,138,.14); color: var(--green); }
.tag.amber { background: rgba(240,160,75,.15); color: var(--accent); }
.tag.blue { background: rgba(88,166,255,.14); color: var(--blue); }
.tag.red { background: rgba(255,107,107,.14); color: var(--red); }
.tag.violet { background: rgba(167,139,250,.15); color: var(--violet); }
.notice { border-radius: 12px; padding: 11px 13px; font-size: 12.5px; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; background: rgba(88,166,255,.08); border: 1px solid rgba(88,166,255,.22); color: #c4dcff; margin-bottom: 12px; }
.notice.amber { background: rgba(240,160,75,.08); border-color: rgba(240,160,75,.25); color: #f6d3ab; }
.stat { border-radius: 14px; padding: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 22px; }
.stat span { font-size: 11px; color: var(--muted); }
.occ-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; }
.occ-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--accent)); }
.empty { text-align: center; padding: 28px 10px; color: var(--muted); font-size: 13px; }
.empty i { font-size: 26px; display: block; margin-bottom: 10px; opacity: .5; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; flex: none; box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); }
.product { display: flex; gap: 12px; align-items: center; }
.product .glyph { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; background: rgba(255,255,255,.06); flex: none; }
.product .info { flex: 1; min-width: 0; }
.product .info b { display: block; font-size: 14px; }
.product .info small { color: var(--muted); font-size: 12px; }
.price { font-family: var(--display); font-weight: 700; color: var(--text); }
.biz-head { border-radius: 16px; padding: 18px; margin-bottom: 14px; position: relative; overflow: hidden; }
.biz-head .glyph { font-size: 34px; }
.biz-head h3 { font-family: var(--display); font-size: 20px; margin: 8px 0 4px; }
.stars { color: var(--accent); font-size: 12px; letter-spacing: 1px; }
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { aspect-ratio: 1; border-radius: 12px; border: 1px dashed var(--line-2); display: grid; place-items: center; font-size: 22px; background: rgba(255,255,255,.03); transition: border-color .2s; }
.slot:hover { border-color: var(--accent); }
.slot.filled { border-style: solid; background: rgba(240,160,75,.08); }
.slot small { display: block; font-size: 9px; color: var(--muted); }
.timeline { display: flex; gap: 4px; margin-top: 10px; }
.timeline i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); }
.timeline i.on { background: var(--green); }

/* world map */
.map-wrap { position: relative; border-radius: 16px; overflow: hidden; background: #0a1220; border: 1px solid var(--line); }
.map-wrap canvas { display: block; width: 100%; cursor: crosshair; }
.map-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.map-crumbs button { font-size: 12px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); }
.map-crumbs button.on { background: var(--accent); color: #1b0f06; font-weight: 600; }
.map-legend { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 10px; font-size: 11px; color: var(--muted); background: rgba(10,18,32,.8); padding: 6px 10px; border-radius: 10px; }
.map-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--c); }

.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0,0,0,.45); }
.modal-card { width: min(440px, 92vw); max-height: 86vh; overflow-y: auto; border-radius: 20px; padding: 22px; box-shadow: var(--shadow); background: rgba(18,22,31,.97); }
.modal-card h3 { font-family: var(--display); margin: 0 0 8px; }

.fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 45; transition: opacity .35s ease; }
.fade.on { opacity: 1; }

/* ---------------------------------------------------------------- football HUD */
.match-hud { position: absolute; inset: 0; pointer-events: none; }
.scoreboard { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 14px; font-weight: 600; font-size: 13px; pointer-events: auto; }
.scoreboard b { font-family: var(--display); font-size: 22px; min-width: 18px; text-align: center; }
.scoreboard .team { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.scoreboard .team i { width: 10px; height: 10px; border-radius: 3px; }
.scoreboard .home i { background: #d2382c; } .scoreboard .away i { background: #4a8fe0; }
.scoreboard .sep { color: var(--muted); }
.match-clock { margin-left: 8px; padding: 4px 9px; border-radius: 8px; background: rgba(255,255,255,.08); font-variant-numeric: tabular-nums; }
.match-msg { position: absolute; top: 30%; left: 0; right: 0; text-align: center; font-family: var(--display); font-size: 54px; font-weight: 800; letter-spacing: -.03em; text-shadow: 0 6px 30px rgba(0,0,0,.6); opacity: 0; transition: opacity .3s, transform .3s; transform: scale(.94); }
.match-msg.on { opacity: 1; transform: scale(1); }
.match-msg small { display: block; font-size: 16px; font-weight: 500; font-family: var(--font); color: var(--muted); letter-spacing: 0; margin-top: 6px; }
.power-meter { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); width: 220px; height: 10px; border-radius: 6px; background: rgba(0,0,0,.5); border: 1px solid var(--line-2); overflow: hidden; }
.power-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--accent), var(--red)); }
.match-help { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 14px; padding: 9px 14px; border-radius: 12px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; justify-content: center; max-width: 92vw; }

/* ---------------------------------------------------------------- touch (CODM / GTA Mobile ergonomic clusters) */
.touch-controls { position: absolute; inset: auto 0 0 0; height: 220px; pointer-events: none; }
.joy-base { position: absolute; left: max(26px, env(safe-area-inset-left)); bottom: calc(24px + var(--safe-b)); width: 112px; height: 112px; border-radius: 50%; background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.2); pointer-events: auto; touch-action: none; }
.joy-knob { position: absolute; left: 33px; top: 33px; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.38); box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.touch-buttons { position: absolute; right: max(22px, env(safe-area-inset-right)); bottom: calc(22px + var(--safe-b)); width: 134px; height: 134px; pointer-events: auto; }
.t-btn { position: absolute; width: 52px; height: 52px; border-radius: 50%; background: rgba(15,20,28,.55); border: 1.5px solid rgba(255,255,255,.24); font-size: 17px; font-weight: 700; backdrop-filter: blur(6px); touch-action: none; display: grid; place-items: center; }
.t-btn.t-act { right: 4px; bottom: 4px; width: 64px; height: 64px; background: rgba(240,160,75,.82); border-color: #fde68a; color: #1b0f06; font-size: 20px; box-shadow: 0 6px 20px rgba(240,160,75,.35); }
#t-sprint { left: 4px; bottom: 12px; }
#t-jump { right: 14px; top: 4px; }
#t-kick { left: 10px; top: 14px; }
.t-word { font-size: 12px; }
body.touch #match-hint { display: none; }
.stamina { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); width: 150px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.45); overflow: hidden; }
.stamina i { display: block; height: 100%; background: var(--green); transform-origin: left center; }
/* in a match the phone buttons become shoot, pass, lob and sprint */
body.in-match.touch .touch-buttons { width: 168px; height: 156px; }
body.in-match.touch :is(#t-act, #t-jump) { display: none; }
body.in-match.touch #t-kick { left: auto; top: auto; right: 0; bottom: 0; width: 72px; height: 72px; font-size: 26px; background: rgba(240,160,75,.82); border-color: #fde68a; }
body.in-match.touch #t-pass { right: 86px; bottom: 0; width: 64px; height: 64px; }
body.in-match.touch #t-lob { right: 6px; bottom: 86px; }
body.in-match.touch #t-sprint { left: auto; right: 82px; bottom: 82px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 640px) {
  .creator { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .creator-panel { margin: 0 10px 10px; padding: 18px; }
  .minimap { width: 92px; height: 92px; left: 10px; top: 10px; }
  .hud-top { left: 110px; top: 10px; right: 10px; }
  .identity-chip { display: none; }
  .hud-meta-pill:not(#clock-pill) { display: none; }
  .match-help { display: none; }
  .match-msg { font-size: 36px; }
  .sheet { top: auto; height: 80vh; left: 8px; right: 8px; width: auto; bottom: 8px; }
  .sheet.wide { width: auto; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
body.touch .interact-prompt { bottom: 34px; }

/* Online upgrade: landscape-first HUD, camera controls, seller galleries and accounts. */
.game-tools { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); max-width: 100%; }
.game-tools button { flex: 1 1 auto; font-size: 11px; font-weight: 600; padding: 7px 9px; border-radius: 9px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--muted); }
.game-tools button:hover { background: rgba(255,255,255,.12); color: var(--text); }
.driving-status { display: none; position: absolute; left: 50%; transform: translateX(-50%); bottom: 88px; border-radius: 999px; padding: 7px 16px; font-size: 12.5px; white-space: nowrap; border: 1px solid rgba(255,255,255,.18); }
body.driving .driving-status { display: block; }
.landscape-prompt { display: none; position: fixed; inset: 0; background: radial-gradient(at top,#243f3d,#0d1117 75%); z-index: 1000; place-items: center; text-align: center; padding: 32px; }
.landscape-prompt article { max-width: 380px; } .landscape-prompt p { line-height: 1.6; font-size: 14px; } .rotate-symbol { font-size: 80px; color: var(--accent); }
.account-gate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: radial-gradient(at top left,#294b49,#111921 70%); overflow-y: auto; }
.account-card { width: min(500px,100%); border-radius: 24px; padding: 28px; max-height: 94dvh; overflow-y: auto; } .account-card h2 { font-family: var(--display); }
.portfolio-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; } .portfolio-grid figure { margin: 0; min-width: 0; } .portfolio-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; background: #202c36; } .portfolio-grid figcaption { font-size: 12px; color: var(--muted); margin: 6px 0; overflow-wrap: anywhere; }
.product .glyph img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; } .sheet a { color: #91d8ff; }
@media (pointer:coarse) and (orientation:portrait) { .landscape-prompt { display: grid; } }
@media (pointer:coarse) and (orientation:landscape) {
  .creator { grid-template-columns: 42% 58%; grid-template-rows: 1fr; } .creator-panel { margin: 8px; padding: 14px; gap: 10px; } .creator-preview { min-height: 0; }
  .minimap { top: max(8px,env(safe-area-inset-top)); left: max(10px,env(safe-area-inset-left)); width: 84px; height: 84px; }
  .minimap-label { font-size: 8px; bottom: 5px; }
  .hud-top { top: max(8px,env(safe-area-inset-top)); left: 104px; right: max(10px,env(safe-area-inset-right)); gap: 6px; }
  .identity-chip, .hud-meta-pill { display: none; }
  .xp-chip { padding: 5px 10px; font-size: 11px; }
  .icon-btn { width: 34px; height: 34px; border-radius: 50%; font-size: 13px; }
  .hud-drawer { top: 48px; right: max(10px,env(safe-area-inset-right)); width: min(320px, 64vw); max-height: calc(100dvh - 58px); padding: 11px; }
  .joy-base { left: max(22px,env(safe-area-inset-left)); bottom: max(16px,env(safe-area-inset-bottom)); width: 102px; height: 102px; }
  .joy-knob { left: 29px; top: 29px; width: 44px; height: 44px; }
  .touch-buttons { right: max(18px,env(safe-area-inset-right)); bottom: max(16px,env(safe-area-inset-bottom)); width: 126px; height: 126px; }
  .t-btn { width: 46px; height: 46px; font-size: 15px; }
  .t-btn.t-act { width: 58px; height: 58px; font-size: 18px; }
  body.touch .interact-prompt { bottom: 20px; max-width: 44vw; font-size: 11.5px; padding: 6px 12px 6px 7px; }
  .driving-status { bottom: 68px; font-size: 11px; padding: 5px 12px; }
  .sheet, .sheet.wide { left: auto; right: 8px; top: 48px; bottom: 8px; height: auto; width: min(520px,76vw); }
  .account-card { padding: 20px; max-height: 94dvh; } .account-card h2 { font-size: 20px; margin: 10px 0; }
  .toast-stack { max-width: 46vw; top: 48px; }
}

/* Touch-first text communication and gesture controls. */
.text-conversation{height:100%;min-height:0;display:flex;flex-direction:column;gap:8px}
.text-thread{flex:1;min-height:90px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;overflow-wrap:anywhere}
.text-conversation #dm-form{display:flex;gap:8px}
.text-conversation #dm-input{flex:1;min-width:0;padding:12px;border-radius:10px;background:#18232d;color:#fff;border:1px solid var(--line)}
.quick-text{padding:10px;border-radius:12px;background:rgba(255,255,255,.04);border:1px solid var(--line)}
.quick-text select{max-width:150px;padding:8px;background:#18232d;color:#fff;border-radius:8px}
#phrase-choices{display:grid;gap:6px;margin-top:6px}
.phrase-choice{text-align:left;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:#253c42;color:#f7f4ed;touch-action:manipulation;font-size:13px;line-height:1.35}
.phrase-choice:hover,.phrase-choice:focus-visible{background:#34565c;outline:2px solid var(--accent)}
@media(pointer:coarse){
  .phrase-choice{min-height:44px;font-size:14px}
  .text-conversation{height:auto;min-height:100%}.text-thread{min-height:75px;max-height:30dvh}
  .text-conversation #dm-input{font-size:16px}.text-conversation #dm-send{min-height:44px}
}

/* Minimal voice & chat cluster */
.talk-controls {
  position: absolute;
  top: 144px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  z-index: 20;
}
.talk-controls .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 13px;
}
.mic-toggle {
  transition: all 0.2s ease;
}
.mic-muted {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.15);
}
.mic-live {
  color: #4ade80;
  border-color: #22c55e;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.4);
}
.mic-ptt {
  color: #facc15;
  border-color: #eab308;
}
.mic-ptt.ptt-active {
  background: #ca8a04;
  color: #fff;
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.6);
}
.call-bar {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  min-width: 290px;
  max-width: 90vw;
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.call-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.call-pulse {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(240, 160, 75, 0.2);
  color: var(--accent);
  animation: pulse 1.4s infinite;
}
.call-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 1.2s infinite;
}
.np-speaking {
  display: inline-block;
  color: #4ade80;
  margin-right: 4px;
  animation: pulse 0.8s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}
/* World map destinations */
#map-find { margin-bottom: 10px; }
#map-find input { width: 100%; }
#map-places { margin: 12px 0; }
.map-results { display: grid; gap: 6px; }
.map-result { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); cursor: pointer; }
.map-result > div { flex: 1 1 160px; min-width: 0; display: grid; }
.map-result small { color: var(--muted); text-transform: capitalize; }
.map-result.on { border-color: #27d3ff; }

/* Actions and emotes menu, opened beside the quick buttons */
.emote-menu { position: absolute; left: 62px; top: 144px; z-index: 27; display: grid; grid-template-columns: repeat(3, 68px); gap: 6px; padding: 8px; border-radius: 16px; background: rgba(13,17,24,.92); max-height: calc(100dvh - 160px); overflow-y: auto; animation: riseDrawer .16s ease; }
.emote-menu button { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 11px; background: rgba(255,255,255,.05); border: 1px solid var(--line); touch-action: manipulation; }
.emote-menu button:hover, .emote-menu button:focus-visible { background: rgba(255,255,255,.12); }
.emote-menu span { font-size: 20px; }
.emote-menu small { font-size: 10.5px; color: var(--muted); }
@media (pointer:coarse) and (orientation:landscape) {
  .emote-menu { left: 56px; top: 100px; max-height: calc(100dvh - 108px); grid-template-columns: repeat(3, 60px); }
}
@media (pointer:coarse) and (orientation:landscape) {
  .talk-controls { flex-direction: row; top: 100px; left: max(10px,env(safe-area-inset-left)); }
  .emote-menu { left: max(10px,env(safe-area-inset-left)); top: 142px; max-height: calc(100dvh - 150px); }
}
