:root {
  --paper:#101611;
  --ink:#f1ead3;
  --muted:#a8b49c;
  --line:#3b4935;
  --orange:#e9c15a;
  --club-green:#81c88c;
  --card:#1b261c
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:Inter,"Avenir Next",Avenir,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:14px
}
button,input,select {
  font:inherit
}
button,a,input,select {
  -webkit-tap-highlight-color:transparent
}
button {
  cursor:pointer
}
button:disabled {
  cursor:not-allowed;
  opacity:.5
}
button:focus-visible,a:focus-visible,canvas:focus-visible {
  outline:3px solid #e6a761;
  outline-offset:4px
}
button {
  color:inherit
}
a {
  color:inherit;
  text-decoration:none
}
[hidden] {
  display:none!important
}
.site-header {
  height:100px;
  max-width:1440px;
  margin:auto;
  padding:0 64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line)
}
.brand {
  display:flex;
  align-items:center;
  font-size:31px;
  font-weight:850;
  letter-spacing:-1.8px
}
.brand-light {
  font-weight:450
}
.brand-ball {
  border-radius:50%;
  background:var(--orange);
  color:#fff8e8;
  width:35px;
  height:35px;
  margin-right:9px;
  text-align:center;
  font-size:37px;
  line-height:33px;
  font-weight:400;
  letter-spacing:0
}
.brand-dot {
  font-size:11px;
  align-self:flex-start;
  margin:5px 0 0 3px;
  letter-spacing:0
}
.header-caption,.eyebrow {
  font-size:10px;
  font-weight:750;
  letter-spacing:1.65px
}
.header-caption {
  display:flex;
  align-items:center;
  gap:8px;
  color:#747e70
}
.header-caption i,.live-dot {
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#7c9c6e
}
.header-actions {
  display:flex;
  gap:23px
}
.icon-button {
  border:0;
  background:none;
  padding:8px 0;
  font-size:12px;
  font-weight:600
}
.icon-button span {
  margin-left:6px
}
main {
  max-width:1440px;
  padding:0 64px;
  margin:auto
}
.intro {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  padding:44px 0 34px
}
.intro .eyebrow {
  color:#858b78;
  display:flex;
  gap:8px;
  align-items:center
}
.eyebrow>span {
  width:5px;
  height:5px;
  background:var(--orange);
  display:inline-block;
  border-radius:50%
}
h1 {
  font-size:57px;
  line-height:1.03;
  letter-spacing:-2.7px;
  margin:18px 0 0;
  font-weight:750
}
h1 em {
  font-family:Georgia,"Times New Roman",serif;
  font-weight:400;
  color:var(--orange);
  letter-spacing:-2.8px
}
.intro>p {
  font-size:14px;
  line-height:1.7;
  color:#7a8377;
  margin:0 4px 6px 0
}
.play-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) 290px;
  gap:22px;
  align-items:start
}
.game-card {
  border:1px solid #deded1;
  border-radius:14px;
  overflow:hidden;
  background:#fffef7;
  box-shadow:0 4px 0 #e9e8dd
}
.scorebar {
  height:66px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  padding:0 26px
}
.team-label {
  display:flex;
  align-items:center;
  gap:9px;
  font-size:10px;
  font-weight:800;
  letter-spacing:1px;
  min-width:0
}
.team-label>span:not(.team-dot) {
  max-width:200px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.team-label.right {
  justify-content:flex-end
}
.team-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  flex-shrink:0
}
.green {
  background:var(--club-green)
}
.gold {
  background:var(--orange)
}
.score-center {
  font-size:30px;
  font-weight:700;
  display:flex;
  gap:18px;
  align-items:center;
  font-variant-numeric:tabular-nums
}
.score-divider {
  font-size:18px;
  color:#b1b5a6;
  font-weight:400
}
.court-wrap {
  position:relative;
  background:#f1dbb5;
  aspect-ratio:12/7;
  overflow:hidden
}
canvas {
  width:100%;
  height:100%;
  display:block;
  outline:none
}
.court-top {
  position:absolute;
  top:18px;
  left:22px;
  right:18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  pointer-events:none
}
.court-tag {
  font-size:8px;
  font-weight:750;
  letter-spacing:1.7px;
  color:#527b76;
  background:#ffffff60;
  padding:7px 10px;
  border:1px solid #ffffff60;
  border-radius:5px
}
.court-button {
  pointer-events:auto;
  background:#ffffff70;
  border:1px solid #ffffff90;
  border-radius:6px;
  font-size:21px;
  line-height:1;
  padding:5px;
  color:#446b64
}
.game-overlay {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#faf4dc14,#fff3d85c 65%,#f8e4c914);
  text-align:center;
  backdrop-filter:blur(2px)
}
.overlay-content {
  padding:24px;
  max-width:440px
}
.overlay-kicker {
  font-size:8px;
  letter-spacing:2px;
  font-weight:800;
  color:#536e59
}
h2 {
  margin:0
}
.overlay-content h2 {
  font-size:44px;
  line-height:1.03;
  letter-spacing:-1.6px;
  font-weight:750;
  margin:15px 0;
  color:#294b41;
  text-shadow:0 1px #fff7
}
.overlay-content p {
  font-size:12px;
  line-height:1.6;
  color:#5c7160;
  margin:0 0 20px
}
.primary {
  background:var(--ink);
  color:#fffdf0;
  border:0;
  border-radius:7px;
  padding:15px 20px;
  font-weight:650;
  font-size:12px;
  display:flex;
  gap:36px;
  justify-content:space-between;
  align-items:center;
  transition:background .2s,transform .2s
}
.primary:hover {
  background:#34594f;
  transform:translateY(-1px)
}
.overlay-content .primary {
  margin:auto;
  min-width:180px;
  background:var(--orange)
}
.overlay-content .primary:hover {
  background:#c9633f
}
.primary span {
  font-size:17px;
  font-weight:400
}
.overlay-hint {
  display:block;
  font-size:7px;
  font-weight:750;
  letter-spacing:1.4px;
  margin-top:18px;
  color:#7e8666
}
.court-footer {
  height:43px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 22px;
  font-size:8px;
  font-weight:650;
  letter-spacing:1px;
  color:#7e8778
}
.court-footer>div {
  display:flex;
  align-items:center;
  gap:7px
}
.court-footer .live-dot {
  width:5px;
  height:5px
}
.text-button {
  background:none;
  border:0;
  font-size:11px;
  color:var(--club-green);
  padding:0;
  font-weight:650
}
.setup-card {
  border:1px solid var(--line);
  border-radius:12px;
  padding:22px;
  background:#f1f0e7;
  min-height:100%
}
.panel-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:20px
}
.panel-top .eyebrow {
  font-size:9px;
  color:#7d8574
}
.tiny-star {
  font-size:20px;
  color:var(--orange);
  line-height:12px
}
.mode-tabs {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:3px;
  padding:4px;
  background:#e6e8dc;
  border-radius:7px;
  margin-bottom:23px
}
.mode-tabs button {
  border:0;
  border-radius:5px;
  background:none;
  font-size:11px;
  padding:9px 5px;
  color:#798273;
  font-weight:650
}
.mode-tabs button.active {
  background:#fffef7;
  color:var(--ink);
  box-shadow:0 1px 3px #294b4110
}
.setup-card h2 {
  font-size:22px;
  letter-spacing:-.6px;
  font-weight:650
}
.mode-description {
  font-size:11px;
  line-height:1.65;
  color:#7d8576;
  margin:10px 0 22px
}
.field-label {
  display:block;
  font-size:8px;
  font-weight:750;
  letter-spacing:1.2px;
  color:#7b8473;
  margin:15px 0 8px
}
input,select {
  height:40px;
  border:1px solid #dcdfd1;
  border-radius:6px;
  background:#fffdf6;
  color:#405347;
  width:100%;
  padding:0 11px;
  font-size:11px;
  outline:none
}
input:focus,select:focus {
  border-color:#79a29a;
  box-shadow:0 0 0 2px #79a29a20
}
input::placeholder {
  color:#a3a795
}
select {
  padding-right:4px
}
.split-fields {
  display:flex;
  gap:10px
}
.split-fields>div {
  flex:1;
  min-width:0
}
.panel-primary {
  width:100%;
  margin-top:22px
}
.small-note {
  font-size:9px;
  line-height:1.6;
  color:#8a907f;
  text-align:center;
  margin:10px 0 0
}
.panel-bottom {
  margin-top:27px;
  padding-top:20px;
  border-top:1px solid #dddfd1;
  display:flex;
  align-items:center;
  gap:12px;
  font-size:10px;
  line-height:1.6;
  color:#949781
}
.panel-bottom strong {
  font-weight:600;
  color:#707d68
}
.little-sun {
  font-size:30px;
  color:#b3ad85
}
.below-court {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:32px 0 44px;
  max-width:calc(100% - 312px)
}
.controls-guide>.eyebrow {
  font-size:8px;
  letter-spacing:1.2px;
  color:#89917c
}
.control-items {
  display:flex;
  gap:21px;
  margin-top:14px;
  align-items:center
}
.control-items>div {
  display:flex;
  gap:4px;
  align-items:center
}
.key {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #d8dccf;
  border-bottom-width:3px;
  width:25px;
  height:25px;
  border-radius:5px;
  font-size:10px;
  background:#fcfbf5;
  color:#5b6d5d
}
.control-label {
  font-size:10px;
  color:#919781;
  margin-left:5px
}
.game-tip {
  font-size:10px;
  line-height:1.7;
  color:#8f967f;
  padding-left:27px;
  position:relative;
  margin:16px 0 0
}
.game-tip>span {
  position:absolute;
  left:0;
  font-size:24px;
  color:#c4b68a
}
.game-tip strong {
  font-weight:500;
  color:#6e7d66
}
footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-top:1px solid var(--line);
  padding:23px 0 30px;
  font-size:9px;
  color:#929883
}
footer>span:first-child {
  font-size:8px;
  font-weight:750;
  letter-spacing:1.3px
}
footer a {
  font-size:9px
}
footer a:hover {
  color:var(--orange)
}
.feedback {
  font-size:11px;
  line-height:1.5;
  color:#b34e31;
  margin:12px 0 0
}
.feedback:empty {
  display:none
}
.or-line {
  border-top:1px solid #dadfcf;
  text-align:center;
  position:relative;
  margin:24px 0 20px
}
.or-line span {
  position:relative;
  top:-6px;
  background:#f1f0e7;
  padding:0 9px;
  font-size:7px;
  letter-spacing:1px;
  color:#8f9782
}
.join-row {
  display:flex;
  gap:8px
}
.join-row input {
  text-transform:uppercase;
  min-width:0;
  letter-spacing:2px
}
.join-row button {
  background:#e1e6d6;
  border:0;
  border-radius:5px;
  font-size:11px;
  padding:0 12px;
  white-space:nowrap
}
.lobby-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px
}
.lobby-head .field-label {
  margin:0
}
.lobby-head .text-button {
  font-size:9px
}
.lobby-list {
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:8px;
  max-height:196px;
  overflow-y:auto
}
.lobby-empty {
  border:1px dashed #cfd4c3;
  border-radius:7px;
  color:#8a907f;
  font-size:9px;
  line-height:1.6;
  margin:0;
  padding:12px 10px;
  text-align:center
}
.lobby-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:3px 8px;
  width:100%;
  padding:9px 10px;
  border:1px solid #d8dccf;
  border-bottom-width:3px;
  border-radius:7px;
  background:#fcfbf5;
  color:var(--ink);
  font-size:10px;
  text-align:left
}
.lobby-row:hover {
  border-color:#9fb8a6;
  background:#fffef9
}
.lobby-row-head {
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0
}
.lobby-row-head strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
  font-weight:650
}
.lobby-code {
  flex:none;
  margin-left:auto;
  color:#8a907f;
  font-size:8px;
  letter-spacing:1px
}
.lobby-row-meta {
  grid-column:1;
  color:#8a907f;
  font-size:8px;
  letter-spacing:.3px
}
.lobby-state {
  grid-column:2;
  grid-row:1/3;
  align-self:center;
  justify-self:end;
  border-radius:20px;
  padding:4px 7px;
  background:#e4ead9;
  color:#5f7d5c;
  font-size:7px;
  font-weight:750;
  letter-spacing:1px
}
.lobby-state.playing {
  background:#f3e2d8;
  color:#a5583c
}
.room-code-block {
  border:1px dashed #b3c5ae;
  border-radius:7px;
  padding:12px;
  margin-top:18px
}
.room-code-block .field-label {
  margin:0 0 10px
}
.room-code-block>div {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  justify-content:space-between
}
.room-code-block strong {
  font-size:20px;
  letter-spacing:3px
}
.room-code-block button {
  font-size:9px
}
.roster-player {
  padding:10px 0;
  border-bottom:1px solid #e0e3d6;
  display:flex;
  align-items:center;
  gap:7px;
  font-size:10px
}
.roster-player small {
  color:#8e9683;
  margin-left:auto;
  font-size:8px
}
.roster-player .team-dot {
  width:6px;
  height:6px
}
.leave {
  display:block;
  margin:16px auto;
  color:#929880;
  font-size:10px
}
.rally-toast {
  position:absolute;
  top:17%;
  left:50%;
  transform:translateX(-50%);
  font-size:15px;
  font-weight:750;
  letter-spacing:.5px;
  background:#fffdf0e8;
  color:var(--ink);
  padding:10px 20px;
  border-radius:40px;
  box-shadow:0 3px 15px #294b4110;
  pointer-events:none;
  white-space:nowrap;
  opacity:0;
  transition:opacity .2s
}
.rally-toast.visible {
  opacity:1
}
.touch-controls {
  position:absolute;
  bottom:18px;
  left:18px;
  right:18px;
  display:none;
  gap:9px;
  pointer-events:none
}
.touch-controls button {
  pointer-events:auto;
  width:54px;
  height:48px;
  border-radius:12px;
  border:1px solid #fffc;
  background:#fff8dc90;
  color:#34554a;
  font-size:24px;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
  backdrop-filter:blur(6px)
}
.touch-controls button:active,.touch-controls button.pressed {
  background:#fff6ce
}
.touch-controls .touch-jump {
  margin-left:auto;
  width:65px
}
.touch-jump small {
  font-size:7px;
  display:inline-block;
  vertical-align:middle
}
.playing .touch-controls {
  display:none
}
dialog {
  border:1px solid var(--line);
  border-radius:18px;
  padding:40px;
  background:var(--paper);
  color:var(--ink);
  max-width:480px;
  width:calc(100% - 32px);
  box-shadow:0 20px 100px #1239
}
dialog::backdrop {
  background:#183b3680;
  backdrop-filter:blur(6px)
}
dialog h2 {
  font-size:30px;
  line-height:1.15;
  letter-spacing:-1px;
  margin:16px 0 20px
}
dialog p {
  font-size:12px;
  line-height:1.8;
  color:#6f7b69
}
dialog .primary {
  width:100%;
  margin-top:24px
}
.dialog-close {
  position:absolute;
  right:20px;
  top:14px
}
@media(min-width:1550px) {
  .site-header,main {
    max-width:1500px
  }
  .intro {
    padding-top:50px
  }
  .play-layout {
    grid-template-columns:minmax(0,1fr) 310px
  }
  .below-court {
    max-width:calc(100% - 332px)
  }
}
@media(max-width:1100px) {
  main {
    padding:0 32px
  }
  .site-header {
    padding:0 32px
  }
  .play-layout {
    grid-template-columns:minmax(0,1fr) 255px;
    gap:16px
  }
  .setup-card {
    padding:18px
  }
  .overlay-content h2 {
    font-size:35px
  }
  .below-court {
    max-width:calc(100% - 271px)
  }
  .game-tip {
    display:none
  }
  .header-caption {
    font-size:8px
  }
  h1 {
    font-size:50px
  }
  .intro {
    padding:32px 0
  }
  .scorebar {
    height:56px;
    padding:0 18px
  }
  .panel-bottom {
    margin-top:20px
  }
}
@media(max-width:800px) {
  main {
    padding:0 20px
  }
  .site-header {
    padding:0 20px;
    height:78px
  }
  .header-caption {
    display:none
  }
  .header-actions {
    gap:16px
  }
  .brand {
    font-size:28px
  }
  .intro {
    padding:30px 0 24px
  }
  h1 {
    font-size:43px
  }
  .intro .eyebrow {
    font-size:8px;
    letter-spacing:1px
  }
  .intro>p {
    font-size:11px;
    line-height:1.7
  }
  .play-layout {
    grid-template-columns:minmax(0,1fr)
  }
  .setup-card {
    min-height:0;
    padding:22px;
    display:block
  }
  .panel-bottom {
    display:none
  }
  .mode-tabs {
    margin-bottom:18px
  }
  .setup-card h2 {
    font-size:23px
  }
  .mode-description {
    margin-bottom:15px
  }
  .below-court {
    max-width:none;
    margin:28px 0 30px
  }
  .game-tip {
    display:block
  }
  .overlay-content h2 {
    font-size:42px
  }
  .scorebar {
    height:60px
  }
  .court-footer {
    height:40px
  }
  .panel-primary {
    margin-top:18px
  }
  .split-fields {
    max-width:none
  }
  .intro>p {
    display:none
  }
  .setup-card .panel-top {
    margin-bottom:14px
  }
  footer>span:nth-child(2) {
    display:none
  }
}
@media(max-width:480px) {
  main {
    padding:0 14px
  }
  .site-header {
    padding:0 17px;
    height:70px
  }
  .brand {
    font-size:25px
  }
  .brand-ball {
    width:30px;
    height:30px;
    font-size:32px;
    line-height:29px
  }
  .header-actions {
    gap:12px
  }
  .icon-button {
    font-size:10px
  }
  .intro {
    padding-top:27px
  }
  h1 {
    font-size:42px
  }
  .overlay-content {
    padding:12px
  }
  .overlay-content h2 {
    font-size:30px;
    margin:9px 0
  }
  .overlay-kicker {
    font-size:6px;
    letter-spacing:1.5px
  }
  .overlay-content p {
    font-size:9px;
    margin-bottom:12px
  }
  .overlay-content .primary {
    padding:11px 16px;
    min-width:150px;
    font-size:10px
  }
  .overlay-hint {
    font-size:6px;
    margin-top:12px
  }
  .court-tag {
    font-size:6px;
    padding:5px 7px
  }
  .court-top {
    left:12px;
    right:12px;
    top:11px
  }
  .court-button {
    font-size:17px
  }
  .scorebar {
    height:51px;
    padding:0 13px
  }
  .team-label {
    font-size:8px;
    letter-spacing:.5px;
    gap:6px
  }
  .score-center {
    font-size:25px;
    gap:12px
  }
  .court-footer {
    font-size:6px;
    padding:0 12px;
    height:34px
  }
  .control-items {
    gap:13px
  }
  .key {
    width:22px;
    height:23px;
    font-size:8px
  }
  .control-label {
    font-size:8px;
    margin-left:2px
  }
  .game-tip {
    display:none
  }
  .controls-guide>.eyebrow {
    font-size:7px
  }
  .rally-toast {
    font-size:11px;
    padding:7px 13px
  }
  .touch-controls {
    bottom:9px;
    left:9px;
    right:9px
  }
  .touch-controls button {
    height:39px;
    width:43px;
    font-size:20px;
    border-radius:9px
  }
  .touch-controls .touch-jump {
    width:57px
  }
  dialog {
    padding:30px 24px
  }
  footer {
    font-size:7px
  }
  footer>span:first-child,footer a {
    font-size:7px
  }
  .court-wrap {
    width:100%;
    min-height:0;
    aspect-ratio:12/7
  }
}
@media(pointer:coarse) {
  .playing .touch-controls {
    display:flex
  }
  .playing.local .touch-controls {
    display:none
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
    scroll-behavior:auto!important
  }
}

.match-extras { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; padding:11px 22px; background:#f1f0e7; border-top:1px solid #e4e5d8; color:#708373; font-size:8px; font-weight:700; letter-spacing:.8px; }
.paused .touch-controls { display:none!important; }
@media(max-width:480px) { .match-extras { padding:10px 12px; font-size:6px; letter-spacing:.3px; } .court-footer { gap:6px; flex-wrap:wrap; height:auto; min-height:34px; padding-top:8px; padding-bottom:8px; } }

.court-actions { display:flex; align-items:center; gap:12px; }
.ping-meter { padding:7px 10px; border-radius:999px; background:#fff8e8ed; color:#236653; font-size:11px; font-weight:800; font-variant-numeric:tabular-nums; white-space:nowrap; border:1px solid currentColor; }
.ping-meter[data-quality="medium"] { color:#95620b; }
.ping-meter[data-quality="high"] { color:#ad403b; }
.ping-meter[data-quality="waiting"] { color:#667879; }

.charm-toggle {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:16px 0 2px;
  padding:10px 12px;
  border:1px solid #dcdfd1;
  border-radius:8px;
  background:#fffdf6;
  cursor:pointer;
}
.charm-toggle .field-label { margin:0 0 3px; }
.charm-toggle small { display:block; font-size:9px; line-height:1.4; color:#8a907f; }
.charm-toggle .switch {
  position:relative;
  width:34px;
  height:20px;
  flex:0 0 auto;
}
.charm-toggle input {
  position:absolute;
  inset:0;
  width:34px;
  height:20px;
  margin:0;
  padding:0;
  border:0;
  background:none;
  opacity:0;
  cursor:pointer;
  z-index:2;
}
.charm-toggle .switch-ui {
  position:absolute;
  inset:0;
  border-radius:12px;
  background:#d8dccf;
  transition:background .15s;
}
.charm-toggle .switch-ui::after {
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#fffdf6;
  box-shadow:0 1px 2px #294b4120;
  transition:transform .15s;
}
.charm-toggle input:checked + .switch-ui { background:#329b98; }
.charm-toggle input:checked + .switch-ui::after { transform:translateX(14px); }
.charm-toggle input:disabled + .switch-ui { opacity:.55; cursor:not-allowed; }
.charm-toggle input:focus-visible + .switch-ui { outline:2px solid #79a29a; outline-offset:2px; }
.replay-toggles { display:grid; gap:8px; margin-top:10px; }
.replay-toggles .charm-toggle { margin:0; }
#charm-stat { white-space:nowrap; }
#charm-stat[data-active="true"] { color:#b65c53; }
#charm-stat[data-active="pending"] { color:#95620b; }

.chat-composer { position:absolute; z-index:14; bottom:14px; left:50%; transform:translateX(-50%); width:min(380px,calc(100% - 24px)); padding:12px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--ink); box-shadow:0 5px 20px #0004; }
.chat-composer label { display:block; font-size:9px; font-weight:800; letter-spacing:1px; margin-bottom:7px; }
.chat-composer>div { display:flex; gap:8px; }
.chat-composer input { min-width:0; flex:1; font-size:16px; }
.chat-composer button { border:0; border-radius:4px; background:var(--club-green); color:var(--paper); font-weight:800; padding:0 12px; }
.chat-composer small { display:block; margin-top:7px; font-size:10px; }

.court-actions .chat-toggle { font-size:11px; font-weight:750; padding:8px; }


.replay-bar { position:absolute; z-index:11; left:12px; right:12px; bottom:16px; display:flex; align-items:center; gap:14px; padding:12px 16px; border:1px solid #ffffff45; border-radius:9px; background:#14272bf2; color:#fff9e7; box-shadow:0 5px 20px #0004; }
.replay-bar>div { display:flex; flex-direction:column; gap:5px; flex:1; min-width:0; }
.replay-badge { color:#f5d164; font-size:10px; font-weight:900; letter-spacing:2px; }
#replay-title { font-size:11px; font-weight:800; }
#replay-progress { width:18%; height:5px; accent-color:#f5d164; }
#replay-skip { padding:10px 13px; border:1px solid #ffffff65; border-radius:5px; color:#fff9e7; background:#ffffff10; font:inherit; font-size:12px; cursor:pointer; }
#replay-skip:disabled { opacity:.75; cursor:default; }
#replay-skip:focus-visible { outline:2px solid #f5d164; outline-offset:3px; }
body.replaying .touch-controls, body.replaying #rally-toast { visibility:hidden; }
@media(max-width:600px) { .replay-bar { padding:10px; gap:8px; bottom:10px; flex-wrap:wrap; } .replay-bar>div { flex-basis:100%; } #replay-progress { flex:1; } #replay-skip { font-size:11px; } }


/* Hand-inked arcade announcements; the bitmap supplies texture, HTML the type. */
.replay-transition { --phase-progress:0; position:absolute; inset:0; z-index:10; display:grid; place-items:center; overflow:hidden; isolation:isolate; pointer-events:none; background:radial-gradient(ellipse at center,#0b171c55,#071015b8); }
.transition-emblem { width:min(94%,920px); position:relative; aspect-ratio:3/1; filter:drop-shadow(0 12px 16px #0009); }
.transition-art { position:absolute; width:100%; height:100%; object-fit:contain; }
.transition-copy { position:absolute; inset:10% 4%; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:clamp(3px,.8vw,10px); color:#fff1c8; text-align:center; transform:rotate(-3deg); }
.transition-copy>span { color:#f5cf68; font-size:clamp(8px,1.15vw,15px); font-weight:900; letter-spacing:.3em; }
.transition-copy>strong { font-family:Impact,'Arial Black',sans-serif; font-size:clamp(32px,6.8vw,86px); line-height:1; font-style:italic; letter-spacing:.025em; text-shadow:3px 4px #06100a,-1px -1px #06100a,0 0 22px #f7d77445; }
.transition-copy>small { font-size:clamp(8px,1vw,12px); font-weight:800; letter-spacing:.15em; }
.transition-sweep { position:absolute; inset:-80%; z-index:-1; opacity:.3; background:linear-gradient(115deg,transparent 40%,#efd18638 48%,#fff2bd99 50%,transparent 57%); transform:translateX(-60%); }
.transition-meter { position:absolute; left:30%; right:30%; bottom:17%; height:3px; background:#fff3; overflow:hidden; }
.transition-meter i { display:block; height:100%; background:#f6d16a; transform-origin:left; transform:scaleX(calc(1 - var(--phase-progress))); box-shadow:0 0 10px #f6d16a; }
.replay-transition[data-phase="outro"] { background:radial-gradient(ellipse at center,#0d262d55,#071015a8); }
.replay-transition[data-phase="outro"] .transition-copy>span { color:#a9d6b1; }
.replay-transition.is-active .transition-emblem { animation:replay-impact 1s both; }
.replay-transition.is-active .transition-sweep { animation:replay-sweep 1s both; }
.highlight-callout { position:absolute; z-index:9; top:15%; left:50%; width:min(400px,68%); aspect-ratio:3/1; transform:translateX(-50%) rotate(-4deg); pointer-events:none; filter:drop-shadow(0 6px 6px #0008); }
.highlight-callout>img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.highlight-callout>div { position:absolute; inset:14% 6%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; color:#fff0c3; text-align:center; }
#highlight-player { max-width:90%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:clamp(8px,1vw,11px); font-weight:800; letter-spacing:.16em; color:#f4cf76; text-transform:uppercase; }
#highlight-title { font-family:Impact,'Arial Black',sans-serif; font-size:clamp(17px,2.5vw,30px); font-weight:900; font-style:italic; line-height:1; letter-spacing:.035em; text-shadow:2px 3px #08160b; }
.highlight-spark { position:absolute; left:50%; top:50%; width:5px; height:5px; border-radius:1px; background:#f5d371; opacity:0; }
.spark-one { --dx:-160px; --dy:-45px; }.spark-two { --dx:150px; --dy:-38px; }.spark-three { --dx:-120px; --dy:40px; }.spark-four { --dx:135px; --dy:42px; }
.highlight-callout.is-active { animation:highlight-pop 1.2s both; }
.highlight-callout.is-active .highlight-spark { animation:highlight-spark .55s ease-out both; }
@keyframes replay-impact { 0% { opacity:0; transform:scale(1.35) rotate(-7deg); } 16% { opacity:1; transform:scale(.97) rotate(1deg); } 26%,78% { opacity:1; transform:scale(1) rotate(0); } 100% { opacity:0; transform:scale(1.06) translateX(22px); } }
@keyframes replay-sweep { 0% { transform:translateX(-60%); } 100% { transform:translateX(60%); } }
@keyframes highlight-pop { 0% { opacity:0; transform:translateX(-50%) translateY(9px) scale(.65) rotate(-9deg); } 14% { opacity:1; transform:translateX(-50%) scale(1.08) rotate(-3deg); } 25%,78% { opacity:1; transform:translateX(-50%) scale(1) rotate(-4deg); } 100% { opacity:0; transform:translateX(-50%) translateY(-12px) scale(.97) rotate(-4deg); } }
@keyframes highlight-spark { 0% { opacity:0; transform:translate(0,0) scale(.5); } 18% { opacity:1; } 100% { opacity:0; transform:translate(var(--dx),var(--dy)) rotate(130deg) scale(0); } }
@media(max-width:600px) { .transition-copy { gap:4px; }.transition-copy>strong { font-size:clamp(28px,7.3vw,42px); }.transition-copy>span { font-size:8px; letter-spacing:.2em; }.transition-copy>small { font-size:7px; }.transition-meter { bottom:14%; left:25%; right:25%; }.highlight-callout { top:17%; width:75%; }#highlight-title { font-size:clamp(16px,4.3vw,24px); } }
@media(prefers-reduced-motion:reduce) { .replay-transition.is-active .transition-emblem,.replay-transition.is-active .transition-sweep,.highlight-callout.is-active,.highlight-callout.is-active .highlight-spark { animation:none; }.transition-sweep,.highlight-spark { display:none; } }

body.replaying .highlight-callout { top:0; width:min(300px,58%); z-index:11; }
body.replaying #highlight-title { font-size:clamp(15px,2vw,24px); }

#watch-match { display:block; margin:14px auto 0; color:inherit; }
.match-controls { position:absolute; z-index:15; left:12px; right:12px; bottom:12px; padding:12px; border:1px solid #f3d47766; border-radius:8px; background:#10221af2; color:#fff0c3; }
.match-controls>div { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }.match-controls strong { font-size:11px; }.match-controls input { width:100%; accent-color:#e8c561; margin:12px 0; }.match-controls button,.match-controls select { background:#263b2e; color:#fff0c3; border:1px solid #f3d47766; border-radius:4px; padding:7px; font-size:12px; }.match-controls button:disabled,.match-controls select:disabled { opacity:.55; }

.lobby-actions { display:flex; gap:8px; grid-column:1 / -1; margin-top:6px; }
.lobby-actions button { flex:1; font-size:11px; padding:7px; }
body.spectating .touch-controls { display:none!important; }

.spectator-chat { position:absolute; z-index:13; top:58px; left:50%; transform:translateX(-50%); width:min(600px,calc(100% - 32px)); pointer-events:none; display:grid; gap:5px; }
.spectator-chat p { margin:0; padding:7px 11px; border:1px solid #a6b98b66; border-radius:6px; background:#142017eb; color:#f1ead3; font-size:clamp(11px,1.2vw,14px); line-height:1.4; overflow-wrap:anywhere; box-shadow:0 2px 8px #0004; }
.spectator-chat strong { color:#efd28a; }
@media(max-width:600px) { .spectator-chat { top:44px; gap:3px; } .spectator-chat p { padding:4px 7px; line-height:1.25; } .spectator-chat p:nth-last-child(n+3) { display:none; } }

.custom-slot { flex-wrap:wrap; }
.custom-slot select { flex:0 0 100%; min-width:0; height:32px; margin-top:3px; font-size:11px; }

/* A draggable thumbstick replaces the three movement keys. */
.touch-controls { align-items:center; left:max(6px,env(safe-area-inset-left)); right:max(6px,env(safe-area-inset-right)); bottom:max(6px,env(safe-area-inset-bottom)); }
.touch-stick { position:relative; flex:0 0 auto; width:100px; height:100px; border-radius:50%; border:1px solid #e6ce7866; background:#17231945; box-shadow:inset 0 0 0 16px #edcf7e0b; pointer-events:auto; touch-action:none; user-select:none; -webkit-user-select:none; }
.touch-stick::before,.touch-stick::after { content:''; position:absolute; background:#edd89735; left:20%; right:20%; top:50%; height:1px; }
.touch-stick::after { transform:rotate(90deg); }
.touch-stick-knob { position:absolute; left:30%; top:30%; width:40%; height:40%; border-radius:50%; background:#d9c47e70; border:1px solid #f7df99a8; box-shadow:0 2px 8px #0004; pointer-events:none; }
.touch-stick.pressed { border-color:#f7df99aa; }
.touch-controls .touch-jump { width:72px; height:72px; border-radius:50%; opacity:.7; }
.touch-controls .touch-jump.pressed { opacity:1; }
#screen-pause { display:none; }
body.immersive { overflow:hidden; }
body.immersive .game-card,[data-theme="camorasta"] .game-card:fullscreen {
  --court-height:calc(100dvh - 56px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  --court-width:calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
  position:fixed; inset:0; width:100%; height:100dvh; max-width:none; margin:0;
  box-sizing:border-box; padding:calc(40px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  border:0; border-radius:0; box-shadow:none; background:#111910; z-index:100; display:grid; place-items:center;
}
body.immersive .game-card .court-wrap,[data-theme="camorasta"] .game-card:fullscreen .court-wrap {
  width:min(var(--court-width),calc(var(--court-height) * 1200 / 610)); height:auto; aspect-ratio:1200/610; min-height:0; margin:0; flex:none;
}
body.immersive .game-card .scorebar,[data-theme="camorasta"] .game-card:fullscreen .scorebar {
  position:absolute; top:max(4px,env(safe-area-inset-top)); left:50%; transform:translateX(-50%); z-index:5;
  width:auto; height:36px; min-height:0; padding:2px 14px; border-radius:24px; background:#101b14b8; pointer-events:none;
}
body.immersive .game-card .score-center,[data-theme="camorasta"] .game-card:fullscreen .score-center { font-size:26px; line-height:1; gap:12px; }
body.immersive .game-card :is(.team-label,.court-footer,.match-extras),[data-theme="camorasta"] .game-card:fullscreen :is(.team-label,.court-footer,.match-extras) { display:none; }
body.immersive .game-card .touch-controls,[data-theme="camorasta"] .game-card:fullscreen .touch-controls { position:fixed; }
body.immersive .game-card .court-top,[data-theme="camorasta"] .game-card:fullscreen .court-top {
  position:fixed; top:max(5px,env(safe-area-inset-top)); left:max(6px,env(safe-area-inset-left)); right:max(6px,env(safe-area-inset-right)); z-index:6;
}
body.immersive #screen-pause,.game-card:fullscreen #screen-pause { display:block; }
@media(max-height:450px) { .touch-stick { width:84px; height:84px; } .touch-controls .touch-jump { width:64px; height:64px; } }

.touch-options { position:absolute; left:0; bottom:calc(100% + 8px); display:flex; gap:5px; }
.touch-controls .touch-options button { width:auto; height:32px; padding:0 10px; border-radius:16px; font-size:11px; }
.touch-options button[aria-pressed="true"] { box-shadow:inset 0 0 0 1px #f3da89; }
body.immersive .court-tag,.game-card:fullscreen .court-tag { visibility:hidden; }

/* Leave room for phone browser chrome, notches and the bottom gesture area. */
@media(pointer:coarse) {
  body.immersive .game-card,[data-theme="camorasta"] .game-card:fullscreen {
    --court-height:calc(100svh - 108px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    --court-width:calc(100svw - 48px - env(safe-area-inset-left) - env(safe-area-inset-right));
    height:100svh;
    padding:calc(44px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(64px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
  }
  body.immersive .game-card .touch-controls,[data-theme="camorasta"] .game-card:fullscreen .touch-controls {
    top:0; bottom:auto; height:100svh; box-sizing:border-box; align-items:flex-end;
    left:max(12px,env(safe-area-inset-left)); right:max(12px,env(safe-area-inset-right));
    padding-bottom:calc(24px + env(safe-area-inset-bottom));
  }
  body.immersive .touch-options,.game-card:fullscreen .touch-options {
    bottom:calc(132px + env(safe-area-inset-bottom));
  }
  @media(max-height:450px) {
    body.immersive .touch-options,.game-card:fullscreen .touch-options {
      bottom:calc(116px + env(safe-area-inset-bottom));
    }
  }
}

/* Fullscreen score pill: labels are hidden, so centre the score instead of leaving it in grid column 1. */
body.immersive .game-card .scorebar,[data-theme="camorasta"] .game-card:fullscreen .scorebar { display:flex; justify-content:center; align-items:center; grid-template-columns:none; }
body.immersive .game-card .score-center,[data-theme="camorasta"] .game-card:fullscreen .score-center { letter-spacing:0; padding-left:.06em; }

/* Fullscreen score pill: same green-to-gold look as the score bar, rounder, with side markers. */
html body.immersive .game-card .scorebar,html body[data-theme="camorasta"] .game-card:fullscreen .scorebar {
  height:44px!important; padding:0 24px!important; border-radius:999px!important;
  background:linear-gradient(90deg,#24402ce6 0%,#141c16ee 32%,#141c16ee 68%,#3a2f1ce6 100%)!important;
  border:1px solid #c3a45488!important; box-shadow:0 6px 20px #0009,inset 0 1px 0 #ffffff14; backdrop-filter:blur(6px);
}
html body.immersive .game-card .score-center,html body[data-theme="camorasta"] .game-card:fullscreen .score-center { font-size:30px; letter-spacing:.04em; gap:14px; text-shadow:0 2px 8px #000a; }
html body.immersive .game-card .score-divider,html body[data-theme="camorasta"] .game-card:fullscreen .score-divider { color:#c3a454; font-size:20px; }
html body.immersive .game-card .score-center::before,html body[data-theme="camorasta"] .game-card:fullscreen .score-center::before,
html body.immersive .game-card .score-center::after,html body[data-theme="camorasta"] .game-card:fullscreen .score-center::after { content:''; width:9px; height:9px; border-radius:50%; flex:none; }
html body.immersive .game-card .score-center::before,html body[data-theme="camorasta"] .game-card:fullscreen .score-center::before { border:2px solid #d9dec7; }
html body.immersive .game-card .score-center::after,html body[data-theme="camorasta"] .game-card:fullscreen .score-center::after { background:#fbf6e7; }

/* Replay bars never cover the court. Windowed: they sit under the court and take the place of the status strip while a replay plays.
   Fullscreen: they sit in the free space beneath the court. */
.game-card:has(.replay-bar:not([hidden]),.match-controls:not([hidden])) .court-footer { display:none; }
.game-card .replay-bar,.game-card .match-controls {
  position:static; z-index:auto; left:auto; right:auto; bottom:auto; margin:0; min-height:44px;
  display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; padding:6px 16px;
  border:0; border-top:1px solid #ffffff22; border-radius:0; box-shadow:none; backdrop-filter:none; background:#14272b;
}
.game-card .replay-bar>div { flex-direction:row; align-items:baseline; gap:10px; }
.game-card .match-controls { background:#10221a; border-top-color:#f3d47744; }
.game-card .match-controls>div { flex:0 0 auto; gap:12px; }
.game-card .match-controls input { flex:1 1 160px; width:auto; min-width:120px; margin:0; }
body.immersive .game-card .replay-bar,body.immersive .game-card .match-controls,
[data-theme="camorasta"] .game-card:fullscreen .replay-bar,[data-theme="camorasta"] .game-card:fullscreen .match-controls {
  position:absolute; z-index:15; left:12px; right:12px; bottom:10px; border:1px solid #f3d47766; border-radius:9px; padding:8px 14px; background:#10221af2; backdrop-filter:blur(10px); box-shadow:0 8px 22px #0008;
}
body.immersive .game-card .replay-bar,[data-theme="camorasta"] .game-card:fullscreen .replay-bar { background:#14272bf2; border-color:#ffffff45; }
@media(max-height:520px) {
  body.immersive .game-card .replay-bar,body.immersive .game-card .match-controls,
  [data-theme="camorasta"] .game-card:fullscreen .replay-bar,[data-theme="camorasta"] .game-card:fullscreen .match-controls { bottom:4px; padding:4px 12px; min-height:0; }
}

/* Match-replay panel: one slim row, like the instant replay bar. */
.game-card .match-controls>div { flex-wrap:nowrap; align-items:center; }
.game-card .match-controls select { width:auto; min-width:64px; max-width:170px; height:30px; padding:2px 8px; margin:0; }
.game-card .match-controls #match-handoff:empty { display:none; }
.game-card .match-controls button { height:30px; padding:2px 12px; white-space:nowrap; }
.game-card .match-controls label { display:flex; align-items:center; gap:6px; font-size:11px; white-space:nowrap; margin:0; }
.game-card .match-controls strong { white-space:nowrap; }
.game-card .match-controls #match-time { font-size:11px; white-space:nowrap; min-width:64px; text-align:center; }
@media(max-width:900px) { .game-card .match-controls>div { flex-wrap:wrap; } .game-card .match-controls input { flex-basis:100%; order:3; } }
