:root {
  --party-ink: #17265b;
  --party-navy: #212f77;
  --party-sky: #a7f2ee;
  --party-gold: #ffdc56;
  --party-paper: #f8f7ff;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.menu-artwork {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% -12%, #7682ff, transparent 62%), linear-gradient(145deg, #2866eb, #2745be 62%, #252c88);
}
.topbar { padding: 16px max(24px, calc((100vw - 1160px) / 2)); }
.brand { color: #fff; text-shadow: 0 2px #15328d; }
.brand > span:not(.brand-star) { color: var(--party-sky); }
.brand-star { color: #273364; background: var(--party-gold); border-color: #fff1a0; }
.brand b, .connection, .icon-button { background: #202f8a; border-color: #bccaff63; }
.icon-button:hover { background: #3149af; }
.connection { color: #ecf7ff; }

.menu-panel.party-home {
  position: fixed;
  inset: 67px 0 0;
  display: block;
  transform: none;
  width: auto;
  max-height: none;
  padding: 0 max(24px, calc((100vw - 1160px) / 2)) 20px;
  color: white;
  overflow: auto;
  scrollbar-width: thin;
}
.lobby-nav {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  width: fit-content;
  margin: 0 auto 14px;
  padding: 4px;
  gap: 4px;
  background: #1d2d77;
  border: 1px solid #b8caff8a;
  border-radius: 13px;
  box-shadow: 0 3px #141e5c;
}
.lobby-nav button {
  border: 0;
  border-radius: 9px;
  padding: 10px clamp(13px, 3vw, 42px);
  white-space: nowrap;
  color: #e7ecff;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}
.lobby-nav button:hover { background: #4257b4; }
.lobby-nav button[aria-current="page"] { background: var(--party-sky); color: #183269; }
.lobby-nav button:focus-visible, .party-home .button:focus-visible, .standings summary:focus-visible { outline: 2px solid white; outline-offset: 2px; }

.lobby-stage { display: flex; flex-direction: column; min-height: min(538px, calc(100dvh - 151px)); }
.jelly-hero { flex: 1 1 auto; position: relative; min-height: 190px; }
.jelly-display {
  position: absolute;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  border-radius: 32px 32px 0 0;
  background:
    radial-gradient(ellipse at 50% 42%, #e6ffd8, #d5ffeb 21%, #8be7ee 58%, #5e91e7 100%);
}
.jelly-display::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(ellipse at 50% 81%, #286da92b 0 2px, transparent 3px 43px);
  mask-image: linear-gradient(0deg, #000, transparent 88%);
}
.jelly-display::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42px;
  background: repeating-conic-gradient(#235bdd28 0% 25%, transparent 0% 50%) 50% 0 / 70px 70px;
  mask-image: linear-gradient(90deg, #000, transparent 38%, transparent 62%, #000);
}
.jelly-plinth {
  position: absolute;
  z-index: 1;
  width: clamp(126px, 32%, 370px);
  height: 20%;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #fff19c 0%, #ffdb62 50%, #e8a44c);
  border: 3px solid #fff2ad;
  border-radius: 50%;
  box-shadow: 0 9px #bd8157, 0 13px 25px #1a629573;
}
.jelly-display .hero-fallback, .jelly-display canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.jelly-display .hero-fallback { display: block; z-index: 2; margin: 0; object-fit: cover; object-position: center 57%; }
.jelly-display canvas { z-index: 3; opacity: 0; }
.jelly-hero.has-preview canvas { opacity: 1; }
.jelly-hero.has-preview .hero-fallback { visibility: hidden; }
.show-dock {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 29%);
  align-items: center;
  gap: 22px;
  padding: 15px 22px 20px;
  border: 2px solid #97aff9;
  border-radius: 0 0 22px 22px;
  background: #212e76;
  box-shadow: 0 6px #172459;
}
.lobby-eyebrow { margin: 0 0 3px; color: var(--party-sky); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.party-home .show-dock h1 { margin: 0; color: white; text-shadow: 0 2px #142466; font-size: clamp(27px, 4vw, 54px); line-height: 1; letter-spacing: -.055em; }
.show-course { margin: 6px 0 0; color: #d6dfff; font-size: 13px; }
.party-home .button, .lobby-panel .button, .result-panel .button, .pause-card .button { border-radius: 12px; text-transform: uppercase; letter-spacing: .05em; }
.party-home .play-button { display: flex; justify-content: space-between; align-items: center; min-height: 62px; padding: 0 18px; border: 2px solid #fff0ac; background: var(--party-gold); color: #272f61; box-shadow: 0 5px #aa7732; font-size: clamp(17px, 2.25vw, 29px); }
.play-button span { font-size: .67em; }
.profile-dock { grid-template-columns: minmax(0, 1fr) auto; }
.party-home .profile-dock h1 { margin-bottom: 9px; }
.jelly-name label, .jelly-coat > span { display: block; color: #a7f2ee; font-size: 11px; font-weight: 900; margin-bottom: 5px; }
.jelly-name input { width: min(100%, 280px); min-height: 40px; border-color: #7995d3; background: #172960; }
.jelly-coat { align-self: end; }
.jelly-coat .swatches { min-height: 40px; align-items: center; gap: 8px; }
.jelly-coat .swatch { border-color: #fffc; }
.jelly-coat .swatch.selected { outline: 2px solid #ffde6b; outline-offset: 2px; }

.course-library, .friends-content { color: var(--party-ink); }
.course-library-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 0 12px; color: white; }
.party-home .course-library-heading h1, .party-home .friends-content h1 { margin: 0; color: inherit; font-size: clamp(29px, 4.2vw, 48px); letter-spacing: -.06em; }
.course-library-heading > span { color: #e9edff; font-size: 13px; font-weight: 800; }
.course-layout { display: grid; grid-template-columns: minmax(245px, .85fr) minmax(0, 1.65fr); gap: 15px; align-items: start; }
.course-feature { border-radius: 19px; overflow: hidden; background: var(--party-paper); border: 2px solid #bbc7fc; }
.course-feature-map { background: #293957; }
.course-feature-map canvas { display: block; width: 100%; height: auto; }
.course-feature-info { padding: 15px; }
.course-feature-info h2 { margin: 0 0 8px; color: var(--party-ink); font-size: 24px; letter-spacing: -.035em; }
#courseBrief b { color: #365387; font-size: 12px; }
#courseBrief p { margin: 5px 0 12px; color: #3e4c77; font-size: 13px; line-height: 1.4; }
.course-feature-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.course-feature-actions .button { white-space: nowrap; min-height: 43px; }
.party-home .course-cards { grid-auto-flow: row; grid-template: none / repeat(3, minmax(0, 1fr)); gap: 9px; background: #1e357c; padding: 10px; margin: 0; border: 1px solid #9bb0f391; border-radius: 18px; overflow: visible; }
.party-home .course-card { min-width: 0; padding-bottom: 7px; background: #ecf1ff; border: 2px solid transparent; color: var(--party-ink); box-shadow: none; }
.party-home .course-card.selected { background: #c9faed; border-color: #45d4b9; box-shadow: 0 0 0 1px #a6ffeb; }
.party-home .course-card b { margin: 6px 7px 0; color: inherit; font-size: 12px; }
.party-home .course-card small { display: none; }
.party-home .course-art { display: block; flex: 0 0 41px; overflow: hidden; }
.party-home .course-art canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.course-preview .course-layout { grid-template-columns: minmax(0, 365px); align-content: end; min-height: calc(100dvh - 195px); }
.course-preview .course-feature-map, .course-preview .course-cards, .course-preview .course-library-heading { display: none; }
.course-preview .party-home { pointer-events: none; }
.course-preview .lobby-nav, .course-preview .course-feature { pointer-events: auto; }

.friends-screen { display: grid; grid-template-columns: minmax(210px, .82fr) minmax(0, 1fr); min-height: 365px; overflow: hidden; border-radius: 25px; border: 2px solid #bac6ff; background: var(--party-paper); box-shadow: 0 6px #1a2d84; }
.friends-art { width: 100%; height: 100%; min-height: 330px; object-fit: cover; }
.friends-content { align-self: center; padding: clamp(18px, 4vw, 44px); }
.friends-actions { display: grid; gap: 12px; margin-top: 15px; }
.friends-actions > div { padding: 13px; border-radius: 12px; background: #e6ecff; }
.friends-actions h2 { margin: 0; color: var(--party-ink); font-size: 18px; }
.friends-actions p { margin: 5px 0 9px; color: #3e4c77; font-size: 12px; }
.friends-actions .join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0; }
.friends-actions .button { min-height: 42px; }
.friends-actions .join-row .button { width: auto; padding-inline: 16px; }
.friends-actions input { width: 100%; text-transform: uppercase; }

.lobby-panel.panel, .result-panel.panel, .pause-card.panel {
  color: #f7f4ff;
  background: linear-gradient(140deg, #3948aa, #242d78);
  border: 2px solid #98acff;
  border-radius: 21px;
  box-shadow: 0 7px 0 #141d54, 0 18px 44px #0e194d7a;
}
.lobby-panel.quick-match-lobby { background: linear-gradient(140deg, #3b50ba, #222b79 76%); box-shadow: 0 7px #18225f, 0 0 0 100vmax #10194599; }
.lobby-panel .eyebrow, .result-panel .eyebrow, .pause-card .eyebrow { color: #b9f8ef; }
.lobby-panel .invite-card, .lobby-panel .roster-member, .result-panel .next-course, .result-panel .results-list li.self { background: #1f307c; border-color: #a7b8f771; }
.lobby-panel .primary, .result-panel .primary, .pause-card .primary { background: var(--party-gold); color: #222b61; box-shadow: 0 4px #bc8634; }
.result-panel.result-board { display: grid; grid-template-columns: minmax(225px, .88fr) minmax(0, 1.12fr); width: min(840px, calc(100vw - 42px)); padding: 0; max-height: calc(100dvh - 105px); text-align: left; }
.result-overview { padding: 22px; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: stretch; }
.result-overview h1 { margin: 6px 0; color: #fff; text-shadow: 0 2px #172061; }
.result-overview > p { margin: 4px 0 15px; color: #e1e7ff; font-size: 13px; }
.result-overview .next-course { text-align: left; }
.result-overview .text-button { margin-top: 10px; }
.result-ranking { padding: 22px; background: #182561a6; border-left: 1px solid #9bb1fa72; }
.result-ranking h2 { margin: 0 0 12px; color: white; font-size: 22px; }
.result-ranking .results-list { max-height: min(42vh, 315px); margin: 0; scrollbar-width: thin; scrollbar-color: #a8b5ff transparent; }
.result-ranking .results-list small { color: #d4ddff; }
.result-ranking .results-list li.qualified small { color: #abf7d8; }
.result-ranking .results-list li.eliminated small { color: #ffc6db; }
.result-board .result-crown { color: var(--party-gold); text-shadow: 0 3px #9a5d3c; }
.result-board[data-outcome="winner"] { border-color: #ffe473; }
.result-board[data-outcome="out"] .result-crown { color: #b5c4ff; text-shadow: none; }

.race-hud { top: 67px; left: 23px; right: 23px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(125px, 240px) minmax(0, 1fr); gap: 10px; }
.race-title, .hud-stats > div, .race-clock { color: #fbfaff; background: #263680eb; border: 1px solid #b9c9ff9c; box-shadow: 0 3px #1c2665; }
.race-title { justify-self: start; max-width: 100%; padding: 8px 11px; }
.race-title small, .hud-stats small { color: #bdefff; }
.race-title > span { display: block; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.race-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-track { margin-top: 5px; }
.round-track:empty { display: none; }
.race-center { display: flex; flex-direction: column; align-items: center; min-width: 0; gap: 5px; }
.race-hud .race-progress { position: static; width: 100%; transform: none; display: flex; min-width: 0; gap: 7px; padding: 3px 6px; color: #fff4b6; border-radius: 22px; background: #203275bf; text-shadow: none; }
.race-hud .race-progress > span:last-child { font-size: 14px; line-height: 1; color: #fff4b6; }
.race-hud .race-progress > div { flex: 1; height: 9px; min-width: 0; position: relative; overflow: visible; background: #b5c6ff66; }
.race-hud #progressFill { height: 100%; background: #a7f2ee; }
.race-hud #progressMarker { position: absolute; top: 50%; width: 9px; height: 9px; border: 2px solid #fff6a6; border-radius: 50%; background: var(--party-gold); transform: translate(-50%, -50%); box-shadow: 0 0 0 1px #674531; }
#checkpointMarks { position: absolute; inset: 0; }
#checkpointMarks i { position: absolute; top: 50%; width: 5px; height: 5px; transform: translate(-50%, -50%) rotate(45deg); background: #eef4ff; border-radius: 1px; }
#checkpointMarks i.passed { background: #178769; }
.hud-stats { justify-self: end; align-items: start; gap: 5px; }
.hud-stats > div:last-child, .race-banner { background: var(--party-gold); color: #222b61; border-color: #fff1ac; }
.hud-stats > div:last-child small { color: #383965; }
.standings { top: 142px; right: 23px; width: auto; min-width: 120px; max-height: none; background: #253475ee; border-color: #b0bdf3a0; z-index: 5; pointer-events: auto; }
.standings:has(details[open]) { width: min(228px, 45vw); }
.standings summary { cursor: pointer; display: list-item; margin: 0; font-weight: 900; }
.standings summary span { float: right; margin-left: 8px; color: #c5d5fc; }
.standings details[open] ol { margin-top: 7px; }
.stage-guide { left: 23px; bottom: 62px; width: auto; max-width: min(270px, 49vw); background: #273477e8; border-color: var(--party-gold); }
.stage-guide small, .stage-guide:not(.tip-open) strong, .stage-guide:not(.tip-open) p { display: none; }
.stage-guide > span { color: #e2f4ff; }
#leaveGameBtn { display: none; }
.countdown { color: #fff1a2; text-shadow: 0 7px #44318e, 0 10px 22px #201a6c88; }
.loading, .rotate-prompt { background: radial-gradient(ellipse at 50% 35%, #596cf4, #233bb4 73%); }

/* Shared carnival trim and race chrome. */
html.can-fullscreen .fullscreen-button { display: block; }
.top-right { gap: 7px; }
.icon-button[aria-pressed="true"] { background: #12204e; color: #b9c9ff; }
.topbar .icon-button { flex: 0 0 auto; }
.lobby-stage { min-height: min(570px, calc(100dvh - 148px)); }
body[data-lobby-view="play"] .lobby-stage { min-height: 0; }
body[data-lobby-view="play"] .jelly-hero { min-height: clamp(235px, 44vh, 485px); }
.lobby-shortcuts { display: grid; min-width: 0; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 12px; padding: 12px 0 1px; }
.featured-practice > strong { display: block; margin-bottom: 6px; color: #f0f6ff; font-size: 13px; }
.featured-courses { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(127px,1fr); gap: 7px; min-width: 0; overflow-x: auto; padding: 1px 2px 5px; scrollbar-width: thin; }
.featured-courses button { display: grid; grid-template-columns: 46px minmax(0,1fr); align-items: center; gap: 6px; min-height: 39px; border: 1px solid #9faffd; border-bottom: 2px solid var(--course-accent); border-radius: 9px; background: #1c307a; color: #fff; padding: 4px 5px; text-align: left; font-size: 11px; }
.featured-courses canvas { width: 46px; height: 24px; object-fit: contain; border-radius: 3px; }
.home-party { min-width: 154px; padding: 9px 11px; color: #f1f8ff; background: #1d327c; border: 1px solid #a1b4fa; border-radius: 11px; }
.home-party summary { font-weight: 800; cursor: pointer; }
.home-party[open] { min-width: 236px; }
.home-party-actions { margin-top: 8px; }
.home-party-actions .button { min-height: 37px; white-space: nowrap; }
.home-party-actions .join-row { display: grid; grid-template-columns: minmax(0,1fr) auto; margin-top: 7px; }
.home-party-actions input { width: 100%; min-height: 36px; }
.show-dock { border-radius: 0 0 22px 22px; }
.jelly-display { background: radial-gradient(ellipse at 50% 37%,#e2ffeb 0%,#aef7f4 31%,#74bdf2 57%,#5968d5 100%); }
.jelly-display::before { background: repeating-radial-gradient(ellipse at 50% 81%, #294aaa46 0 2px, transparent 3px 45px); }
.jelly-plinth { background: linear-gradient(#fff294,#ffc75f 59%,#ed9857); border-color: #fff2c4; }

.race-hud .race-progress { min-height: 24px; border: 1px solid #a6daffc0; box-shadow: inset 0 1px 0 #d7f2ff59; }
.race-hud .race-progress > span:first-child { color: #b7f4ff; font-size: 8px; }
.race-hud .race-progress > div { border: 1px solid #d7eeff; }
.race-hud #progressFill { background: linear-gradient(90deg,#ffbb4c,#ffe678); }
.race-hud #progressMarker { width: 13px; height: 13px; z-index: 2; background: var(--racer, #ffdc56); border-color: #fff4bf; }
#racerMarks { position: absolute; inset: 0; }
.progress-racer { position: absolute; top: 50%; width: 7px; height: 7px; transform: translate(-50%,-50%); background: var(--racer); border: 1px solid white; border-radius: 50%; }
.hazard-hint { margin: 0; padding: 5px 12px; border: 1px solid #ffcf63; border-radius: 8px; color: #fff8dc; background: #472565e6; font-size: 12px; text-align: center; font-weight: 900; }
.hazard-hint[data-signal="open"] { border-color: #67e7bb; }
.hud-stats > div { min-width: 65px; }
.hud-stats > div:last-child { box-shadow: 0 3px #ac7934; }
body[data-phase="racing"] .control-hint { left: 20px; transform: none; }
body[data-phase="racing"] .stage-guide { bottom: 80px; }
.result-podium { display: grid; list-style: none; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: 7px; margin: 0 0 12px; padding: 0; }
.result-podium li { min-width: 0; display: grid; gap: 2px; text-align: center; padding: 7px 4px; border: 1px solid #a7bbfb; border-top: 3px solid var(--racer); border-radius: 8px; background: #233788; }
.result-podium li:first-child { border-color: #ffdf66; padding-block: 12px; }
.result-podium li b { color: #ffe591; font-size: 20px; }
.result-podium li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.result-board[data-outcome="winner"] .result-crown { animation: crown-pop .55s ease-out both; }
.reopen-results { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 6; width: auto; padding-inline: 15px; }
#watchResultsBtn { margin-top: 7px; }
.matchmaking-slot.filled { animation: lineup-arrive .24s ease-out both; }
@keyframes lineup-arrive { from { transform: translateY(3px) scale(.96); opacity: .67; } to { transform: none; opacity: 1; } }
@keyframes crown-pop { 0% { transform: scale(.45) rotate(-12deg); opacity: .2; } 68% { transform: scale(1.18) rotate(4deg); } 100% { transform: scale(1); opacity: 1; } }
.audio-settings { display: grid; grid-template-columns: auto minmax(100px,1fr); gap: 8px 14px; align-items: center; text-align: left; margin: 10px 0 13px; color: #e5eeff; }
.audio-settings label { font-size: 13px; font-weight: 800; }
.audio-settings .volume-slider { width: 100%; min-height: 30px; margin: 0; padding: 0; accent-color: #ffd65e; }
/* The game is landscape-only on touch devices: the rotate prompt covers every screen in portrait. */
.touch-controls .joystick,.touch-controls #jumpTouch { background: radial-gradient(circle at 45% 24%,#489ae8dd,#1c3c82f2); border-color: #81dcff; color: white; }
.touch-controls #diveTouch { background: radial-gradient(circle at 48% 20%,#887aff,#5041bb); border-color: #c9b8ff; color: white; }

@media (max-width: 700px) {
  .topbar { padding: 11px 12px; }
  .top-right { gap: 4px; }
  .topbar .icon-button { width: 29px; height: 29px; font-size: 13px; }
  .topbar .connection { font-size: 7px; padding-inline: 5px; }
  .menu-panel.party-home { inset: 58px 0 0; padding: 0 12px 14px; }
  .lobby-nav { margin-bottom: 10px; }
  .lobby-nav button { padding: 9px clamp(9px, 3.4vw, 22px); }
  .lobby-stage { min-height: min(560px, calc(100dvh - 133px)); }
  .jelly-display { border-radius: 20px 20px 0 0; }
  .jelly-plinth { width: min(75%, 275px); }
  .show-dock { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 13px; }
  .lobby-shortcuts { grid-template-columns: minmax(0,1fr); }
  .lobby-shortcuts .home-party { width: 100%; }
  .featured-courses { grid-auto-columns: 126px; }
  .party-home .play-button { min-height: 47px; }
  .profile-dock { grid-template-columns: minmax(0, 1fr) auto; }
  .jelly-coat .swatches { gap: 5px; }
  .jelly-coat .swatch { width: 19px; height: 19px; }
  .course-layout { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .party-home .course-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-feature-map { max-height: 135px; overflow: hidden; }
  .course-feature-info { padding: 11px; }
  .course-feature-info h2 { font-size: 22px; }
  .friends-screen { grid-template-columns: 1fr; min-height: 0; }
  .friends-art { min-height: 0; height: 155px; object-position: center 58%; }
  .friends-content { padding: 15px; }
  .result-panel.result-board { grid-template-columns: 1fr; width: calc(100vw - 28px); max-height: calc(100dvh - 82px); }
  .result-overview, .result-ranking { padding: 13px; }
  .result-ranking { border-left: 0; border-top: 1px solid #9bb1fa72; }
  .result-ranking .results-list { max-height: min(34vh, 205px); }
  .race-hud { top: 59px; left: 9px; right: 9px; grid-template-columns: minmax(0, 1fr) minmax(59px, .73fr) auto; gap: 4px; }
  .race-title { padding: 5px 6px; }
  .race-title strong { font-size: 12px; }
  .hud-stats { gap: 3px; }
  .hud-stats > div, .hud-stats > div:last-child { display: block; padding: 5px; min-width: 35px; }
  .hud-stats small { font-size: 6px; }
  .hud-stats strong { font-size: 14px; }
  .hud-stats em { font-size: 8px; }
  .standings { top: 109px; right: 9px; min-width: 93px; padding: 7px; }
  .stage-guide { left: 9px; top: auto; bottom: 166px; padding: 5px 8px; }
  body[data-phase="racing"] .stage-guide { bottom: 165px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .topbar { padding: 7px 15px; }
  .menu-panel.party-home { inset: 45px 0 0; padding-inline: 15px; }
  .lobby-nav { margin-bottom: 8px; }
  .lobby-nav button { padding-block: 6px; }
  .lobby-stage { min-height: calc(100dvh - 100px); }
  body[data-lobby-view="play"] .jelly-hero { min-height: clamp(112px, 44vh, 227px); }
  .lobby-shortcuts { padding-top: 9px; }
  .jelly-hero { min-height: 138px; }
  .jelly-plinth { width: min(40%, 215px); }
  .show-dock { grid-template-columns: minmax(0, 1fr) minmax(156px, 27%); padding: 9px 12px 11px; }
  .party-home .show-dock h1 { font-size: clamp(24px, 4vw, 37px); }
  .party-home .play-button { min-height: 43px; }
  .course-feature-map { max-height: 105px; overflow: hidden; }
  .race-hud { top: 49px; }
  .stage-guide { top: 101px; bottom: auto; max-width: min(200px, 30vw); padding: 6px 9px; }
  body[data-phase="racing"] .stage-guide { bottom: auto; }
  .standings:not(.hidden) { display: block; top: 101px; }
  .result-panel.result-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-height: calc(100dvh - 72px); }
  .result-overview, .result-ranking { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .loading-bean, .countdown, .race-banner, .result-crown, .matchmaking-slot { animation: none !important; } }

/* ---------- Landing page: live 3D pack behind a candy logo ---------- */
.landing{position:fixed;inset:0;z-index:15;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:clamp(56px,9vh,96px) 16px clamp(22px,5vh,52px);pointer-events:none;
  background:radial-gradient(ellipse 70% 42% at 50% 22%,#ffffff40,#ffffff00 70%),linear-gradient(#2a1b6b00 60%,#3a1f7a40)}
.landing.hidden{display:none}
.landing>*{pointer-events:auto}
body.landing-active .topbar .brand,body.landing-active #controlHint{visibility:hidden}
.landing-logo{display:flex;flex-direction:column;align-items:center;filter:drop-shadow(0 10px 18px #3b1d7a66);animation:landing-drop .8s cubic-bezier(.2,1.5,.4,1) both}
.landing-crown{width:clamp(56px,7vw,92px);margin-bottom:-14px;z-index:1;transform:rotate(-4deg);animation:landing-bob 2.6s ease-in-out infinite}
.landing-title{margin:0;display:flex;filter:drop-shadow(0 .07em 0 #3b1a72) drop-shadow(0 .1em .08em #2a114f66);align-items:center;gap:.06em;font:900 clamp(46px,8.4vw,118px)/.95 'Arial Black','Trebuchet MS',Arial,sans-serif;letter-spacing:-.01em;transform:rotate(-3deg)}
.landing-title>span{-webkit-text-stroke:.07em #3b1a72;paint-order:stroke fill}
.word-jelly{background:linear-gradient(#fff6a8 8%,#ffd43b 45%,#ff9f1a 92%);-webkit-background-clip:text;background-clip:text;color:transparent}
.word-rush{background:linear-gradient(#ffd0ef 8%,#ff6fc0 45%,#e2389a 92%);-webkit-background-clip:text;background-clip:text;color:transparent;margin-left:.05em}
.landing-title>.landing-badge{display:grid;place-items:center;width:.95em;height:.95em;margin-right:.12em;border-radius:.24em;background:linear-gradient(#ffe36b,#ffaa22);color:#3b1a72;font-size:.62em;-webkit-text-stroke:0;text-shadow:none;border:.07em solid #3b1a72;box-shadow:0 .08em 0 #3b1a72;transform:rotate(-8deg)}
.landing-title>.landing-3d{display:grid;place-items:center;width:1.25em;height:1.25em;margin-left:.15em;border-radius:50%;background:radial-gradient(circle at 35% 30%,#8fd8ff,#2a7cf0 70%);color:#fff;font-size:.42em;-webkit-text-stroke:0;text-shadow:0 .06em 0 #173b8f;border:.09em solid #3b1a72;box-shadow:0 .1em 0 #3b1a72;transform:rotate(8deg) translateY(-.6em)}
.landing-ribbon{position:relative;margin:clamp(6px,1.2vh,14px) 0 0;padding:0 34px;transform:rotate(-2deg)}
.landing-ribbon span{display:block;padding:9px clamp(18px,3vw,34px);background:linear-gradient(#a26bff,#6c3fd8);color:#fff;font:900 clamp(11px,1.45vw,19px)/1 'Arial Black','Trebuchet MS',sans-serif;letter-spacing:.14em;border:3px solid #3b1a72;border-radius:8px;box-shadow:0 4px 0 #3b1a72}
.landing-ribbon::before,.landing-ribbon::after{content:'';position:absolute;top:9px;width:38px;height:100%;background:#5a2fbf;border:3px solid #3b1a72;z-index:-1}
.landing-ribbon::before{left:0;clip-path:polygon(0 0,100% 0,100% 100%,0 100%,28% 50%)}
.landing-ribbon::after{right:0;clip-path:polygon(0 0,100% 0,72% 50%,100% 100%,0 100%)}
.landing-actions{display:flex;flex-direction:column;align-items:center;gap:14px}
.landing-play{display:flex;align-items:center;gap:16px;padding:clamp(14px,2.2vh,20px) clamp(40px,5vw,64px);border:4px solid #3b1a72;border-radius:999px;cursor:pointer;
  background:linear-gradient(#fff07a,#ffd02c 50%,#ffae12);color:#3b1a72;font:900 clamp(22px,2.6vw,34px)/1 'Arial Black','Trebuchet MS',sans-serif;letter-spacing:.03em;
  box-shadow:0 7px 0 #3b1a72,0 14px 26px #3b1a7255,inset 0 3px 0 #fffbe0;animation:landing-pulse 1.8s ease-in-out infinite}
.landing-play span{display:grid;place-items:center;width:1.3em;height:1.3em;border-radius:50%;background:#3b1a72;color:#ffd84a;font-size:.6em}
.landing-play:hover{filter:brightness(1.06);transform:translateY(-2px)}
.landing-play:active{transform:translateY(4px);box-shadow:0 3px 0 #3b1a72}
.landing-play:focus-visible,.landing-links button:focus-visible{outline:4px solid #fff;outline-offset:4px}
.landing-links{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.landing-links button{padding:9px 18px;border:2px solid #ffffffb0;border-radius:999px;background:#2b1b6bb8;color:#fff;font:800 13px/1 'Trebuchet MS',sans-serif;letter-spacing:.04em;cursor:pointer;backdrop-filter:blur(6px)}
.landing-links button:hover{background:#3d2690e0}
@keyframes landing-drop{from{opacity:0;transform:translateY(-40px) scale(.8)}}
@keyframes landing-bob{50%{transform:rotate(4deg) translateY(-6px)}}
@keyframes landing-pulse{50%{transform:scale(1.04)}}
@media(max-height:480px){.landing{padding-top:44px;padding-bottom:12px}.landing-title{font-size:clamp(36px,7vw,72px)}.landing-actions{gap:8px}.landing-play{padding:10px 36px;font-size:22px;box-shadow:0 5px 0 #3b1a72}.landing-links button{padding:6px 12px;font-size:11px}}
@media(prefers-reduced-motion:reduce){.landing-confetti,.landing-crown,.landing-play,.landing-logo{animation:none}}
