/* KNOCKED shell: a sketchbook laid over the live game canvas. */
:root {
  --paper: #f3ecd9; --paper-hi: #fbf6e9; --ink: #1b1a17; --ink-soft: #5a554b; --hl: #f2c14e; --red: #d8342c;
  --line: rgba(90, 130, 190, .35); --margin: rgba(205, 80, 80, .55); --mx: 56px;
  --hand: 'Patrick Hand', 'Comic Sans MS', 'Chalkboard SE', cursive;
  --marker: 'Permanent Marker', 'Comic Sans MS', cursive;
}
* { box-sizing: border-box }
html, body { margin: 0; height: 100%; background: #24242a; overflow: hidden; font-family: var(--hand); color: var(--ink); -webkit-user-select: none; user-select: none }
input, textarea { -webkit-user-select: text; user-select: text }
/* phones: no double-tap zoom anywhere (pinch still works on menus); no grey tap flash */
html, body, a, button, label, select, input, textarea, [role=button], .chip { touch-action: manipulation; -webkit-tap-highlight-color: transparent }
button, .chip, a { -webkit-touch-callout: none }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; overflow: auto }
.overlay.dim { background: rgba(27, 26, 23, .38) }
.overlay.bottom { align-items: flex-end }
#app:empty { display: none }
.hidden { display: none !important }
a { color: inherit }

/* notebook page */
.page { position: relative; width: min(940px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: linear-gradient(90deg, transparent calc(var(--mx) - 2px), var(--margin) calc(var(--mx) - 2px), var(--margin) var(--mx), transparent var(--mx)),
    repeating-linear-gradient(180deg, transparent 0 29px, var(--line) 29px 30px), var(--paper);
  padding: 30px 26px 24px calc(var(--mx) + 16px); border-radius: 6px 12px 8px 14px; box-shadow: 0 2px 0 #cfc5ab, 0 18px 44px rgba(0, 0, 0, .5); transform: rotate(-.35deg) }
.page:before { content: ""; position: absolute; left: 14px; top: 22px; bottom: 22px; width: 18px; background: radial-gradient(circle at 9px 9px, #24242a 0 6px, transparent 7px) 0 0/18px 44px repeat-y; opacity: .9 }
.page.narrow { width: min(460px, 100%) }
.page.mid { width: min(660px, 100%) }
.page.form { width: min(520px, 100%) }

h1 { font-family: var(--marker); font-size: clamp(46px, 9vw, 88px); margin: 0; line-height: .9; letter-spacing: 2px; transform: rotate(-2deg); text-shadow: 3px 3px 0 rgba(27, 26, 23, .12); font-weight: normal }
h1 .a { color: var(--red) }
h1.big { font-size: 58px }
h2 { font-family: var(--marker); font-size: 26px; margin: 0 0 6px; font-weight: normal }
h3 { font-family: var(--marker); font-size: 20px; margin: 14px 0 4px; font-weight: normal }
.sub { margin: 6px 0 12px; font-size: 20px; opacity: .8 }
.win-title { font-size: 32px }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 9px 0 }
.lbl { font-size: 21px; min-width: 128px }
.hint { font-size: 16px; opacity: .72 }
.spacer { flex: 1 }
p { font-size: 19px; line-height: 1.35; margin: 6px 0 }

/* buttons */
.chip { font: inherit; font-size: 19px; background: transparent; border: 2px solid var(--ink); padding: 3px 14px; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-block;
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px; transition: transform .08s }
.chip:hover:not(:disabled) { transform: rotate(-1.5deg) scale(1.03) }
.chip:focus-visible, .tab:focus-visible, input:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px }
.chip.on { background: linear-gradient(176deg, transparent 18%, rgba(242, 193, 78, .85) 18%, rgba(242, 193, 78, .85) 86%, transparent 86%); font-weight: bold; box-shadow: 2px 2px 0 var(--ink) }
.chip.big { font-family: var(--marker); font-size: 30px; padding: 6px 30px }
.chip.danger { border-color: var(--red); color: var(--red) }
.chip:disabled { opacity: .45; cursor: not-allowed }
.chip.link { border: none; padding: 0 2px; text-decoration: underline; text-underline-offset: 3px }
.tag { display: inline-block; font-family: var(--marker); font-size: 14px; letter-spacing: 1px; padding: 1px 8px; margin-left: 8px; vertical-align: middle;
  border: 2px solid currentColor; border-radius: 4px 9px 5px 8px; transform: rotate(-4deg); background: rgba(255, 255, 255, .5) }
.tag-owner { color: #b8860b; box-shadow: 2px 2px 0 rgba(27, 26, 23, .7) }
.tag-admin { color: var(--red) }
.soon { font-size: 13px; margin-left: 6px; padding: 0 6px; border: 1.5px dashed var(--ink-soft); border-radius: 8px; color: var(--ink-soft); vertical-align: middle }
.sw { width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 50% 44% 56% 47%; cursor: pointer; padding: 0 }
.sw.on { outline: 3px solid var(--ink); outline-offset: 2px }

/* forms: handwriting on the ruled line */
form { margin: 4px 0 }
.field { display: block; margin: 12px 0 }
.field > span { display: block; font-size: 19px }
.field input[type=text], .field input[type=email], .field input[type=password] {
  width: 100%; font: inherit; font-size: 22px; padding: 4px 2px; border: none; border-bottom: 2px solid var(--ink); background: transparent; color: var(--ink); border-radius: 0 }
.field input::placeholder { color: rgba(27, 26, 23, .35) }
.field .err { display: block; color: var(--red); font-size: 17px; min-height: 0 }
.field.bad input { border-bottom-color: var(--red) }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; cursor: pointer }
.check input { width: 20px; height: 20px; accent-color: var(--ink) }
.formerr { color: var(--red); font-size: 18px; min-height: 1.2em; margin: 6px 0 }
.note { border: 2px dashed rgba(27, 26, 23, .45); border-radius: 14px 5px 16px 6px; padding: 8px 12px; background: rgba(255, 255, 255, .25); margin: 10px 0 }
.note.warn { border-color: var(--red) }

/* menu */
.menu { width: min(980px, 100%) }
.menu-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.menu-head h1 { font-size: clamp(38px, 6vw, 58px) }
.who { margin-left: auto; text-align: right; font-size: 18px }
.who b { font-family: var(--marker); font-weight: normal; font-size: 22px }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 8px; border-bottom: 2px solid var(--ink); padding-bottom: 6px }
.tab { font: inherit; font-family: var(--marker); font-size: 18px; background: rgba(255, 255, 255, .3); border: 2px solid var(--ink); border-bottom: none; padding: 4px 12px 2px; cursor: pointer; color: var(--ink);
  border-radius: 12px 14px 0 0; transform: rotate(-.6deg) }
.tab:nth-child(even) { transform: rotate(.7deg) }
.tab.on { background: var(--hl); }
.tab:disabled { opacity: .45; cursor: not-allowed }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px }
.card { border: 2px dashed rgba(27, 26, 23, .45); padding: 10px 12px; border-radius: 14px 5px 16px 6px; background: rgba(255, 255, 255, .22); overflow: hidden }
.card canvas { width: 118px; height: 118px; float: right; margin: -4px -4px 0 6px }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 10px 0 }
.mode { text-align: left; font: inherit; color: inherit; background: rgba(255, 255, 255, .28); border: 2px solid var(--ink); border-radius: 18px 6px 16px 8px; padding: 10px 12px; cursor: pointer }
.mode b { display: block; font-family: var(--marker); font-weight: normal; font-size: 22px }
.mode span { font-size: 16px; opacity: .8 }
.mode:hover:not(:disabled) { transform: rotate(-.8deg) }
.mode.on { background: rgba(242, 193, 78, .7); box-shadow: 3px 3px 0 var(--ink) }
.mode:disabled { opacity: .5; cursor: not-allowed }
.bar { height: 16px; border: 2px solid var(--ink); border-radius: 10px 4px 9px 5px; overflow: hidden; background: rgba(255, 255, 255, .3) }
.bar > i { display: block; height: 100%; background: repeating-linear-gradient(-55deg, var(--hl) 0 6px, #e7b23c 6px 9px) }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 19px }
.kv dt { opacity: .7 }
.kv dd { margin: 0 }
table.stats { width: 100%; border-collapse: collapse; font-size: 18px; margin-top: 4px }
table.stats td, table.stats th { border-bottom: 1px solid rgba(27, 26, 23, .25); padding: 2px 6px; text-align: center; font-weight: normal }
table.stats th { font-family: var(--marker); font-size: 17px }
table.stats td:first-child, table.stats th:first-child { text-align: left }
table.ctl { border-collapse: collapse; font-size: 18px; width: 100% }
table.ctl td, table.ctl th { padding: 3px 6px; border-bottom: 1px dashed rgba(27, 26, 23, .25); text-align: left }
.bind { min-width: 96px; font-size: 16px; padding: 2px 8px }
.bind.wait { animation: blink .5s infinite; background: rgba(242, 193, 78, .6) }
@keyframes blink { 50% { opacity: .35 } }

/* landing: the live CPU demo shows through */
.landing { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 16px 16px max(6vh, 24px); pointer-events: none; z-index: 10 }
.landing > * { pointer-events: auto }
.hero { background: rgba(243, 236, 217, .9); border: 2px solid var(--ink); border-radius: 10px 22px 14px 18px; padding: 18px 26px 16px; box-shadow: 4px 5px 0 rgba(27, 26, 23, .8); transform: rotate(-.8deg); text-align: center; max-width: 620px }
.hero h1 { font-size: clamp(52px, 11vw, 104px) }
.hero .sub { margin: 4px 0 8px }
.hero .row { justify-content: center }
.landing .top { position: fixed; top: 14px; right: 16px; display: flex; gap: 8px }
.landing .top .chip { background: rgba(243, 236, 217, .9) }

/* toasts */
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none }
.toast { background: var(--paper-hi); border: 2px solid var(--ink); padding: 8px 16px; font-size: 19px; border-radius: 4px 14px 6px 12px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1deg); animation: pop .25s ease-out }
.toast.err { border-color: var(--red) }
@keyframes pop { from { transform: scale(.6) rotate(-6deg); opacity: 0 } }


/* ── currencies ── */
.coin, .punch { display: inline-flex; align-items: center; gap: 4px; font-weight: bold }
.coin:before, .punch:before, .ico { content: ""; display: inline-block; width: 18px; height: 18px; border: 2px solid var(--ink); flex: none }
.coin:before, .ico.coin { border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe7a0, #e0a92a 60%) }
.punch:before, .ico.punch { border-radius: 40% 55% 45% 50%; background: radial-gradient(circle at 40% 35%, #ffb3a8, #d8342c 65%) }
.ico.xp { border-radius: 3px; background: repeating-linear-gradient(-55deg, var(--hl) 0 4px, #e7b23c 4px 6px) }
.wallet { display: flex; gap: 12px; align-items: center; justify-content: flex-end; font-size: 18px; flex-wrap: wrap }
.wallet.big { font-size: 22px }
.who-top { display: flex; align-items: center; gap: 6px; justify-content: flex-end }
.up { color: #2b7a46 } .down { color: var(--red) }

/* ── menu bits ── */
.mode.big { cursor: default; display: flex; flex-direction: column; gap: 6px }
.mode.big .chip.big { align-self: flex-start; margin-top: auto }
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 8px }
.mapcard { text-align: left; font: inherit; color: inherit; border: 2px solid var(--ink); border-radius: 14px 6px 16px 8px; padding: 10px 12px; cursor: pointer; min-height: 86px }
.mapcard b { display: block; font-family: var(--marker); font-weight: normal; font-size: 20px }
.mapcard span { font-size: 15px; opacity: .85 }
.mapcard.map-barge { background: linear-gradient(180deg, rgba(31,77,99,.15), rgba(31,77,99,.35)) }
.mapcard.map-blacklight { background: #0b0c16; color: #e6f1ff; border-color: #0b0c16; box-shadow: inset 0 0 0 2px #39ff9e55 }
.mapcard.map-blacklight b { color: #39ff9e; text-shadow: 0 0 8px #39ff9e }
.mapcard.map-rooftop { background: linear-gradient(180deg, #f7d8c4, #c9a2c8) }
.mapcard.map-skyisle { background: linear-gradient(180deg, #bfe3f7 0%, #e9f6ff 60%, #ffffff 100%) }
.mapcard.map-arena { background: linear-gradient(180deg, #f6c27a 0%, #f2d9a6 55%, #e3b86e 100%); border-color: #7a2a1c; box-shadow: inset 0 -10px 0 #b8322a }
.mapcard.map-chalkboard { background: #27443a; color: #f0f2e8; border-color: #1b1a17 }
.mapcard.on { outline: 4px solid var(--hl); outline-offset: 2px; box-shadow: 3px 3px 0 var(--ink) }
.queue { border-style: solid }
.qdots { display: flex; gap: 6px } .qdots i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); animation: blink 1s infinite } .qdots i:nth-child(2) { animation-delay: .2s } .qdots i:nth-child(3) { animation-delay: .4s }
.codein { font: inherit; font-size: 20px; width: 110px; padding: 2px 6px; border: none; border-bottom: 2px solid var(--ink); background: transparent; color: var(--ink); text-transform: uppercase; letter-spacing: 2px }
.codein.wide { width: min(320px, 100%); text-transform: none; letter-spacing: 0 }
.sel { font: inherit; font-size: 17px; background: rgba(255,255,255,.5); border: 2px solid var(--ink); border-radius: 8px; padding: 2px 6px; color: var(--ink) }
.lobby .code { font-family: var(--marker); font-size: 26px; letter-spacing: 3px }
.lslot { border: 2px dashed rgba(27,26,23,.4); border-radius: 10px; padding: 8px 10px; min-height: 64px }
.lslot.ready { border-style: solid; border-color: #2b7a46; background: rgba(60,143,90,.12) }
.frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px dashed rgba(27,26,23,.2); font-size: 19px }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #aaa; margin-right: 4px; vertical-align: middle }
.dot.on { background: #3c8f5a; box-shadow: 0 0 0 2px rgba(60,143,90,.25) }
.namelink { font: inherit; background: none; border: none; padding: 0; cursor: pointer; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; font-weight: bold }
.rankbadge { vertical-align: middle; flex: none }
table.lb td.rk { white-space: nowrap; text-align: left }
table.lb tr.me td { background: rgba(242,193,78,.35) }
.myrank { display: flex; gap: 12px; align-items: center; margin: 8px 0 }
.srow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 }
kbd { display: inline-block; font-family: var(--hand); font-size: 17px; min-width: 26px; text-align: center; padding: 0 6px; margin: 1px 3px 1px 0; border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 6px; background: var(--paper-hi) }
kbd.alt { opacity: .6 }
.cheat { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 14px; font-size: 18px; margin: 6px 0 10px }
.cheat b { font-family: var(--marker); font-weight: normal }
.tgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px }
.tk { border: 2px solid var(--ink); border-radius: 10px 4px 9px 5px; padding: 4px 8px; display: flex; justify-content: space-between; font-size: 16px; background: rgba(255,255,255,.3) }
.tk b { font-weight: normal } .tk span { font-family: var(--marker) }
.tk.on { background: var(--hl); transform: scale(1.04) }

/* items (shop + locker) */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px }
.items.big { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) }
.item { font: inherit; color: inherit; text-align: left; position: relative; border: 2px solid var(--ink); border-left: 7px solid var(--rar, #7a756b); border-radius: 12px 5px 14px 6px; padding: 8px 10px; background: rgba(255,255,255,.35); display: flex; flex-direction: column; gap: 2px }
button.item { cursor: pointer }
.item.mini { padding: 6px 8px }
.item.on { background: rgba(242,193,78,.7); box-shadow: 3px 3px 0 var(--ink) }
.item b { font-family: var(--marker); font-weight: normal; font-size: 17px }
.item .rar { font-size: 14px; color: var(--rar) }
.ipv { width: 100%; height: 120px; object-fit: contain; display: block; border-radius: 8px; margin-bottom: 4px }
.bannerpv { border: 2px solid var(--ink) }
.glyph { display: flex; align-items: center; justify-content: center; font-family: var(--marker); font-size: 30px; border: 2px dashed rgba(27,26,23,.35) }
.glyph.g-hit { color: #e0a92a; font-size: 48px; -webkit-text-stroke: 1.5px var(--ink) } .glyph.g-ringout { color: #2a62c9; font-size: 40px }
.locker { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start }
.lockside { position: sticky; top: 0; text-align: center }
.lockcats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding-bottom: 10px; border-bottom: 2px dashed rgba(27,26,23,.25) }
.lockcat { font: inherit; color: var(--ink); cursor: pointer; display: flex; align-items: baseline; gap: 6px; padding: 4px 11px; border: 2px solid var(--ink); border-radius: 10px 4px 11px 5px; background: rgba(255,255,255,.4); font-family: var(--marker); font-size: 16px; transition: transform .1s }
.lockcat small { font-family: inherit; font-size: 12px; color: var(--ink-soft); background: rgba(27,26,23,.08); border-radius: 8px; padding: 0 6px }
.lockcat:hover { transform: translateY(-2px) rotate(-1deg) }
.lockcat.on { background: var(--hl); box-shadow: 3px 3px 0 var(--ink) }
.lockcat.on small { color: var(--ink); background: rgba(255,255,255,.5) }
.lockhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px }
.lockhead h3 { margin: 0; font-size: 26px }
.lockpane .items.big { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) }
.lockpane .item { cursor: pointer }
.lockpane .item:hover { transform: translateY(-2px) }
.nonepv { display: grid; place-items: center; font-size: 54px; color: rgba(27,26,23,.3); border: 2px dashed rgba(27,26,23,.25) }
.lockpv { width: 220px; height: 220px }

/* profile modal */
.profile-modal { position: relative }
.x { position: absolute; top: 8px; right: 12px; font: inherit; font-size: 30px; line-height: 1; background: none; border: none; cursor: pointer; color: inherit; z-index: 2 }
.pbanner { border: 2px solid var(--ink); border-radius: 12px 6px 14px 8px; padding: 10px 14px; overflow: hidden }
.pbanner canvas { width: 120px; height: 120px; float: right }
.toast.rich { pointer-events: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: min(560px, 92vw) }

/* ── in-match overlays ── */
#matchui { position: fixed; inset: 0; pointer-events: none; z-index: 30 }
#matchui > * { pointer-events: auto }
.versus { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; background: rgba(27,26,23,.45); animation: vsin .35s ease-out }
@keyframes vsin { from { opacity: 0; transform: scale(1.05) } }
.vs-row { display: flex; align-items: center; gap: 14px; width: min(980px, 100%) }
.vs-card { flex: 1; min-height: 170px; border: 3px solid var(--ink); border-radius: 14px 6px 18px 8px; padding: 14px 18px; box-shadow: 5px 6px 0 rgba(27,26,23,.85); background: var(--paper); display: flex; flex-direction: column; gap: 8px; justify-content: center }
.vs-card.l { transform: rotate(-1.5deg); animation: slideL .45s cubic-bezier(.2,1.4,.4,1) } .vs-card.r { transform: rotate(1.5deg); text-align: right; align-items: flex-end; animation: slideR .45s cubic-bezier(.2,1.4,.4,1) }
@keyframes slideL { from { transform: translateX(-60vw) rotate(-8deg) } } @keyframes slideR { from { transform: translateX(60vw) rotate(8deg) } }
.vs-name { font-family: var(--marker); font-size: clamp(26px, 4vw, 44px); line-height: 1; -webkit-text-stroke: 1px var(--ink) }
.vs-rank { display: flex; align-items: center; gap: 8px; font-family: var(--marker); font-size: 20px }
.vs-card.r .vs-rank { flex-direction: row-reverse }
.vs-rec { font-size: 19px } .vs-rec b { font-family: var(--marker); font-weight: normal; font-size: 24px }
.vs-mid { text-align: center; color: var(--paper) }
.vs-mid > b { font-family: var(--marker); font-weight: normal; font-size: clamp(48px, 8vw, 90px); color: var(--hl); -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 var(--ink); display: block; transform: rotate(-6deg) }
.vs-h2h { font-size: 17px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 2px 8px; margin-top: 6px }
.vs-h2h b { font-family: var(--marker); font-weight: normal; font-size: 22px }
.vs-map, .vs-mode { background: var(--paper); border: 2px solid var(--ink); border-radius: 6px 12px 8px 10px; padding: 3px 14px; font-size: 18px; box-shadow: 3px 3px 0 var(--ink) }
.vs-map b, .vs-mode { font-family: var(--marker); font-weight: normal }
.vs-count { font-family: var(--marker); font-size: 54px; color: var(--paper); -webkit-text-stroke: 2px var(--ink); text-shadow: 3px 3px 0 var(--ink) }
.vs-skip { color: var(--paper); font-size: 16px; opacity: .85 }
.socials { position: fixed; right: 14px; top: 50%; width: 230px; transform: translate(120%, -50%) rotate(2deg); transition: transform .45s cubic-bezier(.2,1.3,.4,1); background: var(--paper); border: 3px solid var(--ink); border-radius: 12px 6px 14px 8px; box-shadow: 5px 6px 0 rgba(27,26,23,.85); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; z-index: 31 }
.socials.in { transform: translate(0, -50%) rotate(2deg) }
.socials.static { position: static; transform: none; width: auto; max-width: 280px }
.soc-title { font-family: var(--marker); font-size: 21px; line-height: 1.05; padding-right: 18px }
.soc-sub { font-size: 14px; opacity: .7; margin-top: -4px }
.soc { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 18px; padding: 2px 4px; border-radius: 8px }
.soc:hover { background: rgba(242,193,78,.5) }
.soc i { font-style: normal; font-family: var(--marker); font-size: 12px; color: #fff; min-width: 34px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: 2px solid var(--ink) }
.socials .x { top: 2px; right: 6px; font-size: 24px }
.netbanner { position: fixed; top: 92px; left: 50%; transform: translateX(-50%) rotate(-1deg); background: var(--paper-hi); border: 2px solid var(--ink); border-radius: 6px 14px 8px 12px; box-shadow: 3px 3px 0 var(--ink); padding: 6px 16px; font-size: 20px; font-family: var(--marker) }
.ready .page { text-align: center }
.ready .bar > i { transition: none; background: var(--red) }
.results .page { text-align: center }
.res-title { font-size: clamp(54px, 9vw, 86px) }
.res-title.win { color: var(--red) } .res-title.loss { color: var(--ink-soft) }
.res-score { font-family: var(--marker); font-size: 24px; margin: 4px 0 10px }
.res-rank { display: flex; gap: 12px; align-items: center; text-align: left; border: 2px dashed rgba(27,26,23,.4); border-radius: 12px; padding: 8px 12px; margin: 8px 0 }
.res-rank .bar > i { transition: width .7s cubic-bezier(.3,1.2,.5,1) }
.res-ranklbl { font-family: var(--marker); font-size: 20px }
.res-rank b.up, .res-rank b.down { font-family: var(--marker); font-weight: normal; font-size: 22px }
.res-badge.pop { animation: pop .4s ease-out }
.res-ranknote { font-size: 17px; min-height: 1.2em }
.res-rec { font-size: 19px } .res-rec b { font-family: var(--marker); font-weight: normal }
.res-rewards { display: flex; justify-content: center; gap: 22px; margin: 10px 0 4px; flex-wrap: wrap }
.rw { display: flex; align-items: center; gap: 6px; font-size: 18px } .rw b { font-family: var(--marker); font-size: 28px; font-weight: normal }
.res-bonus { font-family: var(--marker); color: #2b7a46; font-size: 19px }
.results .row { justify-content: center }

@media (max-width: 680px) {
  .vs-row { flex-direction: column; gap: 8px } .vs-card { min-height: 0; width: 100% } .vs-card.r { text-align: left; align-items: flex-start } .vs-card.r .vs-rank { flex-direction: row }
  .socials { top: auto; bottom: 10px; transform: translate(120%, 0); width: min(260px, 70vw) } .socials.in { transform: translate(0, 0) rotate(1deg) }
  .locker { grid-template-columns: 1fr } .lockside { position: static } .tgrid { grid-template-columns: repeat(2, 1fr) }
  :root { --mx: 40px }
  .page { padding: 22px 12px 16px calc(var(--mx) + 10px) }
  .page:before { left: 6px }
  .grid2 { grid-template-columns: 1fr }
  .lbl { min-width: 0; width: 100%; font-size: 19px }
  .card canvas { width: 88px; height: 88px }
  .chip { font-size: 17px; padding: 3px 10px }
  .chip.big { font-size: 26px; padding: 5px 22px }
  .who { margin-left: 0; text-align: left; width: 100% }
  .tab { font-size: 16px; padding: 3px 9px 1px }
  .hero { padding: 14px 16px 12px }
}
@media (prefers-reduced-motion: reduce) { .toast, .bind.wait { animation: none } .chip, .tab, .mode { transition: none; transform: none !important } }

/* ── admin page ── */
body.adminbody { overflow: auto; background: #2a2a31 }
#admin { padding: 16px; display: flex; justify-content: center }
.adminpage { width: min(1180px, 100%); max-height: none; transform: none }
.admtag { font-family: var(--hand); font-size: 18px; margin-left: 10px; color: var(--ink-soft); letter-spacing: 0 }
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 10px 0 }
.stat { border: 2px solid var(--ink); border-radius: 12px 5px 14px 6px; padding: 10px 14px; text-decoration: none; background: rgba(255,255,255,.35); display: flex; flex-direction: column }
.stat b { font-family: var(--marker); font-weight: normal; font-size: 36px }
.admsplit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start }
.admsplit .pdetail:empty { display: none }
.admsplit:has(.pdetail:empty) { grid-template-columns: 1fr }
table.admtable td, table.admtable th { text-align: left; vertical-align: top; font-size: 16px }
.clickrow { cursor: pointer } .clickrow:hover td { background: rgba(242,193,78,.3) }
.pill { display: inline-block; border: 2px solid var(--ink); border-radius: 10px; padding: 0 8px; font-size: 14px; margin: 2px 4px 2px 0; background: rgba(255,255,255,.5) }
.pill.red { border-color: var(--red); color: var(--red) }
.chips-wrap { display: flex; flex-wrap: wrap }
.x-mini { border: none; background: none; cursor: pointer; font: inherit; color: var(--red); padding: 0 2px }
td.acts { white-space: nowrap } td.acts .chip { font-size: 15px; padding: 1px 8px; margin: 1px }
.mono { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all }
.reptext { width: 100%; min-height: 80px; font: inherit; font-size: 18px; border: 2px solid var(--ink); border-radius: 8px; background: rgba(255,255,255,.5); padding: 6px; color: var(--ink) }
.cheatpanel { position: fixed; left: 12px; bottom: 34px; z-index: 40; background: rgba(27,26,23,.88); color: #fbf6e9; border-radius: 10px; padding: 6px 10px; max-width: min(640px, 94vw) }
.cheatpanel .chip { color: #fbf6e9; border-color: #fbf6e9; font-size: 14px; padding: 1px 8px }
.cheatpanel .row { margin: 4px 0; gap: 5px }
.srange { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 10px; font-size: 19px; margin: 6px 0 }
.srange input { accent-color: var(--red) }
.binds.compact table.ctl { font-size: 15px } .binds.compact .chip.bind { font-size: 13px; min-width: 70px }
#pPanel { max-height: 46vh; overflow: auto }
.mousepad { margin-top: 8px; border: 2px dashed rgba(27,26,23,.4); border-radius: 10px; padding: 18px; text-align: center; color: var(--ink-soft) }
.rotnext { display: block; margin-top: 4px; font-size: 14px; opacity: .8 }
.punch:before, .ico.punch { border-radius: 30% 45% 40% 35%; background: #d8342c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 9V6.5a1.5 1.5 0 013 0V9m0-3a1.5 1.5 0 013 0v3m0-2.5a1.5 1.5 0 013 0V10m0-1a1.5 1.5 0 013 0v3c0 3-2 5-5 5H9c-2 0-4-2-4-4V9' fill='%23fbf6e9' stroke='%231b1a17' stroke-width='1.3'/%3E%3C/svg%3E") center/88% no-repeat }
@media (max-width: 800px) { .admsplit { grid-template-columns: 1fr } }
html:has(body.adminbody) { overflow: auto; height: auto }
body.adminbody { height: auto; min-height: 100% }
.badges { position: absolute; top: 6px; left: 10px; right: 6px; display: flex; gap: 4px; flex-wrap: wrap; z-index: 1; pointer-events: none }
.bdg { font-style: normal; font-family: var(--marker); font-size: 12px; background: var(--ink); color: var(--paper); padding: 1px 6px; border-radius: 6px; transform: rotate(-3deg) }
.bdg.gold { background: #e0a92a; color: var(--ink) } .bdg.red { background: var(--red) } .bdg.grey { background: #7a756b }
.pill.gold { border-color: #e0a92a; background: rgba(242,193,78,.45) }
.tilebtns { margin: 2px 0 0; gap: 4px } .tilebtns .chip { font-size: 14px; padding: 1px 8px }
.plan { border-style: solid; margin: 12px 0 }
.itemedit { position: relative }
.editgrid { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start }
@media (max-width: 700px) { .editgrid { grid-template-columns: 1fr } }
.vs-team { flex: 1; display: flex; flex-direction: column; gap: 10px }
.vs-team .vs-card { min-height: 110px }
.vs-team .vs-name { font-size: clamp(22px, 3vw, 34px) }
.qcmenu { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 40; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: min(640px, 94vw); background: rgba(27,26,23,.82); padding: 8px 10px; border-radius: 12px }
.qcmenu .chip { color: #fbf6e9; border-color: #fbf6e9; font-size: 16px; padding: 2px 10px }
.reschat { margin-top: 8px; text-align: left }
.chatlog { max-height: 110px; overflow: auto; font-size: 17px; border: 1.5px dashed rgba(27,26,23,.35); border-radius: 8px; padding: 4px 8px; min-height: 30px }
.chatin { width: 100%; font: inherit; font-size: 18px; margin-top: 4px; padding: 3px 6px; border: none; border-bottom: 2px solid var(--ink); background: transparent; color: var(--ink) }
.rivals { justify-content: center }
.platepv { display: flex; align-items: center; justify-content: center; border: 2px dashed rgba(27,26,23,.3); }
/* challenges: a yellow legal pad beside the main sheet */
.menu-wrap { display: flex; align-items: flex-start; justify-content: center; gap: 22px; width: 100%; max-height: calc(100vh - 32px) }
.menu-wrap > .page { flex: 0 1 940px; min-width: 0 }
.notepad { position: relative; flex: 0 0 270px; margin-top: 40px; transform: rotate(-1.6deg); max-height: calc(100vh - 110px); display: flex; flex-direction: column;
  box-shadow: 4px 7px 0 rgba(27,26,23,.18), 0 1px 0 rgba(27,26,23,.3); border-radius: 3px 3px 6px 10px }
.pad-rings { height: 30px; flex: none; border-radius: 4px 4px 0 0; background: #2b2a33; position: relative }
.pad-rings:after { content: ""; position: absolute; left: 14px; right: 14px; top: -9px; height: 26px; background: radial-gradient(ellipse 5px 12px at 50% 50%, transparent 0 3px, #9a9aa3 3.5px 5px, transparent 5.5px) 0 0/22px 26px repeat-x }
.pad-body { overflow: auto; padding: 8px 12px 12px 34px; border-radius: 0 0 6px 10px;
  background: linear-gradient(90deg, transparent 0 25px, rgba(216,52,44,.55) 25px 27px, transparent 27px), repeating-linear-gradient(180deg, transparent 0 25px, rgba(60,110,190,.28) 25px 26px), #fdf1a1 }
.pad-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 2px }
.pad-head h3 { margin: 0; font-size: 22px }
.pad-head small { color: var(--ink-soft) }
.pad-foot { font-size: 14px; color: var(--ink-soft); margin: 8px 0 0; line-height: 1.2 }
.notepad .chal { padding: 5px 0 6px; border-bottom: 1.5px dashed rgba(27,26,23,.25) }
.notepad .chal.done { opacity: .55 }
.notepad .chal.done .chal-txt { text-decoration: line-through; text-decoration-thickness: 2px }
.chal-top { display: flex; gap: 7px; align-items: flex-start; font-size: 17px; line-height: 1.15 }
.chal-top .box { flex: none; width: 17px; height: 17px; margin-top: 1px; border: 2px solid var(--ink); border-radius: 3px 2px 4px 2px; display: grid; place-items: center; font-size: 15px; color: var(--red); font-weight: bold }
.chal-mid { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px 24px }
.chal-mid .bar { flex: 1; height: 10px }
.chal-mid small { font-size: 13px; white-space: nowrap }
.chal-bot { display: flex; justify-content: space-between; align-items: center; margin-left: 24px; min-height: 22px }
.chal-rw { white-space: nowrap; font-size: 14px }
.chal.can-claim .box { background: var(--hl) }
.chip.claim { font-size: 15px; padding: 0 10px; background: var(--hl); animation: blink 1s infinite }
.pad-tab { display: none }
@media (max-width: 1240px) {
  /* not enough room beside the sheet: the pad slides out from the left edge */
  .menu-wrap { display: contents }
  .notepad { position: fixed; left: 0; top: 70px; margin: 0; z-index: 12; width: 280px; transform: translateX(-100%); transition: transform .25s ease; border-radius: 0 6px 10px 0 }
  .notepad.open { transform: translateX(0) rotate(-.6deg) }
  .pad-tab { display: block; position: absolute; left: 100%; top: 40px; writing-mode: vertical-rl; font: inherit; font-family: var(--marker); font-size: 17px;
    padding: 12px 5px; background: #fdf1a1; border: 2px solid var(--ink); border-left: none; border-radius: 0 8px 8px 0; cursor: pointer; color: var(--ink); box-shadow: 3px 3px 0 rgba(27,26,23,.18) }
  .notepad.has-ready .pad-tab { background: var(--hl); animation: blink 1s infinite }
}
/* crates */
.cratelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px }
.crate { border: 2px solid var(--ink); border-radius: 12px 5px 14px 6px; padding: 10px; display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; background: rgba(255,255,255,.35) }
.crate b { font-family: var(--marker); font-weight: normal; font-size: 20px }
.crateart { width: 84px; height: 70px; border: 3px solid var(--ink); border-radius: 6px; background: repeating-linear-gradient(90deg, #c99a5c 0 14px, #b98a4c 14px 16px); position: relative; display: flex; align-items: center; justify-content: center; box-shadow: 3px 3px 0 var(--ink) }
.c-golden .crateart { background: linear-gradient(135deg, #f6d27a, #b98a2c 50%, #f2c14e) }
.crateart i { font-style: normal; font-family: var(--marker); font-size: 34px; color: #fbf6e9; -webkit-text-stroke: 1.5px var(--ink) }
.crateart.big { width: 140px; height: 116px; margin: 20px auto } .crateart.big i { font-size: 60px }
.shake { animation: shake .12s infinite }
@keyframes shake { 0% { transform: rotate(-4deg) } 50% { transform: rotate(4deg) translateY(-3px) } 100% { transform: rotate(-4deg) } }
table.odds { font-size: 14px; border-collapse: collapse } table.odds td { padding: 0 6px }
.reveal .page { text-align: center; overflow: hidden }
.reveal-stage { position: relative; min-height: 260px; display: flex; flex-direction: column; align-items: center; gap: 8px }
.burst { position: absolute; inset: -40px; background: radial-gradient(circle, var(--rar) 0, transparent 60%); opacity: .45; animation: pop .5s ease-out; pointer-events: none }
.item.revealed { width: 220px; position: relative; animation: pop .45s ease-out; box-shadow: 0 0 0 4px var(--rar), 4px 4px 0 6px var(--ink) }
.rar-name { font-family: var(--marker); font-size: 28px; letter-spacing: 2px; position: relative }
.dupe { position: relative } .coin.big { font-size: 30px }
/* 2v2 lobby */
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.teams .lslot { margin-bottom: 8px }
.teamlbl { font-family: var(--marker); font-size: 18px; margin-bottom: 4px } .teamlbl.t0 { color: var(--red) } .teamlbl.t1 { color: #2a62c9 }
.lslot.team0 { border-left: 5px solid var(--red) } .lslot.team1 { border-left: 5px solid #2a62c9 }
.lobbychat { margin: 8px 0 }
/* touch controls */
#touch { position: fixed; inset: 0; z-index: 20; pointer-events: none; user-select: none; -webkit-user-select: none }
#touch > * { pointer-events: auto; touch-action: none }
#touch .stick { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); width: 130px; height: 130px; border-radius: 50%; border: 3px solid rgba(27,26,23,.55); background: rgba(243,236,217,.35) }
#touch .knob { position: absolute; left: 40px; top: 40px; width: 50px; height: 50px; border-radius: 50%; background: rgba(27,26,23,.6); border: 2px solid #fbf6e9 }
#touch .tbtns { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 220px; height: 170px }
#touch .tbtn { position: absolute; width: 70px; height: 70px; border-radius: 50%; border: 3px solid #1b1a17; font-family: var(--marker); font-size: 14px; color: #1b1a17; background: rgba(243,236,217,.82); box-shadow: 2px 3px 0 #1b1a17 }
#touch .tbtn.on { transform: scale(.92); background: var(--hl) }
#touch .b-hit { right: 0; bottom: 50px; background: rgba(216,52,44,.85); color: #fbf6e9 }
#touch .b-heavy { right: 78px; bottom: 96px }
#touch .b-block { right: 78px; bottom: 6px; background: rgba(42,98,201,.85); color: #fbf6e9 }
#touch .b-jump { right: 152px; bottom: 50px; background: rgba(60,143,90,.85); color: #fbf6e9 }
#touch .b-grab { right: 6px; bottom: 128px; width: 54px; height: 54px; font-size: 12px }
#touch .tsmall { position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px }
#touch .tsmall button { width: 40px; height: 40px; border-radius: 10px; border: 2px solid #1b1a17; background: rgba(243,236,217,.8); font-size: 16px }
@media (pointer: coarse) { .vs-skip { font-size: 18px } }
/* tutorial video */
.tutorial { position: fixed; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: 14px }
.tutorial > * { pointer-events: auto }
.tut-top { display: flex; justify-content: space-between; align-items: center }
.tut-top .chip { background: rgba(243,236,217,.9) }
.tut-badge { font-family: var(--marker); background: var(--red); color: #fbf6e9; padding: 3px 12px; border: 2px solid var(--ink); border-radius: 6px; transform: rotate(-2deg) }
.tut-panel { align-self: center; width: min(760px, 100%); background: rgba(243,236,217,.95); border: 3px solid var(--ink); border-radius: 12px 6px 14px 8px; box-shadow: 4px 5px 0 rgba(27,26,23,.8); padding: 10px 16px; text-align: center }
.tut-title { font-family: var(--marker); font-size: 24px }
.tut-cap { font-size: 19px; margin: 4px 0 6px; min-height: 2.6em }
.tut-keys { display: flex; justify-content: center; gap: 6px; margin: 4px 0 }
.tut-keys kbd { font-size: 20px; min-width: 36px; opacity: .45 }
.tut-keys kbd.focus { opacity: 1 }
.tut-keys kbd.lit { background: var(--hl); transform: translateY(2px); border-bottom-width: 2px }
.tut-bar { height: 6px; border-radius: 4px; background: rgba(27,26,23,.15); overflow: hidden; margin: 6px 0 } .tut-bar i { display: block; height: 100%; background: var(--red) }
.tut-dots { display: flex; justify-content: center; gap: 6px } .tut-dots button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; padding: 0; cursor: pointer } .tut-dots button.on { background: var(--ink) }
.tut-ctl { justify-content: center }

/* admin replay viewer */
.film { position: fixed; inset: 0; pointer-events: none; z-index: 11; font-size: 17px }
.film > * { pointer-events: auto }
.film-top { position: absolute; top: 72px; left: 12px; right: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: rgba(251,246,233,.94); border: 2px solid var(--ink); border-radius: 12px 5px 14px 6px; padding: 6px 12px; box-shadow: 3px 3px 0 rgba(27,26,23,.25) }
.film-top b { font-family: var(--marker); font-weight: normal; font-size: 20px }
.film-badge { margin-left: auto; font-family: var(--marker); font-size: 15px; padding: 2px 10px; border-radius: 8px; background: rgba(27,26,23,.1) }
.film-badge.ok { background: #2f9e5b; color: #fff } .film-badge.bad { background: var(--red); color: #fff }
.film-side { position: absolute; top: 140px; right: 12px; width: 300px; max-height: calc(100vh - 272px); overflow: auto; background: rgba(251,246,233,.94); border: 2px solid var(--ink); border-radius: 12px 5px 14px 6px; padding: 8px 12px; box-shadow: 3px 3px 0 rgba(27,26,23,.25) }
.film-side h3 { margin: 4px 0 6px; font-size: 20px }
.film-report { border-bottom: 1.5px dashed rgba(27,26,23,.25); padding: 4px 0 6px; font-size: 15px }
.film-report p { margin: 2px 0 0; color: var(--ink-soft) }
.film-pad { margin: 6px 0 8px }
.film-name { display: flex; align-items: center; gap: 6px } .film-name i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink) }
.film-name small { color: var(--ink-soft) }
.film-pad .keys { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px }
.film-pad .key { font-size: 12px; font-family: var(--marker); padding: 1px 6px; border: 1.5px solid rgba(27,26,23,.35); border-radius: 5px; color: rgba(27,26,23,.45); transition: background .05s }
.film-pad .key.on { background: var(--hl); color: var(--ink); border-color: var(--ink) }
.film-keys { font-size: 13px; margin-top: 8px }
.film-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; background: rgba(27,26,23,.92); color: var(--paper-hi); border-radius: 14px 6px 16px 7px; padding: 8px 14px 12px; box-shadow: 3px 3px 0 rgba(27,26,23,.25) }
.film-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px }
.film-bar .chip { background: rgba(251,246,233,.1); color: var(--paper-hi); border-color: rgba(251,246,233,.5) }
.film-bar .chip.on, .film-play { background: var(--hl) !important; color: var(--ink) !important; border-color: var(--hl) !important }
.film-play { min-width: 54px; font-size: 18px }
.film-time { font-family: var(--marker); margin: 0 8px; min-width: 96px }
.film-speeds { display: flex; gap: 4px; margin-left: auto }
.film-track { position: relative; height: 16px; border-radius: 8px; background: rgba(251,246,233,.18); cursor: pointer; touch-action: none }
.film-track > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); border-radius: 8px; pointer-events: none }
.film-head { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--paper-hi); border: 3px solid var(--ink); pointer-events: none }
.film-mark { position: absolute; top: -7px; width: 4px; height: 30px; margin-left: -2px; background: var(--hl); border-radius: 2px; cursor: pointer }
.film-mark.ro { background: #4fb3ff }
.film-err { margin: auto }
@media (max-width: 800px) { .film-side { display: none } .film-speeds { margin-left: 0 } }

/* smooth tab switching */
.tabbody { position: relative }
.tabbody > .tab-leave { animation: tabLeave .12s ease-in forwards; pointer-events: none }
@keyframes tabLeave { to { opacity: 0; transform: translateX(calc(var(--dir, 1) * -18px)) } }
.tabbody > .tab-enter { opacity: 0; transform: translateX(calc(var(--dir, 1) * 22px)) }
.tabbody > .tab-enter.tab-enter-active { opacity: 1; transform: none; transition: opacity .22s ease-out, transform .32s cubic-bezier(.2,.9,.3,1.15) }
.tabs .tab { transition: background-color .18s, box-shadow .18s, transform .15s }
.notepad.pad-in { animation: padIn .34s cubic-bezier(.2,.9,.3,1.2) }
.notepad.pad-out { animation: padOut .14s ease-in forwards; pointer-events: none }
@keyframes padIn { from { opacity: 0; transform: translateX(-46px) rotate(-6deg) } }
@keyframes padOut { to { opacity: 0; transform: translateX(-46px) rotate(-6deg) } }
@media (max-width: 1240px) {
  .notepad.pad-in { animation: padInN .3s ease-out } .notepad.pad-out { animation: padOutN .19s ease-in forwards }
  @keyframes padInN { from { opacity: 0 } } @keyframes padOutN { to { opacity: 0 } }
}
@media (prefers-reduced-motion: reduce) { .tabbody > .tab-leave, .notepad.pad-in, .notepad.pad-out { animation: none } .tabbody > .tab-enter { opacity: 1; transform: none } }

/* staff tools (hidden; Ctrl+Shift+K) */
.stafftools { position: fixed; left: 14px; bottom: 30px; z-index: 40; width: min(420px, calc(100vw - 28px)); max-height: calc(100vh - 60px); overflow: auto;
  background: rgba(22,21,19,.94); color: #fbf6e9; border: 2px solid #f2c14e; border-radius: 14px 6px 16px 8px; padding: 10px 12px; box-shadow: 4px 5px 0 rgba(0,0,0,.35); font-size: 15px }
.st-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px }
.st-head b { font-family: var(--marker); font-weight: normal; font-size: 20px; color: #f2c14e }
.st-head small { color: rgba(251,246,233,.6) }
.st-x { margin-left: auto }
.stafftools .chip { color: #fbf6e9; border-color: rgba(251,246,233,.55); background: transparent; font-size: 14px; padding: 2px 9px }
.stafftools .chip.on { background: #f2c14e; color: #1b1a17; border-color: #f2c14e }
.st-sec h4 { margin: 8px 0 4px; font-family: var(--marker); font-weight: normal; font-size: 14px; color: rgba(251,246,233,.7); letter-spacing: .04em; text-transform: uppercase }
.st-row { display: flex; flex-wrap: wrap; gap: 5px }
.st-auto { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; cursor: pointer; font: inherit; color: #fbf6e9;
  background: linear-gradient(135deg, #2b2a33, #1b1a17); border: 2px solid rgba(242,193,78,.6); border-radius: 12px 5px 13px 6px; padding: 9px 12px; transition: background .2s, transform .1s }
.st-auto:hover { transform: translateY(-1px) }
.st-auto-t { font-family: var(--marker); font-size: 19px; color: #f2c14e }
.st-auto-s { grid-column: 1; font-size: 13px; color: rgba(251,246,233,.7) }
.st-auto-o { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-family: var(--marker); font-size: 18px; padding: 3px 12px; border-radius: 8px; background: rgba(251,246,233,.12) }
.st-auto.on { background: linear-gradient(135deg, #f2c14e, #e08a2a); color: #1b1a17; border-color: #f2c14e }
.st-auto.on .st-auto-t, .st-auto.on .st-auto-s { color: #1b1a17 } .st-auto.on .st-auto-o { background: #1b1a17; color: #f2c14e }
.st-hint { margin: 8px 0 0; font-size: 12px; color: rgba(251,246,233,.5) }

/* key editors */
.bindsec { margin: 4px 0 14px }
.bindhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px }
.bindhead h4 { margin: 0; font-family: var(--marker); font-weight: normal; font-size: 20px }
.bindhead .chip { margin-left: auto; font-size: 14px; padding: 1px 10px }
.binds.compact .bindhead h4 { font-size: 17px }
.p2keys { font-size: 14px; color: var(--ink-soft); margin-top: 2px }
.p2keys a { color: inherit }

/* legal links */
.legal { font-size: 15px; color: var(--ink-soft); margin-top: 12px } .legal a { color: inherit }
.landing-legal { position: fixed; right: 16px; bottom: 10px; z-index: 5; background: rgba(251,246,233,.85); padding: 2px 10px; border-radius: 8px; margin: 0 }
.check.agree a { color: var(--red) }

/* rank-up moment */
.rankup { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, rgba(22,21,19,.8), rgba(22,21,19,.95)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: ruIn .25s ease-out; cursor: pointer; overflow: hidden }
.rankup.out { animation: ruOut .25s ease-in forwards }
@keyframes ruIn { from { opacity: 0 } } @keyframes ruOut { to { opacity: 0 } }
.ru-rays { position: absolute; left: 50%; top: 42%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax; opacity: .35;
  background: repeating-conic-gradient(from 0deg, var(--tier) 0 9deg, transparent 9deg 22deg); animation: ruSpin 14s linear infinite; mask-image: radial-gradient(circle, #000 0 18%, transparent 60%); -webkit-mask-image: radial-gradient(circle, #000 0 18%, transparent 60%) }
@keyframes ruSpin { to { transform: rotate(360deg) } }
.ru-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none }
.ru-card { position: relative; text-align: center; color: #fbf6e9; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px }
.ru-title { font: 74px/1 var(--marker); letter-spacing: .02em; color: #fff; -webkit-text-stroke: 3px #1b1a17; text-shadow: 6px 7px 0 var(--tier); animation: ruTitle .55s cubic-bezier(.2,1.6,.4,1) both }
@keyframes ruTitle { from { transform: scale(2.2) rotate(-8deg); opacity: 0 } }
.ru-badge { filter: drop-shadow(0 0 30px var(--tier)) drop-shadow(5px 7px 0 rgba(0,0,0,.4)); animation: ruBadge .7s .15s cubic-bezier(.2,1.7,.4,1) both, ruFloat 2.4s 1s ease-in-out infinite }
@keyframes ruBadge { from { transform: scale(.1) rotate(-30deg); opacity: 0 } }
@keyframes ruFloat { 50% { transform: translateY(-8px) } }
.ru-label { font: 42px/1.1 var(--marker); color: var(--tier); -webkit-text-stroke: 1.5px #1b1a17; animation: ruTitle .5s .3s both }
.ru-sub { font-size: 21px; opacity: .9; margin-bottom: 8px; animation: ruIn .4s .5s both }
.ru-card .chip.big { background: var(--tier); color: #1b1a17; border-color: #1b1a17; animation: ruIn .4s .7s both }
@media (prefers-reduced-motion: reduce) { .ru-rays, .ru-badge { animation: none } }

/* coin bets */
.betbar { margin: 8px 0; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 10px 4px 12px 5px; background: rgba(242,193,78,.55); font-size: 17px }
.betbar b { font-family: var(--marker); font-weight: normal; font-size: 19px }
.res-bet { font-family: var(--marker); font-size: 20px; margin: 6px 0 } .res-bet.won { color: #2f9e5b } .res-bet.lost { color: var(--red) }
.stats tr.sess th { padding-top: 14px }
.install-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(20, 20, 26, .55) }
.install-sheet .page { width: min(460px, 100%); margin: 0 }
.install-sheet ol { padding-left: 22px; font-size: 18px; line-height: 1.45 }
.install-sheet li { margin: 6px 0 }
/* ── shop update: rarity shine, NEW badges, bundles, gifts ── */
.badge { font-style: normal; font-family: var(--marker); font-size: 12px; padding: 1px 7px; border-radius: 6px; border: 2px solid var(--ink); transform: rotate(-4deg); display: inline-block }
.badge.new { background: #ff4f6d; color: #fff }
.badge.save { background: #3c8f5a; color: #fff; font-size: 14px }
.item.r-epic, .item.r-legendary { overflow: hidden; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--rar) 55%, transparent) }
.item.r-legendary { background: linear-gradient(160deg, rgba(242,193,78,.35), rgba(255,255,255,.4) 45%, rgba(242,193,78,.25)) }
.item.r-epic { background: linear-gradient(160deg, rgba(122,63,192,.16), rgba(255,255,255,.4) 50%) }
.item.r-epic::after, .item.r-legendary::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.65) 50%, transparent 58%); transform: translateX(-60%); animation: shine 4.5s ease-in-out infinite; pointer-events: none }
.item.r-legendary::after { animation-duration: 3s }
@keyframes shine { 0%, 55% { transform: translateX(-60%) } 85%, 100% { transform: translateX(60%) } }
@media (prefers-reduced-motion: reduce) { .item.r-epic::after, .item.r-legendary::after { animation: none; display: none } }
.chip.gift { padding: 1px 7px }
.bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px }
.bundle { border-style: solid; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(170deg, rgba(242,193,78,.25), rgba(255,255,255,.4) 60%) }
.bundle-head { display: flex; justify-content: space-between; align-items: center }
.bundle-head b { font-family: var(--marker); font-weight: normal; font-size: 22px }
.bundle-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px }
.bundle-item { position: relative; border: 2px solid var(--ink); border-bottom: 5px solid var(--rar); border-radius: 8px 4px 9px 5px; padding: 3px; background: rgba(255,255,255,.45); display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 13px; line-height: 1.1 }
.bundle-item .ipv { width: 100%; height: auto; max-width: 92px }
.bundle-item.got { opacity: .55 }
.bundle-item .tick { position: absolute; top: 2px; right: 4px; font-style: normal; font-family: var(--marker); color: #3c8f5a }
.bundle-buy { align-items: center; gap: 8px; margin: 0 }
.bundle-buy .worth { font-size: 15px; opacity: .75 }
.giftsheet .page { max-width: 420px } .giftsheet .ipv { width: 160px; height: 160px; display: block; margin: 0 auto }
.giftform label { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; font-size: 17px }
.giftform select, .giftform input { font: inherit; font-size: 18px; padding: 4px 8px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper-hi) }
.giftfrom { text-align: center; font-size: 19px; margin: 10px 0 0 }
.bundle-item .bannerpv, .bundle-item .platepv { width: 100%; height: 64px; max-width: none; overflow: hidden; margin-bottom: 2px }
.bundle-item .platepv span { font-size: 13px !important; white-space: nowrap }
