:root {
  color-scheme: light;
  font-family: "Noto Sans TC", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --hoops-brand: #657954;
  --hoops-brand-dark: #425333;
  --hoops-brand-soft: #e8ede4;
  --hoops-page: #f7f8f3;
  --hoops-panel: #ffffff;
  --hoops-ink: #1e293b;
  --hoops-muted: #526173;
  --hoops-line: #cbd5c4;
  --hoops-cyan: #087d91;
  --hoops-cyan-bright: #23d7e8;
  --hoops-yellow: #f6c944;
  --hoops-coral: #d84f68;
  --hoops-success: #167a51;
  --hoops-warning: #a35212;
  --hoops-danger: #b4232f;
  --hoops-focus: #0f5fd7;
  --hoops-shadow: 0 24px 72px rgba(49, 65, 42, 0.15);
  --hoops-shadow-compact: 0 10px 30px rgba(49, 65, 42, 0.11);
  --hoops-material: rgba(255, 255, 255, 0.88);
  --hoops-material-strong: rgba(255, 255, 255, 0.96);
  --sim-brand-primary: var(--hoops-brand);
  --sim-brand-hover: var(--hoops-brand-dark);
  --sim-text-main: var(--hoops-ink);
  --sim-text-muted: var(--hoops-muted);
  --sim-border: rgba(66, 83, 51, 0.16);
  --sim-border-light: var(--hoops-line);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--hoops-page);
  color: var(--hoops-ink);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
a {
  font: inherit;
}

button {
  color: inherit;
  touch-action: manipulation;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 95, 215, 0.62);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.arena-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Entry */

#projectileHoopsEntry {
  min-height: 100vh;
  background:
    radial-gradient(circle at 83% 15%, rgba(35, 215, 232, 0.15), transparent 30%),
    radial-gradient(circle at 10% 85%, rgba(101, 121, 84, 0.15), transparent 34%),
    #f7f8f3;
}

#entryRedirect {
  display: grid;
  place-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  text-align: center;
}

#entryRedirect p {
  margin: 0 0 0.8rem;
  color: var(--hoops-brand-dark);
  font-weight: 800;
}

#entryRedirect a {
  color: var(--hoops-focus);
  font-weight: 750;
}

#entryShell {
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2.5rem);
}

#entryHero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(460px, 1.08fr);
  min-height: calc(100vh - clamp(2rem, 6vw, 5rem));
  overflow: hidden;
  border: 1px solid rgba(66, 83, 51, 0.18);
  border-radius: clamp(24px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--hoops-shadow);
}

#entryCopy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 6rem);
}

#entryBrand {
  width: min(236px, 65vw);
  margin-bottom: clamp(3rem, 8vh, 7rem);
}

#entryBrand img {
  display: block;
  width: 100%;
  height: auto;
}

#entryKicker,
.client-kicker {
  margin: 0 0 0.75rem;
  color: var(--hoops-brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

#entryCopy h1 {
  max-width: 9ch;
  margin: 0;
  color: var(--hoops-brand-dark);
  font-size: clamp(3.5rem, 7.8vw, 7.8rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
}

#entryLead {
  max-width: 35rem;
  margin: 1.7rem 0 0;
  color: var(--hoops-muted);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 550;
  line-height: 1.85;
}

#entryActions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

#entryActions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0.85rem 1.35rem;
  border: 1px solid var(--hoops-brand);
  border-radius: 16px;
  background: var(--hoops-brand);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

#entryActions a:last-child {
  background: #ffffff;
  color: var(--hoops-brand-dark);
}

#entryActions a:hover {
  box-shadow: 0 12px 30px rgba(66, 83, 51, 0.18);
  transform: translateY(-2px);
}

#entryFeatures {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  margin: clamp(2.5rem, 7vh, 5rem) 0 0;
  padding: 0;
  list-style: none;
}

#entryFeatures li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

#entryFeatures strong {
  color: var(--hoops-brand-dark);
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
  font-variant-numeric: tabular-nums;
}

#entryFeatures span {
  color: var(--hoops-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

#entryVisual {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(238, 242, 234, 0.38), rgba(225, 234, 218, 0.9)),
    url("assets/campus-court-background.webp") center / cover;
}

#entryVisual::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(66, 83, 51, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 83, 51, 0.06) 1px, transparent 1px);
  background-size: 58px 58px;
  content: "";
}

#entryGrid {
  position: absolute;
  z-index: 1;
  right: 10%;
  bottom: 8%;
  width: 72%;
  height: 30%;
  border: 2px solid rgba(66, 83, 51, 0.25);
  border-width: 0 0 2px 2px;
}

#entryTrajectory {
  position: absolute;
  z-index: 2;
  left: 13%;
  top: 31%;
  width: 68%;
  height: 44%;
  border: 5px solid var(--hoops-cyan);
  border-color: var(--hoops-cyan) transparent transparent;
  border-radius: 50% 50% 0 0;
  transform: rotate(-10deg);
}

#entryBallArt {
  position: absolute;
  z-index: 4;
  left: 47%;
  top: 23%;
  width: clamp(64px, 7vw, 112px);
  height: auto;
  filter: drop-shadow(0 18px 18px rgba(124, 45, 18, 0.2));
  animation: hoops-spin 7s linear infinite;
}

#entryBall {
  display: none;
}

#entryBall::before,
#entryBall::after {
  position: absolute;
  content: "";
}

#entryBall::before {
  inset: 46% -4px auto;
  border-top: 4px solid #7c2d12;
  transform: rotate(18deg);
}

#entryBall::after {
  inset: -3px 45%;
  border-left: 4px solid #7c2d12;
  border-radius: 50%;
  transform: rotate(-25deg);
}

#entryHoop {
  position: absolute;
  z-index: 3;
  right: 9%;
  top: 34%;
  width: 16%;
  height: 22%;
  border-right: 10px solid var(--hoops-brand-dark);
}

#entryHoop::before {
  position: absolute;
  right: -10px;
  top: -12%;
  width: 83%;
  height: 80%;
  border: 8px solid rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 3px var(--hoops-brand-dark);
  content: "";
}

#entryHoop::after {
  position: absolute;
  right: 31%;
  bottom: 8%;
  width: 68%;
  height: 12px;
  border-radius: 999px;
  background: #dc572f;
  content: "";
}

/* Shared connection banner */

#hostConnection,
#clientConnection {
  position: fixed;
  z-index: 1200;
  top: calc(0.7rem + var(--safe-top));
  left: 50%;
  padding: 0.62rem 0.95rem;
  border: 1px solid rgba(163, 82, 18, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 34px rgba(30, 41, 59, 0.18);
  color: #8a3b0e;
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -14px);
  transition: opacity 180ms ease, transform 240ms ease;
}

#hostConnection.is-visible,
#clientConnection.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

#hostConnection.is-error,
#clientConnection.is-error {
  border-color: rgba(180, 35, 47, 0.48);
  color: var(--hoops-danger);
}

/* Host */

#projectileHoopsHost {
  height: 100vh;
  min-height: 650px;
  overflow: hidden;
}

#hostHeader {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  height: 82px;
  padding: 0 1.15rem;
  border-bottom: 1px solid rgba(66, 83, 51, 0.18);
  background: var(--hoops-material);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 28px rgba(49, 65, 42, 0.06);
  backdrop-filter: blur(20px) saturate(165%);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
}

#hostBrand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: max-content;
  color: inherit;
  text-decoration: none;
}

#hostBrand > span:last-child {
  display: flex;
  flex-direction: column;
}

#hostBrand strong {
  color: var(--hoops-brand-dark);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
}

#hostBrand small {
  margin-top: 0.12rem;
  color: var(--hoops-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

#hostSiteLogo {
  display: block;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.client-brand > span {
  position: relative;
  display: grid;
  place-items: center;
  width: 43px;
  aspect-ratio: 1;
  border: 2px solid var(--hoops-brand-dark);
  border-radius: 50%;
  background: var(--hoops-yellow);
}

.client-brand > span::before {
  width: 26px;
  height: 16px;
  border: 3px solid var(--hoops-cyan);
  border-color: var(--hoops-cyan) transparent transparent;
  border-radius: 50%;
  content: "";
  transform: rotate(-18deg);
}

.client-brand i {
  position: absolute;
  right: 7px;
  bottom: 8px;
  width: 9px;
  aspect-ratio: 1;
  border: 2px solid #7c2d12;
  border-radius: 50%;
  background: #e77928;
}

#hostRoomSummary {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--hoops-line);
  border-radius: 15px;
  background: rgba(244, 247, 241, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

#hostRoomSummary span,
#hostMetrics span {
  color: var(--hoops-muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 750;
}

#hostRoomCode {
  color: var(--hoops-brand-dark);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.15em;
}

#hostPhase {
  padding-left: 0.65rem;
  border-left: 1px solid var(--hoops-line);
  color: var(--hoops-ink);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
}

#hostMetrics {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

#hostMetrics div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 0.32rem;
  min-width: 76px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--hoops-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

#hostMetrics strong {
  color: var(--hoops-brand-dark);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

#hostApp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  height: calc(100vh - 82px);
}

#hostStage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(248, 250, 246, 0.5), rgba(229, 236, 223, 0.76)),
    url("assets/campus-court-background.webp") center / cover,
    #edf1e9;
}

#hostCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

#hostWatermark {
  position: absolute;
  z-index: 20;
  left: 1rem;
  bottom: 0.75rem;
  padding: 0.42rem 0.65rem;
  border: 1px solid rgba(66, 83, 51, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--hoops-brand-dark);
  box-shadow: 0 4px 14px rgba(49, 65, 42, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  pointer-events: none;
}

#hostLobby {
  position: absolute;
  z-index: 15;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2rem, 6vw, 5.5rem);
  background:
    linear-gradient(100deg, rgba(247, 248, 243, 0.97) 0%, rgba(247, 248, 243, 0.92) 48%, rgba(232, 237, 228, 0.82) 100%);
  transition: opacity 280ms ease, visibility 280ms ease;
}

#hostLobby.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

#hostLobbyIntro {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

#hostLobbyIntro img {
  width: 42px;
  height: 42px;
}

#hostLobbyIntro p {
  margin: 0;
  color: var(--hoops-brand);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.15em;
}

#hostLobbyCopy h1 {
  margin: 0.65rem 0 0;
  color: var(--hoops-brand-dark);
  font-size: clamp(3rem, 4.7vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

#hostLobbyCopy h2 {
  margin: 0.55rem 0 0;
  color: var(--hoops-brand);
  font-size: clamp(1.25rem, 2vw, 2rem);
  line-height: 1.2;
}

#hostLobbyLead {
  max-width: 41rem;
  margin: 0.8rem 0 0;
  color: var(--hoops-muted);
  font-size: clamp(0.92rem, 1.35vw, 1.12rem);
  line-height: 1.65;
}

#hostLobbyFeatures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

#hostLobbyFeatures li {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.52rem 0.7rem;
  border: 1px solid var(--hoops-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

#hostLobbyFeatures strong {
  color: var(--hoops-brand-dark);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

#hostLobbyFeatures span {
  color: var(--hoops-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

#hostLobbyProgress {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: max-content;
  max-width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--hoops-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.86);
}

#hostLobbyProgress > span {
  width: 11px;
  aspect-ratio: 1;
  border: 3px solid rgba(101, 121, 84, 0.25);
  border-top-color: var(--hoops-brand);
  border-radius: 50%;
  animation: hoops-spin 1s linear infinite;
}

#hostLobbyProgress strong,
#hostLobbyProgress small {
  display: block;
}

#hostLobbyProgress small {
  color: var(--hoops-muted);
}

#hostLobbyJoin {
  justify-self: end;
  width: min(100%, 390px);
  padding: clamp(1.25rem, 2.5vw, 2.2rem);
  border: 1px solid rgba(66, 83, 51, 0.22);
  border-radius: 30px;
  background: var(--hoops-material-strong);
  box-shadow: var(--hoops-shadow);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  text-align: center;
}

#hostQrFrame {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border: 2px solid var(--hoops-brand-dark);
  border-radius: 22px;
  background: #ffffff;
}

#hostQrImage {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#hostQrImage.has-image {
  display: block;
}

#hostQrFallback {
  color: var(--hoops-brand);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

#hostLobbyJoin > span {
  color: var(--hoops-muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

#hostLobbyJoin > strong {
  display: block;
  margin: 0.3rem 0;
  color: var(--hoops-brand-dark);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.17em;
}

#hostLobbyJoin > small {
  color: var(--hoops-muted);
}

#hostCountdown,
#clientCountdown {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-content: center;
  visibility: hidden;
  background: rgba(247, 248, 243, 0.93);
  opacity: 0;
  text-align: center;
  transition: opacity 180ms ease, visibility 180ms ease;
}

#hostCountdown.is-visible,
#clientCountdown.is-visible {
  visibility: visible;
  opacity: 1;
}

#hostCountdown span,
#clientCountdown span {
  color: var(--hoops-brand);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 850;
  letter-spacing: 0.15em;
}

#hostCountdown strong,
#clientCountdown strong {
  color: var(--hoops-brand-dark);
  font-size: clamp(8rem, 22vw, 18rem);
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
}

#roundIntro {
  position: absolute;
  z-index: 12;
  top: 2rem;
  left: 50%;
  display: grid;
  justify-items: center;
  min-width: min(520px, 80%);
  padding: 1rem 1.4rem;
  border: 1px solid rgba(66, 83, 51, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 48px rgba(49, 65, 42, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px);
  transition: opacity 180ms ease, transform 260ms ease;
}

#roundIntro.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

#roundIntro span {
  color: var(--hoops-cyan);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

#roundIntro strong {
  margin: 0.28rem 0;
  color: var(--hoops-brand-dark);
  font-size: 1.4rem;
}

#roundIntro small {
  color: var(--hoops-muted);
}

#roundHud {
  position: absolute;
  z-index: 10;
  top: 1rem;
  left: 1rem;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0.45rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

#roundHud.is-visible {
  opacity: 1;
}

#roundHud div {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  gap: 0.3rem;
  min-width: 110px;
  padding: 0.58rem 0.72rem;
  border: 1px solid rgba(66, 83, 51, 0.2);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
}

#roundHud span,
#roundHud small {
  color: var(--hoops-muted);
  font-size: 0.7rem;
  font-weight: 750;
}

#roundHud strong {
  color: var(--hoops-brand-dark);
  font-size: 1.16rem;
  font-variant-numeric: tabular-nums;
}

#finalOverlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  visibility: hidden;
  overflow: auto;
  padding: clamp(1.4rem, 4vh, 3.2rem);
  background:
    radial-gradient(circle at 50% 16%, rgba(246, 201, 68, 0.32), transparent 31%),
    rgba(247, 248, 243, 0.97);
  opacity: 0;
  transition: opacity 350ms ease, visibility 350ms ease;
}

#finalOverlay.is-visible {
  visibility: visible;
  opacity: 1;
}

#finalTrophy {
  display: block;
  width: clamp(64px, 8vw, 110px);
  height: auto;
  margin: 0 auto -0.25rem;
  filter: drop-shadow(0 12px 14px rgba(35, 50, 38, 0.14));
}

#finalOverlay > p {
  margin: 0;
  color: var(--hoops-brand);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

#finalOverlay h2 {
  margin: 0.25rem 0 1rem;
  color: var(--hoops-brand-dark);
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.04em;
}

#podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.65rem;
  width: min(760px, 100%);
  min-height: 230px;
}

#podium article {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  padding: 1rem 0.7rem;
  border: 1px solid rgba(66, 83, 51, 0.2);
  border-radius: 22px 22px 10px 10px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(49, 65, 42, 0.13);
}

#podium article > img {
  width: clamp(48px, 5vw, 76px);
  height: clamp(58px, 6vw, 92px);
  margin: -2rem auto -0.8rem;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(35, 50, 38, 0.12));
}

#podium article span {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  margin-bottom: 0.65rem;
  border-radius: 50%;
  background: var(--hoops-brand-soft);
  color: var(--hoops-brand-dark);
  font-size: 1.5rem;
  font-weight: 900;
}

#podium article strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#podium article small {
  margin-top: 0.2rem;
  color: var(--hoops-muted);
}

#podiumFirst {
  min-height: 220px;
  border-color: rgba(184, 134, 11, 0.38) !important;
  background: linear-gradient(180deg, #fff9dd, #ffffff) !important;
}

#podiumSecond {
  min-height: 170px;
}

#podiumThird {
  min-height: 145px;
}

#podiumFirst span {
  background: #f6c944 !important;
  color: #5a3b00 !important;
}

#finalStandings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.65rem;
  width: min(760px, 100%);
  max-height: 180px;
  margin: 1rem 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

#finalStandings li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--hoops-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.86);
}

#finalStandings li span {
  color: var(--hoops-muted);
  font-weight: 800;
}

#finalStandings li strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#finalStandings li em {
  color: var(--hoops-brand-dark);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

#rematchButton {
  min-height: 48px;
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 14px;
  background: var(--hoops-brand);
  color: #ffffff;
  font-weight: 850;
  cursor: pointer;
}

#celebrationLayer {
  position: absolute;
  z-index: 31;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

#celebrationLayer {
  width: 100%;
  height: 100%;
}

#hostPanel {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) minmax(150px, 0.8fr) auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-left: 1px solid var(--hoops-line);
  background: var(--hoops-material-strong);
  box-shadow: -12px 0 36px rgba(49, 65, 42, 0.06);
}

#hostJoinCard,
#hostRoster,
#hostLeaderboard,
#hostActions {
  min-width: 0;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--hoops-line);
}

#hostJoinCard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem 0.7rem;
  align-items: center;
}

#hostJoinCard p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--hoops-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

#hostJoinUrl {
  min-width: 0;
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hostJoinCard #copyJoinButton {
  white-space: nowrap;
}

#copyJoinButton,
#soundButton {
  min-height: 38px;
  padding: 0.45rem 0.62rem;
  border: 1px solid var(--hoops-line);
  border-radius: 10px;
  background: #f7f8f3;
  color: var(--hoops-brand-dark);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

#copyJoinButton {
  justify-self: start;
}

#hostRoster,
#hostLeaderboard {
  min-height: 0;
  overflow: hidden;
}

#hostRoster header,
#hostLeaderboard header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

#hostRoster header > div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

#hostRoster header span,
#hostLeaderboard header span {
  color: var(--hoops-brand-dark);
  font-size: 0.82rem;
  font-weight: 850;
}

#hostRoster header strong,
#hostLeaderboard header small {
  color: var(--hoops-muted);
  font-size: 0.72rem;
}

#rosterList,
#leaderboardList {
  display: grid;
  gap: 0.38rem;
  max-height: calc(100% - 34px);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.roster-player,
.leaderboard-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(203, 213, 196, 0.8);
  border-radius: 10px;
  background: #fbfcfa;
}

.player-dot {
  display: grid;
  place-items: center;
  width: 24px;
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #ffffff;
  color: var(--player-color, var(--hoops-brand));
  font-size: 0.58rem;
  font-weight: 900;
}

.player-color-0 { --player-color: #1d4ed8; }
.player-color-1 { --player-color: #0f766e; }
.player-color-2 { --player-color: #4d7c0f; }
.player-color-3 { --player-color: #a16207; }
.player-color-4 { --player-color: #c2410c; }
.player-color-5 { --player-color: #be123c; }
.player-color-6 { --player-color: #6d28d9; }
.player-color-7 { --player-color: #334155; }

.roster-player strong,
.leaderboard-player strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-player em,
.leaderboard-player em {
  color: var(--hoops-muted);
  font-size: 0.68rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.roster-player.is-ready em {
  color: var(--hoops-success);
}

.roster-player.is-disconnected {
  opacity: 0.58;
}

#hostActions {
  display: grid;
  gap: 0.48rem;
  border-bottom: 0;
}

#hostActionHint {
  margin: 0 0 0.2rem;
  color: var(--hoops-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

#hostActions button {
  min-height: 44px;
  border: 1px solid var(--hoops-line);
  border-radius: 11px;
  background: #f7f8f3;
  color: var(--hoops-brand-dark);
  font-size: 0.78rem;
  font-weight: 820;
  cursor: pointer;
}

#startButton {
  border-color: var(--hoops-brand) !important;
  background: var(--hoops-brand) !important;
  color: #ffffff !important;
}

#abortButton,
#closeRoomButton {
  color: var(--hoops-danger) !important;
}

#closeDialog {
  width: min(460px, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--hoops-line);
  border-radius: 22px;
  box-shadow: var(--hoops-shadow);
}

#closeDialog::backdrop {
  background: rgba(30, 41, 59, 0.42);
}

#closeDialog form {
  padding: 1.5rem;
}

#closeDialog form > span {
  color: var(--hoops-danger);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

#closeDialog h2 {
  margin: 0.35rem 0 0.6rem;
}

#closeDialog p {
  color: var(--hoops-muted);
  line-height: 1.6;
}

#closeDialog form div {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

#closeDialog button {
  min-height: 42px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--hoops-line);
  border-radius: 11px;
  background: #f7f8f3;
  font-weight: 750;
}

#confirmCloseButton {
  border-color: var(--hoops-danger) !important;
  background: var(--hoops-danger) !important;
  color: #ffffff;
}

/* Client */

#projectileHoopsClient {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 85% 8%, rgba(35, 215, 232, 0.12), transparent 28%),
    radial-gradient(circle at 5% 96%, rgba(101, 121, 84, 0.14), transparent 34%),
    var(--hoops-page);
}

#clientApp {
  min-height: 100dvh;
}

.client-screen {
  display: none;
  min-height: 100dvh;
  padding: max(1.2rem, var(--safe-top)) max(1rem, var(--safe-right)) max(1.4rem, var(--safe-bottom)) max(1rem, var(--safe-left));
}

.client-screen.is-active {
  display: grid;
  place-items: center;
}

.client-card {
  width: min(100%, 430px);
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid rgba(66, 83, 51, 0.2);
  border-radius: 28px;
  background: var(--hoops-material);
  box-shadow: var(--hoops-shadow);
  backdrop-filter: blur(24px) saturate(155%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
}

.client-card-wide {
  width: min(100%, 520px);
}

.client-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.55rem;
  color: var(--hoops-brand-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.client-brand > img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.client-card h1 {
  margin: 0;
  color: var(--hoops-brand-dark);
  font-size: clamp(1.8rem, 8vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.client-intro {
  margin: 0.85rem 0 1.45rem;
  color: var(--hoops-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.client-field {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.client-field span {
  color: var(--hoops-muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.client-field input {
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--hoops-line);
  border-radius: 13px;
  background: #ffffff;
  color: var(--hoops-ink);
  font-size: 1rem;
}

.client-field input:focus {
  border-color: var(--hoops-focus);
}

#roomInput {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.client-error {
  min-height: 1.25rem;
  margin: 0.55rem 0;
  color: var(--hoops-danger);
  font-size: 0.78rem;
  font-weight: 700;
}

.client-primary,
.client-secondary {
  width: 100%;
  min-height: 54px;
  margin-top: 0.65rem;
  border: 1px solid var(--hoops-brand);
  border-radius: 14px;
  background: var(--hoops-brand);
  color: #ffffff;
  font-weight: 850;
  cursor: pointer;
}

.client-secondary {
  background: #ffffff;
  color: var(--hoops-brand-dark);
}

.client-footnote {
  margin: 1rem 0 0;
  color: var(--hoops-muted);
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
}

#clientIdentity {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#identityBadge,
#clientPlayerDot {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 66px;
  aspect-ratio: 1;
  border: 4px solid var(--player-color, var(--hoops-brand));
  border-radius: 50%;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.95) 0 7px, rgba(255, 255, 255, 0.35) 7px 13px),
    var(--player-color, var(--hoops-brand));
  box-shadow: 0 10px 24px rgba(49, 65, 42, 0.14);
}

#playerName {
  display: block;
  margin-top: 0.35rem;
  color: var(--hoops-ink);
  font-size: 1.05rem;
}

#lobbyStats,
#waitingStats,
#physicsFeedback {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1.4rem 0;
}

#lobbyStats div,
#waitingStats div,
#physicsFeedback div {
  min-width: 0;
  padding: 0.75rem 0.55rem;
  border: 1px solid var(--hoops-line);
  border-radius: 13px;
  background: #f8faf6;
  text-align: center;
}

#lobbyStats span,
#waitingStats span,
#physicsFeedback span {
  display: block;
  color: var(--hoops-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

#lobbyStats strong,
#waitingStats strong,
#physicsFeedback strong {
  display: block;
  margin-top: 0.15rem;
  overflow: hidden;
  color: var(--hoops-brand-dark);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#physicsFeedback small {
  color: var(--hoops-muted);
  font-size: 0.65rem;
}

#readyState {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 1px solid var(--hoops-line);
  border-radius: 14px;
  background: #f7f8f3;
}

#readyState > span {
  width: 13px;
  aspect-ratio: 1;
  border: 3px solid var(--hoops-muted);
  border-radius: 50%;
}

#readyState.is-ready {
  border-color: rgba(22, 122, 81, 0.4);
  background: #eff9f4;
}

#readyState.is-ready > span {
  border-color: var(--hoops-success);
  background: var(--hoops-success);
  box-shadow: inset 0 0 0 3px #eff9f4;
}

#readyState p {
  margin: 0;
}

#readyState strong,
#readyState small {
  display: block;
}

#readyState small {
  margin-top: 0.2rem;
  color: var(--hoops-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

#aimScreen {
  padding: 0;
  background: #edf1e9;
}

#aimScreen.is-active {
  display: flex;
  flex-direction: column;
}

#clientGameHeader {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 64px;
  padding: calc(0.55rem + var(--safe-top)) max(1rem, var(--safe-right)) 0.55rem max(1rem, var(--safe-left));
  border-bottom: 1px solid var(--hoops-line);
  background: var(--hoops-material);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72), 0 7px 24px rgba(49, 65, 42, 0.06);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

#clientGameHeader > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

#clientPlayerDot {
  width: 34px;
  border-width: 3px;
}

#clientGameHeader p {
  min-width: 0;
  margin: 0;
}

#clientGameHeader small,
#clientGameHeader strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#clientGameHeader small {
  color: var(--hoops-muted);
  font-size: 0.68rem;
}

#clientGameHeader strong {
  max-width: 47vw;
  color: var(--hoops-brand-dark);
  font-size: 0.9rem;
}

#clientGameHeader #clientGameBrand {
  margin-top: 0.12rem;
  color: var(--hoops-brand);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  opacity: 0.78;
}

#clientRound {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--hoops-line);
  border-radius: 10px;
  background: #f7f8f3;
}

#clientRound span {
  color: var(--hoops-muted);
  font-size: 0.66rem;
}

#clientRound strong {
  color: var(--hoops-brand-dark);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

#clientGameShell {
  flex: 1;
  min-height: 0;
  background: #edf1e9;
}

#clientPreview {
  background:
    linear-gradient(rgba(246, 248, 243, 0.52), rgba(229, 236, 223, 0.62)),
    url("assets/campus-court-background.webp") center / cover,
    #edf1e9;
}

#simCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

#previewHud {
  position: absolute;
  z-index: 5;
  top: 0.7rem;
  left: 0.7rem;
  display: flex;
  gap: 0.35rem;
}

#previewHud div {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  gap: 0.22rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(66, 83, 51, 0.22);
  border-radius: 10px;
  background: var(--hoops-material);
  box-shadow: var(--hoops-shadow-compact);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

#previewHud span,
#previewHud small {
  color: var(--hoops-muted);
  font-size: 0.6rem;
  font-weight: 700;
}

#previewHud strong {
  color: var(--hoops-brand-dark);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

#previewDescription {
  position: absolute;
  z-index: 5;
  right: 0.7rem;
  bottom: 0.7rem;
  max-width: min(62%, 330px);
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 9px;
  border: 1px solid rgba(66, 83, 51, 0.14);
  background: var(--hoops-material);
  box-shadow: var(--hoops-shadow-compact);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  color: var(--hoops-muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

#controlPanel {
  border-left-color: var(--hoops-line);
  background: var(--hoops-material);
  box-shadow: 0 -10px 34px rgba(49, 65, 42, 0.1);
  backdrop-filter: blur(24px) saturate(155%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
}

#controlPanel .sim-panel-header {
  background: transparent;
}

#controlHint {
  display: block;
  margin-top: 0.15rem;
  color: var(--hoops-muted);
  font-size: 0.68rem;
}

#controlPanel .sim-panel-title {
  color: var(--hoops-brand-dark);
}

#controlPanel .sim-slider-val {
  color: var(--hoops-cyan);
}

#controlPanel .sim-slider {
  accent-color: var(--hoops-brand);
}

.client-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.client-stepper button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--hoops-line);
  border-radius: 12px;
  background: #f7f8f3;
  color: var(--hoops-brand-dark);
  font-size: 1.25rem;
  font-weight: 850;
}

.client-stepper span {
  color: var(--hoops-muted);
  font-size: 0.72rem;
  text-align: center;
}

#componentReadout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.8rem 0 1rem;
}

#componentReadout div {
  padding: 0.65rem;
  border: 1px solid var(--hoops-line);
  border-radius: 11px;
  background: #f8faf6;
}

#componentReadout span,
#componentReadout strong,
#componentReadout small {
  display: block;
}

#componentReadout span {
  color: var(--hoops-muted);
  font-size: 0.68rem;
}

#componentReadout strong {
  margin-top: 0.15rem;
  color: var(--hoops-brand-dark);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

#componentReadout small {
  color: var(--hoops-muted);
  font-size: 0.62rem;
}

#shootButton {
  min-height: 58px;
}

#trajectoryAssistButton {
  flex: 0 1 44%;
  min-height: 58px;
  border: 1px solid var(--hoops-line);
  background: #f8faf6;
  color: var(--hoops-brand-dark);
}

#trajectoryAssistButton > span,
#trajectoryAssistButton strong,
#trajectoryAssistButton small {
  display: block;
}

#trajectoryAssistButton strong {
  font-size: 0.82rem;
}

#trajectoryAssistButton small {
  margin-top: 0.12rem;
  color: var(--hoops-muted);
  font-size: 0.62rem;
  font-weight: 650;
}

#trajectoryAssistButton.is-active {
  border-color: var(--hoops-brand);
  background: var(--hoops-brand-soft);
  box-shadow: inset 0 0 0 1px rgba(101, 121, 84, 0.24);
}

.client-primary,
.client-secondary,
.sim-btn,
.client-stepper button,
#copyJoinButton,
#soundButton,
#hostActions button,
#rematchButton,
#closeDialog button {
  transform-origin: center;
  transition: transform 110ms ease-out, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.client-primary:not(:disabled):active,
.client-secondary:not(:disabled):active,
.sim-btn:not(:disabled):active,
.client-stepper button:not(:disabled):active,
#copyJoinButton:not(:disabled):active,
#soundButton:not(:disabled):active,
#hostActions button:not(:disabled):active,
#rematchButton:not(:disabled):active,
#closeDialog button:not(:disabled):active {
  transform: scale(0.975);
  transition-duration: 70ms;
}

@media (hover: hover) and (pointer: fine) {
  .client-primary:not(:disabled):hover,
  .client-secondary:not(:disabled):hover,
  .sim-btn:not(:disabled):hover,
  .client-stepper button:not(:disabled):hover,
  #copyJoinButton:not(:disabled):hover,
  #soundButton:not(:disabled):hover,
  #hostActions button:not(:disabled):hover,
  #rematchButton:not(:disabled):hover,
  #closeDialog button:not(:disabled):hover {
    box-shadow: 0 8px 20px rgba(49, 65, 42, 0.13);
    transform: translateY(-1px);
  }
}

#clientFlightView {
  position: relative;
  height: 150px;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid var(--hoops-line);
  border-radius: 18px;
  background:
    linear-gradient(rgba(246, 248, 243, 0.55), rgba(229, 236, 223, 0.68)),
    url("assets/campus-court-background.webp") center / cover,
    #edf1e9;
}

#flightCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#flightIndicator {
  position: absolute;
  inset: 0;
  transition: opacity 180ms ease;
}

#flightIndicator.is-hidden {
  opacity: 0;
}

#flightIndicator::before {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 74px;
  border: 4px solid var(--hoops-cyan);
  border-color: var(--hoops-cyan) transparent transparent;
  border-radius: 50%;
  content: "";
  transform: translateY(-50%) rotate(-7deg);
}

#flightIndicator span {
  position: absolute;
  left: 45%;
  top: 22%;
  width: 48px;
  aspect-ratio: 1;
  border: 3px solid #7c2d12;
  border-radius: 50%;
  background: #e77928;
  animation: hoops-float 1.3s ease-in-out infinite alternate;
}

#flightDescription {
  position: absolute;
  right: 0.55rem;
  bottom: 0.45rem;
  margin: 0;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--hoops-muted);
  font-size: 0.64rem;
}

#roundResultScreen,
#clientFinalScreen {
  text-align: center;
}

#roundResultMark {
  display: grid;
  place-items: center;
  width: 86px;
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  border: 5px solid var(--hoops-brand);
  border-radius: 50%;
  background: var(--hoops-brand-soft);
}

#roundResultMark::before {
  width: 22px;
  height: 40px;
  border: solid var(--hoops-brand-dark);
  border-width: 0 6px 6px 0;
  content: "";
  transform: translateY(-4px) rotate(45deg);
}

#roundResultMark.is-miss {
  border-color: var(--hoops-warning);
  background: #fff5e8;
}

#roundResultMark.is-miss::before {
  width: 36px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--hoops-warning);
  transform: none;
}

#roundScore {
  display: inline-block;
  color: var(--hoops-brand-dark);
  font-size: clamp(4.2rem, 24vw, 7rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#roundScoreUnit {
  color: var(--hoops-muted);
  font-weight: 750;
}

#resultTrajectoryView {
  height: 138px;
  margin: 0.8rem 0;
  overflow: hidden;
  border: 1px solid var(--hoops-line);
  border-radius: 15px;
  background:
    linear-gradient(rgba(246, 248, 243, 0.55), rgba(229, 236, 223, 0.68)),
    url("assets/campus-court-background.webp") center / cover,
    #edf1e9;
}

#resultTrajectoryCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

#nextRoundNotice {
  margin: 1rem 0 0;
  color: var(--hoops-brand);
  font-size: 0.8rem;
  font-weight: 800;
}

#physicsFeedback {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#resultTotal {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--hoops-line);
  border-radius: 12px;
  background: #f8faf6;
  text-align: left;
}

#resultTotal span,
#resultTotal small {
  color: var(--hoops-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

#resultTotal strong {
  color: var(--hoops-brand-dark);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

#clientMedal {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  border: 9px solid #d8a924;
  border-radius: 50%;
  background: var(--hoops-yellow);
  box-shadow: 0 18px 34px rgba(184, 134, 11, 0.22);
}

.client-trophy-art {
  display: block;
  width: 96px;
  height: 96px;
  margin: -0.35rem auto -1.2rem;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(35, 50, 38, 0.15));
}

#clientMedal::before,
#clientMedal::after {
  position: absolute;
  z-index: -1;
  top: 76%;
  width: 34px;
  height: 62px;
  background: var(--hoops-coral);
  content: "";
}

#clientMedal::before {
  left: 18px;
  transform: rotate(12deg);
}

#clientMedal::after {
  right: 18px;
  transform: rotate(-12deg);
}

#clientMedal span::before {
  color: #684a04;
  font-size: 2.5rem;
  font-weight: 900;
  content: "1";
}

#clientPlacement,
#clientFinalScore {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 0.45rem;
  margin-top: 0.7rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--hoops-line);
  border-radius: 13px;
  background: #f8faf6;
  text-align: left;
}

#clientPlacement span,
#clientFinalScore span,
#clientFinalScore small {
  color: var(--hoops-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

#clientPlacement strong,
#clientFinalScore strong {
  color: var(--hoops-brand-dark);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

@media (max-height: 760px) and (min-width: 821px) {
  #hostPanel {
    grid-template-rows: auto minmax(118px, 1fr) minmax(88px, 0.7fr) auto;
  }

  #hostJoinCard,
  #hostRoster,
  #hostLeaderboard,
  #hostActions {
    padding: 0.55rem 0.8rem;
  }

  #hostActions {
    gap: 0.32rem;
  }

  #hostActions button {
    min-height: 44px;
  }
}

@keyframes hoops-spin {
  to { transform: rotate(1turn); }
}

@keyframes hoops-float {
  to { transform: translate(42px, -20px) rotate(70deg); }
}

@media (max-width: 1060px) {
  #hostHeader {
    grid-template-columns: 1fr auto;
  }

  #hostRoomSummary {
    justify-self: end;
  }

  #hostMetrics {
    display: none;
  }

  #hostApp {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  #hostLobby {
    padding: 2.2rem;
  }
}

@media (max-width: 820px) {
  #entryHero {
    grid-template-columns: 1fr;
  }

  #entryCopy {
    min-height: 67vh;
  }

  #entryBrand {
    margin-bottom: 2.5rem;
  }

  #entryVisual {
    min-height: 400px;
  }
}

@media (max-width: 900px) {
  #projectileHoopsHost {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  #hostApp {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(620px, 68dvh) minmax(540px, auto);
    height: auto;
    min-height: calc(100dvh - 82px);
  }

  #hostStage {
    min-height: 620px;
  }

  #hostPanel {
    grid-template-rows: auto minmax(180px, 1fr) minmax(150px, 0.8fr) auto;
    min-height: 540px;
    overflow: visible;
    border-top: 1px solid var(--hoops-line);
    border-left: 0;
    box-shadow: 0 -12px 36px rgba(49, 65, 42, 0.06);
  }

  #hostLobby {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 1.25rem;
    padding: 2rem;
  }

  #hostLobbyCopy h1 {
    font-size: clamp(2.7rem, 7.5vw, 4.2rem);
  }

  #hostLobbyJoin {
    width: min(100%, 280px);
    padding: 1.25rem;
    border-radius: 24px;
  }
}

@media (max-width: 768px) {
  #clientGameShell {
    display: flex;
    flex-direction: column;
  }

  #clientPreview {
    min-height: 42dvh;
    flex: 1 1 46%;
  }

  #controlPanel {
    z-index: 20;
    flex: 0 0 auto;
    max-height: 58dvh;
    overflow: hidden;
  }

  #controlPanel .sim-panel-body {
    padding-bottom: max(1rem, var(--safe-bottom));
    overflow-y: auto;
  }

  #controlPanel.state-half {
    max-height: 39dvh;
  }

  #controlPanel.state-collapsed {
    max-height: 68px;
  }
}

@media (max-width: 560px) {
  #entryShell {
    padding: 0;
  }

  #entryHero {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  #entryCopy {
    padding: 1.5rem;
  }

  #entryCopy h1 {
    font-size: clamp(3.5rem, 18vw, 5.2rem);
  }

  #entryActions {
    display: grid;
  }

  #entryFeatures {
    justify-content: space-between;
  }

  .client-screen {
    align-items: start;
    padding-top: max(1rem, var(--safe-top));
  }

  .client-card {
    border-radius: 22px;
  }

  #previewHud div {
    grid-template-columns: 1fr;
    gap: 0;
    text-align: center;
  }

  #previewHud small {
    display: none;
  }

  #previewDescription {
    max-width: 72%;
  }
}

@media (max-height: 690px) and (max-width: 768px) {
  .client-screen {
    padding-top: max(0.6rem, var(--safe-top));
    padding-bottom: max(0.6rem, var(--safe-bottom));
  }

  .client-card {
    padding: 1rem;
  }

  .client-brand {
    margin-bottom: 1rem;
  }

  #lobbyStats,
  #waitingStats,
  #physicsFeedback {
    margin: 0.8rem 0;
  }

  #clientPreview {
    min-height: 34dvh;
  }

  #controlPanel .sim-panel-body {
    gap: 0.55rem;
    padding: 0.7rem 1rem max(0.7rem, var(--safe-bottom));
  }

  #controlPanel .sim-control-group {
    gap: 0.55rem;
  }

  #controlPanel .sim-slider-wrapper {
    gap: 0.35rem;
  }

  #controlPanel .client-stepper {
    margin-top: 0.3rem;
  }

  #shootButton {
    min-height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  #hostHeader,
  #hostLobbyJoin,
  .client-card,
  #clientGameHeader,
  #previewHud div,
  #previewDescription,
  #controlPanel {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --hoops-line: #657954;
    --hoops-muted: #354052;
  }

  #hostStage,
  #clientPreview,
  #entryVisual {
    background-image: none;
    background-color: #eef2ea;
  }
}
