@font-face { font-family: 'Determination'; src: url('assets/fonts/determination.ttf') format('truetype'); font-display: block; }
:root { --pink: #ff3fb0; --cyan: #2ff4ff; --yellow: #ffe23a; --purple: #a54bff; --bg: #07040f; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: #fff; font-family: 'Determination', 'Courier New', monospace; user-select: none; -webkit-user-select: none; touch-action: none; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#vm { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; display: none; }
canvas#vm.on { display: block; }
button { font-family: inherit; }
img { image-rendering: auto; }

/* ---------------- screens */
.screen { position: fixed; inset: 0; display: none; background: #000; z-index: 20; }
.screen.on { display: block; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#boot { background: #05030a; cursor: pointer; }
.bootart { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; filter: saturate(1.2); }
.bootcta { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); font-size: clamp(22px, 4vw, 52px); color: var(--yellow); text-shadow: 0 0 12px var(--pink), 3px 3px 0 #000; animation: blink 1s steps(2) infinite; white-space: nowrap; }
.loadbar { position: absolute; left: 30%; right: 30%; bottom: 9%; height: 10px; border: 2px solid var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.loadbar i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .2s; }
@keyframes blink { 50% { opacity: .25; } }
.skip { position: absolute; right: 3%; bottom: 4%; font-size: clamp(14px, 1.6vw, 22px); color: #fff; opacity: .85; text-shadow: 2px 2px 0 #000; animation: blink 1.4s steps(2) infinite; }

/* PSD-space layout: 2784 x 1536 artboard */
.psd { position: absolute; left: 50%; top: 50%; width: min(100vw, calc(100vh * 1.8125)); aspect-ratio: 2784 / 1536; transform: translate(-50%, -50%); container-type: size; }
.psd > [style*="--x"], .psd > .ppanel { position: absolute; left: calc(var(--x) / 2784 * 100%); top: calc(var(--y) / 1536 * 100%); width: calc(var(--w) / 2784 * 100%); height: calc(var(--h) / 1536 * 100%); }
.ppanel > img { width: 100%; height: 100%; display: block; }
.ppanel > [style*="--x"] { position: absolute; left: calc(var(--x) / var(--pw) * 100%); top: calc(var(--y) / var(--ph) * 100%); width: calc(var(--w) / var(--pw) * 100%); height: calc(var(--h) / var(--ph) * 100%); }
.pimg { position: absolute; }
.pbtn { padding: 0; border: 0; background: none; cursor: pointer; transition: transform .08s; }
.pbtn img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 .6cqw rgba(47, 244, 255, .55)); }
.pbtn img.h { opacity: 0; }
.pbtn:hover img.h, .pbtn:focus-visible img.h, .pbtn.sel img.h { opacity: 1; }
.pbtn:hover, .pbtn.sel { transform: scale(1.04); }
.pbtn:active { transform: scale(.97); }
.pbtn span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 3cqw; color: #fff; text-shadow: 0 0 .5cqw var(--cyan), .2cqw .2cqw 0 #032; letter-spacing: .1cqw; }
#title .psd { animation: slidein .5s ease-out both; }
@keyframes slidein { from { transform: translate(-40%, -50%); opacity: 0; } }
#menu .ppanel { --pw: 566; --ph: 680; }
#pseudo { background: transparent; border: 0; outline: none; color: var(--yellow); font-family: inherit; font-size: 2.3cqw; padding: 0 1.4cqw; text-shadow: 0 0 .4cqw rgba(255, 226, 58, .6); }
#skinprev { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6%; cursor: pointer; }
#skinprev .chibi, .skinprev .chibi { position: relative; image-rendering: pixelated; height: 82%; }
.chibi img { height: 100%; image-rendering: pixelated; display: block; }
.chibi .hat { position: absolute; image-rendering: pixelated; height: auto; left: 50%; transform: translateX(-50%); }
#b_edit span { font-size: 2.2cqw; }
.lvltag { position: absolute; left: 2%; bottom: 3%; font-size: 2cqw; color: var(--yellow); text-shadow: 0 0 .6cqw var(--pink), .2cqw .2cqw 0 #000; }

/* ---------------- modals */
.modal { position: fixed; inset: 0; display: none; z-index: 40; background: rgba(5, 2, 12, .72); backdrop-filter: blur(2px); }
.modal.on { display: flex; align-items: center; justify-content: center; }
.mbox { position: relative; min-width: min(560px, 92vw); max-width: 92vw; max-height: 92vh; overflow: auto; padding: 28px 30px 26px; background: linear-gradient(#1a0730, #0b0418); border: 3px solid #d58cff; box-shadow: 0 0 18px #a54bff, inset 0 0 24px rgba(165, 75, 255, .35); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 14px); }
.mbox.wide { width: min(860px, 94vw); }
.mbox h2 { margin: 0 0 18px; text-align: center; font-size: 34px; letter-spacing: 2px; color: #e6d4ff; text-shadow: 0 0 10px #a54bff; font-weight: normal; }
.mbox h3 { margin: 16px 0 8px; font-weight: normal; color: var(--cyan); font-size: 20px; }
.close { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: #e6d4ff; font-size: 26px; cursor: pointer; }
.modes { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.modes.col { flex-direction: column; align-items: center; }
.mbtn { position: relative; width: 300px; height: 104px; border: 0; background: none; cursor: pointer; padding: 0; transition: transform .08s; }
.mbtn img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mbtn img.h { opacity: 0; } .mbtn:hover img.h { opacity: 1; } .mbtn:hover { transform: scale(1.04); }
.mbtn b { position: absolute; left: 0; right: 0; top: 26%; font-size: 30px; font-weight: normal; color: #fff; text-shadow: 0 0 8px var(--cyan); }
.mbtn small { position: absolute; left: 0; right: 0; bottom: 18%; font-size: 15px; color: var(--yellow); }
.modes.col .mbtn b { top: 32%; }
.check { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 18px; color: #e6d4ff; font-size: 17px; cursor: pointer; }
.check input, .row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--pink); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 12px 0; font-size: 20px; color: #e6d4ff; }
.row input[type=range] { width: 55%; accent-color: var(--cyan); }
.row select { font-family: inherit; font-size: 18px; background: #12062a; color: #fff; border: 2px solid var(--cyan); padding: 2px 8px; }
.cred { text-align: center; font-size: 18px; line-height: 1.5; color: #e6d4ff; } .cred b { color: var(--yellow); font-weight: normal; } .dim { opacity: .6; font-size: 14px; }
.mm .mmslots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 10px 0 18px; }
.mmslot { height: 170px; border: 2px dashed #5d3a85; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 8px; font-size: 15px; color: #8a7aa8; position: relative; overflow: hidden; }
.mmslot.on { border: 2px solid var(--cyan); box-shadow: 0 0 10px var(--cyan); color: #fff; animation: pop .25s ease-out; }
.mmslot .chibi { height: 110px; margin-bottom: 8px; }
@keyframes pop { from { transform: scale(.7); } }
.mmdots { display: flex; justify-content: center; gap: 10px; } .mmdots i { width: 12px; height: 12px; background: var(--pink); animation: blink .9s steps(2) infinite; } .mmdots i:nth-child(2) { animation-delay: .3s; } .mmdots i:nth-child(3) { animation-delay: .6s; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.cell { position: relative; height: 120px; background: #12062a; border: 2px solid #3d2560; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6px; font-size: 13px; text-align: center; }
.cell:hover { border-color: var(--cyan); } .cell.sel { border-color: var(--yellow); box-shadow: 0 0 10px var(--yellow); }
.cell.lock { opacity: .4; cursor: not-allowed; } .cell.lock::after { content: ''; position: absolute; top: 6px; right: 6px; font-size: 18px; }
.cell .chibi { height: 76px; } .cell img.hi { width: 60px; image-rendering: pixelated; margin-bottom: 14px; }
.skinprev.big { height: 200px; display: flex; justify-content: center; align-items: flex-end; } .skinprev.big .chibi { height: 180px; }

/* ---------------- result screen */
#result { background: #000; }
.res .rbg { position: absolute; inset: 0; width: 100%; height: 100%; }
#rposes img { position: absolute; image-rendering: auto; filter: drop-shadow(0 0 1cqw rgba(0, 0, 0, .6)); }
#rposes .winner { animation: bounce 1s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(-2%); } }
.res #rtitle { animation: zoomin .5s cubic-bezier(.2, 1.6, .5, 1) both; }
@keyframes zoomin { from { transform: scale(.2); opacity: 0; } }
.res .ppanel { animation: fadein .4s ease-out both; }
.res .ppanel:nth-child(5) { animation-delay: .1s; } .res .ppanel:nth-child(6) { animation-delay: .15s; } .res .ppanel:nth-child(7) { animation-delay: .2s; }
@keyframes fadein { from { opacity: 0; transform: translateY(8%); } }
.pval { position: absolute; left: 0; right: 0; top: 48%; text-align: center; font-size: 2.15cqw; color: var(--yellow); text-shadow: 0 0 .4cqw rgba(255, 226, 58, .7), .15cqw .15cqw 0 #000; }
.pin { position: absolute; left: 6%; right: 6%; top: 21%; bottom: 8%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .5cqw; font-size: 1.35cqw; color: #fff; text-align: center; }
.pin .rk { width: 100%; display: flex; justify-content: space-between; font-size: 1.45cqw; color: #fff; }
.pin .rk.me { color: var(--yellow); } .pin .rk.win { color: #ff7ad9; }
.pin .newskin { display: flex; gap: 1cqw; align-items: flex-end; } .pin .newskin .chibi { height: 9cqw; } .pin .newskin img.hi { width: 5cqw; image-rendering: pixelated; }
.pin .lvlimg { width: 70%; aspect-ratio: 16/8; background-size: cover; background-position: center; border: .2cqw solid var(--cyan); }
.pin b { color: var(--yellow); font-weight: normal; font-size: 1.6cqw; }
.pcover { position: absolute; left: 12%; right: 12%; top: 5%; height: 12%; background: #032a33; display: flex; align-items: center; justify-content: center; font-size: 1.7cqw; color: #d6fbff; }
#r_rank { top: 18%; bottom: 28%; padding: 0 2%; justify-content: flex-start; gap: .35cqw; }
#r_rank .rk { font-size: 1.3cqw; }
.pbest { position: absolute; left: 5.6%; width: 89%; top: 73.8%; height: 14.9%; display: flex; align-items: center; justify-content: center; font-size: 1.5cqw; line-height: 1; padding-top: .25cqw; color: #fff; white-space: nowrap; }
#r_next.disabled { filter: grayscale(1) brightness(.6); pointer-events: none; }
#r_next span { font-size: 2.6cqw; }

/* ---------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; display: none; z-index: 10; font-size: 18px; }
#hud.on { display: block; }
#hud .tl { position: absolute; left: 16px; top: 12px; }
#hearts img { width: 34px; image-rendering: pixelated; margin-right: 4px; filter: drop-shadow(0 0 4px #ff2f5f); }
#hearts .ko { color: #c8b6ff; font-size: 22px; text-shadow: 0 0 8px #a54bff; }
.scorebox { margin-top: 6px; color: #e6d4ff; text-shadow: 2px 2px 0 #000; } .scorebox b { color: var(--yellow); font-weight: normal; font-size: 22px; }
#hud .tc { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); text-align: center; }
#timer { font-size: 40px; color: #fff; text-shadow: 0 0 10px var(--cyan), 3px 3px 0 #000; line-height: 1; }
#timer.low { color: #ff3a5c; animation: blink .5s steps(2) infinite; }
#objective { font-size: 16px; color: #ffd0ef; text-shadow: 2px 2px 0 #000; margin: 4px 0; }
#objective.alert { color: #ff3a5c; font-size: 20px; animation: blink .4s steps(2) infinite; }
.itemrow { display: flex; align-items: center; gap: 8px; justify-content: center; }
#items { display: flex; gap: 6px; }
.slot { position: relative; width: 44px; height: 44px; background: rgba(20, 6, 40, .7); border: 2px solid #5d3a85; display: flex; align-items: center; justify-content: center; }
.slot img { width: 30px; image-rendering: pixelated; opacity: .35; filter: grayscale(.6); }
.slot.mine { border-color: #ff7ad9; box-shadow: 0 0 10px #ff3fb0; } .slot.mine img { opacity: 1; filter: none; }
.slot.taken img { opacity: .8; filter: none; }
.slot i { position: absolute; right: -4px; top: -4px; width: 12px; height: 12px; }
#itemcount { font-size: 26px; color: #ff7ad9; text-shadow: 0 0 8px #ff3fb0, 2px 2px 0 #000; }
#hud .tr { position: absolute; right: 14px; top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#minimap { width: 200px; height: 147px; image-rendering: pixelated; background: rgba(6, 4, 16, .75); border: 2px solid #5d3a85; }
.meter { position: relative; width: 200px; height: 18px; background: rgba(10, 4, 24, .8); border: 2px solid #5d3a85; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width .15s; }
.meter span { position: absolute; left: 6px; top: -1px; font-size: 14px; z-index: 1; text-shadow: 1px 1px 0 #000; }
#chaos.hot { border-color: #ff3a5c; box-shadow: 0 0 12px #ff3a5c; animation: shakey .15s infinite; }
@keyframes shakey { 50% { transform: translate(1px, -1px); } }
#hud .bl { position: absolute; left: 16px; bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.meter.small { width: 170px; height: 14px; } .meter.small span { font-size: 11px; top: -2px; }
#noise i { background: linear-gradient(90deg, #5bff8f, #ffe23a, #ff3a5c); } #stam i { background: #ffe23a; } #batt i { background: #fffbe0; } #batt.low { border-color: #ff3a5c; animation: blink .5s steps(2) infinite; }
.meter.mic { display: none; } .meter.mic.on { display: block; } .meter.mic i { background: #ff7ad9; }
#hud .br { position: absolute; right: 16px; bottom: 14px; text-align: right; }
#weapon { display: flex; align-items: center; gap: 10px; justify-content: flex-end; min-height: 52px; padding: 6px 12px; background: rgba(20, 6, 40, .7); border: 2px solid #a54bff; }
#weapon img { width: 44px; image-rendering: pixelated; } #weapon b { font-weight: normal; color: #fff; } #weapon span { color: var(--yellow); font-size: 22px; } #weapon .dim { opacity: .5; }
.keys { font-size: 12px; opacity: .6; margin-top: 4px; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; background: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
#crosshair.hit { background: #ff3a5c; transform: scale(2.5) rotate(45deg); }
#prompt { position: absolute; left: 50%; top: 60%; transform: translateX(-50%); font-size: 20px; color: var(--yellow); background: rgba(10, 4, 24, .75); padding: 4px 14px; border: 2px solid var(--yellow); opacity: 0; white-space: nowrap; }
#prompt.on { opacity: 1; }
#burst { position: absolute; left: 0; right: 0; top: 26%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.burst { font-size: 34px; text-shadow: 0 0 6px var(--glow), 3px 3px 0 #000, -2px -2px 0 #000; animation: burst 1.4s ease-out forwards; white-space: nowrap; }
.burst.big { font-size: clamp(30px, 5.2vw, 72px); animation-duration: 2.2s; }
@keyframes burst { 0% { transform: scale(2.6) rotate(-4deg); opacity: 0; } 10% { transform: scale(1) rotate(2deg); opacity: 1; } 16% { transform: scale(1.1) rotate(-1deg); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
#pops { position: absolute; left: 50%; top: 44%; }
.pop { position: absolute; left: 30px; white-space: nowrap; font-size: 20px; color: var(--yellow); text-shadow: 2px 2px 0 #000; animation: popup 1.2s ease-out forwards; }
@keyframes popup { to { transform: translateY(-60px); opacity: 0; } }
#feed { position: absolute; right: 14px; top: 230px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 16px; }
#feed div { background: rgba(10, 4, 24, .7); padding: 2px 10px; text-shadow: 1px 1px 0 #000; transition: opacity .6s; } #feed div.fade { opacity: 0; }
#hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font-size: 15px; background: rgba(10, 4, 24, .8); border: 2px solid var(--cyan); padding: 6px 14px; opacity: 0; transition: opacity .5s; max-width: 92vw; text-align: center; }
#hint.on { opacity: 1; }
#hurt { position: absolute; inset: 0; box-shadow: inset 0 0 160px #ff0030; opacity: 0; }
#marked { position: absolute; inset: 0; box-shadow: inset 0 0 120px #2ff4ff; opacity: 0; transition: opacity .3s; } #marked.on { opacity: .6; animation: blink .8s infinite; }
.nametag { position: absolute; transform: translate(-50%, -100%); font-size: 15px; white-space: nowrap; text-shadow: 1px 1px 0 #000, 0 0 6px #000; }
.nametag.danger { font-size: 18px; animation: blink .4s steps(2) infinite; }
#jumpscare { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
#jumpscare.on { display: flex; background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(255, 0, 60, .5) 60%, transparent); animation: jsbg .9s forwards; }
#jumpscare img { height: 120vh; image-rendering: pixelated; animation: jsimg .9s cubic-bezier(.1, 1.6, .3, 1) forwards; }
@keyframes jsimg { 0% { transform: scale(.2) rotate(-20deg); } 15% { transform: scale(1.15) rotate(6deg); } 25% { transform: scale(1) rotate(-3deg); } 80% { opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes jsbg { 85% { opacity: 1; } 100% { opacity: 0; } }
#dialog { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); width: min(980px, 94vw); display: none; align-items: flex-end; gap: 0; pointer-events: none; }
#dialog.on { display: flex; animation: fadein .25s ease-out; }
.dport { width: 190px; height: 230px; flex: none; background: url('assets/sprites/mika_hd.png') center top / 120% auto no-repeat; filter: drop-shadow(0 0 10px #ff3fb0); }
.dbox { position: relative; flex: 1; min-height: 150px; background: #ffd0ea; color: #3a0a2a; border: 4px solid #fff; box-shadow: 0 0 0 4px #ff3fb0, 0 0 24px #ff3fb0; padding: 14px 20px 18px; border-radius: 4px; }
.dname { font-size: 22px; color: #ff1f8a; } .dtext { font-size: 23px; line-height: 1.3; min-height: 60px; }
.ditems { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; } .ditems span { display: flex; align-items: center; gap: 4px; font-size: 14px; color: #6a1a4a; } .ditems img { width: 26px; image-rendering: pixelated; } .ditems b { font-weight: normal; }
.dnext { position: absolute; right: 12px; bottom: 6px; color: #ff1f8a; animation: blink .8s steps(2) infinite; }
#dialog.small .dport { width: 120px; height: 150px; } #dialog.small .dbox { min-height: 90px; }
.clicklock { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; font-size: 36px; color: var(--yellow); text-shadow: 0 0 12px var(--pink), 3px 3px 0 #000; background: rgba(0, 0, 0, .35); cursor: pointer; }
.clicklock.on { display: flex; }

/* ---------------- touch */
#touch { position: fixed; inset: 0; z-index: 11; display: none; }
body.is-touch #touch.on, #touch.on.force { display: block; }
.stick { position: absolute; width: 120px; height: 120px; margin: -60px; border: 3px solid rgba(255, 255, 255, .25); border-radius: 50%; display: none; }
.stick.on { display: block; } .knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 63, 176, .5); }
.tbtns { position: absolute; right: 18px; bottom: 18px; display: grid; grid-template-columns: repeat(3, 66px); gap: 10px; }
.tb { width: 66px; height: 66px; border-radius: 50%; background: rgba(20, 6, 40, .55); border: 3px solid rgba(47, 244, 255, .6); display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; }
.tb.big { background: rgba(255, 63, 176, .45); } .tb.on { transform: scale(.9); background: rgba(47, 244, 255, .5); }
body.is-touch #hud .bl, body.is-touch .keys { display: none; }
body.is-touch #minimap { width: 140px; height: 103px; }
@media (max-width: 760px) { #timer { font-size: 28px; } .slot { width: 34px; height: 34px; } .slot img { width: 22px; } #minimap { width: 130px; height: 96px; } .meter { width: 130px; } .dport { width: 110px; height: 140px; } .dtext { font-size: 17px; } }

.equip { font-family: inherit; font-size: 1.4cqw; padding: .3cqw 1.4cqw; background: #2a0f3a; color: #ffe23a; border: .2cqw solid #ff7ad9; box-shadow: 0 0 .6cqw #ff3fb0; cursor: pointer; pointer-events: auto; }
.equip:hover { background: #ff3fb0; color: #fff; }
.pin .newskin img.hi { width: 9cqw; }

#b_start { position: absolute; left: 41%; top: 78%; width: 18%; height: 12%; background: none; border: 0; cursor: pointer; z-index: 1; }

@media (max-height: 500px) {
  #hud { font-size: 13px; } #hearts img { width: 22px; } .scorebox b { font-size: 16px; } #timer { font-size: 26px; } #objective { font-size: 12px; }
  .slot { width: 30px; height: 30px; } .slot img { width: 20px; } #itemcount { font-size: 18px; }
  #minimap { width: 120px !important; height: 88px !important; } .meter { width: 120px; height: 14px; } .meter span { font-size: 11px; }
  #weapon { min-height: 36px; padding: 3px 8px; } #weapon img { width: 28px; } #feed { top: 140px; font-size: 12px; } #hint { font-size: 12px; }
  .burst { font-size: 22px; } .burst.big { font-size: 34px; } #prompt { font-size: 14px; }
  body.is-touch #hud .br { bottom: auto; top: 150px; } .tbtns { grid-template-columns: repeat(3, 54px); } .tb { width: 54px; height: 54px; font-size: 22px; }
  .dport { width: 90px; height: 110px; } .dbox { min-height: 100px; padding: 8px 12px; } .dtext { font-size: 15px; } .dname { font-size: 15px; }
  .mbox h2 { font-size: 24px; } .mbtn { width: 220px; height: 78px; } .mbtn b { font-size: 22px; } .mmslot { height: 120px; } .mmslot .chibi { height: 70px; }
}

/* ================= V2 ================= */
/* title: loading + coins + sound tags */
#menu.loading #b_play { filter: grayscale(.7) brightness(.7); }
.loadtag { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); display: flex; align-items: center; gap: 1cqw; font-size: 1.5cqw; color: var(--cyan); text-shadow: .15cqw .15cqw 0 #000; transition: opacity .4s; }
.loadtag i { width: 14cqw; height: .8cqw; border: .15cqw solid var(--cyan); display: block; } .loadtag b { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .2s; }
.loadtag.done { opacity: 0; pointer-events: none; } .loadtag.pulse span { animation: blink .4s steps(2) infinite; color: var(--yellow); }
.coinstag { position: absolute; left: 2%; bottom: 8%; font-size: 1.7cqw; color: #fff; text-shadow: 0 0 .5cqw var(--yellow), .15cqw .15cqw 0 #000; } .coinstag b { color: var(--yellow); font-weight: normal; }
.soundtag { position: absolute; left: 50%; top: 3%; transform: translateX(-50%); font-size: 1.5cqw; color: #fff; background: rgba(10, 4, 24, .7); border: .15cqw solid var(--pink); padding: .3cqw 1cqw; display: none; animation: blink 1.2s steps(2) infinite; white-space: nowrap; }
.soundtag.on { display: block; }
#newgame { background: #000; cursor: pointer; } #newgame video { object-fit: contain; }

/* live avatars (top-left) */
#avatars { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.av { display: flex; align-items: center; gap: 6px; background: rgba(8, 3, 20, .72); border: 2px solid var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); padding: 3px 8px 3px 3px; width: 200px; transition: transform .15s; }
.av canvas { width: 52px; height: 52px; image-rendering: pixelated; flex: none; border: 1px solid rgba(255, 255, 255, .15); }
.av.me { width: 236px; } .av.me canvas { width: 72px; height: 72px; }
.avinfo { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.avinfo b { font-weight: normal; font-size: 15px; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 #000; }
.av.me .avinfo b { font-size: 19px; }
.avh { color: #ff2f5f; font-size: 16px; letter-spacing: 1px; text-shadow: 0 0 4px #ff2f5f; } .av.me .avh { font-size: 22px; }
.avk { color: #ffb0e0; font-size: 13px; } .av.me .avk { font-size: 16px; }
.av.m-fear { animation: shakey .12s infinite; } .av.m-angry { border-color: #ff3a3a; } .av.m-dead { filter: grayscale(.8); opacity: .75; }
.av.inv { opacity: .45; }
#hud .tr .scorebox { font-size: 16px; }

/* inventory bar (bottom center) */
#inv { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; }
.islot { position: relative; width: 66px; height: 66px; background: rgba(12, 4, 30, .78); border: 2px solid #5d3a85; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.islot img { width: 38px; image-rendering: pixelated; }
.islot small { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 9px; color: #e6d4ff; white-space: nowrap; overflow: hidden; }
.islot em { position: absolute; top: 1px; right: 4px; font-style: normal; font-size: 13px; color: var(--yellow); text-shadow: 1px 1px 0 #000; }
.islot.empty { opacity: .45; } .islot.empty small { font-size: 16px; bottom: auto; position: static; }
.islot.sel { border-color: var(--yellow); box-shadow: 0 0 12px var(--yellow); transform: translateY(-6px); }
.islot.wide { width: 220px; } .islot.wide b { font-weight: normal; color: #c8b6ff; font-size: 18px; }
#prompt .key { display: inline-block; background: var(--yellow); color: #1a0730; padding: 0 6px; margin-right: 6px; font-size: .8em; }

/* overlays */
#blind { position: absolute; inset: 0; background: radial-gradient(circle, #fffde8 20%, #fff 70%); opacity: 0; mix-blend-mode: screen; }
#kissflash { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(circle, rgba(255, 80, 180, .0) 30%, rgba(255, 40, 160, .55)); }
#kissflash.on { animation: kissf 1s ease-out; }
#kissflash.on::after { content: ''; position: absolute; left: 50%; top: 40%; font-size: 120px; transform: translate(-50%, -50%); animation: kissl 1s ease-out forwards; }
@keyframes kissf { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes kissl { 0% { transform: translate(-50%, -50%) scale(.3) rotate(-20deg); } 30% { transform: translate(-50%, -50%) scale(1.2) rotate(8deg); } 100% { transform: translate(-50%, -80%) scale(1); opacity: 0; } }
#spotted { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font-size: 110px; color: #ff2f3f; text-shadow: 0 0 20px #ff0020, 5px 5px 0 #000; opacity: 0; }
#spotted.on { animation: spot .9s ease-out; }
@keyframes spot { 0% { opacity: 1; transform: translateX(-50%) scale(2.5); } 15% { transform: translateX(-50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.jstxt { position: absolute; left: 50%; top: 62%; transform: translateX(-50%) rotate(-6deg); font-size: clamp(40px, 9vw, 120px); color: #fff; -webkit-text-stroke: 3px #000; text-shadow: 0 0 20px #ff0040, 6px 6px 0 #ff0040; white-space: nowrap; animation: jsimg .9s ease-out forwards; }
.slot.done { border-color: #ff7ad9; background: rgba(255, 63, 176, .35); } .slot.done img { opacity: 1; filter: none; } .slot.done::after { content: ''; position: absolute; right: -6px; bottom: -8px; font-size: 16px; }
#itemcount img { width: 22px; image-rendering: pixelated; vertical-align: middle; }
.burst { max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }

/* comic / manga bubbles */
#bubbles { position: absolute; inset: 0; overflow: hidden; }
.bub { position: absolute; max-width: min(320px, 44vw); padding: 6px 12px; font-size: 18px; line-height: 1.1; text-align: center; color: #111; background: #fff; border: 3px solid #111; border-radius: 16px; box-shadow: 4px 4px 0 rgba(0, 0, 0, .55); transform-origin: 50% 100%; white-space: normal; }
.bub::after { content: ''; position: absolute; left: 50%; bottom: -14px; margin-left: -8px; border: 8px solid transparent; border-top: 10px solid #111; }
.bub.scream { background: #fff23a; font-size: 24px; letter-spacing: 1px; border-radius: 4px; clip-path: polygon(0 12%, 8% 0, 18% 10%, 30% 0, 42% 9%, 55% 0, 66% 10%, 78% 0, 90% 9%, 100% 2%, 94% 30%, 100% 55%, 94% 78%, 100% 100%, 82% 90%, 66% 100%, 52% 90%, 38% 100%, 24% 90%, 10% 100%, 4% 80%, 0 58%, 6% 34%); padding: 14px 18px; color: #d0001f; text-shadow: 1px 1px 0 #000; }
.bub.scream::after { display: none; }
.bub.fx { background: transparent; border: 0; box-shadow: none; font-size: 30px; color: var(--yellow); -webkit-text-stroke: 1.5px #000; text-shadow: 3px 3px 0 #ff2f6a; }
.bub.fx::after { display: none; }
.bub.ghost { background: #1a0010; color: #ff3a4a; border-color: #ff3a4a; font-size: 22px; box-shadow: 0 0 14px #ff0020; border-radius: 50% 50% 40% 40%; }
.bub.ghost::after { border-top-color: #ff3a4a; }
.bub.mika { background: #ffd0ea; color: #8a0a4a; border-color: #ff3fb0; box-shadow: 0 0 14px #ff3fb0, 4px 4px 0 rgba(0, 0, 0, .4); font-size: 16px; }
.bub.mika::after { border-top-color: #ff3fb0; }

/* Mika video cam */
#mikacam { position: absolute; right: 14px; top: 60%; width: 210px; transform: translate(120%, -50%); transition: transform .3s cubic-bezier(.2, 1.5, .5, 1); background: #ffd0ea; border: 3px solid #fff; box-shadow: 0 0 0 3px #ff3fb0, 0 0 22px #ff3fb0; }
#mikacam.on { transform: translate(0, -50%); }
#mikacam video { width: 100%; aspect-ratio: 1; display: block; image-rendering: pixelated; object-fit: cover; }
#mikacam b { position: absolute; left: 6px; top: 4px; font-weight: normal; color: #fff; font-size: 15px; background: #ff3fb0; padding: 0 6px; }
#mikacam .mctext { padding: 6px 8px; font-size: 15px; color: #6a0a3a; line-height: 1.15; }
.dport { background: none; filter: drop-shadow(0 0 10px #ff3fb0); display: flex; align-items: flex-end; }
.dport video { width: 100%; aspect-ratio: 1; object-fit: cover; image-rendering: pixelated; border: 4px solid #fff; box-shadow: 0 0 0 4px #ff3fb0; background: #000; }
#dialog { align-items: flex-end; gap: 14px; }

/* touch: left stick, right side = jump / LEFT hand / RIGHT hand, item cycle, pause */
.tbtns { right: 16px; bottom: 16px; display: block; width: 230px; height: 200px; grid-template-columns: none; }
.tbtns .tb { position: absolute; }
.tb small { position: absolute; bottom: 6px; font-size: 10px; opacity: .8; }
.tb.right { right: 0; bottom: 0; width: 104px; height: 104px; font-size: 42px; background: rgba(255, 63, 176, .45); }
.tb.left { right: 112px; bottom: 6px; width: 86px; height: 86px; font-size: 34px; background: rgba(255, 226, 58, .3); }
.tb.jump { right: 14px; bottom: 118px; width: 70px; height: 70px; }
.tcycle { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 316px; }
.tb.sm { width: 48px; height: 48px; font-size: 20px; }
.tpause { position: absolute; left: 50%; top: 8px; margin-left: 120px; }
body.is-touch #inv { bottom: 8px; } body.is-touch #inv .islot { width: 54px; height: 54px; } body.is-touch #inv .islot img { width: 30px; }


/* skin shop */
.wallet { text-align: center; font-size: 22px; color: var(--yellow); margin: -8px 0 10px; text-shadow: 0 0 8px var(--yellow); }
.wallet.no { animation: shakey .1s 4; color: #ff3a5c; }
.cell em { font-style: normal; font-size: 13px; color: #c8b6ff; margin-top: 2px; } .cell em.eq { color: var(--yellow); } .cell em.price { color: #ff8aa0; } .cell em.price.ok { color: #5bff8f; }
.cell.lock { opacity: .8; cursor: pointer; } .cell.lock .chibi, .cell.lock img.hi { filter: brightness(.35); } .cell.lock::after { font-size: 16px; }
.cell .nohat { font-size: 40px; margin-bottom: 10px; }
.coinwin { font-size: 3cqw; color: var(--yellow); text-shadow: 0 0 .8cqw var(--yellow), .2cqw .2cqw 0 #000; animation: pop .4s ease-out; }
.pin .newskin { align-items: center; text-align: left; } .pin .newskin .chibi { height: 6.5cqw; } .pin .newskin img.hi { width: 5cqw; }
.equip.off { filter: grayscale(.6); opacity: .7; } .shopbtn { font-size: 1.1cqw; padding: .2cqw 1cqw; }
#r_skins { top: 19%; gap: .4cqw; }

/* date scene */
#date { background: #12010c; overflow: hidden; cursor: pointer; }
#date .dbg { position: absolute; inset: -10%; background: url('assets/chars/brief_bg.jpg') center / cover; filter: blur(14px) brightness(.45) saturate(1.6) hue-rotate(-20deg); }
#date .dframe { position: absolute; left: 50%; top: 6%; height: 62%; aspect-ratio: 1; transform: translateX(-50%); border: 6px solid #fff; box-shadow: 0 0 0 6px #ff3fb0, 0 0 60px #ff3fb0; overflow: hidden; background: #000; transition: filter .4s; }
#date video { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
#date .mosaic { position: absolute; left: 18%; top: 28%; width: 64%; height: 46%; display: none; backdrop-filter: blur(9px) contrast(1.4); background: repeating-conic-gradient(rgba(255, 80, 170, .35) 0 25%, rgba(120, 0, 70, .35) 0 50%) 0 0 / 22px 22px; border: 3px solid #000; }
#date .mosaic::after { content: 'CENSORED'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); background: #000; color: #fff; font-size: clamp(18px, 3vw, 40px); padding: 2px 12px; letter-spacing: 3px; }
#date.mosaicon .mosaic { display: block; animation: shakey .2s infinite; }
#date.dark .dframe { filter: brightness(.5) saturate(1.6) hue-rotate(-25deg); } #date.dark .dbg { filter: blur(14px) brightness(.15); }
#date.censor .dframe { animation: shakey .1s 6; }
#date .dghost { position: absolute; inset: 0; display: none; background: url('assets/sprites/mika_hd.png') center / contain no-repeat; }
#date.twist .dframe { filter: hue-rotate(160deg) invert(.15) contrast(1.6); animation: shakey .08s infinite; }
#date.twist { background: #2a0006; } #date.twist .dbg { filter: blur(10px) brightness(.4) hue-rotate(140deg); }
#date.loser .dframe { filter: blur(6px) grayscale(.4); } #date.loser .dframe::after { content: 'PRIVATE DO NOT DISTURB'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-6deg); background: #ff3fb0; color: #fff; padding: 8px 18px; font-size: clamp(16px, 2.4vw, 32px); white-space: nowrap; border: 3px solid #fff; }
.dhearts { position: absolute; inset: 0; pointer-events: none; } .dhearts i { position: absolute; bottom: -10%; font-style: normal; color: #ff4fb8; text-shadow: 0 0 10px #ff3fb0; animation: rise 6s linear infinite; }
@keyframes rise { to { transform: translateY(-120vh) rotate(25deg); opacity: 0; } }
.dline { position: absolute; left: 50%; bottom: 4%; width: min(900px, 92vw); transform: translateX(-50%); background: #ffd0ea; color: #3a0a2a; border: 4px solid #fff; box-shadow: 0 0 0 4px #ff3fb0, 0 0 24px #ff3fb0; padding: 12px 20px 16px; min-height: 120px; }
.dwho { font-size: 22px; color: #ff1f8a; } .dsay { font-size: clamp(17px, 2.2vw, 26px); line-height: 1.25; }
.bleep { background: #000; color: #000; padding: 0 2px; letter-spacing: -2px; }
.dnext2 { position: absolute; right: 12px; bottom: 6px; color: #ff1f8a; animation: blink .8s steps(2) infinite; }
.dchoices { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dchoices button { font-family: inherit; font-size: clamp(15px, 1.8vw, 21px); text-align: left; background: #2a0f3a; color: #ffe23a; border: 2px solid #ff7ad9; padding: 6px 12px; cursor: pointer; }
.dchoices button:hover { background: #ff3fb0; color: #fff; }
.dsfx { position: absolute; right: 8%; top: 18%; font-size: clamp(30px, 6vw, 80px); color: #fff23a; -webkit-text-stroke: 2px #000; text-shadow: 5px 5px 0 #ff2f6a; transform: rotate(10deg); opacity: 0; }
.dsfx.on { animation: burst 1.4s ease-out forwards; }
.dskip { position: absolute; right: 2%; top: 3%; font-family: inherit; font-size: 18px; background: rgba(10, 4, 24, .7); color: #fff; border: 2px solid #ff7ad9; padding: 4px 14px; cursor: pointer; z-index: 2; }

@media (max-width: 760px), (max-height: 500px) {
  .av { width: 150px; padding: 2px 5px 2px 2px; } .av.me { width: 176px; } .av canvas { width: 36px; height: 36px; } .av.me canvas { width: 50px; height: 50px; }
  .avinfo b { font-size: 12px; } .av.me .avinfo b { font-size: 14px; } .avh { font-size: 12px; } .av.me .avh { font-size: 15px; } .avk { font-size: 11px; }
  #avatars { gap: 3px; } .islot { width: 50px; height: 50px; } .islot img { width: 28px; } .islot small { font-size: 8px; }
  .bub { font-size: 14px; } .bub.scream { font-size: 17px; } #spotted { font-size: 70px; }
  #mikacam { width: 130px; } #mikacam .mctext { font-size: 12px; }
  .tbtns { transform: scale(.85); transform-origin: 100% 100%; }
}

@media (max-height: 520px) {
  #mikacam { top: 118px; transform: translate(120%, 0); width: 250px; display: flex; align-items: center; }
  #mikacam.on { transform: translate(0, 0); }
  #mikacam video { width: 64px; flex: none; } #mikacam .mctext { font-size: 12px; } #mikacam b { font-size: 11px; }
  body.is-touch #inv .islot { width: 46px; height: 46px; } body.is-touch #inv .islot img { width: 26px; }
  .tcycle { gap: 290px; }
}
body.is-touch #dialog { left: 10px; transform: none; width: calc(100vw - 250px); bottom: 10px; }
body:has(#dialog.on) .tcycle { display: none; }
@media (max-height: 520px) { body.is-touch #dialog .dport { width: 84px; height: 84px; } body.is-touch .ditems span { font-size: 11px; } body.is-touch .ditems img { width: 18px; } }

/* ================= V2.1 ================= */
/* pixel-art comic bubbles (skins injected by hud.js as 9-slice border images) */
.bub { border-radius: 0 !important; background: none !important; border: 12px solid transparent !important; box-shadow: none !important; clip-path: none !important; padding: 0 4px !important;
  image-rendering: pixelated; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.55)); font-size: 18px; line-height: 1.05; letter-spacing: 1px; text-shadow: none; -webkit-text-stroke: 0; }
.bub::after { content: ''; position: absolute; left: 50%; bottom: -26px; margin-left: -12px; width: 24px; height: 18px; border: 0 !important; background-size: 100% 100%; image-rendering: pixelated; display: block !important; }
.bub.shout { color: #111; } .bub.chat { color: #d6fbff; font-size: 15px; }
.bub.scream { color: #d0001f; font-size: 22px; padding: 4px 8px !important; }
.bub.ghost { color: #ff4a5a; font-size: 20px; }
.bub.mika { color: #8a0a4a; font-size: 15px; }
.bub.fx { border: 0 !important; filter: none; font-size: 30px; color: #fff23a; text-shadow: 3px 0 0 #000, -3px 0 0 #000, 0 3px 0 #000, 0 -3px 0 #000, 3px 3px 0 #000, -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 6px 6px 0 #ff2f6a; }
.bub.fx::after { display: none !important; }
#mikacam, .dline, .dbox { border-radius: 0 !important; }

/* avatars: pixel hearts + kisses */
.avh img, .avk img { height: 14px; image-rendering: pixelated; margin-right: 2px; vertical-align: middle; }
.av.me .avh img { height: 18px; } .avk em { color: #fff; font-style: normal; }
.avh .gh { font-style: normal; color: #7affd8; font-size: 13px; }
.avmic { position: absolute; right: 4px; top: 4px; width: 14px; image-rendering: pixelated; display: none; } .av { position: relative; } .av.talk .avmic { display: block; animation: blink .3s steps(2) infinite; }
#itemcount img { height: 20px; }
#minimap { width: 240px !important; height: 176px !important; }
body.is-touch #minimap { width: 160px !important; height: 117px !important; }

/* tips, big kiss, ghost banner, chat */
#tip { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); padding: 6px 14px; background: #10223a; color: #d6fbff; border: 3px solid #2ff4ff; font-size: 16px; opacity: 0; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; box-shadow: 4px 4px 0 rgba(0,0,0,.5); }
#tip.on { animation: tipin 4s steps(8) forwards; } @keyframes tipin { 0% { opacity: 0; transform: translate(-50%, 10px); } 5%, 90% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
#bigkiss { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: none; flex-direction: column; align-items: center; pointer-events: none; }
#bigkiss.on { display: flex; animation: bigkiss 1.6s steps(12) forwards; }
#bigkiss img { width: min(46vw, 420px); image-rendering: pixelated; filter: drop-shadow(6px 6px 0 #7a0028); }
#bigkiss b { font-weight: normal; font-size: clamp(40px, 7vw, 96px); color: #fff; text-shadow: 4px 0 0 #ff1f5a, -4px 0 0 #ff1f5a, 0 4px 0 #ff1f5a, 0 -4px 0 #ff1f5a, 8px 8px 0 #000; margin-top: -10px; }
#bigkiss span { font-size: 26px; color: #ffd0ea; text-shadow: 3px 3px 0 #000; }
@keyframes bigkiss { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { transform: translate(-50%, -60%) scale(1); opacity: 0; } }
#kissflash.on::after { content: none; } #kissflash img { position: absolute; left: 50%; top: 40%; width: 200px; transform: translate(-50%, -50%); image-rendering: pixelated; opacity: 0; } #kissflash.on img { animation: kissl 1s steps(8) forwards; }
#ghostinfo { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); display: none; align-items: center; gap: 10px; max-width: min(720px, 92vw); padding: 8px 14px; background: #062a2a; border: 3px solid #7affd8; color: #d8fff4; font-size: 17px; box-shadow: 4px 4px 0 rgba(0,0,0,.6); }
#ghostinfo.on { display: flex; animation: blink 1.6s steps(2) infinite; } #ghostinfo img { width: 40px; image-rendering: pixelated; }
#hud.ghostmode #objective { color: #7affd8; }
#chat { position: absolute; left: 12px; bottom: 96px; width: min(380px, 60vw); pointer-events: none; }
#chatlog div { font-size: 15px; color: #fff; background: rgba(6, 10, 24, .7); padding: 2px 8px; margin-top: 2px; text-shadow: 1px 1px 0 #000; transition: opacity 1s; word-break: break-word; }
#chatlog div.fade { opacity: 0; } #chatlog b { font-weight: normal; }
#chatin { display: none; width: 100%; margin-top: 4px; font-family: inherit; font-size: 16px; color: #fff; background: #10223a; border: 3px solid #2ff4ff; padding: 4px 8px; outline: none; pointer-events: auto; }
#chat.open #chatin { display: block; } #chat.open #chatlog div.fade { opacity: 1; }
.tb img { width: 46%; image-rendering: pixelated; pointer-events: none; }
.tb.jump { font-size: 14px; }
.tchat { position: absolute; left: 50%; top: 8px; margin-left: 176px; display: flex; gap: 8px; } .tchat .tb { font-size: 12px; }
.tb.sm { border-radius: 0; } .tb { border-radius: 0 !important; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px); }
.coinstag img, .wallet img, .coinwin img, .pin img.ci { height: 1em; image-rendering: pixelated; vertical-align: middle; }
body.is-touch .tchat { left: auto; right: 104px; top: 196px; margin: 0; }
#ghostinfo { top: 142px; font-size: 15px; text-align: center; justify-content: center; }
.islot.wide { width: auto; min-width: 260px; padding: 0 18px; display: flex; align-items: center; justify-content: center; text-align: center; white-space: nowrap; }
.islot.wide b { display: block; width: 100%; text-align: center; line-height: 1; }
@media (max-height: 520px) { #ghostinfo { top: 112px; font-size: 12px; max-width: 60vw; } .islot.wide b { font-size: 13px; } }
/* ghost mode: big centered instructions */
#ghostinfo { top: 24%; left: 50%; transform: translateX(-50%); flex-direction: column; gap: 4px; background: none; border: 0; box-shadow: none; max-width: 94vw; padding: 0; pointer-events: none; }
#ghostinfo.on { display: flex; animation: none; }
#ghostinfo .gi1, #ghostinfo .gi2 { display: flex; align-items: center; gap: 12px; font-size: clamp(20px, 3.4vw, 46px); line-height: 1; white-space: nowrap; letter-spacing: 1px;
  text-shadow: 3px 0 0 #000, -3px 0 0 #000, 0 3px 0 #000, 0 -3px 0 #000, 5px 5px 0 rgba(0,0,0,.6); animation: gipulse 1.2s steps(2) infinite; }
#ghostinfo .gi1 { color: #ff7ad9; } #ghostinfo .gi2 { color: #7affd8; animation-delay: .6s; }
#ghostinfo .gior { font-size: clamp(14px, 1.8vw, 22px); color: #fff; text-shadow: 2px 2px 0 #000; }
#ghostinfo img { height: 1.1em; width: auto; image-rendering: pixelated; }
#ghostinfo.dazed .gi2 { color: #ffe23a; } #ghostinfo.dazed .gi2::after { content: ' (DIZZY...)'; }
@keyframes gipulse { 50% { transform: scale(1.04); } }
/* chat: small framed box under the avatars */
#chat { left: 10px; top: 300px; bottom: auto; width: 236px; }
#chatlog { display: flex; flex-direction: column; gap: 2px; }
#chatlog div { font-size: 13px; line-height: 1.15; background: rgba(6, 10, 24, .78); border-left: 3px solid #2ff4ff; padding: 3px 6px; margin: 0; }
#chat.open #chatlog { background: rgba(6, 10, 24, .5); }
#chatin { font-size: 14px; border-width: 2px; }
#chat::before { content: 'CHAT  [T]'; display: block; font-size: 11px; color: #2ff4ff; opacity: .7; margin-bottom: 2px; text-shadow: 1px 1px 0 #000; }
body.is-touch #chat::before { content: 'CHAT'; }
@media (max-height: 520px), (max-width: 760px) { #chat { top: 222px; width: 180px; } #chatlog div { font-size: 11px; } }
/* voice: mic + green level bars next to avatars */
.avbars { position: absolute; right: 6px; bottom: 5px; display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.avbars b { width: 3px; height: 2px; background: #2a4a34; display: block; }
.avbars b.on { background: #5bff8f; box-shadow: 0 0 4px #5bff8f; }
.av.micon .avmic, .av.talk .avmic { display: block; } .av .avmic { right: 26px; top: auto; bottom: 4px; }
.av.talk { border-color: #5bff8f; box-shadow: 0 0 10px #5bff8f; }
/* video capture button */
#recbtn { position: absolute; top: 12px; right: 264px; pointer-events: auto; display: flex; align-items: center; gap: 6px; font-family: inherit; font-size: 14px; color: #fff; background: rgba(8, 3, 20, .78); border: 2px solid #5d3a85; padding: 4px 8px; cursor: pointer; box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
#recbtn img { height: 18px; image-rendering: pixelated; display: block; }
#recbtn:hover { border-color: #2ff4ff; }
#recbtn.on { border-color: #ff3a5c; color: #ff3a5c; } #recbtn.on::before { content: ''; width: 10px; height: 10px; background: #ff3a5c; display: block; animation: blink .8s steps(2) infinite; }
body.is-touch #recbtn { right: auto; left: 50%; margin-left: -250px; top: 8px; }
@media (max-height: 520px) { #recbtn { right: 176px; } }

/* ================= V2.5 menus: fitting room, breaker-box options, receipt credits ================= */
:root { --ink: #05020c; --night: #140726; --night2: #1d0b36; --cyan: #2ff4ff; --pink: #ff3fb0; --mint: #7affd8; --tag: #ffe23a; }
.pxframe, .mbox.shop, .mbox.opts { border: 0 !important; background: var(--night) !important; box-shadow: none !important;
  clip-path: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px)) !important;
  outline: 0; padding: 0 !important; }
.mbox.shop::before, .mbox.opts::before { content: ''; position: absolute; inset: 0; pointer-events: none; border: 4px solid var(--cyan); clip-path: inherit; box-shadow: inset 0 0 0 4px var(--ink), inset 0 0 40px rgba(47, 244, 255, .12); }
.shophead { display: flex; align-items: center; gap: 16px; padding: 16px 22px 12px; background: linear-gradient(var(--night2), var(--night)); border-bottom: 4px solid var(--ink); }
.shophead h2 { margin: 0 !important; font-size: 30px !important; color: #fff !important; text-shadow: 3px 3px 0 var(--pink) !important; letter-spacing: 1px; text-align: left !important; flex: 1; }
.shophead .close { position: static; width: 40px; height: 40px; background: var(--ink); color: #fff; border: 3px solid var(--pink); font-size: 18px; }
.shophead .close:hover, .receipt .close:hover { background: var(--pink); }
.wallet { margin: 0 !important; display: flex; align-items: center; gap: 6px; font-size: 22px !important; color: var(--tag) !important; background: var(--ink); padding: 4px 12px; border: 3px solid var(--tag); text-shadow: none !important; }
.wallet img { height: 20px; }
/* fitting room */
.mbox.shop { width: min(980px, 96vw); max-height: 94vh; display: flex; flex-direction: column; }
.shopbody { display: grid; grid-template-columns: minmax(240px, 34%) 1fr; flex: 1; min-height: 0; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 18px 16px 20px; min-height: 420px; overflow: hidden;
  background: repeating-linear-gradient(90deg, #22103e 0 24px, #1a0b31 24px 48px); border-right: 4px solid var(--ink); }
.stage::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: repeating-conic-gradient(#2b1650 0 25%, #1c0d36 0 50%) 0 0 / 32px 32px; transform: perspective(300px) rotateX(55deg); transform-origin: bottom; opacity: .9; }
.stage .spot { position: absolute; top: -10%; left: 50%; width: 70%; height: 92%; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 100%, rgba(255, 246, 200, .28), transparent 60%), linear-gradient(rgba(255, 246, 200, .14), rgba(255, 246, 200, 0)); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); z-index: 1; }
.stage .skinprev.big { position: relative; z-index: 2; height: 230px !important; display: flex; align-items: flex-end; justify-content: center; }
.stage .skinprev.big .chibi { height: 220px !important; }
.stage .skinprev.big.pop .chibi { animation: hop .35s steps(4); }
@keyframes hop { 50% { transform: translateY(-14px); } }
.podium { position: relative; z-index: 2; width: 150px; height: 18px; background: var(--pink); box-shadow: 0 6px 0 #a01a70, 0 10px 0 var(--ink); margin-top: -6px; }
.stagename { position: relative; z-index: 2; margin-top: 18px; font-size: 26px; color: #fff; text-shadow: 3px 3px 0 var(--ink); }
.stagesub { position: relative; z-index: 2; font-size: 15px; color: var(--mint); margin: 4px 0 12px; display: flex; align-items: center; gap: 4px; }
.stagesub img, .bigbtn img, .cell em img { height: 1em; image-rendering: pixelated; vertical-align: -2px; }
.bigbtn { position: relative; z-index: 2; font-family: inherit; font-size: 20px; color: var(--ink); background: var(--cyan); border: 0; padding: 10px 26px; cursor: pointer; box-shadow: 0 5px 0 #138a94, 0 9px 0 var(--ink); transition: transform .06s; display: flex; align-items: center; gap: 6px; }
.bigbtn:hover { transform: translateY(-2px); } .bigbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 #138a94, 0 4px 0 var(--ink); }
.bigbtn.buy { background: var(--tag); box-shadow: 0 5px 0 #b89a10, 0 9px 0 var(--ink); }
.bigbtn.done { background: #3a2a5a; color: var(--mint); box-shadow: 0 5px 0 #24183a, 0 9px 0 var(--ink); cursor: default; }
.bigbtn.poor { background: #5a2a3a; color: #ffb0c0; box-shadow: 0 5px 0 #3a1a26, 0 9px 0 var(--ink); cursor: not-allowed; }
.shelf { display: flex; flex-direction: column; padding: 14px 18px 12px; min-height: 0; overflow: auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { font-family: inherit; font-size: 17px; padding: 8px 16px; background: var(--ink); color: #b9a8d8; border: 3px solid #3d2560; cursor: pointer; }
.tab.on { background: var(--pink); color: #fff; border-color: #fff; box-shadow: 3px 3px 0 var(--ink); }
#shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
#shopgrid .cell { font-family: inherit; height: 150px; padding: 8px 6px 6px; background: #0f0620; border: 3px solid #3d2560; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; position: relative; opacity: 1; }
#shopgrid .cell .cv { flex: 1; display: flex; align-items: flex-end; justify-content: center; width: 100%; background: linear-gradient(transparent 70%, #1d0b36); }
#shopgrid .cell .chibi { height: 92px; } #shopgrid .cell img.hi { width: 64px; image-rendering: pixelated; margin-bottom: 18px; }
#shopgrid .cell span { font-size: 14px; } #shopgrid .cell .nohat { font-size: 16px; color: #6a5a8a; margin-bottom: 30px; }
#shopgrid .cell em { font-style: normal; font-size: 13px; padding: 1px 6px; background: var(--ink); }
#shopgrid .cell em.eq { color: var(--ink); background: var(--mint); } #shopgrid .cell em.own { color: var(--mint); }
#shopgrid .cell em.price { color: var(--ink); background: var(--tag); clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 50%); padding-left: 10px; }
#shopgrid .cell em.price:not(.ok) { background: #8a7a50; }
#shopgrid .cell:hover { border-color: var(--cyan); } #shopgrid .cell.sel { border-color: #fff; box-shadow: 0 0 0 3px var(--pink); }
#shopgrid .cell.lock .chibi, #shopgrid .cell.lock img.hi { filter: brightness(.45) saturate(.6); } #shopgrid .cell.lock::after { content: none; }
#shopgrid .cell.lock.sel .chibi, #shopgrid .cell.lock.sel img.hi { filter: none; }
.shophint { margin: 14px 0 0; font-size: 13px; color: #8a7aa8; }
@media (max-width: 700px), (max-height: 520px) { .shopbody { grid-template-columns: 1fr 1.4fr; } .stage { min-height: 0; } .stage .skinprev.big { height: 140px !important; } .stage .skinprev.big .chibi { height: 130px !important; } #shopgrid .cell { height: 120px; } #shopgrid .cell .chibi { height: 70px; } .shophead h2 { font-size: 22px !important; } }
/* options: breaker box */
.mbox.opts { width: min(760px, 94vw); }
.optgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.optgrid section { padding: 14px 20px 16px; border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink); }
.optgrid section:nth-child(2n) { border-right: 0; } .optgrid section:nth-child(n+3) { border-bottom: 0; }
.optgrid h3 { margin: 0 0 10px !important; font-size: 18px !important; color: var(--tag) !important; font-weight: normal; }
.opts .row { margin: 10px 0 !important; font-size: 16px !important; color: #e6d4ff; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.opts .row.sw { flex-direction: row; align-items: center; justify-content: space-between; cursor: pointer; }
.opts input[type=range] { -webkit-appearance: none; appearance: none; width: 100% !important; height: 18px; background: repeating-linear-gradient(90deg, #2a1650 0 10px, #1a0b31 10px 12px); border: 3px solid var(--ink); outline: none; cursor: pointer; }
.opts input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 28px; background: var(--cyan); border: 3px solid var(--ink); box-shadow: 0 3px 0 #138a94; }
.opts input[type=range]::-moz-range-thumb { width: 16px; height: 28px; background: var(--cyan); border: 3px solid var(--ink); border-radius: 0; }
.opts input[type=range]:focus-visible { outline: 3px solid var(--pink); }
.opts select { font-family: inherit; font-size: 16px; background: var(--ink); color: #fff; border: 3px solid var(--cyan); padding: 4px 8px; }
.opts .sw input { position: absolute; opacity: 0; pointer-events: none; }
.opts .sw i { flex: none; width: 54px; height: 26px; background: #3a1a2a; border: 3px solid var(--ink); position: relative; }
.opts .sw i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 16px; background: #ff6a8a; transition: left .1s steps(3); }
.opts .sw input:checked + i { background: #12503a; } .opts .sw input:checked + i::after { left: 28px; background: var(--mint); }
.opts .sw input:focus-visible + i { outline: 3px solid var(--pink); }
.keys2 { font-size: 12px; color: #8a7aa8; line-height: 1.5; margin: 8px 0 0; }
@media (max-width: 640px) { .optgrid { grid-template-columns: 1fr; } .optgrid section { border-right: 0 !important; border-bottom: 4px solid var(--ink) !important; } }
/* credits: a store receipt */
#credits.on { align-items: flex-start; overflow: auto; }
.receipt { position: relative; margin: 4vh auto; width: min(380px, 90vw); filter: drop-shadow(8px 8px 0 rgba(0,0,0,.5)); animation: print 1s steps(10) both; }
@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.rcpt { background: #f4f1e8; color: #222; padding: 26px 24px 30px; font-size: 15px; line-height: 1.35;
  -webkit-mask: linear-gradient(#000 0 0) top/100% calc(100% - 10px) no-repeat, conic-gradient(from 135deg at top, #0000 90deg, #000 0) bottom/16px 10px repeat-x;
  mask: linear-gradient(#000 0 0) top/100% calc(100% - 10px) no-repeat, conic-gradient(from 135deg at top, #0000 90deg, #000 0) bottom/16px 10px repeat-x; }
.rlogo { font-size: 30px; text-align: center; color: #c8186e; line-height: 1; }
.rsub { text-align: center; font-size: 12px; color: #555; margin-top: 6px; }
.rline.dash { border-top: 2px dashed #888; margin: 12px 0; }
.ritem { display: flex; justify-content: space-between; gap: 12px; } .ritem b { font-weight: normal; text-align: right; color: #111; }
.ritem.small { font-size: 12px; color: #666; } .ritem.total { font-size: 20px; } .ritem.total b { color: #c8186e; }
.rbar { height: 48px; margin: 16px 0 10px; background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 7px, transparent 7px 9px, #111 9px 10px, transparent 10px 13px); }
.rthanks { text-align: center; font-size: 13px; color: #444; }
.receipt .close { position: absolute; right: -14px; top: -14px; z-index: 2; width: 38px; height: 38px; background: var(--ink); color: #fff; border: 3px solid var(--pink); font-size: 16px; }
.mmsub { text-align: center; color: #b9a8d8; font-size: 15px; margin: -8px 0 12px; min-height: 18px; }
.mmslot small { font-size: 11px; color: #7affd8; }
.mbtn2 { display: block; margin: 14px auto 0; font-family: inherit; font-size: 16px; background: #05020c; color: #fff; border: 3px solid #ff3fb0; padding: 6px 18px; cursor: pointer; }
.mbtn2:hover { background: #ff3fb0; }
/* record button lives above every screen (menus, videos, game, results) */
#recbtn { position: fixed; z-index: 60; top: 10px; right: auto; left: 50%; transform: translateX(-50%); }
body:has(#hud.on) #recbtn { left: auto; right: 264px; transform: none; }
body:has(#hud.on).is-touch #recbtn { right: auto; left: 50%; margin-left: -250px; }
#rectip { position: fixed; z-index: 60; top: 52px; left: 50%; transform: translateX(-50%); padding: 6px 14px; background: #10223a; color: #d6fbff; border: 3px solid #2ff4ff; font-size: 15px; opacity: 0; pointer-events: none; white-space: nowrap; }
#rectip.on { animation: tipin 4s steps(8) forwards; }
#vidready { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; background: rgba(5, 2, 12, .78); }
#vidready.on { display: flex; }
#vidready .vbox { width: min(640px, 94vw); background: #140726; border: 4px solid #2ff4ff; box-shadow: 8px 8px 0 rgba(0,0,0,.5); padding: 18px 20px; color: #fff; }
#vidready h3 { margin: 0 0 12px; font-weight: normal; font-size: 24px; color: #fff; text-shadow: 3px 3px 0 #ff3fb0; }
#vidready video { width: 100%; max-height: 50vh; background: #000; border: 3px solid #05020c; }
#vidready .vidname { font-size: 13px; color: #8a7aa8; margin: 6px 0 2px; } #vidstate { font-size: 15px; color: #7affd8; min-height: 20px; margin: 4px 0 10px; }
#vidready .vbtns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } #vidready .mbtn2 { margin: 0; }
#recbtn.on::after { content: ''; width: 6px; height: 16px; background: linear-gradient(to top, #5bff8f calc(var(--snd, 0) * 100%), #2a4a34 0); display: block; }

/* V2.14 mic status under the PLAY checkbox */
#micstat { margin-top: 6px; font-family: Determination, monospace; font-size: 14px; letter-spacing: 1px; text-align: center; }
#micstat.on { color: #5bff8f; } #micstat.off { color: #9a8fb8; } #micstat.err { color: #ff6b8a; }
.check input[type=checkbox] { accent-color: #5bff8f; }
/* V2.15: 6 players - rivals' cards are compact, the chat sits right under them */
#avatars { gap: 4px; }
.av:not(.me) { padding: 2px 6px 2px 2px; width: 184px; }
.av:not(.me) canvas { width: 40px; height: 40px; }
.av:not(.me) .avinfo b { font-size: 13px; }
.av:not(.me) .avh img, .av:not(.me) .avk img { width: 12px; height: 12px; }
.mm .mmslots { grid-template-columns: repeat(6, 1fr); gap: 10px; }
.mmslot { font-size: 13px; padding: 6px 4px; } .mmslot .chibi { height: 96px; }
@media (max-width: 760px) { .mm .mmslots { grid-template-columns: repeat(3, 1fr); } }

/* V2.17 super forklift gauge + star-power screen edge */
#fkbar { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); display: none; align-items: center; gap: 10px; padding: 6px 12px; background: rgba(8, 3, 20, .8); border: 2px solid #ffd23a; box-shadow: 0 0 14px #ffb000; font-family: Determination, monospace; color: #fff; font-size: 16px; letter-spacing: 1px; z-index: 6; }
#fkbar.on { display: flex; }
#fkbar b { display: block; width: 220px; height: 14px; background: #2a1a40; border: 2px solid #000; position: relative; overflow: hidden; }
#fkbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ff3a5c, #ffb000, #ffe23a, #5bff8f, #3ad0ff, #c03bff); background-size: 220px 100%; animation: fkshine .6s linear infinite; }
#fkbar.low { border-color: #ff3a5c; animation: blink .3s steps(2) infinite; }
#fkbar em { font-style: normal; color: #ffe23a; min-width: 34px; text-align: right; }
@keyframes fkshine { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
#hud.star::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 40px 6px rgba(255, 210, 60, .55); animation: fkshine .8s linear infinite; }

.nametag.ghosttag { text-shadow: 0 0 6px #7affd8, 0 0 2px #000, 1px 1px 0 #000; font-style: italic; }
.nametag.ghosttag::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 4px; background: #c8fff0; border-radius: 5px 5px 2px 2px; vertical-align: -1px; box-shadow: 0 0 6px #7affd8; }

/* V2.21 map chooser on the result screen */
.mapimg { position: relative; background-size: cover; background-position: center; image-rendering: pixelated; }
.mapimg .marr { position: absolute; top: 50%; transform: translateY(-50%); width: 2.2cqw; height: 3.2cqw; min-width: 26px; min-height: 36px; background: rgba(10, 4, 24, .8); border: 2px solid #ff3fb0; color: #fff; font-family: Determination, monospace; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mapimg .marr:hover { background: #ff3fb0; } .mapimg .marr.l { left: 4px; } .mapimg .marr.r { right: 4px; }
.mapimg em { position: absolute; right: 6px; bottom: 4px; font-style: normal; font-family: Determination, monospace; color: #fff; background: rgba(0,0,0,.6); padding: 1px 5px; font-size: 13px; }

.maprow { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 10px; }
.maprow .mbtn2 { min-width: 40px; padding: 6px 10px; font-size: 20px; }
#mapcard { display: flex; align-items: center; gap: 10px; min-width: 330px; background: rgba(10, 4, 24, .7); border: 2px solid #a54bff; padding: 4px 10px 4px 4px; }
#mapthumb { width: 96px; height: 54px; object-fit: cover; image-rendering: pixelated; border: 1px solid #ff3fb0; }
#mapname { font-family: Determination, monospace; color: #ffe23a; font-size: 17px; letter-spacing: 1px; }

.maprow .mbtn2 { margin: 0; }
/* V2.21 kill / combo announcer */
#announce { position: absolute; left: 50%; top: 26%; transform: translate(-50%, -50%); pointer-events: none; text-align: center; z-index: 7; }
#announce b { display: block; font-family: Determination, monospace; font-size: clamp(34px, 6vw, 84px); letter-spacing: 3px; color: var(--ac, #ffe23a); -webkit-text-stroke: 3px #14081e; paint-order: stroke fill; text-shadow: 4px 4px 0 #14081e, 0 0 24px var(--ac, #ffe23a); animation: annpop .9s cubic-bezier(.2, 1.6, .4, 1) both; }
#announce small { display: block; font-family: Determination, monospace; font-size: clamp(14px, 1.6vw, 22px); color: #fff; text-shadow: 2px 2px 0 #000; margin-top: 4px; animation: annpop .9s .08s both; }
@keyframes annpop { 0% { transform: scale(2.6) rotate(-6deg); opacity: 0; } 25% { transform: scale(.9) rotate(2deg); opacity: 1; } 40% { transform: scale(1.05) rotate(0); } 100% { transform: scale(1); } }
#announce.out b, #announce.out small { animation: annout .35s forwards; } @keyframes annout { to { opacity: 0; transform: scale(.7) translateY(-20px); } }
/* 6 players in the match ranking */
#r_rank { gap: .1cqw; bottom: 27%; } #r_rank .rk { font-size: 1.08cqw; line-height: 1.15; } #r_rank .rk .ci { height: 1.1cqw; }

/* ---- mobile / tablet polish (V2.26) ---- */
body.is-touch #hint { bottom: auto; top: 30vh; font-size: 12px; max-width: 58vw; line-height: 1.35; }
#rotate { display: none; position: fixed; inset: 0; z-index: 9999; background: #0b0418; color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
#rotate b { font-size: 26px; color: #ff7ad9; text-shadow: 0 0 10px #a54bff; }
#rotate small { font-size: 15px; color: #8ff3ff; }
#rotate .rphone { width: 54px; height: 92px; border: 5px solid #8ff3ff; border-radius: 10px; box-shadow: 0 0 14px #2ad4ff; animation: rphone 2s ease-in-out infinite; }
@keyframes rphone { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) { body.is-touch #rotate { display: flex; } }
@media (max-height: 430px) {
  .av { width: 128px; } .av.me { width: 150px; } .av canvas { width: 28px; height: 28px; } .av.me canvas { width: 40px; height: 40px; }
  .avinfo b { font-size: 11px; } .av.me .avinfo b { font-size: 12px; } .avh { font-size: 10px; } .av.me .avh { font-size: 12px; } .avk { font-size: 9px; }
  #avatars { gap: 2px; }
}
#gver { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: rgba(255, 255, 255, .45); z-index: 2; pointer-events: none; }
#fsbtn { position: fixed; z-index: 60; top: 10px; left: calc(50% + 48px); display: flex; align-items: center; gap: 7px; font-family: inherit; font-size: 14px; color: #fff; background: rgba(8, 3, 20, .78); border: 2px solid #5d3a85; padding: 4px 10px; cursor: pointer; box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
#fsbtn:hover { border-color: #ff7ad9; color: #ff7ad9; }
#fsbtn i { width: 14px; height: 14px; border: 2px solid currentColor; box-shadow: inset 0 0 0 2px rgba(8, 3, 20, .9); }
body.fs #fsbtn span::after { content: ' OFF'; }
body:has(#hud.on) #fsbtn { display: none; }
body.portal #fsbtn { display: none; } /* CrazyGames has its own fullscreen button */

/* =====================================================================
   PHONE LAYOUT (V2.30) - body.phone = small screens (height <= 500 or width <= 700)
   Everything is resized for a ~320-430px tall landscape screen.
   ===================================================================== */
/* title: the art and the buttons line up at every screen ratio */
#title video { object-fit: contain; }
body.is-touch #recbtn { display: none !important; }        /* screen recording is desktop only */
body.nofs #fsbtn { display: none !important; }             /* iPhone Safari has no fullscreen */
body.phone #fsbtn { font-size: 10px; padding: 2px 6px; top: 4px; left: auto; right: 4px; gap: 4px; }
body.phone #fsbtn i { width: 9px; height: 9px; }
body.phone:has(.modal.on) #fsbtn, body.phone:has(.modal.on) #recbtn, body.phone:has(#result.on) #fsbtn, body.phone:has(#result.on) #recbtn, body.phone:has(#date.on) #fsbtn { display: none !important; }
body.phone #gver { font-size: 8px; }

/* modals are scaled to fit by JS (fitPhone); no inner cap so we can measure them */
body.phone .modal .mbox { max-height: none; overflow: visible; min-width: 0; transform-origin: 50% 50%; }
body.phone .modal .mbox.scroll { overflow: auto; }
body.phone .mm .mmslots, body.phone #mmslots { grid-template-columns: repeat(6, 1fr) !important; gap: 6px !important; }

/* ---- HUD ---- */
body.phone #hud { font-size: 11px; }
body.phone #avatars { left: 4px; top: 4px; gap: 2px !important; }
body.phone .av { width: auto !important; min-width: 0; padding: 1px 5px 1px 1px !important; gap: 4px; border-width: 1px; box-shadow: none; }
body.phone .av canvas { width: 22px !important; height: 22px !important; }
body.phone .av.me canvas { width: 32px !important; height: 32px !important; }
body.phone .av:not(.me) .avinfo b { display: none; }
body.phone .av .avinfo b { font-size: 10px !important; }
body.phone .avh { font-size: 9px !important; letter-spacing: 0; } body.phone .av.me .avh { font-size: 11px !important; }
body.phone .avk { font-size: 8px !important; }
body.phone .avh img, body.phone .avk img, body.phone .av:not(.me) .avh img { height: 8px !important; width: 8px !important; }
body.phone .av.me .avh img { height: 10px !important; width: 10px !important; }
body.phone .avbars, body.phone .av .avmic { display: none !important; }

body.phone #hud .tc { top: 3px; }
body.phone #timer { font-size: 20px !important; }
body.phone #objective { font-size: 9px !important; margin: 1px auto; max-width: 40vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.phone #objective.alert { font-size: 10px !important; }
body.phone .itemrow { gap: 4px; } body.phone #items { gap: 3px; }
body.phone .slot { width: 20px !important; height: 20px !important; border-width: 1px; } body.phone .slot img { width: 14px !important; }
body.phone #itemcount { font-size: 12px !important; }

body.phone #hud .tr { right: 4px; top: 4px; gap: 2px; }
body.phone #minimap { width: 96px !important; height: 70px !important; border-width: 1px; }
body.phone #hud .tr .scorebox { font-size: 9px !important; margin-top: 0; } body.phone .scorebox b { font-size: 11px !important; }
body.phone #chaos { display: none; }
body.phone #hud .bl { display: none; }

body.phone #hint { top: 52px !important; bottom: auto !important; font-size: 9px !important; max-width: 46vw !important; padding: 3px 8px; line-height: 1.3; border-width: 1px; }
body.phone #tip { bottom: 64px; font-size: 10px; padding: 3px 8px; border-width: 2px; max-width: 70vw; }
body.phone #prompt { font-size: 11px; padding: 2px 8px; border-width: 1px; top: 62%; }
body.phone #feed { top: 96px; right: 4px; font-size: 9px; gap: 2px; }
body.phone .bub { font-size: 10px; padding: 3px 7px; border-width: 2px; border-radius: 10px; max-width: 34vw; }
body.phone .bub.scream { font-size: 12px; }
body.phone #announce b { font-size: 28px !important; -webkit-text-stroke-width: 2px; }
body.phone #announce small { font-size: 11px !important; }
body.phone .burst { font-size: 16px; } body.phone .burst.big { font-size: 26px; }
body.phone #spotted { font-size: 44px; }
body.phone #fkbar { top: 62px; font-size: 10px; padding: 3px 8px; gap: 6px; }
body.phone #mikacam { width: 170px !important; top: 84px !important; }
body.phone #mikacam video { width: 44px !important; } body.phone #mikacam .mctext { font-size: 9px !important; }
body.phone #ghostinfo { top: 22% !important; }
body.phone #ghostinfo .gi1, body.phone #ghostinfo .gi2 { font-size: 18px !important; }
body.phone #ghostinfo .gior { font-size: 10px !important; }
body.phone #chat { top: auto !important; bottom: 54px; left: 4px; width: 150px !important; }
body.phone #chat::before { display: none; }
body.phone #chatlog div { font-size: 9px !important; padding: 1px 4px; }

/* Mika's briefing */
body.phone #dialog { left: 4px !important; transform: none !important; bottom: 4px !important; width: calc(100vw - 8px) !important; gap: 6px; }
body.phone #dialog .dport, body.phone .dport { width: 60px !important; height: 60px !important; }
body.phone .dport video { border-width: 2px; box-shadow: 0 0 0 2px #ff3fb0; }
body.phone .dbox { min-height: 0 !important; padding: 5px 9px !important; }
body.phone .dname { font-size: 11px !important; } body.phone .dtext { font-size: 11px !important; min-height: 0; line-height: 1.25; }
body.phone .ditems { gap: 5px; margin-top: 3px; } body.phone .ditems span { font-size: 9px !important; } body.phone .ditems img { width: 14px !important; }
body.phone .dskip { font-size: 11px; padding: 2px 8px; }

/* ---- touch controls ---- */
body.phone .tbtns { transform: scale(.64) !important; transform-origin: 100% 100% !important; right: 6px !important; bottom: 6px !important; }
body.phone .tb.sm { width: 32px !important; height: 32px !important; font-size: 13px !important; }
body.phone.is-touch .tpause { left: auto; right: 104px; top: 4px; margin: 0; }
body.phone.is-touch .tchat { left: auto; right: 104px; top: 40px; margin: 0; gap: 4px; flex-direction: column; }
body.phone .tchat .tb { font-size: 8px !important; }
body.phone.is-touch #inv { bottom: 4px; gap: 3px; }
body.phone #inv .islot, body.phone.is-touch #inv .islot { width: 32px !important; height: 32px !important; border-width: 1px; }
body.phone #inv .islot img, body.phone.is-touch #inv .islot img { width: 18px !important; }
body.phone #inv .islot small { font-size: 6px !important; } body.phone #inv .islot em { font-size: 8px !important; }
body.phone #inv .islot.wide { width: auto !important; padding: 0 8px; } body.phone #inv .islot.wide b { font-size: 9px !important; }
body.phone .tcycle { bottom: 4px; gap: 252px !important; }
body.phone .stick { width: 96px; height: 96px; margin: -48px; } body.phone .knob { left: 27px; top: 27px; width: 42px; height: 42px; }
body.phone .itemrow { margin-top: 2px; }
body.phone #dialog { width: calc(100vw - 160px) !important; }
body.phone:has(#dialog.on) #inv { display: none; }
body.phone #fsbtn { right: auto; left: 50%; transform: translateX(-50%); }
body.phone .modal .receipt { margin: 0 auto; transform-origin: 50% 50%; }
body.phone .modal .receipt.scroll { overflow: auto; }
body.phone .modal.on { overflow: hidden; }
body.is-touch:not(.phone) .tcycle { gap: 432px; }
@media (max-height: 520px) { body.is-touch:not(.phone) .tcycle { gap: 372px; } }
/* small windows (phone, or a small embed on desktop): F1 and FULLSCREEN sit side by side at the top centre */
body.phone #fsbtn { left: calc(50% + 4px) !important; right: auto !important; transform: none !important; top: 4px !important; }
body.phone #recbtn { left: auto !important; right: calc(50% + 4px) !important; transform: none !important; margin: 0 !important; top: 4px !important; font-size: 10px; padding: 2px 6px; gap: 4px; }
body.phone #recbtn .ico img { height: 10px; }
body.phone:has(#hud.on) #recbtn { right: 104px !important; top: 82px !important; }
