:root {
  color-scheme: dark;
  font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  color: #f9f2d9;
  background: #172720;
  --paper: #fff3d3;
  --ink: #172720;
  --gold: #f6cc5e;
  --rose: #ee8292;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-width: 0;
  background-color: #172720;
  background-image: repeating-linear-gradient(15deg, #f8efc407 0 1px, transparent 1px 5px),
    repeating-linear-gradient(104deg, #11231973 0 1px, transparent 1px 4px);
}
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid #fff4bc; outline-offset: 3px; }
.poster { display: grid; grid-template-columns: clamp(136px, 11vw, 203px) minmax(0, 1fr); margin: 18px 22px 0 0; }
.club { display: grid; align-content: space-between; justify-items: start; padding: 18px 19px; }
.club span { display: block; font-size: .875rem; }
.club-mark { font-weight: 950; color: var(--gold); font-size: 2.2rem; line-height: .96; letter-spacing: -.08em; }
.club-mark span { margin-top: 8px; }
.club-mark span, .club-goal span, .club-record span { letter-spacing: 0; }
.club-record { width: 100%; padding: 14px 0; border-top: 1px dashed #7c8960; border-bottom: 1px dashed #7c8960; }
.club-record strong { display: block; font-size: 3.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.club-record span:last-child { color: #d9e3cb; margin-top: 10px; }
.club-goal b { display: block; font-size: 2rem; }
.gym {
  position: relative; isolation: isolate; overflow: hidden;
  height: calc(100dvh - 36px); min-height: 480px;
  background: #788e79; border: 1px solid #aeb391;
  touch-action: none; user-select: none; -webkit-touch-callout: none;
  border-radius: 20px 20px 7px 7px;
}
.gym:focus-visible { outline-offset: -5px; }
.gym canvas, .overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.gym button { -webkit-tap-highlight-color: transparent; }
.arena-tools { display: flex; position: absolute; z-index: 4; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); gap: 5px; }
.icon { width: 47px; height: 47px; display: grid; place-items: center; padding: 0; border: 1px solid #d5cc9d; border-radius: 12px; background: #263d31; font-size: 24px; }
.icon svg { width: 22px; height: 22px; }
.board {
  display: flex; justify-content: center; position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  border: 1px solid #c5cb9a; border-radius: 12px; overflow: hidden; background: var(--ink);
  text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 3px #344c3999;
}
.board > div { min-width: 69px; padding: 7px 9px; display: flex; flex-direction: column; line-height: 1; }
.board > .time { min-width: 74px; }
.board span { font-size: .875rem; font-weight: 750; margin: 3px 0; }
.board strong { font-size: 1.65rem; }
.home { color: var(--gold); }
.away { color: var(--rose); }
.overlay { display: grid; place-items: center; pointer-events: none; z-index: 2; }
.gym[data-state="menu"] .overlay { transform: translateY(-11%); }
.gym[data-state="paused"] .overlay, .gym[data-state="won"] .overlay, .gym[data-state="over"] .overlay { background: #122b1d45; }
.panel {
  pointer-events: auto; text-align: center; display: grid; justify-items: stretch; gap: 9px;
  width: min(326px, calc(100% - 38px)); padding: 21px; border: 1px solid #eee9b9; border-radius: 19px;
  background: var(--ink); color: var(--paper); box-shadow: 0 6px 0 #152c2380, inset 0 0 0 4px #52745b5c;
}
.panel h2 { font-size: clamp(2.4rem, 5vw, 3.5rem); margin: 0 0 4px; line-height: .98; letter-spacing: -.07em; font-weight: 950; }
.panel-label { font-size: .875rem; color: #d9deae; font-weight: 800; margin: 0; letter-spacing: .075em; }
.panel button, .levels label { min-height: 44px; border: 1px solid #73846d; border-radius: 10px; font-weight: 850; overflow-wrap: anywhere; }
.primary { background: var(--gold); color: var(--ink); font-size: 1.18rem; box-shadow: inset 0 -3px 0 #a36a33ab; }
.primary:hover { background: #ffdc7f; }
.primary:active { box-shadow: inset 0 2px 0 #a36a33ab; }
.secondary, .segmented button, .toggles button { background: #273f32; font-size: .875rem; }
.segmented, .result-actions, .toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.segmented button[aria-pressed="true"], .toggles button[aria-pressed="true"] { background: #d5deb4; color: var(--ink); }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 0; border: 0; margin: 0; }
.levels label { display: grid; place-items: center; position: relative; font-size: .875rem; color: #eceecb; cursor: pointer; }
.levels label:has(:checked) { color: var(--gold); border-color: var(--gold); }
.levels label:has(:focus-visible) { outline: 3px solid var(--gold); }
.levels input { position: absolute; opacity: 0; }
.result-score { font-size: 2.4rem; font-weight: 950; margin: 0; color: var(--gold); line-height: 1; }
.result-score span { color: var(--paper); }
.court-caption {
  position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); pointer-events: none;
  color: var(--paper); display: flex; align-items: baseline; gap: 14px;
}
.court-caption h1 { margin: 0; font-size: clamp(1.8rem, 4.3vw, 4.1rem); line-height: 1; letter-spacing: -.07em; font-weight: 950; }
.court-caption span { font-size: .875rem; font-weight: 800; color: #e6d4a9; }
.rules-link { display: none; }
.message {
  position: absolute; z-index: 1; top: 82px; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); text-align: center; color: #172720;
  background: #faf0cf; padding: 7px 12px; font-size: .875rem; font-weight: 850; border-radius: 8px;
  line-height: 1.4; white-space: pre-line; pointer-events: none;
}
.pads { position: absolute; z-index: 1; bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; right: 12px; display: grid; gap: 5px; }
.pad { display: grid; grid-template-columns: 51px 51px 60px 62px 65px; gap: 5px; justify-content: center; }
.pad-team { display: none; }
.duel .pad { row-gap: 3px; }
.duel .pad-team {
  display: block; grid-column: 1 / -1; justify-self: start; padding: 2px 6px;
  background: #243a2d; border-radius: 4px; font-size: .875rem; font-weight: 850; line-height: 1;
}
.duel .pad[data-side="0"] button { border-color: var(--gold); }
.duel .pad[data-side="1"] button { border-color: var(--rose); }
.pad button {
  min-width: 44px; height: 48px; border: 1px solid #f4e3b2; border-radius: 12px; padding: 0 2px;
  background: #243a2d; font-size: .875rem; font-weight: 850; touch-action: none;
}
.pad button[data-input="jump"] { background: #44634d; }
.pad button[data-input="shoot"] { background: var(--gold); color: var(--ink); }
.pad button.is-ready { outline: 2px solid #e6ffc7; outline-offset: 2px; }
.pad[data-side="1"] button[data-input="shoot"] { background: var(--rose); }
.pad button.is-held { transform: translateY(2px); background: #fff0bf; color: var(--ink); }
.gym.checking .pad button { opacity: .63; }
.gym:fullscreen, .gym.full-window { width: 100%; height: 100dvh; min-height: 0; border: 0; border-radius: 0; }
.gym.full-window { position: fixed; inset: 0; z-index: 20; }
body.locked { overflow: hidden; }
.footer { position: relative; display: grid; min-height: 132px; overflow: hidden; place-items: end center; padding: 30px 18px 13px; }
.footer-scene { position: absolute; inset: 0; pointer-events: none; }
.footer-scene svg { width: 100%; height: 100%; display: block; }
.footer nav { position: relative; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; }
.footer a, .club a { color: var(--paper); text-underline-offset: .24em; }
.footer a { display: grid; place-items: center; min-height: 44px; padding: 0 6px; }
.language-switch {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0 4px;
  margin: 0 auto; padding: 6px 12px; width: min(1050px, 100%);
}
.language-switch a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px;
  color: var(--paper); text-underline-offset: .24em;
}
.language-switch [aria-current] { color: var(--gold); font-weight: 850; }
.footer nav > span { flex-basis: 100%; text-align: center; color: #e6d4a9; }
.club-record, .panel h2 { overflow-wrap: anywhere; }
html:lang(pt) .pad { grid-template-columns: 46px 46px 53px 57px 82px; }
.court-notes {
  display: grid; width: min(1050px, calc(100% - 34px)); margin: clamp(20px, 5vw, 70px) auto 60px;
  grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px 14px;
}
.note { min-width: 0; border-top: 2px solid #8e9567; padding-top: 14px; }
.note-left { grid-column: 1 / 9; }
.note-right { grid-column: 5 / -1; }
.note h2, .info-page h2 {
  color: var(--paper); font-size: clamp(1.35rem, 3.8vw, 2.45rem); letter-spacing: -.038em; font-weight: 900; line-height: 1.07;
  margin: 0 0 12px;
}
.note p, .note ul, .info-page p {
  color: #e5e9d4; font-size: 1.0625rem; line-height: 1.66;
  margin: 0 0 15px;
}
.note h2:not(:first-child), .info-page h2 { margin-top: 24px; }
.equipment { grid-column: 5 / 9; margin: -4px 0 -7px; justify-self: center; }
.equipment img { display: block; width: min(216px, 100%); height: auto; }
.plays { padding-left: 1.22em; }
.plays li { padding-left: .2em; margin: 0 0 8px; }
.plays li::marker { color: var(--gold); }
kbd {
  display: inline-block; font: 800 .875rem ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  background: #365044; color: var(--paper); border: 1px solid #8a9b71; border-radius: 4px; padding: .08em .38em;
}
.answers { grid-column-end: 8; }
.answers h2 { font-size: clamp(1.3rem, 3vw, 1.81rem); }
.note .independent { color: #f0cea4; margin-top: 25px; padding-left: 12px; border-left: 2px solid #e8b864; }
.info-page { width: min(740px, calc(100% - 32px)); margin: clamp(24px, 8vw, 102px) auto; }
.info-page h1 { font-size: clamp(2.4rem, 7vw, 4.3rem); color: var(--paper); letter-spacing: -.07em; line-height: .98; }
.info-page img { width: 100%; height: auto; border: 1px solid #8e9567; margin-block: 4px 18px; border-radius: 14px; }
.info-page a { color: var(--gold); text-underline-offset: .23em; }
.info-page nav { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 32px; }
@media (max-width: 850px) {
  .poster { grid-template-columns: 1fr; margin: 0; }
  .gym { grid-row: 1; height: calc(100dvh - 53px); min-height: 330px; border-radius: 0; }
  .club { grid-row: 2; display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: center; gap: 12px; padding: 12px 16px; }
  .club-mark { display: flex; gap: 8px; align-items: center; }
  .club-mark span { margin: 0; }
  .club-record strong, .club-goal b { font-size: 1.6rem; }
  .club-record { padding: 0 10px; border: 0; border-left: 1px dashed #7c8960; border-right: 1px dashed #7c8960; }
  .club-record span:last-child { margin-top: 3px; }
}
@media (max-width: 520px) {
  .board { left: 8px; transform: none; }
  .board > div { min-width: 61px; }
  .board > .time { min-width: 58px; }
  .court-caption { display: block; left: 12px; right: 12px; }
  .court-caption h1 { font-size: clamp(1.45rem, 7.3vw, 1.8rem); }
  .court-caption span { display: block; margin-top: 4px; }
  .pads { bottom: calc(65px + env(safe-area-inset-bottom)); }
  .club { gap: 9px; padding-inline: 12px; }
  .club-mark { font-size: 1.56rem; }
  .court-notes { display: block; }
  .note { margin-block: 24px; }
  .equipment { margin-inline: auto; width: 158px; }
  .note p, .note ul, .info-page p { font-size: 1rem; }
}
@media (max-width: 540px) and (orientation: portrait) and (min-height: 500px) {
  .gym[data-state="menu"] .overlay { transform: translateY(-17%); }
}
@media (min-width: 851px) {
  .duel .pads { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 345px) {
  .pads { left: 3px; right: 3px; }
  .pad { grid-template-columns: repeat(5, minmax(44px, 48px)); gap: 3px; }
  html:lang(pt) .pad { grid-template-columns: 44px 44px 46px 50px 78px; }
  .pad button { overflow-wrap: anywhere; }
  .arena-tools { gap: 4px; right: 6px; }
  .board { left: 6px; }
}
@media (max-height: 460px) {
  .poster { margin-top: 0; grid-template-columns: 1fr; }
  .gym { grid-row: 1; min-height: 0; height: calc(100dvh - 48px - env(safe-area-inset-bottom)); }
  .rules-link {
    display: flex; grid-column: 1 / -1; grid-row: 2; align-items: center; justify-content: center;
    gap: 10px; min-height: calc(48px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    touch-action: pan-y; color: var(--paper); background: #253d32;
    border-bottom: 1px solid #718267; font-size: .9375rem; font-weight: 800; text-decoration: none;
  }
  .club { grid-row: 3; }
  .panel { gap: 5px; padding: 12px 16px; }
  .panel h2 { font-size: 2.2rem; }
  .pads { bottom: calc(49px + env(safe-area-inset-bottom)); }
  .court-caption h1 { font-size: 1.5rem; }
  .gym[data-state="menu"] .overlay { transform: translateY(-5%); }
}
@media (min-width: 660px) and (max-height: 460px) {
  .message { top: 10px; left: 12px; transform: none; max-width: calc(50% - 124px); text-align: left; }
}
@media (orientation: landscape) and (max-width: 850px) and (min-width: 660px) {
  .duel .pads { grid-template-columns: 1fr 1fr; }
}
