/* Boxing Clever — Punch-Out!! cartoon: chunky outlines, arcade colour, a
   spotlit ring. Shared by the splash/solo career, the phone and the TV. */

:root {
  --ink: #fff7e0;
  --dim: #b8b0d8;
  --night: #14102a;
  --night2: #1f1846;
  --night3: #2c2366;
  --line: #15101f;
  --yellow: #ffd23f;
  --red: #ef3b3b;
  --red2: #b91c1c;
  --blue: #3b6cff;
  --green: #2bd46b;
  --pink: #ff5fa2;
  --display: 'Bangers', 'Impact', 'Arial Black', sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, #4a3aa855, transparent 70%),
    radial-gradient(circle at 50% 120%, #ff5fa222, transparent 50%),
    var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .display { font-family: var(--display); letter-spacing: 1px; font-weight: 400; margin: 0; }
h2 { font-size: 30px; color: var(--yellow); text-shadow: 3px 3px 0 var(--line); }
a { color: var(--yellow); }
.muted { color: var(--dim); }
small { font-size: .8em; }

button {
  font: inherit; font-weight: 800; cursor: pointer; color: var(--ink);
  background: var(--night3); border: 3px solid var(--line); border-radius: 12px;
  padding: 10px 16px; box-shadow: 0 4px 0 var(--line); transition: transform .06s, box-shadow .06s;
}
button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
button.primary { background: var(--yellow); color: var(--line); }
button.red { background: var(--red); color: #fff; }
button:disabled { opacity: .45; cursor: default; }
input { font: inherit; font-size: 20px; padding: 12px; border-radius: 12px; border: 3px solid var(--line); background: #fff7e0; color: var(--line); }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(160px); background: var(--yellow); color: var(--line);
  padding: 10px 18px; border-radius: 12px; border: 3px solid var(--line); font-weight: 800; transition: transform .25s; z-index: 50; }
#toast.show { transform: translateX(-50%) translateY(0); }
#conn { position: fixed; top: 8px; right: 8px; background: var(--red); color: #fff; padding: 4px 10px; border-radius: 8px; display: none; z-index: 60; }
#conn.show { display: block; }

/* ---- the logo ---- */
.logo { font-family: var(--display); line-height: .9; text-align: center; transform: rotate(-3deg); }
.logo .l1, .logo .l2 { display: block; color: var(--yellow); -webkit-text-stroke: 3px var(--line); text-shadow: 6px 6px 0 var(--red), 9px 9px 0 var(--line); }
.logo .l1 { font-size: clamp(54px, 15vw, 120px); }
.logo .l2 { font-size: clamp(64px, 18vw, 150px); color: #fff; margin-top: -4px; }
.logo .glove { font-size: .5em; vertical-align: middle; }

/* ---- the guard: tiles 1–9 ---- */
.guard { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; width: 100%; }
.tile {
  position: relative; aspect-ratio: .62; border-radius: 10px 10px 6px 6px; border: 3px solid var(--line);
  display: flex; align-items: center; justify-content: center; padding: 0; box-shadow: none;
  font-family: var(--display); color: #fff; user-select: none; -webkit-user-select: none;
}
.guard.lg .tile { font-size: clamp(22px, 7vw, 40px); }
.guard.md .tile { font-size: 26px; }
.guard.sm { gap: 2px; } .guard.sm .tile { font-size: 15px; border-width: 2px; border-radius: 6px 6px 4px 4px; }
.tile.up {
  background: linear-gradient(180deg, #ff6b5e 0%, var(--red) 45%, var(--red2) 100%);
  box-shadow: inset 0 4px 0 #ffffff55, inset 0 -6px 0 #00000033, 0 4px 0 var(--line);
  text-shadow: 2px 2px 0 var(--line);
}
.tile.up b { transform: translateY(-2px); }
.tile.down {
  background: #0d0a1d; color: #3a3166; transform: scaleY(.38); transform-origin: bottom;
  box-shadow: none; border-color: #2a2250;
}
.tile.cracked::after { content: ''; position: absolute; inset: 10% 20%; background:
  linear-gradient(115deg, transparent 45%, var(--line) 46% 52%, transparent 53%),
  linear-gradient(60deg, transparent 47%, var(--line) 48% 52%, transparent 53%); opacity: .85; }
button.tile.up.hot { box-shadow: inset 0 4px 0 #ffffff55, inset 0 -6px 0 #00000033, 0 4px 0 var(--line), 0 0 0 3px #ffd23f66; }
button.tile.up.sel { background: linear-gradient(180deg, #fff1a6, var(--yellow) 50%, #e0a800); color: var(--line); text-shadow: none;
  transform: translateY(-8px); box-shadow: 0 10px 0 var(--line), 0 0 18px #ffd23faa; }
button.tile:active { transform: translateY(-4px); }
.tile.fresh.down { animation: punched .45s ease-out; }
@keyframes punched {
  0% { transform: none; background: var(--yellow); }
  40% { transform: scale(1.15) rotate(-6deg); background: #fff; }
  100% { transform: scaleY(.38); }
}

/* ---- dice ---- */
.dice { display: flex; gap: 12px; justify-content: center; }
.die { width: 64px; height: 64px; background: #fffdf5; border: 4px solid var(--line); border-radius: 14px;
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 7px; gap: 2px; box-shadow: 0 5px 0 var(--line); }
.die i { border-radius: 50%; }
.die i.on { background: var(--line); }
.die[data-n="1"] i.on { background: var(--red); }
.die.blank { background: #fffdf522; border-style: dashed; box-shadow: none; }
.die.off { opacity: .25; filter: grayscale(1); }
.dice.rolling .die { animation: tumble .5s ease-out; }
@keyframes tumble { 0% { transform: rotate(-200deg) scale(.4); } 70% { transform: rotate(15deg) scale(1.1); } 100% { transform: none; } }
.dice.xl .die { width: 150px; height: 150px; border-width: 7px; border-radius: 28px; padding: 18px; gap: 6px; box-shadow: 0 10px 0 var(--line); }
.dice.sm .die { width: 34px; height: 34px; border-width: 3px; border-radius: 8px; padding: 4px; gap: 1px; box-shadow: 0 3px 0 var(--line); }

/* ---- punch pad ---- */
.pad { display: grid; gap: 12px; }
.punchbtn { font-family: var(--display); font-size: 26px; letter-spacing: 1px; padding: 12px; background: #3a3166; color: var(--dim); }
.punchbtn.ready { background: var(--yellow); color: var(--line); animation: throb .8s ease-in-out infinite alternate; }
.punchbtn b { font-size: 1.1em; }
.punchbtn em { font-style: normal; font-size: .7em; }
@keyframes throb { to { transform: scale(1.03); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { font-family: var(--display); font-size: 22px; padding: 6px 14px; background: #fff7e0; color: var(--line); border-radius: 999px; }
.chip.mir { background: #c4b5fd; }

/* ---- perks ---- */
.perk { display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; padding: 10px 12px; border: 3px solid var(--line);
  border-radius: 14px; background: var(--night3); color: var(--ink); position: relative; }
.perk.gloves { background: linear-gradient(135deg, #5b1a2a, #3a1430); }
.perk.technique { background: linear-gradient(135deg, #1a3a6b, #1a2650); }
.perk.corner { background: linear-gradient(135deg, #1d4d3a, #173328); }
.perk .pk-ic { font-size: 28px; }
.perk .pk-tx { display: grid; gap: 2px; flex: 1; }
.perk .pk-tx b { font-family: var(--display); font-size: 22px; letter-spacing: 1px; color: var(--yellow); font-weight: 400; }
.perk .pk-tx small { font-size: 14px; color: var(--ink); font-weight: 600; line-height: 1.3; }
.perk .pk-rare { position: absolute; top: -9px; right: 10px; background: var(--pink); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 99px; border: 2px solid var(--line); font-weight: 800; }
.perk.spent { opacity: .5; }
button.perk.picked { outline: 4px solid var(--yellow); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: #ffffff1a; border: 2px solid #ffffff33; }
.pill.spent { opacity: .45; text-decoration: line-through; }

/* ---- opponents ---- */
.portrait { display: block; overflow: visible; }
.portrait.mood-hit { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-10px) rotate(-3deg); } 50% { transform: translateX(8px); } 80% { transform: translateX(-4px); } }
.obadge { display: inline-block; overflow: hidden; border-radius: 50%; border: 3px solid var(--line); background: var(--night3); vertical-align: middle; position: relative; }
.obadge .portrait { position: absolute; left: 50%; top: -6%; transform: translateX(-50%); }
.quirk { font-size: 14px; background: #00000040; border-left: 4px solid var(--pink); padding: 6px 10px; border-radius: 6px; }
.quirk b { color: var(--pink); }
.quirk.none { border-left-color: var(--green); }
.badge { font-family: var(--display); font-size: 18px; letter-spacing: 1px; padding: 2px 10px; border-radius: 8px; border: 3px solid var(--line); }
.badge.ko { background: var(--yellow); color: var(--line); }
.badge.down { background: var(--pink); color: #fff; animation: throb .5s infinite alternate; }
.badge.out { background: #555; color: #ddd; }
.kd { display: inline-flex; gap: 3px; vertical-align: middle; }
.kd i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); }
.kd i.on { background: var(--pink); border-color: var(--pink); }

/* ---- overlays: DOWN!, K.O.!, the ten count ---- */
.boom { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; z-index: 40; pointer-events: none; }
.boom .word { font-family: var(--display); font-size: clamp(80px, 26vw, 220px); color: var(--yellow); -webkit-text-stroke: 4px var(--line);
  text-shadow: 8px 8px 0 var(--red), 12px 12px 0 var(--line); animation: slam .5s cubic-bezier(.2,1.6,.4,1); transform: rotate(-6deg); }
.boom .sub { font-family: var(--display); font-size: 28px; margin-top: 10px; text-shadow: 3px 3px 0 var(--line); }
.boom.fade { animation: fadeout .6s 1.4s forwards; }
@keyframes slam { from { transform: scale(3) rotate(-20deg); opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.count { font-family: var(--display); font-size: 64px; color: #fff; text-shadow: 4px 4px 0 var(--line); }
.flash { animation: flash .3s; }
@keyframes flash { 0% { background: #fff; } }

/* ---- solo career + phone common ---- */
.screen { max-width: 520px; margin: 0 auto; padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--dim); }
.bar .brand { font-family: var(--display); font-size: 24px; color: var(--yellow); text-shadow: 2px 2px 0 var(--line); font-weight: 400; }
.bar .code { font-family: ui-monospace, monospace; letter-spacing: 2px; }
.ring {
  position: relative; border-radius: 18px; border: 4px solid var(--line); overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #6b5bd6 0%, #3a2c8a 55%, #241a5a 100%);
  display: flex; align-items: flex-end; justify-content: center; padding-top: 6px; min-height: 150px;
}
.ring::before, .ring::after { content: ''; position: absolute; left: 0; right: 0; height: 6px; border-top: 3px solid var(--line); border-bottom: 3px solid var(--line); }
.ring::before { top: 38%; background: var(--red); }
.ring::after { top: 52%; background: #fff; }
.ring .portrait { position: relative; z-index: 2; }
.ring .tag { position: absolute; left: 10px; top: 8px; z-index: 3; font-family: var(--display); font-size: 22px; text-shadow: 2px 2px 0 var(--line); }
.ring .tag small { display: block; font-family: var(--body); font-size: 12px; font-weight: 800; color: var(--dim); text-shadow: none; }
.ring .line { position: absolute; right: 10px; top: 8px; z-index: 3; text-align: right; font-weight: 800; font-size: 13px; text-shadow: 1px 1px 0 var(--line); }
.ring .line b { font-family: var(--display); font-size: 28px; font-weight: 400; color: var(--yellow); display: block; }
.ring .line b.good { color: var(--green); }
.msg { text-align: center; font-weight: 800; font-size: 17px; min-height: 1.4em; }
.msg .big { font-family: var(--display); font-size: 30px; font-weight: 400; color: var(--yellow); text-shadow: 2px 2px 0 var(--line); display: block; }
.rollrow { display: flex; align-items: center; justify-content: center; gap: 14px; }
.rollbtn { font-family: var(--display); font-size: 30px; padding: 12px 26px; background: var(--red); color: #fff; letter-spacing: 1px; }
.rollbtn.count { background: var(--pink); animation: throb .5s infinite alternate; }
.stats { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; color: var(--dim); }
.stats b { color: var(--ink); font-size: 16px; }
.timer { height: 8px; border-radius: 99px; background: #ffffff1a; overflow: hidden; border: 2px solid var(--line); }
.timer i { display: block; height: 100%; background: var(--yellow); transition: width .2s linear; }
.timer i.late { background: var(--red); }
.rules { font-size: 13px; line-height: 1.5; color: var(--dim); border-top: 2px dashed #ffffff22; padding-top: 10px; }
.rules b { color: var(--ink); }

/* ---- career ladder ---- */
.ladder { display: grid; gap: 6px; }
.rung { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: #00000030; border: 3px solid transparent; }
.rung.now { border-color: var(--yellow); background: #ffd23f1a; }
.rung.beaten { opacity: .55; }
.rung .nm { flex: 1; font-weight: 800; }
.rung .nm small { display: block; color: var(--dim); font-weight: 600; }
.rung .ln { font-family: var(--display); font-size: 20px; color: var(--yellow); }
.tierhead { font-family: var(--display); font-size: 18px; color: var(--pink); letter-spacing: 2px; margin-top: 6px; }
.card { background: #00000033; border: 3px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.intro { text-align: center; }
.intro .vs { font-family: var(--display); font-size: 40px; color: var(--pink); text-shadow: 3px 3px 0 var(--line); }
.intro .who { font-family: var(--display); font-size: 40px; color: var(--yellow); text-shadow: 3px 3px 0 var(--line); line-height: 1; }
.intro .nick { font-style: italic; color: var(--dim); font-weight: 700; }
.intro .taunt { font-weight: 800; background: #fff; color: var(--line); border-radius: 14px; padding: 8px 12px; border: 3px solid var(--line); position: relative; }
.record { display: flex; gap: 14px; justify-content: center; font-weight: 800; }
.record b { font-family: var(--display); font-size: 26px; font-weight: 400; color: var(--yellow); }
.verdict { font-family: var(--display); font-size: 54px; text-align: center; line-height: 1; text-shadow: 4px 4px 0 var(--line); }
.verdict.win { color: var(--yellow); } .verdict.loss { color: #9ca3af; }
.btncol { display: grid; gap: 8px; }
.btncol button { font-size: 20px; padding: 14px; }

/* ---- kit lobby (phone) ---- */
.join, .lobbyv { max-width: 480px; margin: 0 auto; padding: 28px 14px; display: flex; flex-direction: column; gap: 12px; }
.join h1, .lobbyv h1 { font-size: 44px; color: var(--yellow); text-shadow: 3px 3px 0 var(--line); }
.hint { color: var(--dim); font-size: 16px; }
.seat-row { padding: 8px 12px; background: #00000033; border-radius: 10px; margin: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.tagg { color: var(--dim); font-size: 13px; margin-left: 6px; }
.av { border-radius: 50%; vertical-align: middle; }

/* ---- kit lobby (TV) ---- */
.lobby { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; padding: 48px 64px; min-height: 100vh; }
.lobby h1 { font-size: 110px; color: var(--yellow); -webkit-text-stroke: 3px var(--line); text-shadow: 6px 6px 0 var(--red), 9px 9px 0 var(--line); transform: rotate(-2deg); }
.lobby .join-hint { font-size: 22px; margin-top: 18px; }
.lobby .code { font-family: var(--display); font-size: 84px; letter-spacing: 10px; color: #fff; text-shadow: 4px 4px 0 var(--line); }
.lobby .seat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin: 14px 0; font-size: 22px; }
.lobby .buttons { display: flex; gap: 10px; margin: 16px 0; }
.lobby .buttons button { font-size: 22px; padding: 14px 22px; }
.lobby .qr { background: #fff6d8; padding: 18px; border-radius: 22px; border: 6px solid var(--line); width: 380px; }
.lobby .qr svg { width: 100%; height: auto; display: block; }
.opts { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 10px; font-weight: 800; font-size: 18px; }
.opts select { font: inherit; font-size: 18px; padding: 6px 8px; border-radius: 10px; border: 3px solid var(--line); background: #fff7e0; color: var(--line); }
