:root {
  color: #1c2836;
  background: #071018;
  font-family: "Segoe UI", sans-serif;
  --paper: #f4f7fb;
  --ink: #1c2836;
  --muted: #6d7c8e;
  --line: #d5e1ec;
  --sage: #d8f7f1;
  --sage-ink: #0b5c50;
  --accent: #14c8b4;
  --accent-ink: #042824;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  background: #071018;
  font-size: clamp(14px, 0.35vw + 13px, 16px);
}

body.is-locked {
  overflow: hidden;
  background: #071018;
}

body.is-locked .top,
body.is-locked main,
body.is-locked #player-menu,
body.is-locked #doc {
  display: none;
}

.login {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
}

.login[hidden] {
  display: none;
}

.court-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body:has(#watch:not([hidden])) .court-bg {
  display: none;
}

.top,
main {
  position: relative;
  z-index: 1;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(380px, calc(100% - 36px));
  padding: 28px 26px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: rgba(8, 14, 24, 0.62);
  color: #f4f7fb;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.login-brand img,
.logo img {
  display: block;
  object-fit: cover;
  border-radius: 14px;
}

.login-brand img {
  width: 52px;
  height: 52px;
}

.login-mark {
  margin: 0;
  color: #f4f7fb;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.login-card h2 {
  margin: 0 0 18px;
  color: #f7f9fc;
  font-size: 28px;
  font-weight: 650;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: #c5d3e2;
  font-size: 12px;
}

.login-card input {
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
}

.login-card input:focus {
  outline: 2px solid rgba(20, 200, 180, 0.75);
  outline-offset: 1px;
}

.login-error {
  margin: 0 0 10px;
  color: #f0c2bc;
  font-size: 12px;
}

.login-card button[type="submit"] {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.login-card button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: wait;
}

.logout {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.72;
}

body:has(#depot:not([hidden])),
body:has(#settings:not([hidden])) {
  min-height: 100vh;
  background: transparent;
}

body:has(#depot:not([hidden])) .top,
body:has(#settings:not([hidden])) .top {
  background: rgba(8, 14, 24, 0.55);
  backdrop-filter: blur(18px);
  border-bottom-color: rgba(255, 255, 255, 0.14);
  color: #f4f7fb;
}

body:has(#depot:not([hidden])) h1,
body:has(#depot:not([hidden])) h2,
body:has(#depot:not([hidden])) h3,
body:has(#depot:not([hidden])) .add-form label,
body:has(#depot:not([hidden])) .logout,
body:has(#settings:not([hidden])) h1,
body:has(#settings:not([hidden])) h2,
body:has(#settings:not([hidden])) h3,
body:has(#settings:not([hidden])) .logout {
  color: #f4f7fb;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(8, 16, 26, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #e7eef6;
}

.brand {
  flex: 1 1 auto;
  min-width: 0;
}

.watch-title {
  display: none;
  margin: 2px 0 0;
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

h1, h2 {
  margin: 0;
  font-weight: 650;
  color: #2f3640;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 20px;
}

.logo span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

main {
  padding: 28px;
}

.tabs, .match-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.match-list {
  flex-direction: column;
  align-items: stretch;
}

.tab,
.match-list button,
.add-form button,
#video-fields button {
  border: 1px solid transparent;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  cursor: pointer;
}

.tab.is-active {
  background: var(--sage);
  color: var(--sage-ink);
  border-color: #d3e3d5;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.tab svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.tab[data-tab="settings"] {
  justify-content: center;
  width: 42px;
  padding: 8px 0;
}

.tab[data-tab="settings"] svg {
  width: 18px;
  height: 18px;
}

.tab[hidden] {
  display: none;
}

.match-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid rgba(140, 210, 230, 0.18);
  border-radius: 14px;
  background: rgba(8, 16, 28, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.match-list .match-delete,
.match-list .match-open {
  width: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

.match-list .match-delete {
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
}

.match-list .match-delete svg {
  width: 18px;
  height: 18px;
}

.match-list .match-delete:hover {
  color: #e53935;
  background: #f8ecec;
}

.match-list .match-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 9px 14px 9px 2px;
}

.match-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e7eef6;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.match-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
  text-align: right;
}

.match-score b {
  color: #f4f8fc;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.match-score b.is-win {
  color: #3ddc97;
}

.match-score b.is-loss {
  color: #ff8b95;
}

.match-score .set-line {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.match-score .set-line b {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
}

.match-score .set-pair {
  color: #93a6ba;
  white-space: nowrap;
}

.match-pick {
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.match-pick input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #2f6f86;
  cursor: pointer;
}

.match-list .match-doc {
  flex: 0 0 36px;
  align-self: stretch;
  display: grid;
  place-items: center;
  width: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #d1242f;
  padding: 0;
  cursor: pointer;
}

.match-list .match-doc svg {
  width: 18px;
  height: 18px;
}

.match-list .match-doc:hover {
  color: #a51c26;
  background: #fdecee;
}

.doc {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start center;
  padding: 28px 16px;
  background: rgba(7, 11, 20, 0.46);
}

.doc[hidden] {
  display: none;
}

.doc-sheet {
  width: max-content;
  max-width: min(820px, calc(100vw - 32px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  border-radius: 22px;
  background: #f4f7fb;
  color: var(--ink);
  padding: 18px 18px 22px;
  box-shadow: 0 24px 60px rgba(7, 11, 20, 0.35);
}

.doc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: -18px;
  z-index: 3;
  margin: -18px -18px 0;
  background: #f4f7fb;
  padding: 18px 18px 8px;
}

.doc-head h2 {
  margin: 0;
  min-width: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

#doc-close {
  margin-left: auto;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.doc-note,
.doc-wait {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.doc-block {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(60, 68, 80, 0.08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(40, 32, 24, 0.05);
}

.doc-team,
body:has(#depot:not([hidden])) h3.doc-team,
body:has(#settings:not([hidden])) h3.doc-team {
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid #f0eae3;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-wrap {
  overflow-x: auto;
}

.doc-table {
  width: 780px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.doc-table [data-skill="S"] { --skill: #3d74a8; }
.doc-table [data-skill="R"] { --skill: #3f8b62; }
.doc-table [data-skill="A"] { --skill: #c45b78; }
.doc-table [data-skill="B"] { --skill: #6f67b2; }
.doc-table [data-skill="F"] { --skill: #3d9a86; }

.doc-table th,
.doc-table td {
  padding: 0;
  white-space: nowrap;
}

.doc-table thead th {
  position: sticky;
  top: 0;
  text-align: center;
  font-weight: 700;
}

.doc-table thead .doc-skill {
  padding: 8px 0 1px;
  background: color-mix(in srgb, var(--skill) 9%, white);
  box-shadow: inset 0 2px 0 var(--skill);
  color: var(--skill);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-table thead .doc-grade {
  padding: 0 0 9px;
  background: color-mix(in srgb, var(--skill) 9%, white);
  color: #a3988e;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.doc-table thead .doc-grade.is-total {
  color: var(--skill);
}

.doc-table [data-value="#"] { --value: #1f9a52; }
.doc-table [data-value="+"] { --value: #5a9a22; }
.doc-table [data-value="!"] { --value: #c4840c; }
.doc-table [data-value="-"] { --value: #d86a1c; }
.doc-table [data-value="/"] { --value: #d44858; }
.doc-table [data-value="="] { --value: #5e6d88; }

.doc-table thead .doc-grade[data-value] {
  color: var(--value);
  font-weight: 800;
}

.doc-table thead tr:first-child th:first-child,
.doc-table tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  background: #fff;
  text-align: left;
  box-shadow: 8px 0 12px -12px rgba(36, 49, 64, 0.45);
}

.doc-table thead tr:first-child th:first-child {
  z-index: 4;
  top: 0;
  padding-left: 16px;
  color: #8b837a;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.doc-table td {
  width: 18px;
  height: 30px;
  border-bottom: 1px solid #f4efe8;
  color: #243140;
  font-size: 11px;
  text-align: center;
}

.doc-table tbody th {
  height: 30px;
  padding: 0 8px 0 10px;
  border-bottom: 1px solid #f4efe8;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
}

.doc-table tbody tr:last-child th,
.doc-table tbody tr:last-child td {
  border-bottom: 0;
}

.doc-table tbody tr:hover td,
.doc-table tbody tr:hover th {
  background: #fbf8f4;
}

.doc-no {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2f6;
  color: #314155;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.doc-name {
  display: inline-block;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.doc-table .is-lead {
  box-shadow: inset 1px 0 0 rgba(36, 49, 64, 0.06);
}

.doc-table .is-zero {
  color: #e4dcd3;
  font-weight: 500;
}

.doc-table tbody td[data-value]:not(.is-zero):not(.is-total) {
  color: var(--value);
  font-weight: 750;
}

.doc-table tbody .is-total:not(.is-zero) {
  color: var(--skill);
  font-weight: 750;
}

.doc-table tbody td.is-link {
  cursor: pointer;
}

.doc-table tbody td.is-link:hover,
.doc-table tbody td.is-link:focus-visible {
  background: color-mix(in srgb, var(--skill) 18%, white);
  text-decoration: underline;
  outline: none;
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 0 auto;
}

.match-actions[hidden],
.match-actions button[hidden] {
  display: none;
}

.match-actions button {
  height: 34px;
  border: 1px solid rgba(255, 248, 240, 0.22);
  border-radius: 999px;
  padding: 0 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

#pick-all {
  background: rgba(255, 255, 255, 0.1);
  color: #f6f3ee;
}

#watch-picked {
  border-color: rgba(255, 248, 240, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 46%),
    linear-gradient(135deg, rgba(20, 200, 180, 0.7), rgba(90, 150, 230, 0.45));
  color: #f4fffc;
}

.team-logos[hidden],
.team-detail[hidden] {
  display: none;
}

.team-logos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.team-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 1px solid rgba(140, 210, 230, 0.18);
  border-radius: 16px;
  background: rgba(10, 20, 32, 0.72);
  padding: 10px 8px 10px;
  color: #e7eef6;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.team-logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.team-logo span {
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  line-height: 1.25;
}

.team-logo small {
  color: #93a6ba;
  font-size: 11px;
}

.team-detail {
  margin-top: 18px;
}

.team-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 248, 240, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 42%),
    radial-gradient(120% 160% at 0% 0%, rgba(20, 200, 180, 0.22), transparent 58%),
    radial-gradient(120% 160% at 100% 120%, rgba(122, 162, 255, 0.18), transparent 56%),
    rgba(8, 16, 26, 0.62);
  box-shadow: 0 16px 36px rgba(7, 11, 20, 0.28);
  backdrop-filter: blur(16px);
}

.team-detail h3 {
  margin: 0;
  min-width: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

#team-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  flex: none;
  border: 1px solid rgba(255, 248, 240, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f6f3ee;
  padding: 0 12px 0 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

#team-back svg {
  width: 16px;
  height: 16px;
}

.empty {
  margin-top: 16px;
  padding: 16px;
  background: rgba(10, 20, 32, 0.62);
  border: 1px dashed rgba(140, 210, 230, 0.28);
  border-radius: 16px;
  color: #b7c6d6;
}

.people[hidden] {
  display: none;
}

.people {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 248, 240, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(8, 18, 30, 0.62);
  backdrop-filter: blur(16px);
}

.people h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.people-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.people-form input {
  width: 180px;
  border: 1px solid rgba(255, 248, 240, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f6f3ee;
  font: inherit;
  font-size: 13px;
}

.people-form button,
.people-list button {
  height: 34px;
  border: 1px solid rgba(255, 248, 240, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f6f3ee;
  padding: 0 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.people-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.people-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #f6f3ee;
  font-size: 13px;
}

.people-who {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.people-who b {
  font-weight: 650;
}

.people-meta {
  color: rgba(244, 247, 251, 0.62);
  font-size: 12px;
}

.people-list small {
  color: rgba(244, 247, 251, 0.62);
}

.people-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: #f6f3ee;
  font-size: 12px;
}

body:has(#watch:not([hidden])) {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(980px 540px at -6% -14%, rgba(20, 200, 180, 0.2), transparent 62%),
    radial-gradient(860px 480px at 108% -6%, rgba(122, 162, 255, 0.22), transparent 58%),
    linear-gradient(168deg, #071018 0%, #0e1c2c 52%, #102433 100%);
}

body:has(#watch:not([hidden])) .top {
  padding: 8px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 46%),
    radial-gradient(140% 200% at 0% 0%, rgba(20, 200, 180, 0.2), transparent 58%),
    radial-gradient(140% 200% at 100% 140%, rgba(122, 162, 255, 0.16), transparent 56%),
    rgba(8, 14, 24, 0.62);
  backdrop-filter: blur(18px);
  border-bottom-color: rgba(255, 248, 240, 0.16);
  color: #f4f7fb;
}

body:has(#watch:not([hidden])) h1,
body:has(#watch:not([hidden])) .logout {
  color: #f4f7fb;
}

body:has(#watch:not([hidden])) h1 {
  font-size: 16px;
}

body:has(#watch:not([hidden])) .watch-title {
  display: block;
  color: rgba(244, 247, 251, 0.72);
}

body:has(#watch:not([hidden])) main {
  flex: 1;
  min-height: 0;
  padding: 12px;
}

#watch:not([hidden]) {
  height: 100%;
}

.studio {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.skill-rail,
.rail,
.stage {
  min-width: 0;
  min-height: 0;
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(80, 60, 40, 0.05);
}

.skill-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow: auto;
  overflow-x: hidden;
  border: 1px solid rgba(140, 210, 230, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 32%),
    radial-gradient(140% 70% at 0% 0%, rgba(20, 200, 180, 0.16), transparent 56%),
    radial-gradient(120% 70% at 100% 110%, rgba(122, 162, 255, 0.14), transparent 52%),
    rgba(8, 16, 26, 0.72);
  backdrop-filter: blur(18px);
  color: #f4f7fb;
  font-size: 12px;
  box-shadow: 0 16px 36px rgba(7, 11, 20, 0.28);
}

.skill-result {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255, 248, 240, 0.14);
  border-radius: 14px;
  background: rgba(8, 14, 24, 0.38);
  overflow: hidden;
}

.skill-result[hidden] {
  display: none;
}

.result-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 0;
  flex-shrink: 0;
}

.value-row {
  display: flex;
  flex-direction: row;
  gap: 3px;
}

.value-row button {
  flex: 1;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  padding: 0;
  color: #3d4d5e;
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.value-row button[data-value="#"] { --tone: #1f9a52; background: #3dce78; color: #08331c; border-color: #2bb868; }
.value-row button[data-value="+"] { --tone: #6aaf28; background: #9be05a; color: #23400a; border-color: #7cc63e; }
.value-row button[data-value="!"] { --tone: #d3920d; background: #ffc53d; color: #4a3204; border-color: #e6ad22; }
.value-row button[data-value="-"] { --tone: #d86a1c; background: #ff9a4a; color: #4a2208; border-color: #ee7d2e; }
.value-row button[data-value="/"] { --tone: #d44858; background: #ff7d88; color: #4a1018; border-color: #ee5d6c; }
.value-row button[data-value="="] { --tone: #5e6d88; background: #9aabC8; color: #1c2838; border-color: #7d90ad; }

.value-row button.is-on {
  background: var(--tone);
  color: #f7fbff;
  border-color: var(--tone);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.28);
}

.action-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.action-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.action-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(12, 18, 28, 0.96);
  color: rgba(244, 247, 251, 0.68);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  padding: 5px 6px;
}

.action-table th:last-child,
.action-table td:last-child {
  text-align: right;
}

.action-table td {
  padding: 5px 6px;
  color: #f4f7fb;
  background: transparent;
  border-bottom: 1px solid rgba(255, 248, 240, 0.08);
}

.action-table .mark-col {
  width: 28px;
  padding: 0 4px;
  text-align: center;
  box-shadow: none;
  overflow: visible;
}

.row-mark {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #b0d0ff;
  cursor: pointer;
}

.action-table th:nth-child(3),
.action-table td:nth-child(3) {
  width: 78px;
  padding-right: 4px;
  padding-left: 4px;
  text-align: center;
}

.code-count {
  margin-left: 4px;
  color: #f4f7fb;
  font-weight: 750;
}

.value-mark {
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 2px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.value-mark[data-value="#"] { color: #08331c; background: #3dce78; }
.value-mark[data-value="+"] { color: #23400a; background: #9be05a; }
.value-mark[data-value="!"] { color: #4a3204; background: #ffc53d; }
.value-mark[data-value="-"] { color: #4a2208; background: #ff9a4a; }
.value-mark[data-value="/"] { color: #4a1018; background: #ff7d88; }
.value-mark[data-value="="] { color: #1c2838; background: #9aabc8; }

.action-table th:last-child,
.action-table td:last-child {
  width: 96px;
}

.time-cell {
  line-height: 1.2;
}

.match-tag {
  display: block;
  color: rgba(244, 247, 251, 0.5);
  font-size: 10px;
  font-weight: 650;
}

.action-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 2px 0 0 rgba(176, 208, 255, 0.55);
}

.action-table td:nth-child(3),
.action-table td:last-child {
  white-space: nowrap;
}

.action-table td:last-child {
  font-variant-numeric: tabular-nums;
}

.action-table tr.is-timed {
  cursor: pointer;
}

.action-table tr.is-timed:hover td,
.action-table tr.is-current td {
  background: rgba(176, 208, 255, 0.16);
}

.rail-label {
  margin: 0;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skill-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.skill-list > button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  padding: 6px 7px 6px 9px;
  text-align: left;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #3d4d5e;
  cursor: pointer;
  box-shadow: inset 2px 0 0 var(--tone, #c5d0da);
}

.tone-serve { --tone: #7ec8e3; --tone-on: #1f6f93; background: rgba(236, 248, 252, 0.94); }
.tone-receive { --tone: #7dceab; --tone-on: #1f7a52; background: rgba(236, 250, 244, 0.94); }
.tone-set { --tone: #f0c27a; --tone-on: #b47a2a; background: rgba(255, 248, 236, 0.94); }
.tone-attack { --tone: #f0a0b4; --tone-on: #c45274; background: rgba(255, 242, 246, 0.94); }
.tone-block { --tone: #b7b0e6; --tone-on: #6a5eb8; background: rgba(244, 242, 255, 0.94); }
.tone-dig { --tone: #e4d09a; --tone-on: #a6843a; background: rgba(255, 248, 236, 0.94); }
.tone-free { --tone: #7ed4c4; --tone-on: #1f8a78; background: rgba(236, 252, 248, 0.94); }
.tone-custom { --tone: #9ec0ff; --tone-on: #3a6ad4; background: rgba(238, 244, 255, 0.96); }

.skill-list > button[aria-pressed="true"] {
  background: var(--tone-on, var(--tone));
  color: #fff;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--tone-on, var(--tone)) 70%, #1a2c3c);
}

.skill-list > button[aria-pressed="true"] .skill-count {
  color: rgba(255, 255, 255, 0.86);
}

.skill-count {
  color: #8aa0b2;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.skill-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0;
  min-width: 0;
}

.skill-filters label,
.rail-video label,
.add-form label,
.rail-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

.skill-filters label {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#value-filter[hidden],
.attack-codes[hidden],
.setter-calls[hidden],
.zones[hidden] {
  display: none;
}

.setter-calls,
.attack-codes,
.zones {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.setter-calls > span,
.attack-codes > span,
.zones > span {
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.zone-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 3px;
}

.zone-row button {
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 248, 240, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f6f3ee;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.zone-row button.is-on {
  border-color: #8eb4d4;
  background: #8eb4d4;
  color: #102033;
}

.setter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.attack-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.attack-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
}

.setter-row {
  flex-wrap: nowrap;
  gap: 3px;
}

.setter-row button,
.attack-row button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(214, 196, 204, 0.7);
  border-radius: 999px;
  background: rgba(251, 246, 248, 0.9);
  color: #8a6270;
  font-size: 11px;
  font-weight: 650;
}

.setter-row button {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  gap: 2px;
  height: 16px;
  padding: 0 2px;
  border-color: rgba(214, 196, 170, 0.75);
  background: rgba(251, 247, 242, 0.9);
  color: #8d6a4a;
  font-size: 9px;
}

.setter-row button small,
.attack-row button small {
  color: #c4a8b2;
  font-size: 10px;
  font-weight: 600;
}

.attack-row button {
  flex: 0 0 auto;
  gap: 2px;
  height: 20px;
  padding: 0 5px;
  font-size: 10px;
}

.setter-row button small {
  color: #c4a888;
}

.setter-row button.is-on,
.attack-row button.is-on {
  border-color: #e2a8b8;
  background: #e2a8b8;
  color: #fff;
}

.setter-row button.is-on {
  border-color: #e2c09a;
  background: #e2c09a;
}

.setter-row button.is-on small,
.attack-row button.is-on small {
  color: rgba(255, 255, 255, 0.82);
}

.value-picks[hidden] {
  display: none;
}

.value-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.value-picks button {
  min-width: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px 7px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.value-picks button.is-on {
  border-color: #d3e3d5;
  background: var(--sage);
  color: var(--sage-ink);
}

.player-picker,
.skill-filters select,
.skill-filters input,
.rail-filter input,
.rail-video input,
.add-form input[type="text"],
.add-form input[type="url"] {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.skill-rail .player-picker,
.skill-filters select,
.skill-filters input {
  border-color: rgba(255, 248, 240, 0.18);
  border-radius: 10px;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: #f6f3ee;
  background: rgba(255, 255, 255, 0.08);
}

.skill-filters select option {
  color: #000000;
  background: #ffffff;
}

.player-picker {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}

.player-menu {
  position: fixed;
  z-index: 20;
  max-height: 280px;
  overflow: auto;
  padding: 4px;
  background: rgba(12, 18, 28, 0.94);
  border: 1px solid rgba(255, 248, 240, 0.16);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(7, 11, 20, 0.35);
  backdrop-filter: blur(16px);
}

.player-menu[hidden] {
  display: none;
}

.player-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f6f3ee;
  padding: 7px 8px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.player-menu button:hover,
.player-menu button.is-selected {
  background: rgba(176, 208, 255, 0.18);
}

.player-empty {
  margin: 6px 8px;
  color: rgba(244, 247, 251, 0.62);
  font-size: 12px;
}

.stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0b121a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.video-slot {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #070b10;
  color: #d9d3cb;
}

.scoreboard {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(14, 16, 20, 0.72);
  color: #f6f3ee;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.pass-clock {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(14, 16, 20, 0.72);
  color: #f6f3ee;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.pass-clock span {
  color: rgba(246, 243, 238, 0.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pass-clock b {
  min-width: 64px;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
}

.pass-clock.is-flying b {
  color: #ffd23f;
}

.pass-clock.is-done b {
  color: #5fd38d;
}

.score-set:empty {
  display: none;
}

.score-set {
  padding-left: 4px;
  color: rgba(246, 243, 238, 0.62);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-row img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 7px;
  background: #fff;
}

.score-row b {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.rotation-bar {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(14, 16, 20, 0.78);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.rotation-bar button {
  min-width: 28px;
  height: 22px;
  padding: 0 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #f6f3ee;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.rotation-bar button.is-on {
  background: #f4f7fb;
  color: #1c2126;
}

.rotation-bar .set-filter {
  display: flex;
  align-items: center;
  margin-left: 4px;
}

.rotation-bar .set-filter select {
  height: 22px;
  max-width: 78px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #f6f3ee;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.rotation-bar .set-filter select.is-on {
  background: #f4f7fb;
  color: #1c2126;
}

.rotation-bar .set-filter select option {
  color: #000000;
  background: #ffffff;
}

.seek-bar {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(14, 16, 20, 0.78);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.seek-bar button {
  min-width: 26px;
  height: 22px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #f6f3ee;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.seek-bar button.is-on {
  background: #f4f7fb;
  color: #1c2126;
}

#video-warm {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.youtube-host.is-warm {
  position: fixed;
  left: -4800px;
  top: 0;
  width: 1920px;
  height: 1080px;
  opacity: 0.02;
  pointer-events: none;
}

.video-slot:not(:has(iframe)):not(:has(.poster)):not(:has(.youtube-host)):not(:has(.file-player)) {
  display: grid;
  place-items: center;
}

.youtube-host,
.youtube-host.is-live,
.video-slot iframe,
.video-slot .file-player,
.poster {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #2a3036 center / cover no-repeat;
}

.poster {
  position: relative;
  padding: 0;
  cursor: pointer;
}

.poster span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(251, 248, 244, 0.88);
}

.poster span::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 22px;
  border-style: solid;
  border-width: 14px 0 14px 20px;
  border-color: transparent transparent transparent #5d6b62;
}

.rail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-filter {
  margin: 14px 14px 8px;
}

.filter-line {
  display: flex;
  justify-content: space-between;
}

.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.skill-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.skill-table th,
.skill-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid #f0e8de;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-table th {
  position: sticky;
  top: 0;
  background: #e7f0ea;
  color: var(--sage-ink);
  font-weight: 650;
}

.skill-table td {
  color: #6a625a;
}

.skill-table tbody tr {
  cursor: pointer;
}

.skill-table tbody tr:nth-child(even) {
  background: #fbf8f4;
}

.skill-table tbody tr.is-selected td {
  background: #e7f0ea;
}

.player-cell {
  color: #4f6f86;
  font-weight: 650;
}

.rail-video {
  border-top: 1px solid #f0e8de;
}

.video-edit {
  width: 100%;
  border: 0;
  background: transparent;
  color: #5d7d72;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

#video-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 12px;
}

#video-fields[hidden] {
  display: none;
}

#video-fields button {
  border-radius: 10px;
  background: #dcead9;
  color: var(--sage-ink);
  font-weight: 650;
}

.rail-video .status {
  margin: 0;
  padding: 0 14px 10px;
}

.rail-video .status:empty {
  display: none;
  padding: 0;
  min-height: 0;
}

.add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.add-form button.add-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  margin-bottom: 1px;
  padding: 0 12px 0 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 12px 24px rgba(4, 40, 36, 0.35);
}

.add-form button.add-submit svg {
  width: 16px;
  height: 16px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(4, 40, 36, 0.12);
  box-shadow: inset 0 0 0 1px rgba(4, 40, 36, 0.16);
}

.add-form button.add-submit:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 28px rgba(4, 40, 36, 0.4);
}

.field-logo {
  display: block;
}

.field-logo.youtube {
  width: 32px;
  height: 22px;
}

.field-logo.drive {
  width: 22px;
  height: 20px;
}

.field-logo.disk {
  width: 24px;
  height: 22px;
}

.video-slot .file-player {
  object-fit: contain;
  background: #000;
}

.add-form input[type="text"],
.add-form input[type="url"] {
  min-width: 280px;
}

.status {
  min-height: 1.2em;
}

.nav-toggle,
.nav-backdrop {
  display: none;
}

.nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.nav-toggle {
  position: relative;
  z-index: 5;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #f4f7fb;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease, top 0.18s ease;
}

.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }

body.nav-open .nav-toggle span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  border: 0;
  background: rgba(7, 11, 20, 0.5);
  cursor: pointer;
}

/* 1280px altı: telefon, phablet ve tablet. 1280px ve üzeri mevcut masaüstü düzenidir. */
@media (max-width: 1279px) {
  main {
    padding: 20px;
  }

  h1,
  .logo {
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  }

  #depot > h2,
  #settings > h2,
  .team-detail h3 {
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  }

  .studio {
    grid-template-columns: minmax(220px, 26vw) minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .top,
  body:has(#depot:not([hidden])) .top,
  body:has(#settings:not([hidden])) .top,
  body:has(#watch:not([hidden])) .top {
    backdrop-filter: none;
    background: rgba(8, 14, 24, 0.94);
  }

  .nav-toggle {
    display: inline-block;
  }

  .tabs {
    position: fixed;
    z-index: 32;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: min(300px, 86vw);
    height: 100dvh;
    margin: 0;
    padding: 76px 16px 24px;
    overflow: auto;
    background: rgba(8, 14, 24, 0.96);
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.28);
    transform: translateX(104%);
    visibility: hidden;
  }

  body.nav-open .top {
    z-index: 40;
  }

  body.nav-open .tabs {
    transform: none;
    visibility: visible;
  }

  body.nav-open .nav-backdrop {
    display: block;
  }

  .tabs .tab,
  .tabs .logout {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    width: 100%;
    padding: 0 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #f4f7fb;
    font-size: 15px;
    opacity: 1;
  }

  .tabs .tab.is-active {
    background: var(--sage);
    color: var(--sage-ink);
  }

  .tab[data-tab="settings"] {
    width: 100%;
    justify-content: flex-start;
    padding: 0 16px;
  }

  .nav-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .tabs .tab[hidden] {
    display: none;
  }

  body:has(#watch:not([hidden])) main {
    padding: 8px;
  }

  .studio {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(180px, 38vh) minmax(0, 1fr);
  }

  .stage {
    order: -1;
  }

  .skill-list {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .skill-list > button,
  .player-picker,
  .skill-filters select,
  .zone-row button,
  .value-row button,
  .setter-row button,
  .attack-row button,
  .rotation-bar button,
  .seek-bar button,
  .player-menu button {
    min-height: 44px;
  }

  .skill-list > button {
    padding: 8px 10px;
    font-size: 13px;
  }

  .zone-row {
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  }

  .value-row,
  .setter-row,
  .attack-row {
    flex-wrap: wrap;
  }

  .setter-row button,
  .attack-row button,
  .value-row button {
    flex: 1 1 44px;
    height: 44px;
    font-size: 12px;
  }

  .action-scroll,
  .doc-wrap,
  .doc-sheet {
    max-width: 100%;
  }

  .action-table td,
  .action-table th {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .action-table .mark-col {
    width: 44px;
  }

  .row-mark {
    width: 22px;
    height: 22px;
  }

  .rotation-bar,
  .seek-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .rotation-bar {
    left: 8px;
    max-width: min(56%, calc(100% - 132px));
  }

  .seek-bar {
    right: 8px;
    max-width: min(44%, 240px);
  }

  .rotation-bar button,
  .seek-bar button {
    flex: 0 0 44px;
    height: 44px;
  }

  .rotation-bar .set-filter select {
    height: 44px;
    max-width: 96px;
  }

  .add-form,
  .people-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    align-items: end;
  }

  .add-form input,
  .add-form input[type="text"],
  .add-form input[type="url"],
  .people-form input,
  .login-card input,
  .skill-filters select,
  .player-picker {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
  }

  .add-form button.add-submit,
  .people-form button,
  .people-list button,
  #team-back,
  .match-actions button,
  #doc-close,
  .login-card button[type="submit"] {
    min-height: 44px;
    height: 44px;
  }

  .team-bar {
    flex-wrap: wrap;
  }

  .match-actions {
    margin-left: auto;
  }
}

@media (max-width: 1023px) and (orientation: landscape) {
  .studio {
    grid-template-columns: minmax(210px, 36vw) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .stage {
    order: 0;
  }
}

@media (max-width: 767px) {
  .top,
  body:has(#watch:not([hidden])) .top {
    gap: 8px;
    padding: 8px 10px;
  }

  main {
    padding: 14px;
  }

  .login-card {
    width: min(380px, calc(100% - 24px));
    padding: 22px 16px 18px;
  }

  .login-card h2 {
    font-size: clamp(1.4rem, 7vw, 1.75rem);
  }

  .team-logos {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 10px;
  }

  .doc {
    padding: 0;
    align-items: end;
  }

  .doc-sheet {
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 18px 18px 0 0;
  }

  .scoreboard,
  .pass-clock {
    top: 8px;
  }

  .rotation-bar,
  .seek-bar {
    left: 8px;
    right: 8px;
    max-width: none;
    overflow: hidden;
  }

  .rotation-bar {
    bottom: 56px;
  }

  .seek-bar {
    bottom: 8px;
  }

  .rotation-bar button,
  .seek-bar button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 2px;
  }

  .scoreboard {
    left: 8px;
    max-width: calc(100% - 108px);
  }

  .pass-clock {
    right: 8px;
    gap: 4px;
    padding: 6px 8px;
  }

  .score-row b,
  .pass-clock b {
    font-size: clamp(16px, 4.2vw, 20px);
  }

  .pass-clock b {
    min-width: 0;
  }
}

@media (max-width: 639px) {
  .studio {
    grid-template-rows: minmax(150px, 34dvh) minmax(0, 1fr);
    gap: 8px;
  }

  .team-detail h3 {
    flex: 1 1 140px;
  }

  .match-actions {
    width: 100%;
    margin: 0;
  }

  .match-actions button {
    flex: 1 1 120px;
  }

  .people-form {
    grid-template-columns: 1fr;
  }

  .action-table th:nth-child(3),
  .action-table td:nth-child(3) {
    width: 64px;
  }

  .action-table th:last-child,
  .action-table td:last-child {
    width: 72px;
  }

  .match-list .match-delete {
    flex-basis: 44px;
  }
}
