:root {
  --bg: #0f1218;
  --ink: #151b26;
  --panel: #f8fafc;
  --muted: #667085;
  --line: rgba(21, 27, 38, 0.14);
  --gold: #ffbd4a;
  --red: #f04f6f;
  --blue: #2d7cff;
  --cyan: #2ad4ff;
  --green: #14b87a;
  --violet: #8268ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background:
    radial-gradient(circle at 18% 12%, rgba(240, 79, 111, 0.22), transparent 24rem),
    radial-gradient(circle at 86% 10%, rgba(45, 124, 255, 0.24), transparent 28rem),
    radial-gradient(circle at 54% 82%, rgba(255, 189, 74, 0.14), transparent 24rem),
    linear-gradient(145deg, #0f1218, #171d28 48%, #10141d);
  color: #f8fafc;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button, select, input { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(15, 18, 24, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 max(22px, calc((100vw - 1240px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { font-weight: 900; }
.brand span { color: var(--gold); }

nav {
  color: #d8e0ee;
  display: flex;
  font-size: 0.92rem;
  font-weight: 800;
  gap: 18px;
}

main {
  margin: 0 auto;
  width: min(1240px, calc(100% - 32px));
}

.hero {
  align-items: center;
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  min-height: calc(100vh - 72px);
  padding: 48px 0 34px;
}

.eyebrow, .label {
  color: var(--gold);
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(3.1rem, 8vw, 6.7rem);
  letter-spacing: 0;
  line-height: 0.94;
  margin: 14px 0 22px;
}

.lede {
  color: #ccd7e6;
  font-size: 1.13rem;
  max-width: 770px;
}

.hero-actions, .host-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.primary-action, .secondary-action, .host-actions button, .room-card button, .join-row button {
  border-radius: 7px;
  font-weight: 900;
  min-height: 46px;
  padding: 0 16px;
}

.primary-action, .join-row button {
  background: var(--gold);
  color: #251600;
}

.secondary-action, .host-actions button, .room-card button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-stage {
  align-items: center;
  aspect-ratio: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    #0a0e15;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  overflow: hidden;
  position: relative;
}

.arena-rings {
  animation: rotate-rings 14s linear infinite;
  background:
    conic-gradient(from 0deg, transparent, rgba(255, 189, 74, 0.42), transparent, rgba(42, 212, 255, 0.34), transparent),
    radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 58%);
  border-radius: 50%;
  filter: blur(2px);
  height: 76%;
  position: absolute;
  width: 76%;
}

.arena-token {
  align-items: center;
  animation: token-float 4s ease-in-out infinite;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  font-weight: 900;
  height: 34%;
  justify-content: center;
  position: absolute;
  text-transform: uppercase;
  width: 34%;
}

.arena-token span {
  position: relative;
  z-index: 2;
}

.arena-token img {
  display: block;
  height: 88%;
  object-fit: contain;
  position: relative;
  width: 88%;
  z-index: 2;
}

.arena-token.token-scissors img {
  height: 96%;
  width: 96%;
}

.arena-token::before, .arena-token::after {
  content: "";
  position: absolute;
}

.token-rock {
  background: linear-gradient(145deg, #6b7280, #232b38);
  left: 9%;
  top: 13%;
}

.token-rock::before {
  background: #a1a8b4;
  border-radius: 45% 55% 40% 60%;
  height: 38%;
  width: 46%;
}

.arena-token:has(img)::before,
.arena-token:has(img)::after {
  display: none;
}

.token-paper {
  animation-delay: -1.4s;
  background: linear-gradient(145deg, #ffffff, #cfd8e8);
  color: #17202e;
  right: 9%;
  top: 26%;
}

.token-paper::before {
  background: #f8fafc;
  border: 2px solid rgba(21, 27, 38, 0.22);
  border-radius: 6px;
  height: 46%;
  transform: rotate(-12deg);
  width: 34%;
}

.token-scissors {
  animation-delay: -2.7s;
  background: linear-gradient(145deg, #f04f6f, #94233f);
  bottom: 12%;
  left: 32%;
}

.token-scissors::before, .token-scissors::after {
  background: #fff;
  border-radius: 999px;
  height: 7px;
  width: 46%;
}

.token-scissors::before { transform: rotate(38deg); }
.token-scissors::after { transform: rotate(-38deg); }

.setup-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  margin-bottom: 24px;
}

.setup-card, .host-panel, .broadcast, .phone-preview, .roadmap {
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.setup-card {
  padding: 20px;
}

.setup-card h2 {
  line-height: 1.12;
  margin: 6px 0 14px;
}

.setup-fields, .join-row {
  display: grid;
  gap: 12px;
}

.setup-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

input, select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-weight: 800;
  min-height: 46px;
  padding: 0 12px;
  width: 100%;
}

.join-row {
  grid-template-columns: 120px minmax(150px, 1fr) auto;
}

#joinHint {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 10px;
}

.app-shell {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 270px minmax(0, 1fr) 270px;
  margin-bottom: 28px;
}

.host-panel {
  display: grid;
  gap: 20px;
  padding: 18px;
}

.room-card {
  background:
    radial-gradient(circle at top right, rgba(42, 212, 255, 0.22), transparent 12rem),
    #17202e;
  border-radius: 8px;
  color: #fff;
  padding: 16px;
}

.room-card strong {
  display: block;
  font-size: 2.2rem;
  letter-spacing: 0.08em;
  margin: 4px 0 8px;
}

.room-card p {
  color: #c9d5e5;
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.host-actions button {
  background: #17202e;
  color: #fff;
  width: 100%;
}

.host-actions button:disabled, .room-card button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.player-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.player-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  gap: 8px;
  min-height: 40px;
  padding: 7px 9px;
}

.avatar {
  align-items: center;
  background: #eaf0fb;
  border-radius: 50%;
  color: var(--blue);
  display: flex;
  flex: 0 0 28px;
  font-size: 0.72rem;
  font-weight: 900;
  height: 28px;
  justify-content: center;
}

.player-row.eliminated { opacity: 0.46; }
.player-row.active .avatar { background: var(--gold); color: #251600; }
.player-row:only-child,
.lobby-roster:empty::before {
  color: var(--muted);
  font-weight: 800;
}

.lobby-roster:empty::before {
  content: "No players have joined this room yet.";
}

.broadcast {
  min-height: 690px;
  overflow: hidden;
  padding: 22px;
}

.broadcast-header {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.round-pill {
  background: #17202e;
  border-radius: 999px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 8px 12px;
  white-space: nowrap;
}

.featured-match {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 189, 74, 0.2), transparent 16rem),
    linear-gradient(145deg, rgba(45, 124, 255, 0.12), rgba(240, 79, 111, 0.12)),
    #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr auto 1fr;
  margin-bottom: 18px;
  min-height: 260px;
  padding: 18px;
}

.featured-match.empty {
  align-items: center;
  color: var(--muted);
  display: flex;
  justify-content: center;
  text-align: center;
}

.featured-match.lobby-board {
  display: block;
}

.lobby-board-inner {
  align-content: center;
  display: grid;
  gap: 22px;
  min-height: 100%;
}

.lobby-board-head {
  text-align: center;
}

.lobby-board-head h3 {
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1;
  margin: 8px 0 10px;
}

.lobby-board-head p,
.lobby-empty {
  color: var(--muted);
  font-weight: 800;
}

.lobby-name-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 10px 0;
}

.lobby-name {
  align-items: center;
  animation: lobby-drift 10s ease-in-out infinite;
  background: var(--lobby-bg, #fff);
  border: 1px solid rgba(21, 27, 38, 0.12);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(21, 27, 38, 0.08);
  display: flex;
  gap: 10px;
  min-height: 52px;
  padding: 9px 13px 9px 10px;
}

.lobby-name:nth-child(3n + 1) { --lobby-bg: #fff7e6; animation-delay: -1.2s; }
.lobby-name:nth-child(3n + 2) { --lobby-bg: #eef6ff; animation-delay: -3.1s; }
.lobby-name:nth-child(3n + 3) { --lobby-bg: #effdf7; animation-delay: -4.8s; }

.lobby-name span {
  align-items: center;
  background: linear-gradient(145deg, #fff3d8, #e9f3ff);
  border: 1px solid rgba(21, 27, 38, 0.1);
  border-radius: 50%;
  color: var(--blue);
  display: flex;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.lobby-name strong {
  color: var(--ink);
  font-size: clamp(0.98rem, 1.5vw, 1.24rem);
}

.lobby-name.you {
  border-color: rgba(255, 189, 74, 0.75);
  box-shadow: 0 0 0 4px rgba(255, 189, 74, 0.12);
}

.featured-match.round-overview {
  align-items: center;
  display: grid;
  text-align: center;
}

.round-overview-inner h3 {
  color: var(--ink);
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: 0.98;
  margin: 8px 0 12px;
}

.round-overview-inner p {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 800;
  max-width: 720px;
  margin: 0 auto;
}

.duelist {
  align-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  justify-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  position: relative;
  text-align: center;
}

.duelist.winner {
  animation: winner-pulse 1.6s ease-in-out infinite;
  border-color: rgba(20, 184, 122, 0.65);
  box-shadow: 0 0 0 4px rgba(20, 184, 122, 0.12);
}

.duelist.waiting {
  opacity: 0.72;
}

.throw-art {
  align-items: center;
  animation: reveal-pop 520ms cubic-bezier(.2, 1.5, .4, 1);
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #fff;
  display: grid;
  font-size: 0.82rem;
  font-weight: 900;
  height: 118px;
  justify-items: center;
  overflow: hidden;
  position: relative;
  text-transform: uppercase;
  width: 118px;
}

.throw-art::before, .throw-art::after {
  content: "";
  position: absolute;
}

.throw-art span {
  position: relative;
  z-index: 2;
}

.throw-art.hidden {
  background: linear-gradient(145deg, #222b3a, #0f141f);
}

.throw-art.rock { background: linear-gradient(145deg, #6b7280, #232b38); }
.throw-art.rock::before {
  background: #aab1bd;
  border-radius: 45% 55% 42% 58%;
  height: 40%;
  transform: rotate(-12deg);
  width: 48%;
}

.throw-art.paper { background: linear-gradient(145deg, #fff, #d7e0ef); color: #17202e; }
.throw-art.paper::before {
  background: #fff;
  border: 2px solid rgba(21, 27, 38, 0.2);
  border-radius: 7px;
  height: 48%;
  transform: rotate(-10deg);
  width: 35%;
}

.throw-art.scissors { background: linear-gradient(145deg, #f04f6f, #982642); }
.throw-art.scissors::before, .throw-art.scissors::after {
  background: #fff;
  border-radius: 999px;
  height: 8px;
  width: 48%;
}
.throw-art.scissors::before { transform: rotate(38deg); }
.throw-art.scissors::after { transform: rotate(-38deg); }

.throw-art.lizard { background: linear-gradient(145deg, #14b87a, #087850); }
.throw-art.lizard::before {
  background: #a8f3d0;
  border-radius: 60% 40% 48% 52%;
  height: 34%;
  transform: rotate(18deg);
  width: 48%;
}

.throw-art.spock { background: linear-gradient(145deg, #8268ff, #33247e); }
.throw-art.spock::before, .throw-art.spock::after {
  background: #e6e1ff;
  border-radius: 999px;
  height: 44%;
  top: 24%;
  width: 9px;
}
.throw-art.spock::before { transform: translateX(-8px) rotate(-8deg); }
.throw-art.spock::after { transform: translateX(8px) rotate(8deg); }

.rpsls-guide {
  background: #0f1724;
  border: 1px solid rgba(21, 27, 38, 0.14);
  border-radius: 8px;
  margin-top: 16px;
  overflow: hidden;
}

.rpsls-guide img {
  display: block;
  height: auto;
  width: 100%;
}

.rpsls-guide-compact {
  margin-top: 14px;
}

.rpsls-guide-broadcast {
  margin: 8px auto 0;
  max-width: min(760px, 100%);
}

.versus {
  align-items: center;
  color: var(--red);
  display: flex;
  font-size: 2.1rem;
  font-weight: 900;
}

.match-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.match-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 138px;
  padding: 12px;
}

.match-card.featured { border-color: rgba(255, 189, 74, 0.8); }
.match-card.revealed { box-shadow: inset 0 0 0 2px rgba(20, 184, 122, 0.12); }
.match-card.draw { box-shadow: inset 0 0 0 2px rgba(255, 189, 74, 0.22); }

.match-top {
  color: var(--muted);
  display: flex;
  font-size: 0.74rem;
  font-weight: 900;
  justify-content: space-between;
  text-transform: uppercase;
}

.mini-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.mini-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-throw {
  border-radius: 999px;
  color: #fff;
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 900;
  padding: 4px 8px;
  text-transform: uppercase;
}

.mini-throw.rock { background: #343c4b; }
.mini-throw.paper { background: #dce4f2; color: #17202e; }
.mini-throw.scissors { background: #c92d58; }
.mini-throw.lizard { background: #0f9f74; }
.mini-throw.spock { background: #6046d8; }
.mini-throw.hidden { background: #7b8797; }

.winner-note {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.draw-note {
  color: #a86100;
  font-size: 0.78rem;
  font-weight: 900;
}

.score-note,
.timer-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.series-history {
  background: rgba(23, 32, 46, 0.05);
  border: 1px solid rgba(21, 27, 38, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
  padding: 10px;
  width: 100%;
}

.series-title {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.series-result {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(21, 27, 38, 0.08);
  border-radius: 7px;
  color: var(--ink);
  display: grid;
  font-size: 0.74rem;
  font-weight: 800;
  gap: 8px;
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) minmax(58px, auto);
  min-height: 34px;
  padding: 6px 8px;
}

.series-result span,
.series-result strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-round {
  color: var(--muted);
}

.series-result strong {
  color: var(--green);
  text-align: right;
}

.series-result.draw strong {
  color: #a86100;
}

.series-history-mini {
  gap: 4px;
  padding: 8px;
}

.series-history-mini .series-result {
  font-size: 0.68rem;
  grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr);
}

.series-history-mini .series-result strong {
  grid-column: 2 / -1;
  text-align: left;
}

.featured-match > .timer-note {
  grid-column: 1 / -1;
  text-align: center;
}

.timer-note.mini {
  color: #7a4f00;
}

.phone-preview { padding: 18px; }

.phone {
  background: #0d1119;
  border: 8px solid #202836;
  border-radius: 28px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #fff;
  min-height: 580px;
  overflow: hidden;
}

.phone-top {
  background: #202836;
  border-radius: 0 0 14px 14px;
  height: 24px;
  margin: 0 auto 12px;
  width: 42%;
}

.phone-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.phone-body p { color: #cbd5e1; }

.match-opponent {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 189, 74, 0.16), rgba(42, 212, 255, 0.08)),
    rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.match-opponent[hidden] {
  display: none;
}

.match-opponent span {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-opponent strong {
  min-width: 0;
  overflow: hidden;
  color: #f8fafc;
  font-size: 1.04rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-opponent em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #facc15;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 900;
}

.throw-buttons {
  display: grid;
  gap: 10px;
}

.throw-buttons button {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  display: grid;
  gap: 10px;
  grid-template-columns: 48px 1fr auto;
  min-height: 64px;
  padding: 8px 12px;
  text-align: left;
}

.throw-buttons button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.throw-buttons button.selected {
  background: var(--gold);
  color: #251600;
}

.tiny-art {
  height: 42px;
  transform: scale(0.82);
  width: 42px;
}

.small-note {
  color: #aebbd0;
  font-size: 0.82rem;
}

.roadmap {
  margin-bottom: 34px;
  padding: 24px;
}

.section-head { margin-bottom: 18px; }

.timeline {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.timeline div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.timeline strong, .timeline span { display: block; }
.timeline span { color: var(--muted); margin-top: 4px; }

.toast {
  background: #17202e;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  bottom: 18px;
  box-shadow: var(--shadow);
  color: #fff;
  font-weight: 800;
  left: 50%;
  max-width: min(460px, calc(100% - 32px));
  padding: 12px 14px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 50;
}

@keyframes rotate-rings {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes token-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.03); }
}

@keyframes reveal-pop {
  from { opacity: 0; transform: scale(0.72) rotate(-12deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes winner-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(20, 184, 122, 0.12); }
  50% { box-shadow: 0 0 0 8px rgba(20, 184, 122, 0.18); }
}

@media (max-width: 1100px) {
  .hero, .setup-grid, .app-shell, .timeline {
    grid-template-columns: 1fr;
  }

  .phone { min-height: 0; }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  main { width: min(100% - 24px, 1240px); }

  .hero {
    min-height: 0;
    padding-top: 34px;
  }

  .setup-fields, .join-row, .featured-match {
    grid-template-columns: 1fr;
  }

  .versus { justify-content: center; }
}

.player-main {
  margin: 0 auto;
  max-width: 1040px;
  padding: 42px 0 54px;
}

.player-hero {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 260px;
  margin-bottom: 24px;
}

.player-hero h1,
.host-header h1 {
  font-size: clamp(2.7rem, 7vw, 5.7rem);
}

.compact-stage {
  align-items: center;
  aspect-ratio: 1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent), #0a0e15;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  overflow: hidden;
  position: relative;
}

.player-console {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.7fr);
  align-items: start;
}

.standalone-phone {
  min-height: 520px;
}

.player-join-row {
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr) auto;
}

.host-main {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 32px;
}

.host-header {
  align-items: end;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.56fr);
  margin-bottom: 18px;
}

.host-dashboard {
  display: grid;
  gap: 18px;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: start;
}

.host-dashboard .host-panel {
  position: sticky;
  top: 90px;
}

.broadcast-stage {
  min-height: calc(100vh - 140px);
}

.broadcast-stage .featured-match {
  min-height: 360px;
}

.broadcast-stage .throw-art {
  height: 148px;
  width: 148px;
}

.broadcast-stage .duelist h3 {
  font-size: clamp(1.6rem, 3vw, 2.65rem);
}

.broadcast-stage .duelist p {
  color: var(--muted);
  font-weight: 800;
}

.broadcast-stage .match-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.throw-art {
  animation: none;
  transition: transform 260ms ease, box-shadow 260ms ease, opacity 260ms ease;
}

.throw-art::before,
.throw-art::after {
  display: none;
}

.throw-art {
  isolation: isolate;
}

.choice-mark,
.choice-mark i {
  display: block;
  position: absolute;
}

.choice-img {
  display: block;
  height: 82%;
  left: 50%;
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 82%;
  z-index: 2;
}

.throw-art.paper .choice-img {
  height: 88%;
  width: 88%;
}

.throw-art.scissors .choice-img {
  height: 92%;
  width: 92%;
}

.throw-art.lizard .choice-img {
  height: 98%;
  width: 98%;
}

.throw-art.spock .choice-img {
  height: 92%;
  width: 92%;
}

.tiny-art .choice-img {
  height: 86%;
  width: 86%;
}

.tiny-art.scissors .choice-img {
  height: 94%;
  width: 94%;
}

.tiny-art.lizard .choice-img {
  height: 96%;
  width: 96%;
}

.tiny-art.spock .choice-img {
  height: 90%;
  width: 90%;
}

.choice-mark {
  inset: 18%;
  z-index: 1;
}

.throw-label {
  align-self: end;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 5px 8px;
  position: relative;
  z-index: 3;
}

.throw-art.paper .throw-label {
  background: rgba(21, 27, 38, 0.08);
}

.tiny-art .throw-label {
  display: none;
}

.tiny-art .choice-mark {
  inset: 13%;
}

.rock-mark i {
  background: linear-gradient(145deg, #d7dde8, #7d8798);
  border: 2px solid rgba(255, 255, 255, 0.42);
  box-shadow: inset -5px -8px 14px rgba(15, 18, 24, 0.22);
}

.rock-mark i:nth-child(1) {
  border-radius: 48% 52% 44% 56%;
  height: 58%;
  left: 16%;
  top: 23%;
  transform: rotate(-18deg);
  width: 64%;
}

.rock-mark i:nth-child(2) {
  border-radius: 44% 56% 50% 50%;
  height: 36%;
  left: 8%;
  top: 42%;
  transform: rotate(12deg);
  width: 42%;
}

.rock-mark i:nth-child(3) {
  border-radius: 54% 46% 52% 48%;
  height: 42%;
  right: 8%;
  top: 20%;
  transform: rotate(20deg);
  width: 44%;
}

.paper-mark {
  background: linear-gradient(145deg, #ffffff, #dce5f4);
  border: 2px solid rgba(21, 27, 38, 0.18);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(21, 27, 38, 0.16);
  height: 64%;
  inset: auto;
  left: 28%;
  top: 13%;
  transform: rotate(-9deg);
  width: 45%;
}

.paper-mark i {
  background: rgba(45, 124, 255, 0.22);
  border-radius: 999px;
  height: 3px;
  left: 18%;
  width: 62%;
}

.paper-mark i:nth-child(1) { top: 28%; }
.paper-mark i:nth-child(2) { top: 45%; }
.paper-mark i:nth-child(3) { top: 62%; }

.scissors-mark {
  inset: 12%;
}

.scissors-mark .blade {
  background: linear-gradient(90deg, #f8fafc, #b9c4d6);
  border: 1px solid rgba(21, 27, 38, 0.18);
  border-radius: 999px 999px 4px 4px;
  height: 10px;
  left: 34%;
  top: 43%;
  transform-origin: 9% 50%;
  width: 56%;
}

.scissors-mark .blade-a {
  transform: rotate(-34deg);
}

.scissors-mark .blade-b {
  transform: rotate(34deg);
}

.scissors-mark .handle {
  border: 7px solid #f8fafc;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(240, 79, 111, 0.28), 0 4px 9px rgba(21, 27, 38, 0.16);
  height: 30%;
  left: 7%;
  top: 27%;
  width: 30%;
}

.scissors-mark .handle-b {
  top: 55%;
}

.scissors-mark .pivot {
  background: #ffbd4a;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(21, 27, 38, 0.25);
  height: 16%;
  left: 31%;
  top: 46%;
  width: 16%;
}

.lizard-mark i:first-child {
  background: #a8f3d0;
  border-radius: 62% 38% 48% 52%;
  height: 44%;
  left: 18%;
  top: 28%;
  transform: rotate(16deg);
  width: 58%;
}

.lizard-mark i:last-child {
  background: #eafff4;
  border-radius: 50%;
  height: 10%;
  right: 22%;
  top: 36%;
  width: 10%;
}

.spock-mark i {
  background: #e6e1ff;
  border-radius: 999px;
  height: 58%;
  top: 18%;
  width: 12%;
}

.spock-mark i:nth-child(1) { left: 26%; transform: rotate(-12deg); }
.spock-mark i:nth-child(2) { left: 44%; }
.spock-mark i:nth-child(3) { right: 26%; transform: rotate(12deg); }

.hidden-mark i {
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  height: 62%;
  left: 19%;
  top: 19%;
  width: 62%;
}

.duelist.revealed .throw-art {
  animation: featured-reveal 760ms cubic-bezier(.18, .9, .24, 1.12);
}

.duelist:not(.waiting) .throw-art {
  transform: scale(1);
}

.duelist.waiting .throw-art {
  opacity: 0.72;
}

.duelist.winner {
  animation: winner-glow 2.4s ease-in-out infinite;
}

.arena-token {
  animation-duration: 6s;
}

.arena-rings {
  animation-duration: 26s;
  opacity: 0.72;
}

@keyframes winner-glow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(20, 184, 122, 0.11); }
  50% { box-shadow: 0 0 0 6px rgba(20, 184, 122, 0.18); }
}

@keyframes lobby-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes featured-reveal {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.82) rotate(-4deg);
  }
  58% {
    opacity: 1;
    transform: translateY(-4px) scale(1.05) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

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

@media (max-width: 1100px) {
  .player-hero,
  .player-console,
  .host-header,
  .host-dashboard {
    grid-template-columns: 1fr;
  }

  .host-dashboard .host-panel {
    position: static;
  }

  .compact-stage {
    max-width: 320px;
  }
}

@media (max-width: 720px) {
  .player-main,
  .host-main {
    width: min(100% - 24px, 1240px);
    padding-top: 28px;
  }

  .player-join-row {
    grid-template-columns: 1fr;
  }

  .broadcast-stage .featured-match {
    min-height: 0;
  }

  .broadcast-stage .throw-art {
    height: 112px;
    width: 112px;
  }
}
