/* CHAOS CROWN: Crown Arena (the 3D online party game) */
#party { background: #07060d; overflow: hidden; touch-action: none; }
#pcv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#pLabels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
#pLabels .nl { position: absolute; left: 0; top: 0; font: 700 12px/1 'Oxanium', sans-serif; letter-spacing: .04em; white-space: nowrap; text-shadow: 0 0 4px #000, 0 0 2px #000, 0 1px 0 #000; will-change: transform; }
#pLabels .nl.me { font-size: 13px; color: #fff !important; padding: 2px 6px; background: rgba(0,0,0,.45); border-radius: 3px; }
#pLabels .nl.hold { color: #ffd76a !important; }
#pLabels .pop { position: absolute; left: 0; top: 0; font: 800 18px/1 'Oxanium', sans-serif; letter-spacing: .06em; text-shadow: 0 0 10px currentColor, 0 2px 0 #000; will-change: transform; }
#pFlash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 3; mix-blend-mode: screen; }
#pHud { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
#pHud button { pointer-events: auto; }

#pTop { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
#pTimerBox { text-align: center; padding: 4px 14px 5px; background: linear-gradient(180deg, rgba(14,11,22,.85), rgba(14,11,22,.55)); clip-path: var(--chamf); box-shadow: inset 0 0 0 1px rgba(242,184,58,.6); }
#pTimer { font: 800 22px/1 'Oxanium', sans-serif; color: #fff; letter-spacing: .05em; }
#pTimer.low { color: #ff3b5c; animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }
#pRound { font: 600 10px/1.3 'Chakra Petch'; letter-spacing: .14em; text-transform: uppercase; color: rgba(237,230,214,.8); }
#pTeams { display: flex; align-items: center; gap: 6px; font: 800 16px 'Oxanium'; }
#pTeams .ta { color: #2EF2FF; text-shadow: 0 0 8px #2EF2FF; } #pTeams .tb { color: #FF2BD6; text-shadow: 0 0 8px #FF2BD6; }
#pTeams em { font-style: normal; color: #F2B83A; font-size: 12px; margin: 0 3px; }
.tbar { width: 110px; height: 8px; background: #FF2BD6; box-shadow: 0 0 8px #FF2BD6; } .tbar i { display: block; height: 100%; width: 50%; background: #2EF2FF; box-shadow: 0 0 8px #2EF2FF; transition: width .3s; }
#pCoop { text-align: center; } .cbar { width: 180px; height: 9px; background: rgba(0,0,0,.6); box-shadow: inset 0 0 0 1px #7a1fd0; margin: 0 auto 3px; }
.cbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7a1fd0, #ff2848); transition: width .3s; }
#pCoop span { font: 600 11px 'Chakra Petch'; letter-spacing: .06em; color: #f1d9ff; text-shadow: 0 0 6px #000; }
#pCoop.hot .cbar { animation: pulse .35s infinite alternate; }

#pBoard { position: absolute; top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 2px; min-width: 112px; max-width: 30vw; }
#pBoard .br { display: flex; align-items: center; gap: 5px; padding: 3px 6px; background: rgba(10,8,16,.62); font: 600 11px/1.1 'Chakra Petch'; transition: transform .2s; }
#pBoard .br i { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }
#pBoard .br .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
#pBoard .br b { font: 700 12px 'Oxanium'; } #pBoard .br em { font-style: normal; color: #F2B83A; font-size: 10px; }
#pBoard .br.me { box-shadow: inset 2px 0 0 #fff; background: rgba(40,34,60,.75); }
#pBoard .br.hold { color: #ffd76a; box-shadow: inset 0 0 0 1px rgba(242,184,58,.8), 0 0 10px rgba(242,184,58,.35); }

#pFeed { position: absolute; top: 74px; right: max(8px, env(safe-area-inset-right)); display: flex; flex-direction: column; align-items: flex-end; gap: 3px; max-width: 46vw; }
#pFeed .fd { font: 500 11px/1.25 'Chakra Petch'; padding: 3px 7px; background: rgba(10,8,16,.6); text-align: right; animation: fin .25s ease-out; transition: opacity .5s; }
#pFeed .fd.out { opacity: 0; }
@keyframes fin { from { transform: translateX(20px); opacity: 0; } }

#pMult { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); font: 800 20px 'Oxanium'; color: #ffd76a; text-shadow: 0 0 14px #F2B83A, 0 2px 0 #000; letter-spacing: .06em; }
#pMultPop { position: absolute; top: 30%; left: 50%; transform: translate(-50%,-50%); font: 900 64px 'Oxanium'; color: #ffd76a; opacity: 0; pointer-events: none; text-shadow: 0 0 30px #F2B83A, 0 4px 0 #6a3d00; }
#pMultPop.show { animation: multPop 1.1s cubic-bezier(.2,1.6,.4,1) both; }
#pMultPop.m4 { color: #fff; text-shadow: 0 0 40px #ff2bd6, 0 0 20px #F2B83A, 0 4px 0 #6a3d00; }
@keyframes multPop { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.2) rotate(-12deg); } 25% { opacity: 1; transform: translate(-50%,-50%) scale(1.25) rotate(4deg); } 70% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-80%) scale(.9); } }
#pPow { position: absolute; top: 104px; left: 50%; transform: translateX(-50%); font: 700 12px 'Oxanium'; letter-spacing: .12em; padding: 3px 10px; border: 1px solid; background: rgba(0,0,0,.5); }

#pCount { position: absolute; top: 40%; left: 50%; transform: translate(-50%,-50%); font: 900 120px/1 'Oxanium'; color: #fff; opacity: 0; text-shadow: 0 0 40px #2EF2FF, 0 0 80px #FF2BD6; pointer-events: none; }
#pCount.show { animation: cnt 1s ease-out both; }
@keyframes cnt { 0% { opacity: 0; transform: translate(-50%,-50%) scale(2.2); } 20% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: .0; transform: translate(-50%,-50%) scale(.7); } }

#pAnn { position: absolute; top: 22%; left: 0; right: 0; text-align: center; opacity: 0; pointer-events: none; padding: 0 12px; }
#pAnn b { display: block; font: 900 clamp(26px, 7.5vw, 58px)/1 'Oxanium'; letter-spacing: .04em; color: #fff; text-shadow: 0 0 24px var(--ac, #2EF2FF), 0 3px 0 #000; }
#pAnn span { display: block; margin-top: 6px; font: 600 clamp(12px, 3.2vw, 17px) 'Chakra Petch'; letter-spacing: .12em; text-transform: uppercase; color: #f4ecff; text-shadow: 0 0 8px #000; }
#pAnn.gold { --ac: #F2B83A; } #pAnn.gold b { color: #ffe9a8; } #pAnn.mag { --ac: #FF2BD6; } #pAnn.cyan { --ac: #2EF2FF; }
#pAnn.show { animation: ann 1.9s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes ann { 0% { opacity: 0; transform: scale(2) skewX(-10deg); filter: blur(6px); } 12% { opacity: 1; transform: scale(.94) skewX(0); filter: none; } 20% { transform: scale(1.04); } 28% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
#pDead { position: absolute; top: 55%; left: 0; right: 0; text-align: center; font: 700 16px 'Oxanium'; letter-spacing: .2em; text-transform: uppercase; color: #ff9eb0; text-shadow: 0 0 10px #000; }
#pHint { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(150px, calc(env(safe-area-inset-bottom) + 150px)); width: min(92vw, 520px); margin: 0; text-align: center; font: 500 12px/1.3 'Chakra Petch'; color: rgba(244,236,255,.85); text-shadow: 0 0 6px #000, 0 0 2px #000; }
#keysHint { position: absolute; left: 0; right: 0; bottom: max(8px, env(safe-area-inset-bottom)); margin: 0; text-align: center; font: 500 11px 'Chakra Petch'; color: rgba(237,230,214,.6); text-shadow: 0 0 4px #000; }
body.touch #keysHint { display: none; }
body:not(.touch) #pHint { bottom: 34px; }

#pBtns { position: absolute; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); display: flex; gap: 5px; }
.pico { width: 34px; height: 34px; border: 0; padding: 0; background: rgba(14,11,22,.8); clip-path: var(--chamf); box-shadow: inset 0 0 0 1px rgba(156,122,53,.8); font: 700 16px 'Oxanium'; color: var(--bone); display: grid; place-items: center; }
.pico img { width: 22px; height: 22px; }
.pico.txt { width: auto; padding: 0 10px; font: 700 11px 'Chakra Petch'; letter-spacing: .1em; text-transform: uppercase; color: #ffd76a; box-shadow: inset 0 0 0 1px #F2B83A, 0 0 12px rgba(242,184,58,.4); }

/* touch controls */
#joyZone { position: absolute; left: 0; bottom: 0; width: 58%; height: 62%; pointer-events: auto; display: none; touch-action: none; }
body.touch #joyZone { display: block; }
#joy { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 2px solid rgba(46,242,255,.5); background: radial-gradient(rgba(46,242,255,.12), rgba(46,242,255,.02)); opacity: 0; pointer-events: none; transition: opacity .15s; left: 22%; top: 80%; }
body.touch #joy { opacity: .35; } #joy.on { opacity: 1 !important; }
#joyK { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; border-radius: 50%; transform: translate(-50%,-50%); background: radial-gradient(#fff, #2EF2FF 60%, #0a6f7a); box-shadow: 0 0 16px #2EF2FF; }
.act { position: absolute; display: none; border: 0; border-radius: 50%; font: 800 14px 'Oxanium'; letter-spacing: .08em; color: #fff; touch-action: none; }
body.touch .act { display: grid; place-items: center; }
#bAtk { right: max(18px, env(safe-area-inset-right)); bottom: max(26px, calc(env(safe-area-inset-bottom) + 18px)); width: 96px; height: 96px; background: radial-gradient(circle at 40% 35%, #ff7ae6, #FF2BD6 55%, #7a0a62); box-shadow: 0 0 22px rgba(255,43,214,.7), inset 0 -4px 0 rgba(0,0,0,.3); }
#bDash { right: max(124px, calc(env(safe-area-inset-right) + 124px)); bottom: max(34px, calc(env(safe-area-inset-bottom) + 26px)); width: 68px; height: 68px; font-size: 12px; background: radial-gradient(circle at 40% 35%, #a8fbff, #2EF2FF 55%, #066a75); color: #022; box-shadow: 0 0 18px rgba(46,242,255,.7), inset 0 -4px 0 rgba(0,0,0,.3); }
.act.down { transform: scale(.9); filter: brightness(1.3); }
.act.cool { filter: saturate(.3) brightness(.7); }

#pToast { position: absolute; z-index: 9; left: 50%; bottom: 46%; transform: translateX(-50%); padding: 8px 14px; background: rgba(12,10,20,.92); box-shadow: inset 0 0 0 1px #F2B83A; font: 600 13px 'Chakra Petch'; opacity: 0; pointer-events: none; transition: opacity .25s; max-width: 90vw; text-align: center; }
#pToast.show { opacity: 1; }

/* panels */
.ppanel { position: absolute; inset: 0; z-index: 8; display: none; align-items: center; justify-content: center; background: rgba(5,4,10,.55); padding: 10px; }
.ppanel.show { display: flex; }
.pp { width: min(420px, 100%); max-height: 100%; overflow-y: auto; padding: 16px 16px 18px; background: linear-gradient(180deg, rgba(22,18,32,.97), rgba(10,8,16,.97)); clip-path: var(--chamf); box-shadow: inset 0 0 0 1px #9c7a35, inset 0 0 0 4px rgba(156,122,53,.2); display: flex; flex-direction: column; gap: 8px; }
.pp.wide { width: min(560px, 100%); }
.pp h2 { margin: 0; font: 400 30px/1 'Grenze Gotisch', serif; color: #ffe9a8; text-shadow: 0 0 14px rgba(242,184,58,.5); letter-spacing: .03em; }
.pp .sub { margin: -2px 0 2px; font: 500 12px 'Chakra Petch'; letter-spacing: .12em; text-transform: uppercase; color: rgba(237,230,214,.8); }
.phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note { margin: 0; font: 400 12px/1.35 'Chakra Petch'; color: rgba(237,230,214,.75); }
.note.center { text-align: center; }
.lbl { margin-top: 4px; font: 700 11px 'Chakra Petch'; letter-spacing: .16em; text-transform: uppercase; color: #F2B83A; }
.lbl .note { letter-spacing: 0; text-transform: none; font-weight: 400; margin-left: 6px; }
.seg { display: flex; gap: 3px; flex-wrap: wrap; }
.seg button { flex: 1; min-height: 36px; padding: 4px 8px; border: 0; background: rgba(255,255,255,.05); font: 600 12px 'Chakra Petch'; color: rgba(237,230,214,.75); box-shadow: inset 0 0 0 1px rgba(156,122,53,.5); }
.seg button.on { color: #fff; background: rgba(46,242,255,.14); box-shadow: inset 0 0 0 1px #2EF2FF, 0 0 10px rgba(46,242,255,.35); }
.seg button:disabled { cursor: default; } .seg button:disabled:not(.on) { opacity: .45; }
.seg.three button { font-size: 12px; min-height: 42px; }
.seg.sm button { min-height: 30px; font-size: 11px; }
#sgTeam .tc.on { background: rgba(46,242,255,.2); } #sgTeam .tm2.on { background: rgba(255,43,214,.2); box-shadow: inset 0 0 0 1px #FF2BD6, 0 0 10px rgba(255,43,214,.35); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 500 13px 'Chakra Petch'; }
.row > span:first-child { min-width: 92px; color: rgba(237,230,214,.85); }
.row .seg { flex: 1; min-width: 160px; }
.row label { display: flex; align-items: center; gap: 6px; } .row input[type=checkbox] { width: 18px; height: 18px; accent-color: #2EF2FF; }
.prow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .prow > .bar { flex: 1; }
.stepper { display: flex; align-items: center; gap: 4px; } .stepper button { width: 34px; height: 34px; border: 0; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(156,122,53,.6); font: 700 18px 'Oxanium'; }
.stepper b { min-width: 22px; text-align: center; font: 700 16px 'Oxanium'; }
.mini { border: 0; min-height: 30px; padding: 4px 10px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(156,122,53,.7); font: 600 11px 'Chakra Petch'; letter-spacing: .08em; text-transform: uppercase; }
.bar.gold { color: #1a1000; background: linear-gradient(180deg, #ffe08a, #d79a22); box-shadow: inset 0 0 0 1px #fff3c4, 0 0 16px rgba(242,184,58,.5); }
.bar.gold:hover { color: #000; box-shadow: inset 0 0 0 1px #fff, 0 0 22px rgba(242,184,58,.8); }
.bar.danger { color: #ffb3c2; box-shadow: inset 0 0 0 1px #ff3b5c; }
.cust { display: flex; flex-direction: column; gap: 5px; }
.cust .sw { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.cust .sw button { aspect-ratio: 1; border: 0; border-radius: 50%; min-height: 22px; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.cust .sw button.on { box-shadow: 0 0 0 2px #0b0a10, 0 0 0 4px #fff, 0 0 12px currentColor; }
.cust .bd, .cust .ht { display: flex; gap: 3px; flex-wrap: wrap; }
.cust .bd button, .cust .ht button { flex: 1; min-width: 56px; min-height: 30px; border: 0; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(156,122,53,.45); font: 600 11px 'Chakra Petch'; color: rgba(237,230,214,.75); }
.cust .bd button.on, .cust .ht button.on { color: #fff; box-shadow: inset 0 0 0 1px #FF2BD6, 0 0 8px rgba(255,43,214,.35); background: rgba(255,43,214,.12); }
.linkrow { display: flex; gap: 6px; } .linkrow input { flex: 1; min-width: 0; padding: 8px; background: #07060c; color: #cfefff; border: 1px solid rgba(46,242,255,.5); font: 12px 'Chakra Petch'; user-select: all; -webkit-user-select: all; }
.linkrow .bar { padding: 8px 12px; font-size: 12px; letter-spacing: .08em; }
.lock { font: 600 11px 'Chakra Petch'; color: rgba(237,230,214,.7); } .lock.on { color: #ffd76a; } .lock.on::before { content: '\1F512 '; }
#lbPeople { display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow-y: auto; }
.lp { display: flex; align-items: center; gap: 7px; padding: 5px 8px; background: rgba(255,255,255,.04); font: 600 13px 'Chakra Petch'; }
.lp i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.lp .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp em { font-style: normal; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #F2B83A; }
.lp .tm { font-size: 11px; font-weight: 700; }
.lp.me { box-shadow: inset 2px 0 0 #fff; } .lp.gate { color: #ffd76a; font-weight: 500; font-size: 12px; }
#lbPass, #gatePw { flex: 1; min-width: 100px; padding: 8px; background: #07060c; color: #fff; border: 1px solid rgba(242,184,58,.6); font: 14px 'Chakra Petch'; }
.slider { display: flex; flex-direction: column; gap: 4px; font: 600 13px 'Chakra Petch'; } .slider input { accent-color: #FF2BD6; }
.how-body p { margin: 0 0 8px; font: 400 13px/1.4 'Chakra Petch'; }
#resRows { display: flex; flex-direction: column; gap: 3px; }
.rrow { display: grid; grid-template-columns: 22px 12px 1fr auto; gap: 4px 8px; align-items: center; padding: 6px 8px; background: rgba(255,255,255,.04); font: 600 13px 'Chakra Petch'; }
.rrow i { width: 12px; height: 12px; border-radius: 50%; } .rrow b { font: 800 15px 'Oxanium'; color: #F2B83A; } .rrow .sm { grid-column: 3 / 5; font-size: 11px; font-weight: 400; color: rgba(237,230,214,.65); }
.rrow.me { box-shadow: inset 2px 0 0 #fff; background: rgba(46,242,255,.08); }
.rrow:first-child { background: rgba(242,184,58,.14); box-shadow: inset 0 0 0 1px rgba(242,184,58,.6); }
#pResult.won h2 { animation: pulse .6s ease-in-out infinite alternate; }
#pResult { background: rgba(5,4,10,.35); }

/* title button */
.bar.arena { color: #1a1000; background: linear-gradient(180deg, #ffe08a, #d79a22); box-shadow: inset 0 0 0 1px #fff3c4, 0 0 22px rgba(242,184,58,.55); line-height: 1.1; }
.bar.arena small { display: block; font: 600 10px 'Chakra Petch'; letter-spacing: .14em; margin-top: 3px; opacity: .8; }
.bar.arena:hover { color: #000; }

@media (max-width: 520px) {
  #pTimer { font-size: 19px; }
  #pBoard { min-width: 96px; } #pBoard .br .nm { max-width: 62px; }
  #pFeed { top: 50px; }
  .pp h2 { font-size: 26px; }
}
@media (max-height: 520px) {
  #pHint { bottom: 120px; }
  #bAtk { width: 80px; height: 80px; } #bDash { width: 58px; height: 58px; right: 108px; }
}
@media (max-width: 560px) {
  #pBtns { flex-direction: column; }
  #pFeed { top: 64px; right: 50px; max-width: 52vw; }
}
.pp > * { flex-shrink: 0; }
#party .seg { height: auto; width: auto; }
