/* SMASHPLANK HUD + menus.
   Chunky cartoon look: fat ink outlines, offset drop shadows, wobbly type.
   Z-order: canvas (0) < effects flash/vignette (40-41, from effects.js) < HUD (50) < overlays (60+). */

:root {
  --ink: #2b1a10;
  --cream: #fff6e0;
  --yellow: #ffd23a;
  --orange: #ff8a3d;
  --red: #ff4f4f;
  --green: #5ad66f;
  --sky: #7fd3ff;
  --wood: #d9a066;
  --panel: rgba(43, 26, 16, 0.72);
  --font: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --comic: 'Bangers', 'Impact', 'Arial Black', sans-serif;
  --outline: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink),
             2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #8fd8ff;
  font-family: var(--font);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
}
#game, #game canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ---------- buttons / inputs ---------- */
.btn {
  font-family: var(--font); color: var(--ink); cursor: pointer;
  background: var(--yellow); border: 4px solid var(--ink); border-radius: 16px;
  box-shadow: 0 6px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { background: #ffe066; transform: translateY(-2px) rotate(-1deg); box-shadow: 0 8px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn.big { font-size: clamp(22px, 3.4vw, 34px); padding: 10px 30px; letter-spacing: 1px; }
.btn.small { font-size: 16px; padding: 6px 14px; border-width: 3px; box-shadow: 0 4px 0 var(--ink); }
.btn:disabled { opacity: .6; cursor: progress; }

kbd {
  display: inline-block; min-width: 1.7em; padding: 1px 6px; margin: 0 1px;
  font-family: var(--font); font-size: .85em; color: var(--ink); text-align: center;
  background: var(--cream); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 0 2px 0 var(--ink);
}

.slider { display: flex; align-items: center; gap: 10px; font-size: 15px; justify-content: center; flex-wrap: wrap; }
.slider input { accent-color: var(--yellow); width: 160px; }
.slider output { min-width: 2.6em; text-align: left; }
.check { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 15px; }
.check input { accent-color: var(--yellow); width: 18px; height: 18px; }

/* ---------- join screen ---------- */
#join {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,240,200,.15), rgba(30,60,90,.45) 75%);
}
.join-inner { text-align: center; max-width: 720px; width: 100%; display: flex; flex-direction: column; gap: 14px; align-items: center; }
#title {
  margin: 0; font-family: var(--comic); font-weight: 400; line-height: 1;
  font-size: clamp(54px, 13vw, 150px); letter-spacing: 2px; white-space: nowrap;
  filter: drop-shadow(0 8px 0 var(--ink));
}
#title span {
  display: inline-block; color: var(--yellow);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 0 5px 0 #d1650f, 0 10px 0 var(--ink);
  animation: wobble 1.6s ease-in-out infinite;
}
#title span:nth-child(n+6) { color: var(--wood); text-shadow: 0 5px 0 #8a5326, 0 10px 0 var(--ink); }
#title span.bonk { animation: wobble 1.6s ease-in-out infinite, bonk .5s cubic-bezier(.2,2,.4,1); }
@keyframes wobble {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
  50% { transform: translateY(-10px) rotate(5deg) scale(1.05); }
}
@keyframes bonk { 0% { transform: scale(1.5, .5); } 100% { transform: scale(1); } }
.tagline { margin: 0; font-size: clamp(16px, 2.4vw, 24px); text-shadow: var(--outline); }
.tagline b { color: var(--yellow); }
#join-form { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
#name {
  font-family: var(--font); font-size: clamp(20px, 3vw, 28px); color: var(--ink); text-align: center;
  width: min(320px, 80vw); padding: 10px 16px; border: 4px solid var(--ink); border-radius: 16px;
  background: var(--cream); box-shadow: inset 0 4px 0 rgba(0,0,0,.12), 0 6px 0 var(--ink); outline: none;
}
#name:focus { background: #fff; }
#join-error { min-height: 1.2em; color: #ffd0d0; text-shadow: var(--outline); }
#join-error.waiting { color: #fff3b0; }
#join-error.blocked {
  color: var(--cream); font-size: 20px; line-height: 1.35; max-width: 460px; margin: 6px auto;
  padding: 14px 18px; background: rgba(43,26,16,.85); border: 4px solid var(--ink); border-radius: 18px;
}
/* wide screens: menu column on the left, the demo beans brawl on the right */
@media (min-width: 1000px) {
  #join {
    justify-content: flex-start; padding-left: 5vw;
    background: linear-gradient(90deg, rgba(25,45,70,.62), rgba(25,45,70,.25) 50%, transparent 70%);
  }
  .join-inner { max-width: 600px; }
  #title { font-size: clamp(64px, 8.5vw, 124px); }
}
.controls {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 18px;
  background: var(--panel); border: 4px solid var(--ink); border-radius: 18px; padding: 14px 18px;
  font-size: 16px; width: 100%; text-align: left;
}
.tip { margin: 0; font-size: 15px; opacity: .95; text-shadow: var(--outline); min-height: 1.2em; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 50; pointer-events: none; text-shadow: var(--outline); }

#round-box {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); text-align: center;
  background: var(--panel); border: 4px solid var(--ink); border-radius: 18px; padding: 4px 20px 6px;
  min-width: 150px;
}
#round-state { font-size: 14px; letter-spacing: 2px; color: var(--yellow); }
#round-timer { font-size: 38px; line-height: 1; }
#round-timer.small { font-size: 26px; padding: 4px 0 2px; }
#round-timer.urgent { color: var(--red); animation: pulse .5s ease-in-out infinite alternate; }
#round-sub { font-size: 13px; opacity: .9; }
#round-sub:empty { display: none; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.15); } }

#mini-board {
  position: absolute; top: 10px; right: 10px; margin: 0; padding: 6px 8px; list-style: none;
  background: var(--panel); border: 4px solid var(--ink); border-radius: 16px; min-width: 190px; max-width: 42vw;
}
#mini-board li { display: flex; align-items: center; gap: 6px; font-size: 16px; padding: 2px 4px; border-radius: 8px; }
#mini-board li.me { background: rgba(255,210,58,.25); }
#mini-board li .rank { width: 1.3em; color: var(--yellow); }
#mini-board li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mini-board li .sc { min-width: 2.5em; text-align: right; }
#mini-board:empty { display: none; }
.swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); flex: none;
}

/* never wider than the gap to the left edge of the centred round timer */
#feed { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 5px; max-width: min(420px, calc(50vw - 110px)); }
.feed-item {
  font-size: 15px; background: var(--panel); border: 3px solid var(--ink); border-radius: 12px; padding: 4px 10px;
  animation: feedIn .35s cubic-bezier(.2,1.6,.4,1) both;
}
.feed-item.big { font-size: 17px; background: rgba(160, 60, 20, .8); }
.feed-item.out { animation: feedOut .4s ease-in forwards; }
.feed-item b { font-weight: 400; }
@keyframes feedIn { from { transform: translateX(-120%) rotate(-6deg); } to { transform: none; } }
@keyframes feedOut { to { transform: translateX(-120%); opacity: 0; } }

/* reticle + hit marker */
#reticle { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#reticle .dot {
  position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ink); opacity: .85;
}
#hitmarker { position: absolute; left: 0; top: 0; opacity: 0; }
#hitmarker i {
  position: absolute; width: 5px; height: 16px; background: #fff; border: 2px solid var(--ink); border-radius: 3px;
  left: -2.5px; top: -8px;
}
#hitmarker i:nth-child(1) { transform: rotate(45deg) translateY(-16px); }
#hitmarker i:nth-child(2) { transform: rotate(135deg) translateY(-16px); }
#hitmarker i:nth-child(3) { transform: rotate(225deg) translateY(-16px); }
#hitmarker i:nth-child(4) { transform: rotate(315deg) translateY(-16px); }
#hitmarker.on { animation: hitmark .35s ease-out forwards; }
#hitmarker.on.big i { background: var(--yellow); }
@keyframes hitmark { 0% { opacity: 1; transform: scale(1.8); } 40% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }

/* combo popup */
#combo {
  position: absolute; left: 50%; top: 24%; transform: translateX(-50%); font-family: var(--comic);
  font-size: clamp(36px, 6vw, 64px); color: #a6f7ff; letter-spacing: 2px; opacity: 0; white-space: nowrap;
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
}
#combo.on { animation: comboPop 1.3s cubic-bezier(.2,1.8,.4,1) forwards; }
#combo.hot { color: #ff7ad1; }
@keyframes comboPop {
  0% { opacity: 0; transform: translateX(-50%) scale(2.6) rotate(-12deg); }
  15% { opacity: 1; transform: translateX(-50%) scale(1) rotate(-4deg); }
  75% { opacity: 1; transform: translateX(-50%) scale(1.05) rotate(3deg); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(.9); }
}

#score-pops { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }
.score-pop {
  position: absolute; left: 0; top: 0; font-size: 32px; color: #b6ff7a; white-space: nowrap; transform: translateX(-50%);
  animation: scorePop 0.9s ease-out forwards;
}
.score-pop.big { font-size: 46px; color: var(--yellow); }
.score-pop.neg { color: var(--red); }
@keyframes scorePop {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(.4); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.25); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(1); }
}

#banner {
  position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-family: var(--comic);
  font-size: clamp(60px, 14vw, 170px); color: var(--yellow); letter-spacing: 3px; line-height: 1; opacity: 0;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink);
}
#banner.small { font-size: clamp(36px, 7vw, 80px); }
#banner.on { animation: bannerPop 1s cubic-bezier(.2,1.8,.4,1) forwards; }
#banner.go { color: #ff6b3d; }
@keyframes bannerPop {
  0% { opacity: 0; transform: scale(3) rotate(-10deg); }
  18% { opacity: 1; transform: scale(1) rotate(-3deg); }
  70% { opacity: 1; transform: scale(1.06) rotate(2deg); }
  100% { opacity: 0; transform: scale(.7) rotate(4deg); }
}

#respawn-msg {
  position: absolute; left: 0; right: 0; top: 58%; text-align: center; font-size: clamp(22px, 3.6vw, 34px);
}
#respawn-msg:empty { display: none; }

/* bonk meter (bottom left) */
#bonk-box {
  position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 4px solid var(--ink); border-radius: 20px; padding: 8px 16px 8px 10px;
}
#bonk-swatch { width: 46px; height: 54px; border-radius: 50% 50% 46% 46%; border: 4px solid var(--ink); position: relative; }
#bonk-swatch::before, #bonk-swatch::after {
  content: ''; position: absolute; top: 12px; width: 13px; height: 13px; background: #fff; border-radius: 50%;
  border: 2px solid var(--ink); box-shadow: inset 3px 1px 0 #fff, inset 6px 3px 0 var(--ink);
}
#bonk-swatch::before { left: 7px; } #bonk-swatch::after { right: 7px; }
#bonk-name { font-size: 14px; opacity: .9; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bonk-pct { font-size: 46px; line-height: .95; transition: color .2s; }
#bonk-pct span { font-size: 24px; }
#bonk-pct.shake { animation: shake .3s linear; }
#my-score { font-size: 26px; color: var(--yellow); margin-left: 8px; }
#my-score span { font-size: 15px; color: var(--cream); }
@keyframes shake {
  0%, 100% { transform: none; } 20% { transform: translate(-4px, 2px) rotate(-5deg) scale(1.2); }
  40% { transform: translate(4px, -2px) rotate(4deg) scale(1.15); } 60% { transform: translate(-3px, 1px) rotate(-3deg); }
  80% { transform: translate(2px, -1px) rotate(2deg); }
}

/* charge meter (bottom center) */
#charge {
  position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); text-align: center; opacity: 0;
  transition: opacity .12s;
}
#charge.on { opacity: 1; }
#charge-label { font-size: 18px; letter-spacing: 3px; margin-bottom: 4px; }
#charge-bar {
  position: relative; width: min(340px, 60vw); height: 26px; border: 4px solid var(--ink); border-radius: 14px;
  background: rgba(43,26,16,.65); overflow: hidden; box-shadow: 0 4px 0 var(--ink);
}
#charge-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: linear-gradient(90deg, #ffe066, #ff8a3d 60%, #ff3d3d);
  box-shadow: inset 0 5px 0 rgba(255,255,255,.4);
}
#charge-ticks {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 2px), rgba(43,26,16,.6) calc(25% - 2px) 25%);
}
#charge.full #charge-bar { animation: shake .18s linear infinite; }
#charge.full #charge-fill { background: linear-gradient(90deg, #fff27a, #ff4f4f); animation: glow .25s ease-in-out infinite alternate; }
#charge.full #charge-label { color: var(--yellow); }
@keyframes glow { from { filter: brightness(1); } to { filter: brightness(1.45); } }

/* parry pip (under the charge meter): ready / guard / lock (whiff lockout) / busy / dazed */
#parry-pip {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 2px 10px 2px 6px;
  background: var(--panel); border: 3px solid var(--ink); border-radius: 12px;
  font-size: 13px; letter-spacing: 2px; transition: background .12s, opacity .12s;
}
#parry-pip .shield {
  width: 13px; height: 15px; background: var(--wood); border: 2px solid var(--ink);
  border-radius: 3px 3px 50% 50% / 3px 3px 60% 60%;
}
#parry-pip .bar {
  position: relative; width: 44px; height: 8px; border: 2px solid var(--ink); border-radius: 5px;
  background: rgba(0,0,0,.35); overflow: hidden;
}
#parry-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: var(--yellow); }
#parry-pip[data-state="ready"] #parry-label { color: var(--cream); }
#parry-pip[data-state="busy"] { opacity: .45; }
#parry-pip[data-state="guard"] { background: var(--yellow); color: var(--ink); text-shadow: none; box-shadow: 0 0 14px 4px rgba(255,220,80,.75); }
#parry-pip[data-state="guard"] .shield { background: #fff6c0; }
#parry-pip[data-state="lock"] { background: rgba(150, 30, 30, .85); }
#parry-pip[data-state="lock"] #parry-fill { background: #ff8a8a; }
#parry-pip[data-state="lock"] .shield { background: #9a6a45; transform: rotate(25deg); }
#parry-pip[data-state="dazed"] { background: rgba(90, 50, 170, .9); }
#parry-pip.pop { animation: pipPop .25s cubic-bezier(.2,2,.4,1); }
@keyframes pipPop { from { transform: translateX(-50%) scale(1.5); } to { transform: translateX(-50%) scale(1); } }

/* DAZED! (you got parried). Sits where the charge meter goes (you can't charge while dazed), not
   at mid-screen: the third-person camera puts your own bean there, stars and all. */
#dazed {
  position: absolute; left: 0; right: 0; bottom: 46px; text-align: center; font-family: var(--comic);
  font-size: clamp(30px, 4.6vw, 54px); color: #d9b8ff; letter-spacing: 3px; opacity: 0; pointer-events: none;
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink);
  transition: opacity .15s;
}
#dazed.on { opacity: 1; animation: dazedSway 0.9s ease-in-out infinite alternate; }
#dazed i { display: inline-block; font-style: normal; color: var(--yellow); margin: 0 .2em; }
#dazed.on i { animation: spin 1s linear infinite; }
#dazed.on i:last-child { animation-direction: reverse; }
@keyframes dazedSway {
  from { transform: rotate(-5deg) translateX(-12px) scale(1, .95); }
  to { transform: rotate(5deg) translateX(12px) scale(1, 1.05); }
}

#netinfo { position: absolute; right: 12px; bottom: 34px; font-size: 15px; display: flex; gap: 10px; }
#hint { position: absolute; right: 12px; bottom: 12px; font-size: 13px; opacity: .8; }

/* Tab scoreboard */
#scoreboard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 140px); overflow: auto;
  background: rgba(43,26,16,.88); border: 5px solid var(--ink); border-radius: 22px; padding: 12px 18px 16px;
}
#scoreboard h2 { margin: 0 0 8px; text-align: center; font-family: var(--comic); font-weight: 400; font-size: 40px; color: var(--yellow); letter-spacing: 2px; }
table { width: 100%; border-collapse: collapse; font-size: clamp(13px, 1.8vw, 18px); }
th { font-weight: 400; color: var(--yellow); font-size: .8em; letter-spacing: 1px; padding: 4px 6px; text-align: center; }
td { padding: 5px 6px; text-align: center; border-top: 2px solid rgba(255,246,224,.12); }
th.l, td.l { text-align: left; }
tr.me td { background: rgba(255,210,58,.2); }
td.nm { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td .swatch { vertical-align: -2px; margin-right: 6px; }

/* ---------- round end overlay ---------- */
#roundend {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 30%, rgba(90,50,10,.78), rgba(20,10,5,.92) 70%);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  overflow-y: auto; text-shadow: var(--outline);
  animation: fadeIn .4s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
/* round-end confetti: pieces fly up out of the podium, flutter and fall */
#re-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
#re-confetti i {
  position: absolute; bottom: 30%; width: 10px; height: 16px; border-radius: 2px; opacity: 0;
  animation: confetti var(--t, 3s) cubic-bezier(.15,.7,.4,1) var(--d, 0s) forwards;
}
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  35% { opacity: 1; transform: translate(calc(var(--dx) * .6), var(--dy)) rotate(calc(var(--rot) * .5)); }
  100% { opacity: 0; transform: translate(var(--dx), 70vh) rotate(var(--rot)); }
}
#roundend .re-inner { position: relative; z-index: 1; }
.re-inner { width: min(900px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; margin: auto; }
.re-title {
  margin: 0; font-family: var(--comic); font-weight: 400; font-size: clamp(48px, 9vw, 100px); color: var(--yellow);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 7px 0 var(--ink);
  animation: wobble 2s ease-in-out infinite;
}
#podium { display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 2vw, 20px); min-height: 250px; width: 100%; }
.pod { display: flex; flex-direction: column; align-items: center; width: clamp(96px, 22vw, 190px); }
.pod .bean {
  width: 64px; height: 76px; border-radius: 50% 50% 46% 46%; border: 4px solid var(--ink); position: relative;
  animation: beanHop .6s ease-in-out infinite alternate; animation-delay: var(--d, 0s);
  box-shadow: inset -8px -6px 0 rgba(0,0,0,.18);
}
.pod .bean::before, .pod .bean::after {
  content: ''; position: absolute; top: 16px; width: 18px; height: 18px; background: #fff; border-radius: 50%;
  border: 3px solid var(--ink); box-shadow: inset 5px 2px 0 #fff, inset 9px 4px 0 var(--ink);
}
.pod .bean::before { left: 9px; } .pod .bean::after { right: 9px; }
.pod.p1 .bean { width: 80px; height: 94px; }
.pod .crown { width: 46px; height: 34px; margin-bottom: 2px; }
.pod .crown.on {
  background: var(--ink);
  clip-path: polygon(0 100%, 0 20%, 25% 55%, 50% 0, 75% 55%, 100% 20%, 100% 100%);
  animation: wobble 1s ease-in-out infinite; position: relative;
}
.pod .crown.on::after {
  content: ''; position: absolute; inset: 4px 4px 3px; background: var(--yellow);
  clip-path: polygon(0 100%, 0 22%, 25% 60%, 50% 3%, 75% 60%, 100% 22%, 100% 100%);
}
.pod .pname { font-size: clamp(15px, 2.2vw, 22px); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 4px 0 2px; }
.pod .pscore { font-size: clamp(14px, 1.8vw, 18px); color: var(--yellow); margin-bottom: 4px; }
.pod .block {
  width: 100%; border: 4px solid var(--ink); border-bottom: none; border-radius: 12px 12px 0 0;
  display: flex; justify-content: center; padding-top: 8px; font-family: var(--comic); font-size: 46px; color: var(--ink); text-shadow: none;
  background: linear-gradient(#ffe8a8, #e9b65a); transform-origin: bottom; animation: rise .7s cubic-bezier(.2,1.5,.4,1) both;
  animation-delay: var(--d, 0s); box-shadow: inset 0 8px 0 rgba(255,255,255,.45);
}
.pod.p1 .block { height: 130px; background: linear-gradient(#fff3a8, #ffc93c); }
.pod.p2 .block { height: 95px; background: linear-gradient(#f0f4ff, #b9c4d8); }
.pod.p3 .block { height: 70px; background: linear-gradient(#ffd7b0, #d48a52); }
.pod.empty { opacity: .35; }
@keyframes rise { from { transform: scaleY(0); } }
@keyframes beanHop { from { transform: translateY(0) scale(1.06, .94); } to { transform: translateY(-14px) scale(.96, 1.05) rotate(4deg); } }

#awards { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.award {
  background: var(--cream); color: var(--ink); text-shadow: none; border: 4px solid var(--ink); border-radius: 14px;
  padding: 6px 14px; text-align: center; box-shadow: 0 5px 0 var(--ink); transform: rotate(var(--r, 0deg));
  animation: awardIn .5s cubic-bezier(.2,1.8,.4,1) both; animation-delay: var(--d, 0s);
}
.award .t { font-size: 13px; color: #b0571e; letter-spacing: 1px; }
.award .n { font-size: 19px; }
@keyframes awardIn { from { transform: scale(0) rotate(-30deg); } }
.re-table-wrap {
  width: 100%; background: rgba(43,26,16,.85); border: 4px solid var(--ink); border-radius: 18px; padding: 6px 12px; max-height: 32vh; overflow: auto;
}
/* column names stay put while the table scrolls (top: -6px cancels the wrap's padding) */
.re-table-wrap thead th { position: sticky; top: -6px; z-index: 1; background: rgb(43,26,16); }
#re-next { font-size: clamp(20px, 3vw, 28px); }
#re-next b { color: var(--yellow); font-weight: 400; display: inline-block; min-width: 1.2em; }

/* while the leaderboard is up, the in-game HUD steps aside */
body.roundend-open #hud > *:not(#netinfo) { visibility: hidden; }

/* ---------- pause + connection ---------- */
#pause, #conn {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(20,10,5,.45); text-shadow: var(--outline);
}
#conn { z-index: 90; }
.card {
  background: var(--panel); border: 5px solid var(--ink); border-radius: 22px; padding: 20px 26px;
  display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; max-width: 100%;
}
.card h2 { margin: 0; font-family: var(--comic); font-weight: 400; font-size: 40px; color: var(--yellow); letter-spacing: 2px; }
#conn .card { flex-direction: row; font-size: 22px; }
.spinner {
  width: 34px; height: 12px; background: var(--wood); border: 3px solid var(--ink); border-radius: 3px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  #feed { top: auto; bottom: 110px; max-width: 70vw; }
  .feed-item { font-size: 13px; }
  #mini-board { min-width: 0; font-size: 13px; top: 96px; }
  #mini-board li { font-size: 13px; }
  #round-timer { font-size: 30px; }
  #bonk-pct { font-size: 34px; }
  #bonk-swatch { width: 36px; height: 42px; }
  #bonk-swatch::before, #bonk-swatch::after { top: 8px; width: 10px; height: 10px; }
  #bonk-swatch::before { left: 5px; } #bonk-swatch::after { right: 5px; }
  #my-score { font-size: 20px; }
  #hint { display: none; }
  #charge { bottom: 118px; }
  #parry-pip { bottom: 88px; }
  #dazed { bottom: 116px; }
  #podium { min-height: 200px; }
  .pod.p1 .block { height: 100px; } .pod.p2 .block { height: 74px; } .pod.p3 .block { height: 54px; }
}
/* short screens (720p laptops, landscape phones): squeeze the leaderboard so "Next round" stays in view */
@media (max-height: 760px) {
  #roundend { align-items: flex-start; }
  .re-inner { gap: 8px; }
  .re-title { font-size: clamp(40px, 11vh, 72px); }
  #podium { min-height: 170px; }
  .pod.p1 .block { height: 76px; } .pod.p2 .block { height: 56px; } .pod.p3 .block { height: 40px; }
  .pod .block { font-size: 34px; padding-top: 4px; }
  .pod .bean { width: 50px; height: 60px; } .pod.p1 .bean { width: 62px; height: 74px; }
  .pod .bean::before, .pod .bean::after { top: 12px; width: 14px; height: 14px; }
  .pod .bean::before { left: 6px; } .pod .bean::after { right: 6px; }
  .award { padding: 4px 12px; }
  .re-table-wrap { max-height: 26vh; order: 2; }
  #re-next { order: 1; } /* keep the countdown above the (scrollable) table */
}
@media (max-height: 560px) {
  .controls { font-size: 13px; }
  /* very short windows: shrink the podium so the score table (Parries etc.) is still on screen */
  .re-title { font-size: clamp(30px, 9vh, 44px); }
  #podium { min-height: 118px; }
  .pod .crown { width: 30px; height: 22px; }
  .pod .bean { width: 36px; height: 44px; } .pod.p1 .bean { width: 44px; height: 52px; }
  .pod .bean::before, .pod .bean::after { top: 9px; width: 10px; height: 10px; }
  .pod .bean::before { left: 4px; } .pod .bean::after { right: 4px; }
  .pod.p1 .block { height: 46px; } .pod.p2 .block { height: 34px; } .pod.p3 .block { height: 26px; }
  .pod .block { font-size: 24px; padding-top: 0; }
  .award .t { font-size: 11px; } .award .n { font-size: 15px; }
  .re-table-wrap { max-height: 40vh; }
}
