:root {
  --bg: #f3f0e8;
  --panel: #fffdf8;
  --text: #17130b;
  --muted: #70695c;
  --line: #ded4bf;
  --gold: #d7ad45;
  --gold-soft: #f5e7bd;
  --green: #087a54;
  --blue: #1b5fd0;
  --red: #c8342d;
  --ink: #070707;
  --origin-tree-mark: url("assets/branding/main-tree.png");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(215, 173, 69, 0.20), transparent 30%),
    linear-gradient(135deg, #f7f4ec 0%, var(--bg) 52%, #ede6d8 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
  display: grid;
  grid-template-columns: 260px 1fr;
  -webkit-tap-highlight-color: transparent;
}

button, input, select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #111 0%, #2a2110 100%);
  color: #fff8df;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
}

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

button.secondary {
  background: #e7ecf2;
  color: var(--text);
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sidebar {
  background:
    linear-gradient(180deg, #050505 0%, #151007 66%, #241a08 100%);
  color: white;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #020202;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: Impact, "Arial Black", "Trebuchet MS", sans-serif;
  font-size: 17px;
  font-weight: 900;
  text-shadow: 0 1px 0 #000;
  box-shadow: 0 0 0 3px rgba(215, 173, 69, 0.12);
  font-size: 0;
}

.brand-mark::before {
  content: "";
  width: 42px;
  height: 42px;
  background: var(--origin-tree-mark) center / contain no-repeat;
}

.brand small {
  display: block;
  color: #d7c99f;
  margin-top: 3px;
}

.brand .current-account {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.brand .version-label {
  color: #fff3c4;
  font-size: 12px;
  font-weight: 900;
}

.brand strong {
  color: #fff8df;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 900;
}

nav {
  display: grid;
  gap: 6px;
}

nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #e8dcc0;
}

nav button.has-alert {
  color: #fff8df;
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-alert-badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  border: 1px solid #fff1b8;
  border-radius: 50%;
  background: #b42318;
  color: white;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.2);
}

.nav-badge-stack {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.nav-message-badge {
  display: grid;
  place-items: center;
  min-width: 27px;
  height: 23px;
  border: 1px solid #fff1b8;
  border-radius: 999px;
  background: #16834a;
  color: white;
  padding: 0 6px;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 0 0 4px rgba(22, 131, 74, 0.17);
}

nav button.active,
nav button:hover {
  background: rgba(215, 173, 69, 0.16);
  color: #fff8df;
  box-shadow: inset 3px 0 0 var(--gold);
}

.mobile-nav-handle {
  position: relative;
  display: none;
  grid-template-columns: auto auto;
  gap: 4px;
}

.mobile-invite-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border: 2px solid #fff8df;
  border-radius: 50%;
  background: #b42318;
  color: white;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.34);
}

.mobile-invite-badge[hidden] {
  display: none;
}

.tree-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 1px 0 #000);
}

.mobile-menu-lines {
  display: grid;
  gap: 4px;
  width: 15px;
}

.mobile-menu-lines i {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: #fff8df;
}

main {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1, h2, h3 {
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-weight: 900;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.top-account {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7b560f;
}

.version-badge {
  display: inline-grid;
  place-items: center;
  min-height: 20px;
  border: 1px solid rgba(215, 173, 69, 0.68);
  border-radius: 999px;
  background: #070707;
  color: var(--gold);
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
}

.score-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  min-width: 140px;
  max-width: 240px;
}

.score-pill span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.score-pill strong {
  display: grid;
  gap: 2px;
  max-height: 72px;
  overflow-y: auto;
  font-size: 15px;
  color: #7b560f;
}

.score-pill strong span {
  color: #7b560f;
  font-size: 15px;
  white-space: nowrap;
}

.leader-identity {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

.leader-identity b {
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tree-crest {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.user-tree-crest img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.user-tree-color-layer {
  position: absolute;
  inset: 13% 15% 16%;
  background: linear-gradient(
    to bottom,
    var(--tree-crown) 0 42%,
    var(--tree-trunk) 42% 68%,
    var(--tree-roots) 68% 100%
  );
  mix-blend-mode: color;
  z-index: 2;
  opacity: 1;
  filter: saturate(1.45) contrast(1.08);
  clip-path: polygon(10% 0, 90% 0, 100% 47%, 82% 100%, 18% 100%, 0 47%);
  pointer-events: none;
}

.user-tree-crest.team-colored img {
  filter: saturate(0.3) brightness(0.82) contrast(1.18);
}

.user-tree-crest.mini {
  width: 24px;
  height: 27px;
}

.user-tree-crest.small {
  width: 44px;
  height: 50px;
}

.user-tree-crest.profile {
  width: 116px;
  height: 132px;
}

.user-identity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.startup-error {
  max-width: 720px;
  border-left: 5px solid var(--red);
}

.startup-error small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(40, 28, 8, 0.07);
  overflow-x: auto;
  position: relative;
}

#groups .panel::after,
#knockout .panel::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 14px;
  width: min(170px, 42%);
  aspect-ratio: 1;
  background: var(--origin-tree-mark) center / contain no-repeat;
  opacity: 0.055;
  pointer-events: none;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.metric {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 120px;
}

.metric strong {
  font-size: 34px;
}

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

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tabs button {
  background: #e7ecf2;
  color: var(--text);
}

.tabs button.active {
  background: var(--ink);
  color: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input[type="number"] {
  width: 56px;
  height: 42px;
  padding: 8px;
  border: 1px solid #cdbb91;
  border-radius: 6px;
  background: #fffaf0;
  color: var(--text);
  font-weight: 900;
  text-align: center;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 20px 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.match-row strong {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  overflow: hidden;
  color: #1f1a10;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.match-row strong.right {
  justify-content: flex-end;
}

.match-row span {
  text-align: center;
  color: #7b560f;
  font-weight: 900;
}

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

.special-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.podium-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.knockout-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.knockout-match {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 12px;
}

.knockout-match.locked-match {
  opacity: 0.68;
}

.winner-select {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.right {
  text-align: right;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.status.live { background: #dbeafe; color: var(--blue); }
.status.final { background: #dcfce7; color: var(--green); }
.status.open { background: var(--gold-soft); color: #7b560f; }
.status.locked { background: #fee2e2; color: var(--red); }

.leader-change {
  color: var(--green);
  font-weight: 700;
}

.rules-list {
  display: grid;
  gap: 12px;
}

.rule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 12px;
}

.rule-card strong {
  display: block;
  color: #7b560f;
  margin-bottom: 6px;
}

.rule-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.section-head.compact h2 {
  margin-bottom: 4px;
}

.section-head.compact p {
  margin-bottom: 0;
}

.tip-warning {
  border: 1px solid #e7b54b;
  border-radius: 8px;
  background: #fff1c7;
  color: #7b560f;
  font-weight: 800;
  padding: 10px 12px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chat-head h2 {
  margin-bottom: 0;
}

.chat-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.chat-message {
  width: min(78%, 520px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 10px 12px;
}

.chat-message.self {
  justify-self: end;
  background: #f5e7bd;
  border-color: #d7ad45;
}

.chat-message div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.chat-message small {
  color: var(--muted);
  font-weight: 800;
}

.chat-message p {
  margin-bottom: 0;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.chat-form input[type="text"] {
  min-height: 42px;
  border: 1px solid #cdbb91;
  border-radius: 6px;
  background: #fffdf8;
  padding: 0 12px;
  color: var(--text);
  font-weight: 800;
}

.chat-note {
  margin: 10px 0 0;
}

.team-search-box,
.team-search-panel {
  display: grid;
  gap: 10px;
}

.team-search-box {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.team-search-box label {
  font-weight: 900;
}

.team-search-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.team-search-control input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid #cdbb91;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.team-search-results {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.team-search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.team-search-result-head h3,
.team-search-result-head p {
  margin-bottom: 0;
}

.team-search-result-head > span {
  border-radius: 999px;
  background: #f5e7bd;
  color: #7b560f;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.team-search-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.team-search-suggestions button {
  display: grid;
  gap: 3px;
  background: #fffaf0;
  color: var(--text);
  text-align: left;
}

.team-search-suggestions small {
  color: var(--muted);
}

.team-search-empty {
  border: 1px dashed #cdbb91;
  border-radius: 6px;
  margin: 0;
  padding: 12px;
  color: var(--muted);
}

.invite-box {
  display: grid;
  gap: 8px;
}

.invite-box strong {
  display: inline-flex;
  width: fit-content;
  border-radius: 8px;
  background: #070707;
  color: var(--gold);
  padding: 8px 12px;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 22px;
}

.invite-box input {
  min-height: 42px;
  border: 1px solid #cdbb91;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.invite-notification-panel {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, #fff5cf, #fffdf8 64%);
  box-shadow: 0 10px 28px rgba(123, 86, 15, 0.18), 0 0 0 4px rgba(215, 173, 69, 0.12);
}

.invite-notification-panel::before {
  content: "!";
  position: absolute;
  top: 12px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #b42318;
  color: white;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 20px;
  box-shadow: 0 0 0 5px rgba(180, 35, 24, 0.15);
}

.invite-notification-list {
  display: grid;
  gap: 10px;
}

.invite-notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #ead7a8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
}

.invite-notification p {
  margin: 3px 0 0;
}

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-list > .member-chip {
  border-radius: 999px;
  background: #f5e7bd;
  color: #7b560f;
  padding: 7px 10px;
  font-weight: 900;
}

.member-list .member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.member-chip .user-identity {
  padding: 0;
}

.member-chip button {
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #7f1d1d;
  color: #fff7ed;
  font-size: 11px;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.admin-group-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
}

.admin-search {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cdbb91;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--text);
  margin-bottom: 12px;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.admin-user-list {
  display: grid;
  gap: 10px;
}

.admin-user-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
}

.admin-user-card.has-warning {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(215, 173, 69, 0.16);
}

.admin-score-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.admin-score-strip span {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffaf0;
  padding: 8px;
}

.admin-score-strip strong {
  color: #7b560f;
  font-size: 18px;
}

.admin-score-strip small,
.warning-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.warning-line {
  border-left: 4px solid var(--gold);
  background: #fff8e6;
  margin: 0;
  padding: 8px 10px;
}

.admin-action-row {
  justify-content: flex-start;
}

.admin-action-row button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.warning-card-panel {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
  border-color: var(--gold);
  background:
    linear-gradient(135deg, rgba(255, 216, 77, 0.24), transparent 38%),
    #fff8e6;
}

.yellow-card-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 74px;
  border: 2px solid #8a650f;
  border-radius: 7px;
  background: linear-gradient(135deg, #ffd84d 0%, #d7ad45 100%);
  box-shadow: 0 10px 22px rgba(123, 86, 15, 0.22);
  transform: rotate(-7deg);
}

.yellow-card-icon span {
  color: #5f4208;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 34px;
  line-height: 1;
}

.warning-message {
  border-left: 4px solid var(--gold);
  background: rgba(255, 253, 248, 0.78);
  margin: 8px 0;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 900;
}

.code-copy-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.icon-button.copy-code-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: #070707;
  color: var(--gold);
  padding: 0;
  font-size: 22px;
}

.group-actions {
  margin-top: 12px;
}

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

.group-action-button {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 78px;
  border: 1px solid #cdbb91;
  background: #fffaf0;
  color: var(--text);
  text-align: left;
}

.group-action-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.group-action-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.group-popup {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.55);
}

.group-popup-panel {
  width: min(520px, 100%);
  border: 1px solid rgba(215, 173, 69, 0.52);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: var(--shadow);
  padding: 18px;
}

.popup-code strong {
  font-size: 28px;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.stack-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.stack-form input,
.stack-form select {
  width: 100%;
}

.stack-form button {
  justify-self: start;
}

.competition-hub {
  background:
    linear-gradient(135deg, rgba(215, 173, 69, 0.16), transparent 36%),
    #fffaf0;
}

.group-matchday-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.group-matchday-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.group-matchday-score > strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.15;
}

.group-matchday-score > strong:first-child {
  text-align: right;
}

.match-score-box,
.schedule-score {
  display: grid;
  place-items: center;
  min-height: 52px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: #070707;
  color: var(--gold);
  padding: 6px 8px;
}

.match-score-box strong,
.schedule-score strong {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 25px;
  line-height: 1;
}

.match-score-box small,
.schedule-score small {
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.match-score-box.is-live,
.schedule-score.is-live {
  border-color: #f1cf63;
  box-shadow: 0 0 0 2px rgba(215, 173, 69, 0.18);
}

.prediction-live-result {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.prediction-live-result .match-score-box {
  min-width: 82px;
}

.locked-tip-card {
  border-color: rgba(90, 90, 90, 0.4);
  background: #f4f3ef;
}

.locked-tip-card .score-input:disabled {
  border-color: #777;
  background: #dedcd5;
  color: #222;
  cursor: not-allowed;
  opacity: 1;
}

.locked-tip-note {
  margin: 8px 0 0;
  color: #5f5b52;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.tip-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.tip-comparison > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(205, 187, 145, 0.8);
  border-radius: 6px;
  background: #fffdf8;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tip-comparison span.saved-tip {
  border-color: rgba(22, 101, 52, 0.38);
  background: #f0fdf4;
  color: #166534;
}

.tip-comparison span.missing-tip {
  border-style: dashed;
  opacity: 0.7;
}

.tip-comparison span.hidden-tip,
.schedule-tip.hidden-tip {
  border-style: dashed;
  border-color: rgba(123, 86, 15, 0.34);
  background: #f7f2e8;
  color: #746b5b;
}

.tip-comparison span.hidden-tip em,
.schedule-tip.hidden-tip em {
  color: #746b5b;
  font-size: 11px;
}

.tip-comparison strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
}

.tip-comparison em {
  align-self: center;
  font-style: normal;
  white-space: nowrap;
}

.schedule-hero .section-head {
  align-items: stretch;
}

.schedule-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 8px;
  min-width: min(420px, 100%);
}

.schedule-stats span {
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 173, 69, 0.45);
  border-radius: 8px;
  background: #070707;
  color: var(--gold);
  padding: 10px;
}

.schedule-stats strong {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 24px;
}

.schedule-stats small {
  color: #fff3c4;
  font-size: 11px;
  font-weight: 900;
}

.schedule-list {
  display: grid;
  gap: 16px;
}

.schedule-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.schedule-day-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #070707;
  color: var(--gold);
  padding: 14px 16px;
}

.schedule-day-head h2 {
  margin: 0;
  color: var(--gold);
  font-size: 19px;
}

.schedule-day-head span {
  color: #fff3c4;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.schedule-matches {
  display: grid;
  gap: 0;
}

.schedule-match {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}

.schedule-match:first-child {
  border-top: 0;
}

.schedule-match.is-live {
  background: #fff7e0;
}

.schedule-match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-match-meta small {
  margin-left: auto;
  color: var(--muted);
}

.schedule-match-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.schedule-team {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.15;
}

.schedule-team.right {
  text-align: right;
}

.schedule-score {
  min-height: 58px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 0 12px;
}

.schedule-score strong {
  font-size: 30px;
}

.schedule-tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.schedule-tip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(205, 187, 145, 0.8);
  border-radius: 6px;
  background: #fffdf8;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-tip .user-identity {
  flex: 1 1 auto;
}

.schedule-tip strong,
.schedule-tip em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-tip em {
  color: var(--text);
  font-style: normal;
}

.schedule-tip.saved-tip {
  border-color: rgba(22, 101, 52, 0.38);
  background: #f0fdf4;
}

.schedule-tip.missing-tip {
  border-style: dashed;
  opacity: 0.72;
}

.bug-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bug-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.bug-form .span-form {
  grid-column: span 2;
}

.bug-form textarea,
.bug-form input[type="text"] {
  width: 100%;
  border: 1px solid #cdbb91;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-weight: 800;
  resize: vertical;
}

.bug-form button {
  justify-self: start;
}

.bug-list {
  display: grid;
  gap: 10px;
}

.bug-admin-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.bug-admin-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 12px;
}

.bug-admin-summary strong {
  display: block;
  color: #7b560f;
  font-size: 28px;
}

.bug-admin-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bug-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 10px;
}

.bug-item.new-bug {
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(215, 173, 69, 0.18);
}

.bug-item.severity-critical {
  border-color: #7f1d1d;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.12), #fffaf0 46%);
}

.bug-item.severity-blocking {
  border-color: #c2410c;
  background: linear-gradient(135deg, rgba(194, 65, 12, 0.12), #fffaf0 46%);
}

.bug-item.severity-normal {
  border-color: #d7ad45;
}

.bug-status-stack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bug-item.closed {
  opacity: 0.72;
}

.bug-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.bug-item-head strong,
.bug-item-head small {
  display: block;
}

.bug-item-head small {
  color: var(--muted);
  margin-top: 3px;
}

.bug-item p {
  margin: 8px 0 0;
}

.bug-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.bug-actions button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 12px;
}

.bug-image-picker small,
.bug-delete-hint {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}

.bug-attachment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.bug-attachment {
  display: grid;
  gap: 6px;
  margin: 0;
  color: inherit;
  text-decoration: none;
}

.bug-attachment img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eee;
}

.bug-report-images {
  max-width: 760px;
}

.bug-status-notification-panel {
  border: 2px solid var(--blue);
  background: #f3f7ff;
}

.bug-status-notification-list {
  display: grid;
  gap: 10px;
}

.bug-status-notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #b9caec;
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.bug-status-notification p,
.bug-status-notification small {
  display: block;
  margin: 4px 0 0;
}

.test-match-list {
  display: grid;
  gap: 12px;
}

.test-match {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 12px;
}

.test-match.live-card {
  background:
    linear-gradient(135deg, rgba(215, 173, 69, 0.16), transparent 35%),
    #fffaf0;
}

.test-match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.test-match-meta strong {
  color: #7b560f;
}

.test-score-grid,
.test-live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 20px 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.test-live-grid {
  grid-template-columns: minmax(0, 1fr) 56px 20px 56px 110px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.team-name {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.team-name.right {
  justify-content: flex-end;
}

select {
  min-height: 42px;
  border: 1px solid #cdbb91;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--text);
  font-weight: 800;
  padding: 0 8px;
}

.live-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  justify-items: center;
  padding: 14px 0 16px;
}

.live-scoreboard > strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.live-score {
  display: grid;
  grid-template-columns: 76px 22px 76px;
  gap: 8px;
  align-items: center;
}

.live-score input[type="number"],
.readonly-score {
  width: 76px;
  height: 64px;
  background: #070707;
  border-color: var(--gold);
  color: var(--gold);
  font-size: 30px;
  font-family: Impact, "Arial Black", sans-serif;
}

.readonly-score {
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 6px;
}

.live-score span {
  color: #7b560f;
  font-size: 30px;
  font-weight: 900;
  text-align: center;
}

.live-controls {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.live-controls.simulation-controls {
  grid-template-columns: minmax(0, 1fr) 56px 20px 56px 120px;
}

.locked-note {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  padding: 10px 0;
}

.prediction-comparison {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 90px;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  padding: 8px 10px;
}

.compare-row.self {
  background: #f5e7bd;
  box-shadow: inset 3px 0 0 var(--gold);
}

.compare-row span {
  min-width: 0;
  overflow: hidden;
  font-weight: 900;
}

.compare-row strong {
  text-align: center;
  font-size: 18px;
}

.compare-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.72);
  padding: 20px;
}

.auth {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top, rgba(215, 173, 69, 0.22), transparent 34%),
    rgba(7, 7, 7, 0.86);
  padding: 20px;
}

.auth[hidden] {
  display: none;
}

.update-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top, rgba(215, 173, 69, 0.24), transparent 34%),
    rgba(7, 7, 7, 0.9);
  padding: 20px;
}

.update-overlay[hidden] {
  display: none;
}

.update-panel {
  display: grid;
  gap: 10px;
  width: min(430px, 100%);
  border: 1px solid rgba(215, 173, 69, 0.56);
  border-radius: 8px;
  background: #fffdf8;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.update-panel h1 {
  margin-bottom: 0;
}

.update-progress {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(215, 173, 69, 0.58);
  border-radius: 999px;
  background: #f1eadb;
}

.update-progress span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #070707, var(--gold));
  transition: width 240ms ease;
}

.update-panel small {
  color: var(--muted);
  font-weight: 900;
}

.patch-notes-overlay {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(7, 7, 7, 0.88);
  padding: 20px;
}

.patch-notes-overlay[hidden] {
  display: none;
}

.patch-notes-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(760px, 100%);
  max-height: min(820px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid rgba(215, 173, 69, 0.66);
  border-radius: 8px;
  background: #fffdf8;
  padding: 24px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.46);
}

#patchNotesPopupContent {
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.patch-notes-dialog-head {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.patch-notes-dialog-head h1,
.patch-notes-dialog-head p {
  margin-bottom: 0;
}

.patch-notes-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.patch-note-popup-sections,
.patch-note-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.patch-note-section h3 {
  color: #7b560f;
  font-size: 16px;
  margin-bottom: 8px;
}

.patch-note-section ul,
.patch-note-limitations ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.patch-note-section li,
.patch-note-limitations li {
  color: var(--muted);
  line-height: 1.45;
}

.patch-note-summary {
  color: #342b1d;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.55;
}

.patch-note-popup-hint {
  border-left: 3px solid var(--gold);
  color: var(--muted);
  margin: 18px 0 0;
  padding-left: 12px;
}

.patch-notes-page {
  display: grid;
  gap: 24px;
}

.patch-notes-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 4px 0 22px;
}

.patch-notes-hero h2 {
  font-size: 32px;
  margin-bottom: 8px;
}

.patch-notes-hero p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.patch-version-current {
  flex: 0 0 auto;
  border: 1px solid rgba(215, 173, 69, 0.7);
  border-radius: 999px;
  background: #070707;
  color: var(--gold);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
}

.patch-notes-timeline {
  display: grid;
  gap: 28px;
}

.patch-note-release {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.patch-note-release.current {
  border-bottom-color: rgba(215, 173, 69, 0.72);
}

.patch-note-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.patch-note-meta span {
  color: #7b560f;
  font-size: 20px;
  font-weight: 900;
}

.patch-note-meta time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.patch-note-content > h2 {
  margin-bottom: 8px;
}

.patch-note-limitations {
  border-left: 3px solid #c9962b;
  background: #fff7df;
  margin-top: 20px;
  padding: 14px 16px;
}

.patch-note-limitations strong {
  display: block;
  margin-bottom: 8px;
}

.auth-panel {
  width: min(440px, 100%);
  border: 1px solid rgba(215, 173, 69, 0.52);
  border-radius: 8px;
  background: #fffdf8;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.auth-panel .brand-mark {
  margin-bottom: 18px;
}

.auth-form,
.profile-form {
  display: grid;
  gap: 12px;
}

.auth-form label,
.profile-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.auth-form .check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.auth-form .check-label input {
  min-height: auto;
  width: 18px;
  height: 18px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-row button {
  min-height: 42px;
}

.auth-form input,
.profile-form input {
  min-height: 42px;
  border: 1px solid #cdbb91;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.readonly-field {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 11px 12px;
}

.readonly-field small,
.readonly-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.readonly-field strong {
  color: var(--text);
  font-size: 17px;
}

.password-change-form {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.password-change-form h3 {
  margin: 0;
}

#joinGroupCode {
  text-transform: uppercase;
}

.profile-form .span-form {
  grid-column: span 1;
}

.suggestions {
  display: grid;
  gap: 6px;
}

.suggestions button {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  background: #fffaf0;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
}

.suggestions p {
  margin: 0;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #f5e7bd;
  color: #7b560f;
  padding: 7px 9px;
  font-weight: 900;
}

.chip-list button {
  min-height: 34px;
  width: 34px;
  border-radius: 50%;
  padding: 0;
  touch-action: manipulation;
}

.profile-crests,
.profile-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.profile-crest-showcase {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(215, 173, 69, 0.58);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 30%, rgba(215, 173, 69, 0.18), transparent 42%),
    #090806;
  color: #fff8df;
  margin-bottom: 14px;
  padding: 14px;
}

.profile-crest-showcase small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-crest-showcase h3 {
  margin: 4px 0;
  font-size: 20px;
}

.profile-crest-showcase p {
  color: #d7c99f;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.profile-choice-card {
  display: grid;
  gap: 10px;
  min-height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.profile-choice-card:hover,
.profile-choice-card.active {
  border-color: var(--gold);
  background: #fff7df;
  transform: none;
}

.profile-choice-card .crest {
  width: 100%;
}

.profile-choice-card span {
  display: grid;
  gap: 2px;
}

.profile-choice-card small,
.profile-choice-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.profile-choice-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.profile-picker-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(215, 173, 69, 0.55);
  border-radius: 8px;
  background: #fff7df;
  margin: 10px 0 14px;
  padding: 10px;
}

.profile-picker-panel input {
  min-height: 42px;
  border: 1px solid #cdbb91;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.profile-card-picker {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.profile-card-picker label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.crest {
  display: grid;
  place-items: center;
  min-height: 96px;
  border-radius: 8px;
  border: 2px solid var(--gold);
  background: var(--crest-bg, #070707);
  color: var(--crest-fg, var(--gold));
  text-align: center;
  padding: 10px;
}

.crest strong {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 28px;
}

.crest small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 900;
}

.crest.flag {
  background:
    linear-gradient(135deg, rgba(215, 173, 69, 0.20), transparent 45%),
    #fffaf0;
  color: var(--text);
}

.crest.flag strong {
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 42px;
  line-height: 1;
}

.crest.flag img {
  width: min(118px, 82%);
  max-height: 72px;
  border-radius: 5px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  object-fit: cover;
}

.crest.empty {
  background: #f1eadb;
  color: var(--muted);
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

.danger-zone {
  border: 1px solid #f0a48f;
  border-radius: 8px;
  background: #fff1ed;
  margin-top: 18px;
  padding: 14px;
}

.danger-zone h3 {
  margin-bottom: 6px;
  color: #9a3412;
}

.danger-button {
  background: linear-gradient(135deg, #9a1c1c 0%, #5f0f0f 100%);
}

.intro[hidden] {
  display: none;
}

.intro-panel {
  width: min(540px, 100%);
  background: white;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.intro-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .team-search-control {
    grid-template-columns: 1fr;
  }

  .team-search-control button {
    width: 100%;
  }

  .team-search-result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  body {
    grid-template-columns: 1fr;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: auto;
    bottom: auto;
    top: 0;
    z-index: 12;
    width: min(286px, 82vw);
    height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
    border-right: 1px solid rgba(215, 173, 69, 0.36);
    transform: translateX(-100%);
    transition: transform 210ms ease;
    box-shadow: 12px 0 28px rgba(0, 0, 0, 0.22);
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-handle {
    display: grid;
    place-items: center;
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 12px;
    width: 58px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border: 2px solid rgba(215, 173, 69, 0.88);
    border-radius: 14px;
    background:
      radial-gradient(circle at 50% 24%, rgba(255, 248, 223, 0.16), transparent 36%),
      #050505;
    color: var(--gold);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
    z-index: 20;
  }

  .mobile-nav-handle:active {
    transform: scale(0.96);
  }

  body.mobile-nav-open .mobile-nav-handle {
    border-color: #fff3c4;
    background: #120d05;
  }

  .brand {
    display: flex;
    margin-bottom: 18px;
  }

  nav {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-top: 0;
  }

  nav button {
    min-height: 46px;
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 8px;
  }

  nav button.active,
  nav button:hover {
    box-shadow: inset 3px 0 0 var(--gold);
  }

  main {
    padding: 14px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 3;
    align-items: center;
    flex-direction: row;
    background: rgba(243, 240, 232, 0.94);
    border-bottom: 1px solid rgba(222, 212, 191, 0.78);
    margin: -14px -14px 14px -14px;
    padding: 12px 14px 12px 72px;
    backdrop-filter: blur(10px);
  }

  .topbar h1 {
    max-width: 52vw;
    margin-bottom: 0;
    font-size: 22px;
    line-height: 1;
  }

  .eyebrow {
    font-size: 10px;
  }

  .score-pill {
    min-width: 92px;
    padding: 8px 10px;
  }

  .score-pill strong {
    font-size: 22px;
  }

  .grid {
    gap: 12px;
  }

  .panel, .card {
    padding: 13px;
  }

  .metric {
    min-height: 96px;
  }

  .metric strong {
    font-size: 28px;
  }

  .span-3, .span-4, .span-6, .span-8 {
    grid-column: span 12;
  }

  .match-row {
    grid-template-columns: minmax(0, 1fr) 50px 16px 50px minmax(0, 1fr);
    gap: 8px;
  }

  input[type="number"] {
    width: 50px;
  }

  .match-row strong {
    font-size: 13px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .chat-message {
    width: 92%;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

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

  .bug-form {
    grid-template-columns: 1fr;
  }

  .bug-form .span-form {
    grid-column: span 1;
  }

  .bug-admin-summary {
    grid-template-columns: 1fr;
  }

  .admin-score-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bug-item-head {
    flex-direction: column;
  }

  .bug-attachment-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bug-status-notification {
    align-items: stretch;
    flex-direction: column;
  }

  .test-score-grid {
    grid-template-columns: minmax(0, 1fr) 50px 16px 50px minmax(0, 1fr);
    gap: 8px;
  }

  .test-live-grid {
    grid-template-columns: minmax(0, 1fr) 50px 16px 50px 94px;
    gap: 8px;
  }

  .team-name {
    font-size: 13px;
  }

  .schedule-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .schedule-match-main {
    grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr);
  }

  .schedule-score {
    min-height: 50px;
    padding: 0 8px;
  }

  .schedule-score strong {
    font-size: 25px;
  }

  .schedule-match-meta small {
    margin-left: 0;
    width: 100%;
  }

  .profile-choice-grid {
    grid-template-columns: 1fr;
  }

  .patch-note-release {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .patch-note-meta {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  select {
    font-size: 12px;
    padding: 0 6px;
  }

  .live-scoreboard {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .knockout-list {
    grid-template-columns: 1fr;
  }

  .live-scoreboard > strong {
    font-size: 17px;
  }

  .live-score {
    grid-row: 2;
    grid-template-columns: 70px 20px 70px;
  }

  .live-score input[type="number"],
  .readonly-score {
    width: 70px;
    height: 58px;
    font-size: 28px;
  }

  .live-controls.simulation-controls {
    grid-template-columns: minmax(0, 1fr) 50px 16px 50px 94px;
    gap: 8px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    position: sticky;
    top: 68px;
    z-index: 2;
    background: rgba(243, 240, 232, 0.96);
    padding: 8px 0;
  }

  .tabs button {
    min-height: 38px;
    padding: 6px 4px;
    font-size: 12px;
  }
}

@media (max-width: 430px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar {
    width: min(276px, 84vw);
    transform: translateX(-100%);
  }

  .mobile-nav-handle {
    top: calc(10px + env(safe-area-inset-top));
    left: 10px;
    width: 54px;
    height: 48px;
    min-height: 48px;
    border-radius: 13px;
  }

  .tree-icon {
    width: 31px;
    height: 31px;
  }

  .mobile-menu-lines {
    width: 13px;
  }

  .profile-crest-showcase {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .user-tree-crest.profile {
    width: 88px;
    height: 100px;
  }

  .match-row {
    grid-template-columns: minmax(0, 1fr) 46px 12px 46px minmax(0, 1fr);
    gap: 6px;
  }

  input[type="number"] {
    width: 46px;
    height: 40px;
    padding: 6px;
  }

  .match-row strong {
    font-size: 12px;
  }

  .special-grid,
  .podium-grid {
    grid-template-columns: 1fr;
  }

  nav button {
    font-size: 10px;
    min-height: 52px;
  }

  .test-match-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .test-score-grid {
    grid-template-columns: minmax(0, 1fr) 46px 12px 46px minmax(0, 1fr);
    gap: 6px;
  }

  .test-live-grid {
    grid-template-columns: minmax(0, 1fr) 46px 12px 46px 82px;
    gap: 6px;
  }

  .team-name {
    font-size: 12px;
  }

  .schedule-day-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-match {
    padding: 12px;
  }

  .schedule-match-main {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
  }

  .schedule-team.right {
    text-align: center;
  }

  .schedule-score {
    justify-self: center;
    min-width: 96px;
  }

  .schedule-tips {
    grid-template-columns: 1fr;
  }

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

  .patch-notes-overlay {
    align-items: end;
    padding: 0;
  }

  .patch-notes-dialog {
    width: 100%;
    max-height: 92dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .patch-notes-dialog-actions,
  .patch-notes-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .patch-notes-dialog-actions button {
    width: 100%;
  }

  .patch-note-popup-sections,
  .patch-note-section-grid {
    grid-template-columns: 1fr;
  }

  .group-action-grid {
    grid-template-columns: 1fr;
  }

  .invite-notification {
    align-items: stretch;
    flex-direction: column;
  }

  .warning-card-panel {
    grid-template-columns: 1fr;
  }

  .live-controls {
    grid-template-columns: 1fr;
  }

  .live-controls.simulation-controls {
    grid-template-columns: minmax(0, 1fr) 46px 12px 46px 82px;
  }

  .compare-row {
    grid-template-columns: minmax(0, 1fr) 52px 72px;
    padding: 7px 8px;
  }

  .compare-row strong {
    font-size: 16px;
  }

  .compare-row em {
    font-size: 11px;
  }
}
