:root { --ink: #33402f; --cream: #fff8ea; --sage: #8fb57a; --sky: #6fb1e8; --sun: #ffc56b; --rose: #ef7a6b; --fd: 'Fredoka', system-ui, sans-serif; --fb: 'Nunito', system-ui, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bfe0f2; font-family: var(--fb); color: var(--ink); }
body { touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
#app { position: fixed; inset: 0; }
#app canvas { position: absolute; inset: 0; display: block; }
.hidden { display: none !important; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 0; }
.round { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 248, 234, .85); font-size: 18px; font-weight: 900; box-shadow: 0 3px 0 rgba(60, 70, 50, .25); }
.phase { display: flex; flex-direction: column; align-items: center; padding: 6px 20px 8px; border-radius: 18px; background: rgba(255, 248, 234, .88); box-shadow: 0 4px 0 rgba(60, 70, 50, .2); }
.phase span { font-weight: 900; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #6b7a5f; }
.phase b { font-family: var(--fd); font-size: 30px; line-height: 1; }
.phase.urgent b { color: #d9534f; }
.stat { min-width: 96px; padding: 6px 13px; border-radius: 16px; background: rgba(255, 248, 234, .9); font-family: var(--fd); font-weight: 700; font-size: 16px; text-align: center; box-shadow: 0 3px 0 rgba(60, 70, 50, .2); line-height: 1.15; }
.stat .team-row { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 15px; }
.stat .team-pill { display: inline-flex; align-items: center; gap: 3px; }
.stat .team-vs { font-family: var(--fb); font-size: 10px; font-weight: 900; color: #7b8a6f; text-transform: uppercase; }
.stat small { display: block; font-family: var(--fb); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: #6b7a5f; margin-top: 2px; }
.match { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 84px); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 20px; background: rgba(255, 248, 234, .9); box-shadow: 0 4px 0 rgba(60, 70, 50, .2); }
.match .sw { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 900; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #6b7a5f; }
.match .sw i { width: 30px; height: 30px; border-radius: 10px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12); }
.match .pct { text-align: center; }
.match .pct b { display: block; font-family: var(--fd); font-size: 28px; line-height: 1; }
.match .pct span { font-weight: 900; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #6b7a5f; }
.hint { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 10px 18px; border-radius: 16px; background: rgba(51, 64, 47, .82); color: #fff8ea; font-weight: 900; font-size: 17px; text-align: center; opacity: 0; transition: opacity .3s; max-width: 86vw; }
.hint.on { opacity: 1; }
.cross { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .95); box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }
.cross::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; }
.joy { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(255, 255, 255, .22); border: 3px solid rgba(255, 255, 255, .55); }
.joy #joyKnob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; background: rgba(255, 248, 234, .9); box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.actions { position: absolute; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.act { pointer-events: auto; width: 74px; height: 74px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; background: rgba(255, 248, 234, .92); font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; box-shadow: 0 5px 0 rgba(60, 70, 50, .25); }
.act .ic { font-size: 26px; line-height: 1.1; }
.act:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(60, 70, 50, .25); }
.act.on { background: #cfe9ff; box-shadow: 0 5px 0 rgba(60, 70, 50, .25), 0 0 0 3px #6fb1e8; }
.act.big { width: 96px; height: 96px; font-size: 13px; background: linear-gradient(180deg, #bfe8ff, #7cc4f2); }
.act.interact { width: auto; min-width: 84px; height: 64px; padding: 6px 14px; border-radius: 22px; background: linear-gradient(180deg, #ffe7a3, #ffc357); color: #4d3006; box-shadow: 0 5px 0 rgba(110, 70, 15, .32), 0 0 0 3px #fff8ea; }
.act.interact.active { background: linear-gradient(180deg, #b8f2e6, #6fd6c5); color: #19423b; }
.act.big .ic { font-size: 34px; }

/* screens */
.screen { position: absolute; inset: 0; display: none; }
.screen.on { display: flex; }
#title { flex-direction: column; align-items: center; justify-content: center; gap: 11px; padding: 14px 16px; overflow-y: auto; background: radial-gradient(72% 58% at 50% 50%, rgba(255, 248, 234, .32), rgba(24, 32, 28, .18) 85%); }
.title-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.logo { font-family: var(--fd); font-weight: 700; font-size: clamp(42px, 8vw, 72px); line-height: 1; color: #fff8ea; text-shadow: 0 4px 0 #5b7e4c, 0 10px 24px rgba(25, 38, 22, .45); letter-spacing: -.01em; }
.logo em { font-style: normal; color: var(--sun); }
.tag { margin: 2px 0 0; font-weight: 900; font-size: clamp(13px, 1.8vw, 15px); color: #fff8ea; text-align: center; text-shadow: 0 2px 8px rgba(20, 30, 20, .72), 0 1px 0 rgba(30, 40, 25, .6); max-width: 640px; }

/* Storybook 6-World Selector */
.world-picker { width: min(96vw, 840px); padding: 10px 12px 12px; border-radius: 24px; background: rgba(255, 248, 234, .86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 0 rgba(50, 62, 42, .25), 0 16px 36px rgba(20, 30, 20, .28); }
.picker-hdr { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: #526347; }
.picker-hdr em { font-style: normal; padding: 2px 10px; border-radius: 99px; background: #e6dec8; color: #3d4d34; font-size: 11px; }
.map-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.map-card { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 5px; border-radius: 16px; background: #f4ecda; box-shadow: 0 3px 0 rgba(60, 70, 50, .2); text-align: left; transition: transform .12s, box-shadow .15s, background .15s; overflow: hidden; }
.map-card:hover { transform: translateY(-2px); background: #fffaf0; }
.map-card:active { transform: translateY(2px); }
.map-card.active { background: #fffdf6; box-shadow: 0 4px 0 #d48b28, 0 0 0 3px #ffb94a, 0 8px 18px rgba(35, 45, 25, .26); transform: translateY(-2px); }
.map-thumb { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 11px; overflow: hidden; background: #8fb57a; }
.map-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-badge { position: absolute; left: 5px; top: 5px; padding: 2px 6px; border-radius: 8px; background: rgba(28, 34, 30, .74); color: #fff8ea; font-weight: 900; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.map-lock-tag { position: absolute; right: 5px; bottom: 5px; padding: 2px 6px; border-radius: 8px; background: rgba(42, 32, 24, .88); color: #ffe094; font-weight: 900; font-size: 9.5px; letter-spacing: .03em; box-shadow: 0 2px 0 rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(255, 206, 104, .5); }
.map-card.is-locked { background: #e8e0cf; opacity: .88; }
.map-card.is-locked .map-thumb img { filter: saturate(.42) brightness(.72); }
.map-card.is-locked .map-name { color: #67705e; }
.map-card.locked-shake { animation: mapCardShake .32s cubic-bezier(.36, .07, .19, .97); }
@keyframes mapCardShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-3px); } }
.map-name { padding: 5px 3px 2px; font-family: var(--fd); font-weight: 700; font-size: 12.5px; line-height: 1.15; color: #2f3c2b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Player Gamertag + Hider Spirit Selector Row */
.player-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; width: min(96vw, 840px); }
.gamertag-box { display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px 11px; border-radius: 18px; background: rgba(255, 248, 234, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 0 rgba(50, 62, 42, .2); }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: #58c24a; box-shadow: 0 0 0 3px rgba(88, 194, 74, .28); flex-shrink: 0; animation: pulseDot 2s ease-in-out infinite; }
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: .78; } }
.gt-lbl { font-weight: 900; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #56664b; }
.gt-input { width: 126px; padding: 4px 8px; border-radius: 10px; border: 2px solid #dfd6c1; background: #fffdf7; font: 800 13px var(--fb); color: var(--ink); outline: none; user-select: text; -webkit-user-select: text; transition: border-color .15s, box-shadow .15s; }
.gt-input:focus { border-color: #f5a623; box-shadow: 0 0 0 3px rgba(245, 166, 35, .22); }
.gt-dice { width: 29px; height: 29px; border-radius: 10px; background: #ede5d2; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s, background .15s; }
.gt-dice:hover { background: #ffe5a3; transform: rotate(14deg); }
.gt-dice:active { transform: scale(.92); }
.spirit-picker { flex: 1 1 430px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 6px 10px; border-radius: 18px; background: rgba(255, 248, 234, .84); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 0 rgba(50, 62, 42, .2); }
.sp-lbl { font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #56664b; margin-right: 2px; }
.spirit-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.sp-pill { padding: 5px 10px; border-radius: 99px; background: #ede5d2; font-weight: 800; font-size: 12px; color: #394734; transition: transform .1s, background .15s, box-shadow .15s; }
.sp-pill:hover { background: #fff8ea; }
.sp-pill.active { background: linear-gradient(180deg, #ffe29a, #ffc155); color: #4f3206; box-shadow: 0 2px 0 rgba(120, 80, 20, .3), 0 0 0 2px #f5a623; }

.modes { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.mode { width: 174px; padding: 12px 14px 12px; border-radius: 24px; background: rgba(255, 248, 234, .95); box-shadow: 0 6px 0 rgba(60, 70, 50, .25), 0 14px 30px rgba(30, 45, 25, .24); display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .1s; }
.mode:hover { transform: translateY(-2px); }
.mode:active { transform: translateY(4px); }
.mode .mi { font-size: 32px; line-height: 1.1; }
.mode b { font-family: var(--fd); font-size: 25px; line-height: 1.05; }
.mode small { font-weight: 800; font-size: 12px; color: #6b7a5f; line-height: 1.25; }
.note { margin: 0; font-weight: 800; font-size: 11.5px; color: rgba(255, 248, 234, .88); text-shadow: 0 1px 4px rgba(20, 30, 20, .65); text-align: center; }
.hud-world { font-weight: 800; font-size: 10px; color: #5d6e52; letter-spacing: .04em; margin-top: 1px; }
.world-btn { width: 100%; margin-top: 9px; padding: 11px 10px; font-size: 16px; background: linear-gradient(180deg, #dff3d8, #b7dfa9); color: #2b4523; }

@media (max-width: 820px) {
  .map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mode { width: 150px; padding: 10px 10px; }
  .sp-pill { padding: 4px 8px; font-size: 11px; }
}
#result { align-items: center; justify-content: center; background: rgba(40, 55, 35, .35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.card { width: min(92vw, 340px); padding: 22px 20px 16px; border-radius: 28px; background: var(--cream); text-align: center; box-shadow: 0 8px 0 rgba(60, 70, 50, .25), 0 24px 50px rgba(30, 40, 25, .35); }
.r-emoji { font-size: 52px; }
.card h2 { margin: 4px 0; font-family: var(--fd); font-size: 34px; }
.card p { margin: 0 0 14px; font-weight: 800; color: #6b7a5f; }
.r-row { display: flex; gap: 10px; }
.btn { flex: 1; padding: 14px 10px; border-radius: 18px; font-family: var(--fd); font-weight: 700; font-size: 18px; background: #e9e2d0; box-shadow: 0 4px 0 rgba(60, 70, 50, .2); }
.btn.primary { background: linear-gradient(180deg, #ffd88a, #ffb547); color: #5a3a08; }
.link { margin-top: 10px; background: none; font-weight: 900; color: #6b7a5f; text-decoration: underline; }

.vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(60, 50, 30, .28)); transition: backdrop-filter .45s, -webkit-backdrop-filter .45s, background .45s; }
.vignette.blindfold { background: radial-gradient(90% 80% at 50% 50%, rgba(255, 248, 234, .68), rgba(45, 58, 40, .82)); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#hud, .screen { z-index: 2; }
.help { position: absolute; left: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); padding: 8px 12px; border-radius: 12px; background: rgba(51, 64, 47, .72); color: #fff8ea; font-weight: 800; font-size: 12px; line-height: 1.6; }
.help:empty { display: none; }
.help kbd { display: inline-block; min-width: 18px; padding: 0 5px; margin: 0 1px; border-radius: 5px; background: rgba(255, 248, 234, .9); color: #33402f; font: 900 11px var(--fb); text-align: center; }
/* prop hunt HUD */
.match .dis { display: flex; flex-direction: column; align-items: center; min-width: 120px; }
.match .dis small, .match .sus small { font-weight: 900; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #6b7a5f; }
.match .dis b { font-family: var(--fd); font-size: 22px; line-height: 1.1; }
.match .sus { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.susbar { width: 90px; height: 10px; border-radius: 5px; background: rgba(51, 64, 47, .15); overflow: hidden; }
.susbar i { display: block; height: 100%; width: 0; background: #6bbf59; transition: width .2s, background .3s; }
.cross.prop { border-color: #ffd36b; transform: scale(1.25); }
.cross.prop::before { content: attr(data-label); position: absolute; top: 32px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 4px 10px; border-radius: 10px; background: rgba(51, 64, 47, .85); color: #fff8ea; font: 900 12px var(--fb); }
.cross.hit { border-color: #ffde59; background: rgba(255, 222, 89, .32); transform: scale(1.52) rotate(45deg); box-shadow: 0 0 0 4px rgba(255, 138, 42, .52); transition: transform .06s, border-color .08s; }
.cross.hit::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff8ea; font: 900 16px/1 var(--fb); text-shadow: 0 1px 4px rgba(0, 0, 0, .75); transform: rotate(-45deg); }
.cross.wrong { border-color: #ef5b4f; transform: scale(0.86); box-shadow: 0 0 0 3px rgba(239, 91, 79, .45); }

/* Floating combat damage & penalty popups */
.dmg-pop { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 16; font-family: var(--fd); font-weight: 800; font-size: 20px; color: #fff8ea; text-shadow: 0 2px 0 rgba(40, 26, 12, .85), 0 4px 12px rgba(0, 0, 0, .45); transform: translate(-50%, -50%) scale(0.7); animation: dmgPopFloat .68s cubic-bezier(.2, 1.35, .4, 1) forwards; white-space: nowrap; }
.dmg-pop.crit { font-size: 25px; color: #ffd95c; }
.dmg-pop.elim { font-size: 28px; color: #7fe3ff; }
.dmg-pop.pen { font-size: 19px; color: #ff7a6b; }
@keyframes dmgPopFloat {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.65); }
  22% { opacity: 1; transform: translate(-50%, -85%) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -175%) scale(0.92); }
}
.timer-pen-shake { animation: timerPenShake .34s ease; color: #d9443a !important; }
@keyframes timerPenShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px) scale(1.12); } 75% { transform: translateX(5px) scale(1.06); } }

/* Position-lock active badge on Hider HUD */
#btnPosLock.is-locked { background: linear-gradient(180deg, #ffd15c, #f09522) !important; color: #3c2208 !important; box-shadow: 0 0 0 3px rgba(255, 211, 107, .55) !important; }

/* In-match 6-icon Emote Strip */
.hs-emote-bar { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 64px); transform: translateX(-50%); display: flex; gap: 6px; padding: 5px 8px; border-radius: 999px; background: rgba(255, 248, 234, .92); box-shadow: 0 4px 14px rgba(25, 35, 22, .22); z-index: 12; pointer-events: auto; }
.hs-emote-bar.hidden { display: none !important; }
.hs-emote-btn { border: 0; background: rgba(51, 64, 47, .08); border-radius: 999px; width: 34px; height: 34px; font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: transform .12s; }
.hs-emote-btn:active { transform: scale(1.22); }
.hs-emote-float { position: fixed; left: 50%; top: 34%; transform: translate(-50%, -50%); pointer-events: none; z-index: 17; font-size: 46px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); animation: emoteFloatUp 1.35s cubic-bezier(.2, 1.25, .4, 1) forwards; }
@keyframes emoteFloatUp {
  0% { opacity: 0; transform: translate(-50%, -10%) scale(0.5); }
  20% { opacity: 1; transform: translate(-50%, -55%) scale(1.18); }
  80% { opacity: 1; transform: translate(-50%, -95%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -135%) scale(0.85); }
}

/* mobile-first transform chips */
.chips { position: absolute; right: 100px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px; pointer-events: none; }
.chips .chip { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 22px; background: rgba(255, 248, 234, .95); box-shadow: 0 5px 0 rgba(60, 70, 50, .25), 0 8px 18px rgba(30, 40, 25, .2); font: 800 16px var(--fb); color: #33402f; animation: chipIn .25s cubic-bezier(.3, 1.6, .5, 1); }
.chips .chip:first-child { box-shadow: 0 5px 0 rgba(60, 70, 50, .25), 0 0 0 3px #ffd36b, 0 8px 18px rgba(30, 40, 25, .2); }
.chips .chip span { font-size: 26px; line-height: 1; }
.chips .chip b { font-family: var(--fd); font-weight: 700; font-size: 17px; }
.chips .chip kbd { min-width: 20px; padding: 1px 5px; border-radius: 5px; background: #33402f; color: #fff8ea; font: 900 11px var(--fb); }
.chips .chip:active { transform: translateY(3px); }
@keyframes chipIn { from { transform: scale(.6) translateX(20px); opacity: 0; } }
@media (max-width: 560px) { .chips { right: 96px; } .chips .chip { padding: 9px 13px 9px 10px; } .chips .chip b { font-size: 15px; } }
/* sound toggle (under the quit button) */
.mute { position: absolute; left: 12px; top: calc(env(safe-area-inset-top, 0px) + 62px); width: 38px; height: 38px; font-size: 16px; }

/* hider health: water meter — soak it to 0 and you're caught */
.hp { position: absolute; left: 64px; top: calc(env(safe-area-inset-top, 0px) + 14px); display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 16px; background: rgba(255, 248, 234, .9); box-shadow: 0 3px 0 rgba(60, 70, 50, .2); }
.hp .hp-ic { font-size: 18px; }
.hp b { font-family: var(--fd); font-size: 16px; min-width: 28px; text-align: right; }
.hpbar { width: 130px; height: 12px; border-radius: 6px; background: rgba(51, 64, 47, .18); overflow: hidden; }
.hpbar i { display: block; height: 100%; width: 100%; border-radius: 6px; background: linear-gradient(180deg, #8fdc6e, #4fae45); transition: width .15s, background .3s; }
.hp.low .hpbar i { background: linear-gradient(180deg, #ff8a7a, #d9443a); }
.hp.hit { animation: hpShake .25s; }
@keyframes hpShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hurt { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(110% 85% at 50% 50%, transparent 45%, rgba(90, 170, 230, .55)); transition: opacity .35s; }
.hurt.on { opacity: 1; transition: none; }
@media (max-width: 560px) { .hpbar { width: 90px; } }
.joy.sprint { border-color: #ffd36b; box-shadow: 0 0 0 4px rgba(255, 211, 107, .35); }

/* 5v5 Team Activity Feed & Spectator Pill (Warm Storybook Cream) */
.feed { position: absolute; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 74px); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; max-width: min(74vw, 310px); z-index: 3; }
.feed-item { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 14px; background: rgba(255, 248, 234, .92); box-shadow: 0 3px 0 rgba(60, 70, 50, .2), 0 6px 14px rgba(25, 35, 22, .16); font-size: 12px; font-weight: 800; color: var(--ink); line-height: 1.25; animation: feedSlide .22s cubic-bezier(.3, 1.4, .5, 1); transition: opacity .3s, transform .3s; }
.feed-item.soak { border-left: 4px solid #55a9e6; }
.feed-item.ally { border-left: 4px solid #75b35e; }
.feed-item.warn { border-left: 4px solid #ef7a6b; }
.feed-item.out { opacity: 0; transform: translateX(14px); }
.feed-item b { font-family: var(--fd); font-weight: 700; }
@keyframes feedSlide { from { opacity: 0; transform: translateX(18px) scale(.92); } }

.spec-bar { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 9px 14px; border-radius: 22px; background: rgba(255, 248, 234, .95); box-shadow: 0 5px 0 rgba(60, 70, 50, .25), 0 14px 28px rgba(25, 35, 22, .28); pointer-events: auto; z-index: 4; max-width: 92vw; }
.spec-bar span { font-weight: 900; font-size: 13.5px; color: var(--ink); }
.spec-btns { display: flex; gap: 7px; }
.spec-btn { padding: 7px 12px; border-radius: 14px; font-family: var(--fd); font-weight: 700; font-size: 13.5px; background: #eae2cf; color: var(--ink); box-shadow: 0 3px 0 rgba(60, 70, 50, .2); }
.spec-btn.primary { background: linear-gradient(180deg, #ffd88a, #ffb547); color: #5a3a08; }
.spec-btn:active { transform: translateY(2px); }

/* ============================================================
 * Photon Matchmaking Lobby Screen (Smooth Persistent DOM + Organic Joins)
 * ============================================================ */
#queueScreen { align-items: center; justify-content: center; padding: 14px; background: radial-gradient(82% 72% at 50% 50%, rgba(34, 48, 34, .42), rgba(16, 24, 18, .68)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.q-card { width: min(94vw, 580px); padding: 18px 20px 16px; border-radius: 28px; background: var(--cream); text-align: center; box-shadow: 0 8px 0 rgba(50, 62, 42, .28), 0 24px 54px rgba(18, 28, 18, .42); animation: qCardIn .36s cubic-bezier(.16, 1, .3, 1) both; transition: box-shadow .35s, transform .35s; }
.q-card.is-full { box-shadow: 0 8px 0 rgba(168, 112, 20, .34), 0 0 0 4px #ffc857, 0 26px 60px rgba(18, 28, 18, .48); }
@keyframes qCardIn { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.96); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }
.q-top-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 13px; border-radius: 99px; background: #ede5d2; font-weight: 900; font-size: 10.5px; letter-spacing: .09em; color: #4d5e43; }
.q-card h2 { margin: 7px 0 4px; font-family: var(--fd); font-size: clamp(23px, 3.8vw, 30px); color: var(--ink); line-height: 1.1; }
.q-role { display: inline-block; padding: 4px 13px; border-radius: 99px; background: linear-gradient(180deg, #ffe8ad, #ffc966); font-weight: 900; font-size: 12px; color: #543606; box-shadow: 0 2px 0 rgba(120, 80, 20, .2); }

.q-clock-wrap { position: relative; display: flex; align-items: center; justify-content: center; gap: 16px; margin: 13px auto 13px; padding: 9px 20px 9px 14px; width: fit-content; border-radius: 22px; background: #f3ecda; box-shadow: inset 0 2px 5px rgba(60, 70, 50, .1); }
.q-dial { position: relative; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.q-dial-svg { width: 50px; height: 50px; transform: rotate(-90deg); overflow: visible; }
.q-dial-track { fill: none; stroke: #dfd6c0; stroke-width: 5; }
.q-dial-arc { fill: none; stroke: url(#qGrad); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 144.5; stroke-dashoffset: 130; transition: stroke-dashoffset .42s cubic-bezier(.16, 1, .3, 1); }
.q-dial-ic { position: absolute; font-size: 18px; line-height: 1; animation: qIconFloat 2.2s ease-in-out infinite; }
@keyframes qIconFloat { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.1); } }
.q-clock { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.q-clock b { font-family: var(--fd); font-size: 27px; color: var(--ink); font-variant-numeric: tabular-nums; }
.q-clock small { font-weight: 900; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: #6d7c61; }
.q-count { padding-left: 15px; border-left: 2px solid #dfd6c0; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.q-count b { font-family: var(--fd); font-size: 25px; color: #478035; font-variant-numeric: tabular-nums; transition: transform .22s cubic-bezier(.2, 1.4, .4, 1), color .25s; }
.q-count b.bump { transform: scale(1.22); color: #d68513; }
.q-count span { font-weight: 900; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #6d7c61; }

.q-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; text-align: left; }
.q-col { padding: 9px 10px 10px; border-radius: 19px; background: #f5efe0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.q-col-hdr { font-family: var(--fd); font-weight: 700; font-size: 13.5px; padding: 1px 5px 7px; display: flex; align-items: center; justify-content: space-between; }
.q-col-hdr em { font-style: normal; font-family: var(--fb); font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 99px; background: rgba(60, 72, 50, .09); }
.q-col-hdr.sage { color: #3d6c2e; }
.q-col-hdr.sky { color: #286496; }
.q-slots { display: flex; flex-direction: column; gap: 6px; }

.q-slot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 5px 9px 5px 7px; border-radius: 12px; min-height: 34px; font-size: 12.5px; font-weight: 800; will-change: transform, opacity; transition: background-color .28s, box-shadow .28s, color .25s; }
.q-slot.empty { color: #88937d; background: linear-gradient(90deg, rgba(232, 224, 205, .52) 0%, rgba(248, 242, 228, .88) 50%, rgba(232, 224, 205, .52) 100%); background-size: 220% 100%; animation: qSlotShimmer 2.5s ease-in-out infinite; animation-delay: var(--row-delay, 0s); }
@keyframes qSlotShimmer { 0%, 100% { background-position: 100% 50%; } 50% { background-position: 0% 50%; } }

.q-slot.filled { background: #fffdf8; color: var(--ink); box-shadow: 0 2px 0 rgba(60, 70, 50, .14); }
.q-slot.self { background: linear-gradient(90deg, #fff4d1, #fffdf8); box-shadow: 0 2px 0 rgba(160, 110, 20, .22), inset 0 0 0 2px #f5b340; }
.q-slot.just-joined { animation: qSlotEnter .44s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes qSlotEnter {
  0% { opacity: .82; background: #fff4cf; transform: translate3d(0, 5px, 0) scale(.975); box-shadow: 0 0 0 2.5px rgba(255, 190, 66, .78), 0 6px 14px rgba(120, 85, 15, .16); }
  55% { opacity: 1; background: #fffdf8; transform: translate3d(0, -1px, 0) scale(1.012); box-shadow: 0 0 0 2px rgba(118, 194, 92, .45), 0 3px 6px rgba(60, 70, 50, .14); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.q-slot.just-swapped { animation: qSlotSwap .4s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes qSlotSwap {
  0% { opacity: .85; background: #eaf5ff; transform: translate3d(-6px, 0, 0) scale(.98); box-shadow: 0 0 0 2.5px rgba(86, 174, 240, .72); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.q-slot-left { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; }
.q-mini-av { width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.q-mini-av.hider { background: #e3f3da; box-shadow: inset 0 0 0 1px #a6d493; }
.q-mini-av.seeker { background: #ddeffd; box-shadow: inset 0 0 0 1px #95c8f0; }
.q-slot-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--fd); font-weight: 600; font-size: 13.5px; }
.q-slot.empty .q-slot-txt { font-family: var(--fb); font-weight: 800; font-size: 12px; }
.q-dots { display: inline-flex; gap: 1px; margin-left: 1px; }
.q-dots i { font-style: normal; animation: qDotWave 1.3s ease-in-out infinite; }
.q-dots i:nth-child(2) { animation-delay: .2s; }
.q-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes qDotWave { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-1.5px); } }
.q-slot-empty-dot { width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: #c5bca7; flex-shrink: 0; animation: pulseDot 1.6s ease-in-out infinite; }

.q-slot-right { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.q-ready-dot { width: 7px; height: 7px; border-radius: 50%; background: #5ec24c; box-shadow: 0 0 0 2px rgba(94, 194, 76, .24); }
.q-join-badge { font-size: 10px; font-weight: 900; color: #b57410; background: #fff0cb; padding: 1px 6px; border-radius: 6px; letter-spacing: .03em; }
.q-ping { font-size: 10.5px; font-weight: 900; color: #6c7c60; font-variant-numeric: tabular-nums; min-width: 31px; text-align: right; }
.q-you { padding: 1.5px 5.5px; border-radius: 6px; background: #ffb845; color: #4f3104; font: 900 9.5px var(--fb); letter-spacing: .04em; flex-shrink: 0; }

.q-status { margin: 11px 0 10px; font-weight: 800; font-size: 12.5px; color: #56664b; min-height: 18px; transition: color .25s; }
.q-card.is-full .q-status { color: #3c752b; font-weight: 900; }
.q-cancel { width: 170px; padding: 10px 14px; font-size: 15px; transition: transform .12s, background .15s; }
.q-cancel:hover { background: #e2dac5; transform: translateY(-1px); }

/* ============================================================
 * Animated 5 VS 5 Match Start Clash Presentation
 * ============================================================ */
#vsScreen { align-items: center; justify-content: center; padding: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden; }
.vs-backdrop { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(55% 65% at 22% 54%, rgba(76, 146, 62, .34), transparent 70%),
  radial-gradient(55% 65% at 78% 54%, rgba(56, 136, 206, .34), transparent 70%),
  linear-gradient(108deg, rgba(24, 38, 24, .82) 0%, rgba(28, 36, 30, .78) 49.4%, rgba(255, 224, 130, .28) 50%, rgba(22, 34, 44, .82) 50.6%, rgba(18, 28, 38, .86) 100%);
  animation: vsBgFade .35s ease-out both;
}
@keyframes vsBgFade { from { opacity: 0; } to { opacity: 1; } }

.vs-stage { position: relative; z-index: 1; width: min(96vw, 890px); display: flex; flex-direction: column; align-items: center; gap: 15px; }
.vs-banner { text-align: center; animation: vsBannerIn .48s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes vsBannerIn { from { opacity: 0; transform: translate3d(0, -20px, 0) scale(.95); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }
.vs-kicker { display: inline-block; padding: 4px 15px; border-radius: 99px; background: linear-gradient(180deg, #ffe7a3, #ffbe4d); color: #4f3104; font-weight: 900; font-size: 11px; letter-spacing: .12em; box-shadow: 0 3px 0 rgba(90, 58, 8, .38); }
.vs-banner h2 { margin: 7px 0 0; font-family: var(--fd); font-size: clamp(26px, 4.6vw, 40px); color: #fff8ea; text-shadow: 0 4px 0 rgba(28, 40, 26, .72), 0 10px 26px rgba(0, 0, 0, .48); line-height: 1.05; }

.vs-arena { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.vs-team { padding: 13px 14px 14px; border-radius: 24px; background: rgba(255, 248, 234, .95); box-shadow: 0 8px 0 rgba(24, 34, 24, .38), 0 20px 44px rgba(8, 14, 10, .42); animation: vsTeamPanel .42s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes vsTeamPanel { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.vs-team.hiders { border-top: 5px solid #6cb354; }
.vs-team.seekers { border-top: 5px solid #52a4e5; }
.vs-team-hdr { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 8px; border-bottom: 2px solid #ebe2ce; margin-bottom: 9px; }
.vs-team.hiders .vs-team-hdr span { font-family: var(--fd); font-weight: 700; font-size: 17.5px; color: #386829; }
.vs-team.seekers .vs-team-hdr span { font-family: var(--fd); font-weight: 700; font-size: 17.5px; color: #245d8f; }
.vs-team-hdr small { font-weight: 900; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #718065; }

.vs-list { display: flex; flex-direction: column; gap: 7px; }
.vs-player { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 11px; border-radius: 14px; background: #f6efe0; box-shadow: 0 3px 0 rgba(60, 70, 50, .14); opacity: 0; will-change: transform, opacity; }
.vs-team.hiders .vs-player { animation: vsDealLeft .52s cubic-bezier(.16, 1, .3, 1) forwards; }
.vs-team.seekers .vs-player { animation: vsDealRight .52s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes vsDealLeft { from { opacity: 0; transform: translate3d(-52px, 6px, 0) scale(.95); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }
@keyframes vsDealRight { from { opacity: 0; transform: translate3d(52px, 6px, 0) scale(.95); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }

.vs-player.is-you { background: linear-gradient(90deg, #fff1c2, #fffdf6); box-shadow: 0 3px 0 rgba(160, 108, 18, .26), inset 0 0 0 2.5px #f5ac32; }
.vs-player.is-you::after { content: ''; position: absolute; top: 0; bottom: 0; width: 60px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); transform: skewX(-20deg) translateX(-120px); animation: vsYouSheen 2.4s .75s ease-in-out infinite; pointer-events: none; }
@keyframes vsYouSheen { 0% { transform: skewX(-20deg) translateX(-120px); } 45%, 100% { transform: skewX(-20deg) translateX(380px); } }

.vs-p-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.vs-avatar { width: 31px; height: 31px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.vs-team.hiders .vs-avatar { background: #e1f2d8; box-shadow: inset 0 0 0 1.5px #9fd18b; }
.vs-team.seekers .vs-avatar { background: #dceeff; box-shadow: inset 0 0 0 1.5px #8cc4f0; }
.vs-name { font-family: var(--fd); font-weight: 600; font-size: 15.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-you-pill { padding: 2px 6px; border-radius: 7px; background: #ffb53d; color: #4d2f04; font: 900 10px var(--fb); letter-spacing: .05em; flex-shrink: 0; }
.vs-p-right { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.vs-ping { font-size: 11px; font-weight: 900; color: #6e7d63; font-variant-numeric: tabular-nums; }

.vs-center { position: relative; width: 126px; height: 126px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vs-shockwave { position: absolute; width: 104px; height: 104px; border-radius: 50%; border: 3px solid rgba(255, 220, 120, .85); opacity: 0; animation: vsShock 1.1s .28s cubic-bezier(.16, 1, .3, 1) forwards; pointer-events: none; }
@keyframes vsShock { 0% { opacity: .95; transform: scale(.75); } 100% { opacity: 0; transform: scale(2.05); } }
.vs-burst { position: absolute; inset: -18px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 214, 102, .38) 0deg 15deg, rgba(255, 248, 234, .04) 15deg 30deg); mask-image: radial-gradient(circle, #000 36%, transparent 72%); -webkit-mask-image: radial-gradient(circle, #000 36%, transparent 72%); animation: vsSpin 12s linear infinite; }
@keyframes vsSpin { to { transform: rotate(360deg); } }
.vs-crest { position: relative; width: 110px; height: 110px; border-radius: 50%; background: linear-gradient(180deg, #fff6db, #ffc654); box-shadow: 0 6px 0 #b87414, 0 0 0 5px #fff8ea, 0 16px 34px rgba(0, 0, 0, .46); display: flex; align-items: center; justify-content: center; gap: 4px; animation: vsCrestIn .56s .12s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes vsCrestIn { 0% { opacity: 0; transform: scale(1.65); } 100% { opacity: 1; transform: scale(1); } }
.vs-num { font-family: var(--fd); font-weight: 700; font-size: 34px; color: #4e3005; line-height: 1; }
.vs-word { font-style: normal; font-family: var(--fd); font-weight: 700; font-size: 19px; padding: 3px 6px; border-radius: 9px; background: #4e3005; color: #fff8ea; line-height: 1; }

.vs-foot { width: min(88vw, 520px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vs-bar { width: 100%; height: 9px; border-radius: 99px; background: rgba(255, 248, 234, .22); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3); }
.vs-bar i { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, #8ee075, #ffd36b, #6dc2ff); }
.vs-bar i.run { animation: vsFill var(--vs-dur, 3.5s) linear forwards; }
@keyframes vsFill { from { width: 0%; } to { width: 100%; } }
#vsFootTxt { font-weight: 900; font-size: 12px; letter-spacing: .07em; color: rgba(255, 248, 234, .92); text-transform: uppercase; text-align: center; }

@media (max-width: 720px) {
  .q-teams { grid-template-columns: 1fr; gap: 7px; }
  .vs-arena { grid-template-columns: 1fr; gap: 8px; }
  .vs-center { width: 78px; height: 78px; margin: -2px auto; }
  .vs-crest { width: 74px; height: 74px; }
  .vs-num { font-size: 24px; }
  .vs-word { font-size: 14px; }
  .vs-player { padding: 5px 9px; }
}

/* ============================================================
 * Graphics Quality Pill (Ultra PC Match · High · Battery) & Toast
 * ============================================================ */
.gfx-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 248, 234, .92);
  color: var(--ink);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .01em;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(60, 70, 50, .24), 0 6px 14px rgba(20, 30, 20, .16);
  transition: transform .12s, background .18s, box-shadow .18s;
}
.gfx-pill[data-tier="ultra"] {
  background: linear-gradient(180deg, #fff9e6, #ffe8a8);
  color: #4f3205;
  box-shadow: 0 3px 0 rgba(120, 78, 12, .28), inset 0 0 0 1.5px #f0b643, 0 6px 14px rgba(20, 30, 20, .18);
}
.gfx-pill[data-tier="high"] {
  background: linear-gradient(180deg, #f3fbeb, #d6f0be);
  color: #2c521e;
  box-shadow: 0 3px 0 rgba(48, 86, 34, .26), inset 0 0 0 1.5px #96cf72, 0 6px 14px rgba(20, 30, 20, .16);
}
.gfx-pill:active {
  transform: translateY(2px) scale(.97);
}
.hud-gfx {
  position: absolute;
  left: 12px;
  top: calc(env(safe-area-inset-top, 0px) + 108px);
  z-index: 3;
}
.title-gfx {
  position: absolute;
  right: max(14px, calc(env(safe-area-inset-right, 0px) + 14px));
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px));
  z-index: 4;
}
.gfx-toast {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 58px);
  transform: translate3d(-50%, -8px, 0);
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(40, 52, 36, .9);
  color: #fff8ea;
  font-family: var(--fb);
  font-weight: 900;
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 90;
  box-shadow: 0 6px 18px rgba(15, 24, 15, .34);
  transition: opacity .22s ease, transform .22s cubic-bezier(.22, 1, .36, 1);
}
.gfx-toast.on {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

/* Painted village shown behind the lobby while the 3D world is still being built at launch (the lobby is
   already usable); it fades out as soon as the world is ready. */
#worldLoadingBg { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: #cfe3d2 url(assets/concepts/map_overview.webp) center / cover no-repeat;
  transition: opacity .6s ease; }
#worldLoadingBg.done { opacity: 0; }

/* AAA Radial Motion Speedlines (sprint, smoke dash, launch-stars, flight) */
#speedLines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  background:
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      rgba(255, 255, 255, 0) 0deg 8deg,
      rgba(255, 250, 232, 0.22) 8deg 9.4deg,
      rgba(255, 255, 255, 0) 9.4deg 18deg
    );
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 46%, rgba(0, 0, 0, 0.92) 94%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 46%, rgba(0, 0, 0, 0.92) 94%);
  transition: opacity .16s ease-out;
}

/* Diegetic 3D World Toy Beacons */
#worldBeaconsLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}
.wb-pin {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  background: rgba(255, 251, 240, 0.90);
  border: 1.5px solid rgba(244, 178, 52, 0.92);
  color: #34230a;
  font-family: var(--fb);
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(45, 32, 12, 0.26), 0 0 0 2px rgba(255, 224, 122, 0.28);
  transform: translate3d(-50%, -100%, 0);
  will-change: transform, opacity;
}
.wb-pin .wb-ic { font-size: 13px; }
.wb-pin .wb-dist { color: #9a5d14; font-size: 10px; }
.wb-pin.wb-close {
  border-color: #46b56b;
  box-shadow: 0 4px 14px rgba(40, 140, 74, 0.34), 0 0 0 3px rgba(105, 224, 140, 0.35);
}

/* AAA Killstreak Medal Callout (#killBanner) */
#killBanner {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 84px);
  transform: translate3d(-50%, -12px, 0) scale(0.75);
  z-index: 92;
  pointer-events: none;
  padding: 9px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b4a 0%, #ffb732 52%, #ffe066 100%);
  border: 2.5px solid #fff8dc;
  color: #361804;
  font-family: var(--fd, 'Fredoka', system-ui, sans-serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 24px rgba(235, 96, 36, 0.52), 0 3px 0 rgba(120, 42, 8, 0.36);
  opacity: 0;
  transition: opacity .18s ease, transform .24s cubic-bezier(0.22, 1.4, 0.36, 1);
}
#killBanner.on {
  opacity: 1;
  transform: translate3d(-50%, 0, 0) scale(1);
}

/* 1-Tap Emote Trigger Button (#btnEmoteToggle) */
#btnEmoteToggle {
  position: fixed;
  right: max(172px, calc(env(safe-area-inset-right, 0px) + 172px));
  top: max(14px, calc(env(safe-area-inset-top, 0px) + 14px));
  z-index: 42;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 252, 244, 0.92);
  border: 2px solid rgba(114, 150, 92, 0.55);
  box-shadow: 0 3px 10px rgba(32, 46, 26, 0.22);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .12s ease, background .15s ease;
}
#btnEmoteToggle:active { transform: scale(0.92); }
#btnEmoteToggle.is-open {
  background: linear-gradient(180deg, #ffe799, #ffc94a);
  border-color: #df8e14;
}

/* Result Rematch Button & Quick Play Map Card */
.btn.rematch-btn {
  background: linear-gradient(180deg, #4ec675 0%, #2f9e56 100%);
  color: #fffef5;
  border: 2px solid #88e6a6;
  box-shadow: 0 4px 0 rgba(25, 84, 44, 0.34), 0 8px 18px rgba(47, 158, 86, 0.32);
}
.btn.rematch-btn:active { transform: translateY(2px); }
.map-card.quick-play-card {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 8px;
  border-color: #f3b53c !important;
  background: linear-gradient(135deg, rgba(255, 245, 210, 0.96), rgba(217, 248, 224, 0.96)) !important;
  box-shadow: 0 6px 18px rgba(243, 181, 60, 0.30);
}
.map-card.quick-play-card .map-thumb {
  width: 86px;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}
.map-card.quick-play-card .map-name {
  font-size: 14.5px;
  padding: 0;
}

/* ============================================================ v4.0 Genre-King & AAA HUD Declutter */
/* Top-left compact gear button & expandable settings drawer */
#btnHudSettings {
  position: fixed;
  left: max(62px, calc(env(safe-area-inset-left, 0px) + 62px));
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px));
  z-index: 44;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 252, 244, 0.92);
  border: 2px solid rgba(114, 150, 92, 0.45);
  box-shadow: 0 3px 0 rgba(60, 70, 50, 0.18);
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}
#btnHudSettings.is-open {
  background: linear-gradient(180deg, #ffe8a3, #ffc94a);
  border-color: #df8e14;
}
.hud-settings-pop {
  position: fixed;
  left: max(14px, calc(env(safe-area-inset-left, 0px) + 14px));
  top: calc(env(safe-area-inset-top, 0px) + 60px);
  z-index: 46;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 18px;
  background: rgba(255, 251, 240, 0.96);
  border: 2px solid rgba(180, 160, 120, 0.55);
  box-shadow: 0 10px 26px rgba(32, 42, 24, 0.28);
  pointer-events: auto;
}
.hud-settings-pop.hidden { display: none !important; }
.hud-settings-pop #btnMute,
.hud-settings-pop #btnQuality {
  position: static !important;
  inset: auto !important;
  margin: 0 !important;
}
/* Keep Mute / Quality / FPS / Controls pills tucked cleanly behind the ⚙️ Gear button during gameplay */
body:not(.hud-settings-open) #hud #btnMute,
body:not(.hud-settings-open) #hud #btnQuality,
body:not(.hud-settings-open) #hud #btnFpsCap,
body:not(.hud-settings-open) #hud .fps-pill,
html:not(.is-mobile-touch) body:not(.hud-settings-open) #hud #btnHudQuickSettings,
body:not(.hud-settings-open) #hud #btnControls,
body:not(.hud-settings-open) #hud .ctrl-hud-btn {
  display: none !important;
}
/* Slim top-center disguise/paint bar so the 3D world breathes */
#hud #matchBox {
  padding: 4px 11px;
  gap: 10px;
  border-radius: 16px;
  transform: scale(0.92);
  transform-origin: top center;
}
#hud .hp {
  top: max(60px, calc(env(safe-area-inset-top, 0px) + 60px));
  left: max(14px, calc(env(safe-area-inset-left, 0px) + 14px));
}

/* Seeker Crosshair Proximity Heat-Arc (Cold -> Warm -> Hot) */
.cross-heat {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%) rotate(-90deg);
  pointer-events: none;
  z-index: 12;
  transition: opacity .16s ease;
}
.cross-heat.hidden { display: none !important; }
.cross-heat svg { width: 100%; height: 100%; overflow: visible; }
.cross-heat circle {
  fill: none;
  stroke: #56d8ff;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 125.6;
  stroke-dashoffset: 125.6;
  filter: drop-shadow(0 0 6px rgba(86, 216, 255, 0.7));
  transition: stroke-dashoffset .14s linear, stroke .2s ease;
}
.cross-heat[data-temp="warm"] circle {
  stroke: #ffb833;
  filter: drop-shadow(0 0 8px rgba(255, 184, 51, 0.85));
}
.cross-heat[data-temp="hot"] {
  animation: heatPulse .42s ease-in-out infinite;
}
.cross-heat[data-temp="hot"] circle {
  stroke: #ff4d4f;
  stroke-width: 4.2;
  filter: drop-shadow(0 0 11px rgba(255, 77, 79, 0.95));
}
@keyframes heatPulse {
  0%, 100% { transform: translate(-50%, -50%) rotate(-90deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(-90deg) scale(1.12); }
}

/* Hider Boop-Stun / Bait Prop Button */
#btnBoop.boop-act {
  background: linear-gradient(180deg, #fff4c2, #ffcf56);
  color: #4a2a04;
  border: 2px solid #f09e1a;
}
#btnBoop.is-cd {
  opacity: 0.62;
  filter: grayscale(0.45);
}
#btnBoop.is-overdrive {
  box-shadow: 0 0 0 3px rgba(255, 210, 72, 0.78), 0 4px 16px rgba(242, 148, 24, 0.55);
  animation: heatPulseOverdrive .7s ease-in-out infinite;
}
@keyframes heatPulseOverdrive {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Funny Post-Match Award Superlatives */
.gk-awards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 6px;
  text-align: left;
}
.gk-awards.hidden { display: none !important; }
.gk-award {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 13px;
  background: rgba(255, 251, 238, 0.95);
  border: 1.5px solid rgba(236, 178, 66, 0.65);
  box-shadow: 0 2px 6px rgba(60, 48, 20, 0.10);
}
.gk-award.gk-tone-violet { border-color: #a864f5; background: rgba(246, 238, 255, 0.95); }
.gk-award.gk-tone-coral { border-color: #ef6a56; background: rgba(255, 241, 238, 0.95); }
.gk-award.gk-tone-sky { border-color: #46b5e8; background: rgba(238, 249, 255, 0.95); }
.gk-award.gk-tone-emerald { border-color: #4cb972; background: rgba(238, 252, 243, 0.95); }
.gk-aw-ic { font-size: 20px; line-height: 1; flex-shrink: 0; }
.gk-aw-meta { display: flex; flex-direction: column; gap: 1px; }
.gk-aw-meta b { font-family: var(--fd); font-size: 13.5px; color: #2f2818; line-height: 1.1; }
.gk-aw-meta small { font-size: 11px; font-weight: 800; color: #675d49; line-height: 1.2; }

/* Live 3-Map Rematch Vote */
.mv-wrap {
  margin: 6px 0 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(244, 249, 236, 0.94);
  border: 1.5px solid rgba(114, 172, 92, 0.48);
}
.mv-wrap.hidden { display: none !important; }
.mv-hdr {
  font-family: var(--fd);
  font-size: 12px;
  font-weight: 700;
  color: #36522b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mv-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.mv-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 5px;
  border-radius: 11px;
  border: 1.5px solid rgba(110, 130, 96, 0.35);
  background: #fffdf6;
  color: #2f3c2b;
  font-family: var(--fb);
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
  transition: transform .1s ease, border-color .15s ease, background .15s ease;
}
.mv-btn:active { transform: scale(0.96); }
.mv-btn.active {
  border-color: #3aa85f;
  background: linear-gradient(180deg, #e9fce8, #c9f2cf);
  box-shadow: 0 2px 8px rgba(58, 168, 95, 0.25);
}
.mv-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mv-cnt { font-size: 11px; color: #2b6f3e; }

/* ==========================================================================
 * v5.0 GTA 6 Living World Systems (Wanted Stars, Squad Ping, Breaking News)
 * ========================================================================== */
#wantedStarsHud.wanted-hud {
  position: fixed;
  left: max(16px, calc(env(safe-area-inset-left, 0px) + 16px));
  top: calc(env(safe-area-inset-top, 0px) + 114px);
  z-index: 36;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(36, 26, 12, 0.90), rgba(22, 16, 8, 0.94));
  border: 1.5px solid #ffd24c;
  box-shadow: 0 3px 12px rgba(255, 196, 36, 0.34), inset 0 1px 0 rgba(255, 245, 200, 0.25);
  pointer-events: none;
  animation: wantedPop .24s cubic-bezier(.22, 1.32, .36, 1);
}
#wantedStarsHud.hidden { display: none !important; }
#wantedStarsHud .ws-stars {
  font-size: 14px;
  letter-spacing: 1px;
  color: #ffd644;
  text-shadow: 0 0 8px rgba(255, 214, 68, 0.85);
  line-height: 1;
}
#wantedStarsHud .ws-stars em {
  font-style: normal;
  color: rgba(255, 240, 200, 0.28);
  text-shadow: none;
}
#wantedStarsHud .ws-mul {
  font-family: var(--fd);
  font-size: 11.5px;
  color: #fff3c2;
  letter-spacing: 0.02em;
}
#wantedStarsHud[data-stars="4"],
#wantedStarsHud[data-stars="5"] {
  border-color: #ff6b4a;
  box-shadow: 0 0 16px rgba(255, 92, 64, 0.62);
}
@keyframes wantedPop {
  from { transform: scale(0.84); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#btnSquadPing {
  position: fixed;
  right: max(220px, calc(env(safe-area-inset-right, 0px) + 220px));
  top: max(14px, calc(env(safe-area-inset-top, 0px) + 14px));
  z-index: 42;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 252, 244, 0.92);
  border: 2px solid rgba(236, 168, 44, 0.72);
  box-shadow: 0 3px 10px rgba(32, 46, 26, 0.22);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .12s ease, background .15s ease;
}
#btnSquadPing:active { transform: scale(0.92); }
#btnSquadPing:hover { background: #fff4d2; }

.gk-news-ticker {
  margin: 4px auto 6px;
  padding: 5px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #27221b 0%, #3a3022 100%);
  color: #ffe89e;
  border: 1.5px solid #e7b547;
  font-family: var(--fb);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 2px 8px rgba(30, 22, 10, 0.20);
}
.gk-news-ticker.hidden { display: none !important; }

.prog-persona-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf2, #f3ebff);
  border: 1.5px solid #9c6be6;
  font-weight: 900;
  font-size: 11px;
  color: #3f226b;
  white-space: nowrap;
}

/* v8.3.0: Clear Offline Mode Notice Banner & Seeker Champion Picker */
.offline-notice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 6px auto 2px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3d6, #ffdca0);
  border: 2px solid #d9822b;
  color: #6b3305;
  font-family: var(--fb, 'Nunito', sans-serif);
  font-size: 12.5px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(107, 51, 5, 0.16);
}
.offline-notice.hidden { display: none !important; }
.q-top-pill.is-offline {
  background: linear-gradient(180deg, #fff1cf, #ffd591) !important;
  color: #6b3305 !important;
  border-color: #d9822b !important;
}
.online-dot.is-offline {
  background: #e0822b !important;
  box-shadow: 0 0 0 3px rgba(224, 130, 43, 0.28) !important;
}
.seeker-picker { margin-top: 0; }
#title .player-row { gap: 6px; margin: 4px 0; }
#title .spirit-picker { padding: 5px 10px; }
#title .title-head { margin-bottom: 4px; }
#title .modes { margin-top: 6px; }
.note-link { color: inherit; text-decoration: underline; font-weight: 900; opacity: 0.9; }
.note-link:hover { opacity: 1; }
.web-play-cta {
  position: fixed;
  left: max(14px, env(safe-area-inset-left, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1f3324 0%, #132117 100%);
  border: 2px solid #76d462;
  color: #f6fff0;
  text-decoration: none;
  box-shadow: 0 5px 18px rgba(15, 28, 18, 0.35);
  transition: transform 0.14s ease, filter 0.14s ease;
}
.web-play-cta:hover { transform: translateY(-2px); filter: brightness(1.08); }
.web-play-cta .wpc-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, #42d478, #28a8e8);
  color: #fff; font-size: 13px;
}
.web-play-cta b { display: block; font: 700 13.5px/1.1 var(--fd, 'Fredoka', sans-serif); color: #fff; }
.web-play-cta small { display: block; font: 800 10.5px/1.1 var(--fb, 'Nunito', sans-serif); color: #a8f09c; }
html.is-native-cap .web-play-cta { display: none !important; }
html.is-mobile-touch .web-play-cta {
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: max(92px, calc(env(safe-area-inset-bottom, 0px) + 92px));
  padding: 6px 11px;
  gap: 7px;
  border-radius: 13px;
}
html.is-mobile-touch .web-play-cta .wpc-ic { width: 22px; height: 22px; font-size: 11px; }
html.is-mobile-touch .web-play-cta b { font-size: 11.5px; }
html.is-mobile-touch .web-play-cta small { font-size: 9px; }

/* v8.3.1: Unmistakable Characters Button + Full-Screen Interactive 3D Character Selection Showcase */
.chars-title-btn {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: 158px;
  z-index: 25;
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid #f2b441;
  background: linear-gradient(180deg, #fff4cc 0%, #ffd26a 100%);
  color: #4a2a04;
  font-family: var(--fd, 'Fredoka', sans-serif);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(138, 82, 10, 0.28), 0 6px 16px rgba(40, 28, 10, 0.22);
  transition: transform 0.14s ease, filter 0.14s ease;
}
.chars-title-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.chars-title-btn:active { transform: translateY(2px); }
html.is-mobile-touch #title > #btnDesktopChars { display: none !important; }

.char-select-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  pointer-events: none;
  background: radial-gradient(circle at 72% 52%, rgba(255, 248, 226, 0) 24%, rgba(26, 36, 28, 0.28) 100%);
}
.char-select-screen.on { display: flex; }

.cs-panel {
  pointer-events: auto;
  width: min(390px, 44vw);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 26px;
  background: rgba(255, 251, 240, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2.5px solid rgba(226, 206, 168, 0.95);
  box-shadow: 0 8px 0 rgba(56, 46, 30, 0.18), 0 18px 42px rgba(24, 34, 24, 0.28);
  color: #3a3428;
  overflow: hidden;
}
.cs-head { display: flex; align-items: center; justify-content: space-between; }
.cs-head h2 { margin: 0; font: 700 22px/1.1 var(--fd, 'Fredoka', sans-serif); color: #36522e; }
.cs-close-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: #ede4cf; color: #524838; font: 900 15px/1 var(--fb, 'Nunito', sans-serif);
  cursor: pointer;
}
.cs-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cs-tab {
  padding: 9px 10px; border-radius: 14px; border: 2px solid #e3d6ba;
  background: #fffdf6; color: #5b513e;
  font: 800 13px/1.1 var(--fb, 'Nunito', sans-serif); cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.cs-tab.active {
  background: linear-gradient(180deg, #ffe79e, #ffc44d);
  border-color: #e69d1e; color: #4a2a04;
  box-shadow: 0 3px 0 rgba(138, 82, 10, 0.25);
}
.cs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
  flex: 1 1 auto;
}
.cs-card {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 15px;
  border: 2px solid #e5dac2; background: #fffef9;
  color: #3d3629; text-align: left; cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.cs-card:hover { border-color: #f0b23c; transform: translateY(-1px); }
.cs-card.active {
  background: linear-gradient(180deg, #fff5cf, #ffe08a);
  border-color: #e59a16;
  box-shadow: 0 3px 0 rgba(145, 92, 12, 0.24);
}
.cs-card-ic { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.cs-card-txt { display: flex; flex-direction: column; min-width: 0; }
.cs-card-txt b { font: 700 13.5px/1.15 var(--fd, 'Fredoka', sans-serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-card-txt small { font: 800 10.5px/1.2 var(--fb, 'Nunito', sans-serif); color: #756853; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cs-bio {
  padding: 10px 12px; border-radius: 15px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid #e5dac2;
}
.cs-bio-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.cs-bio-top b { font: 700 16px/1.1 var(--fd, 'Fredoka', sans-serif); color: #2f4a28; }
.cs-role-badge {
  padding: 3px 9px; border-radius: 999px;
  background: #e5f5d8; color: #2e6324;
  font: 900 10.5px/1.1 var(--fb, 'Nunito', sans-serif);
}
.cs-bio p { margin: 0; font: 700 12px/1.35 var(--fb, 'Nunito', sans-serif); color: #5c5344; }

.cs-done-btn {
  width: 100%; padding: 12px 16px; border-radius: 16px; border: 0;
  background: linear-gradient(180deg, #74c95b, #4c9c38);
  color: #fffef6; font: 700 16px/1 var(--fd, 'Fredoka', sans-serif);
  box-shadow: 0 4px 0 #316e23; cursor: pointer;
}
.cs-done-btn:active { transform: translateY(2px); }

.cs-drag-stage {
  flex: 1 1 auto;
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.cs-drag-stage:active { cursor: grabbing; }
.cs-drag-hint {
  padding: 7px 14px; border-radius: 999px;
  background: rgba(34, 42, 32, 0.62); color: #fff8e4;
  font: 800 12.5px/1 var(--fb, 'Nunito', sans-serif);
  backdrop-filter: blur(4px);
}

@media (max-height: 460px) {
  .cs-panel { width: min(350px, 47vw); padding: 10px 12px; gap: 6px; border-radius: 20px; }
  .cs-head h2 { font-size: 17px; }
  .cs-tab { padding: 6px 8px; font-size: 11.5px; }
  .cs-card { padding: 6px 8px; gap: 6px; border-radius: 11px; }
  .cs-card-ic { font-size: 17px; }
  .cs-card-txt b { font-size: 12px; }
  .cs-card-txt small { font-size: 9.5px; }
  .cs-bio { padding: 6px 9px; }
  .cs-bio-top b { font-size: 13.5px; }
  .cs-bio p { font-size: 10.5px; line-height: 1.25; }
  .cs-done-btn { padding: 8px 12px; font-size: 13.5px; border-radius: 12px; }
}

/* ==========================================================================
 * v8.6.0: Concept 1 — Storybook Wooden & Brass Crest Main Screen (Desktop)
 * Strictly scoped to desktop (`html:not(.is-mobile-touch)`) so mobile stays untouched.
 * ========================================================================== */
.c1-sub-bar,
.desk-menu-btn,
.world-picker-backdrop,
.picker-close-btn,
.crest-logo-img,
.desk-prof-stats,
.crest-5v5,
.crest-emblem,
.c1-svg-ic {
  display: none;
}

@keyframes crestFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}
@keyframes crestSheen {
  0% { transform: translateX(-160%) skewX(-24deg); }
  100% { transform: translateX(270%) skewX(-24deg); }
}

html:not(.is-mobile-touch) #title:not(.on) {
  display: none !important;
}
html:not(.is-mobile-touch) #title.on {
  display: block;
  padding: 0;
  background:
    radial-gradient(64% 54% at 50% 42%, rgba(255, 244, 210, 0) 35%, rgba(20, 28, 18, 0.50) 100%),
    linear-gradient(180deg, rgba(16, 26, 18, 0.34) 0%, rgba(16, 26, 18, 0) 22%, rgba(16, 26, 18, 0) 62%, rgba(14, 22, 16, 0.68) 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Hide redundant inline desktop boxes (moved into centered Storybook Crest + Oak & Brass Sub-Bar) */
html:not(.is-mobile-touch) #title > #btnDesktopChars,
html:not(.is-mobile-touch) #title .spirit-picker,
html:not(.is-mobile-touch) #title .seeker-picker,
html:not(.is-mobile-touch) #title #progStrip,
html:not(.is-mobile-touch) #title .logo,
html:not(.is-mobile-touch) #title .tag {
  display: none !important;
}

/* Top-Left: Carved Oak & Gilded Brass Player Profile Medallion */
html:not(.is-mobile-touch) #title .player-row {
  position: fixed;
  top: 22px;
  left: 26px;
  z-index: 28;
  margin: 0;
  padding: 0;
  width: auto;
  max-width: none;
  display: flex;
  align-items: center;
}
html:not(.is-mobile-touch) #title .gamertag-box {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3c2b1c 0%, #261a10 100%);
  border: 2px solid #d4a756;
  box-shadow: 0 6px 18px rgba(15, 10, 4, 0.45), inset 0 1px 0 rgba(255, 232, 174, 0.35);
  color: #fff7e2;
}
html:not(.is-mobile-touch) #title .gt-lbl { display: none; }
html:not(.is-mobile-touch) #title .gt-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  gap: 1px;
}
html:not(.is-mobile-touch) #title .gt-input {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #fff7e2;
  padding: 1px 4px;
  margin-left: -4px;
  width: 118px;
  font-family: var(--fd, 'Fredoka', sans-serif);
  font-size: 14.5px;
  font-weight: 700;
}
html:not(.is-mobile-touch) #title .gt-input:focus {
  background: rgba(255, 236, 186, 0.14);
  outline: 1.5px solid #ffd573;
}
html:not(.is-mobile-touch) #title .desk-prof-stats {
  display: block;
  font: 800 10.5px/1.1 var(--fb, 'Nunito', sans-serif);
  color: #f0c975;
  white-space: nowrap;
}
html:not(.is-mobile-touch) #title .gt-dice {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 224, 148, 0.14);
  border: 1px solid rgba(212, 167, 86, 0.55);
  color: #ffefca;
  box-shadow: none;
  font-size: 13px;
  transition: transform 0.14s ease, background 0.14s ease;
}
html:not(.is-mobile-touch) #title .gt-dice:hover {
  background: rgba(255, 214, 118, 0.28);
  transform: translateY(-1px);
}

/* Top-Right: Carved Oak & Brass Party + Gear Medallions */
html:not(.is-mobile-touch) #title > #btnDesktopParty {
  position: fixed !important;
  top: 22px !important;
  left: auto !important;
  right: 80px !important;
  z-index: 30;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #3c2b1c 0%, #261a10 100%) !important;
  border: 2px solid #d4a756 !important;
  color: #fff6df !important;
  font: 700 14px/1 var(--fd, 'Fredoka', sans-serif);
  box-shadow: 0 6px 16px rgba(15, 10, 4, 0.42), inset 0 1px 0 rgba(255, 232, 174, 0.32) !important;
  transition: transform 0.15s ease, filter 0.15s ease;
}
html:not(.is-mobile-touch) #title > #btnDesktopParty .c1-svg-ic {
  display: inline-block;
}
html:not(.is-mobile-touch) #title > #btnDesktopParty:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

html:not(.is-mobile-touch) #title > #btnDesktopMenu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 32;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #3c2b1c 0%, #261a10 100%);
  border: 2px solid #d4a756;
  color: #ffdf88;
  box-shadow: 0 6px 16px rgba(15, 10, 4, 0.42), inset 0 1px 0 rgba(255, 232, 174, 0.32);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
html:not(.is-mobile-touch) #title > #btnDesktopMenu:hover,
html:not(.is-mobile-touch) #title.desk-menu-open > #btnDesktopMenu {
  transform: translateY(-2px);
  filter: brightness(1.14);
}

/* Oak & Brass Dropdown under Gear Medallion */
html:not(.is-mobile-touch) #title > #btnTitleTutorial,
html:not(.is-mobile-touch) #title > #btnTitleQuickSettings,
html:not(.is-mobile-touch) #title > #btnTitleFpsCap,
html:not(.is-mobile-touch) #title > #btnTitleQuality {
  position: fixed !important;
  right: 26px !important;
  left: auto !important;
  width: 178px !important;
  height: 38px !important;
  padding: 0 14px !important;
  justify-content: flex-start !important;
  text-align: left !important;
  border-radius: 13px !important;
  background: linear-gradient(180deg, #3a291a 0%, #241910 100%) !important;
  border: 1.5px solid #d4a756 !important;
  color: #fff6df !important;
  font: 700 13.5px/1 var(--fd, 'Fredoka', sans-serif) !important;
  box-shadow: 0 10px 24px rgba(10, 8, 4, 0.48) !important;
  z-index: 35 !important;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s ease, filter 0.14s ease;
}
html:not(.is-mobile-touch) #title > #btnTitleTutorial { top: 76px !important; }
html:not(.is-mobile-touch) #title > #btnTitleQuickSettings { top: 120px !important; }
html:not(.is-mobile-touch) #title > #btnTitleFpsCap { top: 164px !important; }
html:not(.is-mobile-touch) #title > #btnTitleQuality { top: 208px !important; }

html:not(.is-mobile-touch) #title.desk-menu-open > #btnTitleTutorial,
html:not(.is-mobile-touch) #title.desk-menu-open > #btnTitleQuickSettings,
html:not(.is-mobile-touch) #title.desk-menu-open > #btnTitleFpsCap,
html:not(.is-mobile-touch) #title.desk-menu-open > #btnTitleQuality {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
html:not(.is-mobile-touch) #title.desk-menu-open > #btnTitleTutorial:hover,
html:not(.is-mobile-touch) #title.desk-menu-open > #btnTitleQuickSettings:hover,
html:not(.is-mobile-touch) #title.desk-menu-open > #btnTitleFpsCap:hover,
html:not(.is-mobile-touch) #title.desk-menu-open > #btnTitleQuality:hover {
  filter: brightness(1.16);
}

/* Upper-Center: Floating Illustrated Hue & Seek Storybook Emblem */
html:not(.is-mobile-touch) #title .title-head {
  position: fixed;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  margin: 0;
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
html:not(.is-mobile-touch) #title .crest-logo-img {
  display: block;
  width: clamp(220px, 23vw, 305px);
  height: auto;
  filter: drop-shadow(0 12px 26px rgba(16, 22, 14, 0.56));
  animation: crestFloat 4.2s ease-in-out infinite;
}
html:not(.is-mobile-touch) #title #lobbyOfflineBanner {
  pointer-events: auto;
  margin-top: 6px;
  font-size: 12px;
  padding: 5px 14px;
}

/* Lower-Center HERO: Double-Beveled Gilded Brass Play Crests (Hide & Seek) */
html:not(.is-mobile-touch) #title .modes {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 26;
  margin: 0 !important;
  width: min(92vw, 640px);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
html:not(.is-mobile-touch) #title .mode {
  position: relative;
  overflow: visible;
  flex: 1 1 0;
  max-width: 310px;
  height: 84px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 22px 0 18px;
  border-radius: 20px;
  border: 2.5px solid #e7c06d;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(.22, 1, .36, 1), box-shadow 0.16s ease, filter 0.16s ease;
}
html:not(.is-mobile-touch) #title .mode::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 242, 200, 0.38);
  pointer-events: none;
}
html:not(.is-mobile-touch) #title .mode::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.28) 50%, transparent 75%);
  background-size: 240% 100%;
  background-position: 140% 0;
  pointer-events: none;
  transition: background-position 0.55s ease;
}
html:not(.is-mobile-touch) #title .mode:hover::after {
  background-position: -60% 0;
}
html:not(.is-mobile-touch) #title .mode-hide {
  background: linear-gradient(180deg, #3c8c4a 0%, #245f32 58%, #1a4725 100%) !important;
  box-shadow: 0 7px 0 #103018, 0 16px 34px rgba(8, 22, 12, 0.55), inset 0 2px 0 rgba(188, 255, 190, 0.35) !important;
}
html:not(.is-mobile-touch) #title .mode-seek {
  background: linear-gradient(180deg, #2b80c9 0%, #1a5394 58%, #133c6e 100%) !important;
  box-shadow: 0 7px 0 #0b2647, 0 16px 34px rgba(8, 18, 36, 0.55), inset 0 2px 0 rgba(176, 232, 255, 0.38) !important;
}
html:not(.is-mobile-touch) #title .mode:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.07);
}
html:not(.is-mobile-touch) #title .mode:active {
  transform: translateY(3px) scale(0.99);
}
html:not(.is-mobile-touch) #title .crest-emblem {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, rgba(255, 244, 205, 0.26), rgba(0, 0, 0, 0.24));
  border: 1.5px solid rgba(255, 226, 152, 0.55);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.28);
}
html:not(.is-mobile-touch) #title .mode .m-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
html:not(.is-mobile-touch) #title .mode b {
  font: 700 23px/1.05 var(--fd, 'Fredoka', sans-serif);
  color: #fffaf0;
  text-shadow: 0 2px 0 rgba(10, 20, 14, 0.55);
  margin: 0;
}
html:not(.is-mobile-touch) #title .mode small {
  font: 800 12px/1.15 var(--fb, 'Nunito', sans-serif);
  color: #f6e7c1;
  margin: 0;
}
html:not(.is-mobile-touch) #title .crest-5v5 {
  display: inline-block;
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(18, 14, 8, 0.45);
  border: 1px solid rgba(255, 224, 148, 0.48);
  font: 900 9.5px/1.1 var(--fb, 'Nunito', sans-serif);
  letter-spacing: 0.08em;
  color: #ffdf8a;
}
html:not(.is-mobile-touch) #title .mode .tut-first-pill {
  position: absolute !important;
  top: -13px !important;
  left: 16px !important;
  right: auto !important;
  margin: 0 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #ffe79e, #f2b43b) !important;
  border: 1.5px solid #472c08 !important;
  color: #3d2104 !important;
  font: 900 10px/1.1 var(--fb, 'Nunito', sans-serif) !important;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(10, 14, 8, 0.36) !important;
}

/* Bottom-Center Slim Carved Oak & Brass Sub-Bar (World | Champions | Journey) */
html:not(.is-mobile-touch) #title .c1-sub-bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 26;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(34, 24, 16, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(212, 167, 86, 0.65);
  box-shadow: 0 10px 26px rgba(10, 8, 4, 0.48);
  white-space: nowrap;
}
html:not(.is-mobile-touch) #title .c1-sub-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #fff6e0;
  font: 700 13.5px/1 var(--fd, 'Fredoka', sans-serif);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
html:not(.is-mobile-touch) #title .c1-sub-item:hover {
  background: rgba(255, 214, 118, 0.18);
  color: #ffdf88;
}
html:not(.is-mobile-touch) #title .c1-sub-div {
  width: 1px;
  height: 18px;
  background: rgba(212, 167, 86, 0.34);
}
html:not(.is-mobile-touch) #title .c1-sub-val {
  font-style: normal;
  font: 800 11.5px/1 var(--fb, 'Nunito', sans-serif);
  color: #e8c77b;
}

/* World Picker: Sleek Centered Modal (Opened from World Button in Sub-Bar!) */
html:not(.is-mobile-touch) #title .world-picker-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(14, 10, 6, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
html:not(.is-mobile-touch) #title.world-modal-open .world-picker-backdrop {
  opacity: 1;
  pointer-events: auto;
}
html:not(.is-mobile-touch) #title .world-picker {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  z-index: 46 !important;
  width: min(820px, 90vw) !important;
  max-width: 820px !important;
  max-height: 86vh;
  overflow-y: auto;
  margin: 0 !important;
  padding: 20px 22px 22px !important;
  border-radius: 26px !important;
  background: rgba(255, 251, 240, 0.97) !important;
  border: 2.5px solid #d4a756 !important;
  box-shadow: 0 24px 64px rgba(10, 8, 4, 0.58) !important;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.95);
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(.22, 1, .36, 1);
}
html:not(.is-mobile-touch) #title.world-modal-open .world-picker {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
html:not(.is-mobile-touch) #title .picker-hdr { margin-bottom: 12px; }
html:not(.is-mobile-touch) #title .picker-hdr-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
html:not(.is-mobile-touch) #title .picker-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: #ede4cf;
  color: #463f30;
  font: 900 14px/1 var(--fb, 'Nunito', sans-serif);
  cursor: pointer;
}
html:not(.is-mobile-touch) #title .picker-close-btn:hover { background: #ffd97a; }
html:not(.is-mobile-touch) #title .map-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
html:not(.is-mobile-touch) #title .map-card.quick-play-card {
  grid-column: 1 / -1 !important;
  flex-direction: row !important;
  align-items: center !important;
  padding: 8px 14px !important;
  gap: 14px !important;
}
html:not(.is-mobile-touch) #title .map-card.quick-play-card .map-thumb {
  width: 112px !important;
  height: 54px !important;
  flex: 0 0 112px !important;
}

/* Bottom-Left: Matching Carved Oak & Brass Google Play CTA (Web Only) */
html:not(.is-mobile-touch) #title .web-play-cta {
  left: 26px;
  bottom: 24px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3c2b1c 0%, #261a10 100%);
  border: 1.5px solid #d4a756;
  box-shadow: 0 8px 22px rgba(10, 8, 4, 0.44), inset 0 1px 0 rgba(255, 232, 174, 0.28);
}
html:not(.is-mobile-touch) #title .web-play-cta small {
  color: #e8c77b;
}
html:not(.is-mobile-touch) #title .note {
  display: none;
}

@media (max-width: 960px) {
  html:not(.is-mobile-touch) #title .modes { width: min(94vw, 540px); bottom: 86px; gap: 12px; }
  html:not(.is-mobile-touch) #title .mode { height: 74px; padding: 0 14px; }
  html:not(.is-mobile-touch) #title .mode b { font-size: 19px; }
  html:not(.is-mobile-touch) #title .c1-sub-item { padding: 7px 11px; font-size: 12.5px; }
  html:not(.is-mobile-touch) #title .web-play-cta { display: none; }
}
