:root {
  --bg: #0b1110;
  --surface: rgba(20, 28, 26, 0.9);
  --surface-strong: rgba(30, 39, 36, 0.94);
  --surface-soft: rgba(244, 219, 150, 0.08);
  --text: #fff7e7;
  --muted: #bcb099;
  --line: rgba(244, 219, 150, 0.16);
  --line-strong: rgba(244, 219, 150, 0.3);
  --accent: #d9a230;
  --accent-strong: #f2c257;
  --accent-soft: rgba(217, 162, 48, 0.15);
  --gold: #f0c75b;
  --gold-soft: rgba(240, 199, 91, 0.16);
  --red: #e76548;
  --red-soft: rgba(231, 101, 72, 0.14);
  --green: #69c17f;
  --green-soft: rgba(105, 193, 127, 0.15);
  --blue: #66b5d8;
  --blue-soft: rgba(102, 181, 216, 0.14);
  --violet: #b9a7ff;
  --violet-soft: rgba(185, 167, 255, 0.14);
  --ink: #0b100f;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.22);
  --glow-gold: 0 0 22px rgba(240, 199, 91, 0.18);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(130deg, rgba(28, 73, 62, 0.2), transparent 38%),
    linear-gradient(180deg, #0b1110 0%, #101715 48%, #130f0b 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(244, 219, 150, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 219, 150, 0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent 76%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(240, 199, 91, 0.7);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 199, 91, 0.42) rgba(9, 14, 13, 0.55);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(9, 14, 13, 0.55);
}

::-webkit-scrollbar-thumb {
  border: 2px solid rgba(9, 14, 13, 0.55);
  border-radius: 999px;
  background: rgba(240, 199, 91, 0.42);
}

.app-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  min-height: 300px;
  padding: 34px clamp(18px, 4vw, 48px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(6, 12, 11, 0.92) 0%, rgba(6, 12, 11, 0.62) 38%, rgba(6, 12, 11, 0.04) 70%, rgba(6, 12, 11, 0.5) 100%),
    linear-gradient(180deg, rgba(6, 12, 11, 0.04) 0%, transparent 54%, rgba(11, 17, 16, 0.98) 100%),
    url("assets/five-elements-hero.jpg") center 42% / cover no-repeat;
  border-bottom: 1px solid rgba(240, 199, 91, 0.2);
}

.app-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 96px;
  background: linear-gradient(180deg, transparent, rgba(11, 17, 16, 0.98));
  pointer-events: none;
}

.brand-block,
.header-actions {
  position: relative;
  z-index: 1;
}

.brand-block {
  min-width: 0;
  max-width: 600px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  border: 1px solid rgba(240, 199, 91, 0.28);
  border-radius: 999px;
  background: rgba(11, 17, 16, 0.5);
  color: var(--gold);
  padding: 5px 10px;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

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

h1 {
  margin-bottom: 14px;
  color: #fff8e8;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow: 0 5px 24px rgba(0, 0, 0, 0.68);
}

h2 {
  margin-bottom: 14px;
  color: #fff5df;
  font-size: 22px;
}

h3 {
  margin-bottom: 10px;
  color: #fff5df;
  font-size: 17px;
}

.element-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.element-ribbon span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.28);
}

.element-metal {
  background: linear-gradient(145deg, #fff1a8, #8b6926);
}

.element-wood {
  background: linear-gradient(145deg, #74d889, #1e6c45);
}

.element-water {
  background: linear-gradient(145deg, #70c7ef, #1a597a);
}

.element-fire {
  background: linear-gradient(145deg, #ff8062, #9e2218);
}

.element-earth {
  background: linear-gradient(145deg, #d4a15b, #704722);
}

.header-actions,
.section-actions,
.inline-actions,
.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions {
  justify-content: flex-end;
  max-width: 520px;
  padding: 14px;
  border: 1px solid rgba(240, 199, 91, 0.2);
  border-radius: 8px;
  background: rgba(8, 13, 12, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.week-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f0dfb6;
  font-size: 14px;
  font-weight: 700;
}

.auth-box {
  display: grid;
  gap: 6px;
  min-width: min(260px, 100%);
}

.auth-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.auth-status strong {
  color: #fff6e4;
}

.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(9, 14, 13, 0.82);
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(240, 199, 91, 0.16);
}

select[disabled],
input[disabled],
textarea[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
}

.button {
  min-height: 38px;
  border: 1px solid rgba(240, 199, 91, 0.75);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 42%),
    linear-gradient(180deg, #ffd873, #b77d22);
  color: #1d1407;
  padding: 8px 13px;
  font-weight: 900;
  text-shadow: 0 1px rgba(255, 255, 255, 0.22);
  box-shadow: 0 11px 24px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.38);
  transition: transform 0.12s ease, filter 0.12s ease, border 0.12s ease, box-shadow 0.12s ease;
}

a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.button:hover {
  border-color: #fff0b8;
  filter: brightness(1.08);
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.3);
}

.button:active {
  transform: translateY(1px);
}

.button-secondary {
  border-color: rgba(240, 199, 91, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 248, 225, 0.08), transparent),
    rgba(14, 22, 20, 0.84);
  color: #ffe8a2;
  text-shadow: none;
}

.button-secondary:hover {
  background: rgba(48, 42, 25, 0.92);
}

.button-danger {
  border-color: rgba(231, 101, 72, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(50, 20, 17, 0.9);
  color: #ffc5ba;
  text-shadow: none;
}

.button-danger:hover {
  background: rgba(92, 31, 24, 0.94);
  border-color: #ff9b86;
}

.button[disabled],
.segmented button[disabled] {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-compact {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.tabbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 11px clamp(18px, 4vw, 48px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(240, 199, 91, 0.18);
  background: linear-gradient(180deg, rgba(14, 20, 18, 0.94), rgba(8, 13, 12, 0.9));
  backdrop-filter: blur(18px);
}

.tab-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 82px;
  min-height: 42px;
  border: 1px solid rgba(244, 219, 150, 0.1);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.02);
  color: #d7c6a0;
  padding: 9px 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.14s ease, background 0.14s ease, color 0.14s ease, border 0.14s ease;
}

.tab-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  opacity: 0.88;
}

.tab-label {
  line-height: 1;
}

.tab-button:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 199, 91, 0.34);
  background: rgba(240, 199, 91, 0.07);
  color: #ffe8a2;
}

.tab-button.is-active {
  border-color: rgba(240, 199, 91, 0.72);
  background: linear-gradient(180deg, rgba(240, 199, 91, 0.2), rgba(240, 199, 91, 0.08));
  color: #fff1bc;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.tab-button.is-active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 5px;
  left: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-strong);
  box-shadow: 0 0 14px rgba(242, 194, 87, 0.55);
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 48px) 48px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px) 28px;
  text-align: center;
}

.site-footer a {
  color: rgba(255, 247, 231, 0.72);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.site-footer .beian-police-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.site-footer img {
  height: 16px;
  width: auto;
  flex: 0 0 auto;
}

.site-footer a:hover {
  color: #fff1bc;
  text-decoration: underline;
}

.readonly-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border: 1px solid rgba(102, 181, 216, 0.26);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(102, 181, 216, 0.13), rgba(102, 181, 216, 0.06));
  color: #c4edff;
  padding: 10px 12px;
}

.readonly-banner strong {
  color: #e8f7ff;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
}

.panel,
.metric,
.team-card,
.match-card,
.rule-card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(244, 219, 150, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 225, 0.06), rgba(255, 248, 225, 0.018) 72%),
    var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 199, 91, 0.5), transparent);
  opacity: 0.62;
  pointer-events: none;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 0;
}

.panel-body {
  padding: 18px;
}

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

.mini {
  font-size: 12px;
}

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

.player-detail-metric-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric {
  position: relative;
  min-height: 102px;
  padding: 15px 15px 14px;
  overflow: hidden;
  isolation: isolate;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #f0c75b, #69c17f, #66b5d8, #e76548);
  opacity: 0.78;
}

.metric::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -42px;
  z-index: -1;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 199, 91, 0.17), transparent 66%);
}

.metric-label {
  margin: 0 0 8px;
  color: #d7c7a3;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.metric-value {
  margin: 0;
  color: #fff6e4;
  font-size: 26px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.metric .muted {
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.mini-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid rgba(244, 219, 150, 0.12);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.055);
  padding: 10px;
}

.mini-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-metric strong {
  color: #fff5df;
  font-size: 18px;
}

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

.honor-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(244, 219, 150, 0.12);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.055);
  padding: 10px;
}

.honor-item strong {
  display: block;
  margin: 2px 0;
  color: #fff5df;
  font-size: 16px;
}

.honor-item p,
.honor-item small {
  margin: 0;
}

.honor-item p {
  color: var(--gold);
  font-weight: 900;
}

.honor-item small {
  color: var(--muted);
}

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

.relationship-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(102, 181, 216, 0.16);
  border-radius: 8px;
  background: rgba(102, 181, 216, 0.055);
  padding: 10px;
}

.relationship-item-column {
  display: block;
}

.relationship-avatars {
  display: flex;
  align-items: center;
}

.relationship-avatars .player-avatar {
  width: 42px;
  border-color: rgba(102, 181, 216, 0.34);
  font-size: 17px;
}

.relationship-avatars .player-avatar + .player-avatar {
  margin-left: -10px;
}

.relationship-item strong {
  display: block;
  min-width: 0;
  margin: 2px 0;
  color: #fff5df;
  font-size: 16px;
}

.relationship-item p,
.relationship-item small {
  margin: 0;
}

.relationship-item p {
  color: #c4edff;
  font-weight: 900;
}

.relationship-item small {
  color: var(--muted);
}

.relationship-tags,
.title-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.relationship-tags {
  margin: 8px 0 6px;
}

.relationship-tag,
.title-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 100%;
  border: 1px solid rgba(244, 219, 150, 0.14);
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.07);
  color: #ead9b4;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.relationship-tag strong {
  display: inline;
  margin: 0;
  font-size: 12px;
}

.relationship-tag small {
  color: var(--muted);
}

.relationship-tag-empty {
  color: var(--muted);
}

.storyline-list,
.highlight-record-list {
  display: grid;
  gap: 10px;
}

.storyline-item,
.highlight-record {
  min-width: 0;
  border: 1px solid rgba(105, 193, 127, 0.16);
  border-radius: 8px;
  background: rgba(105, 193, 127, 0.055);
  padding: 12px;
}

.storyline-item span {
  display: inline-flex;
  min-height: 24px;
  border: 1px solid rgba(105, 193, 127, 0.28);
  border-radius: 999px;
  color: #c7f7cf;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 900;
}

.storyline-item strong,
.highlight-record strong {
  display: block;
  margin: 8px 0 4px;
  color: #fff5df;
  font-size: 17px;
}

.storyline-item p,
.highlight-record p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.highlight-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.player-detail-header {
  padding-bottom: 0;
}

.player-detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
}

.player-detail-title {
  min-width: 0;
}

.detail-back {
  width: fit-content;
  min-height: 34px;
  margin-bottom: 12px;
}

.player-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.player-avatar {
  display: grid;
  place-items: center;
  width: 86px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border: 1px solid rgba(240, 199, 91, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(240, 199, 91, 0.16), rgba(102, 181, 216, 0.1)),
    rgba(9, 14, 13, 0.86);
  color: #fff1bc;
  overflow: hidden;
  font-size: 34px;
  font-weight: 900;
}

.player-avatar-large {
  width: min(180px, 32vw);
}

.player-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.avatar-upload-button {
  position: relative;
  overflow: hidden;
}

.avatar-upload-button input {
  position: absolute;
  inset: 0;
  cursor: pointer;
  opacity: 0;
}

.avatar-lock-hint {
  margin: 12px 0 0;
}

.player-link {
  color: #fff3c6;
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 199, 91, 0.45);
}

.player-link:hover {
  color: #ffe28a;
  border-bottom-color: #ffe28a;
}

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

.team-poster {
  min-width: 0;
  border: 1px solid rgba(240, 199, 91, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(240, 199, 91, 0.12), rgba(102, 181, 216, 0.06)),
    rgba(9, 14, 13, 0.7);
  padding: 13px;
}

.team-poster.is-ranked {
  border-color: rgba(240, 199, 91, 0.58);
}

.team-poster-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.team-poster-head strong {
  display: block;
  color: #fff5df;
  font-size: 22px;
}

.team-poster-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.team-poster-ranking {
  margin-top: 6px;
}

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

.poster-member {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(244, 219, 150, 0.1);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.045);
  padding: 8px 6px;
  text-align: center;
}

.poster-member .player-avatar {
  width: 48px;
  font-size: 18px;
}

.poster-member strong {
  max-width: 100%;
  overflow: hidden;
  color: #fff5df;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-member span {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.poster-member i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  border: 1px solid rgba(244, 219, 150, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.record-card {
  border: 1px solid rgba(240, 199, 91, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 199, 91, 0.16), rgba(105, 193, 127, 0.08), rgba(102, 181, 216, 0.1)),
    rgba(9, 14, 13, 0.72);
  padding: 16px;
}

.record-card-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.record-card-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.record-card h3 {
  margin-bottom: 6px;
  font-size: 30px;
}

.record-title {
  display: inline-flex;
  margin-top: 8px;
  border: 1px solid rgba(240, 199, 91, 0.42);
  border-radius: 999px;
  color: #ffe8a2;
  padding: 5px 10px;
}

.title-badge-row {
  margin-top: 9px;
}

.title-badge {
  border-color: rgba(105, 193, 127, 0.22);
  background: rgba(105, 193, 127, 0.1);
  color: #c7f7cf;
}

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

.info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid rgba(244, 219, 150, 0.1);
  padding-bottom: 9px;
}

.info-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.info-list dd {
  min-width: 0;
  margin: 0;
  color: #fff5df;
  overflow-wrap: anywhere;
}

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

.draw-reveal {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(240, 199, 91, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(240, 199, 91, 0.1), rgba(12, 20, 18, 0.76)),
    rgba(13, 22, 20, 0.86);
  padding: 14px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.draw-reveal-head,
.draw-reveal-team-title,
.draw-reveal-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.draw-reveal-head h3 {
  margin: 0 0 4px;
  color: #fff5df;
  font-size: 17px;
}

.draw-reveal-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.draw-reveal-step {
  min-width: 0;
  border: 1px solid rgba(255, 248, 225, 0.12);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.06);
  color: var(--muted);
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.draw-reveal-step.is-done {
  border-color: rgba(240, 199, 91, 0.48);
  color: #ffe8a2;
}

.draw-reveal-step.is-active {
  background: rgba(240, 199, 91, 0.16);
  box-shadow: 0 0 0 1px rgba(240, 199, 91, 0.16), 0 10px 24px rgba(0, 0, 0, 0.22);
}

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

.draw-reveal-team {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 225, 0.12);
  border-radius: 8px;
  background: rgba(8, 15, 14, 0.72);
}

.draw-reveal-team-title {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(240, 199, 91, 0.08);
}

.draw-reveal-team-title strong {
  min-width: 0;
  overflow: hidden;
  color: #fff5df;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-reveal-members {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 10px;
  list-style: none;
}

.draw-reveal-member {
  min-height: 34px;
  border: 1px solid rgba(255, 248, 225, 0.1);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.04);
  padding: 7px 8px;
  color: #fff5df;
}

.draw-reveal-member strong {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-reveal-member.is-hidden {
  color: rgba(220, 213, 191, 0.58);
}

.draw-reveal-member.is-revealed {
  animation: reveal-pop 0.32s ease-out;
}

.draw-reveal-attribute {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.08);
  color: #ffe8a2;
  font-size: 12px;
  font-weight: 900;
}

@keyframes reveal-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.team-card {
  min-width: 0;
}

.team-card.is-ranked {
  border-color: rgba(240, 199, 91, 0.66);
}

.team-title {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(240, 199, 91, 0.11), transparent);
}

.team-title-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.team-title strong {
  min-width: 0;
  overflow: hidden;
  color: #fff5df;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-ranking-badge {
  align-self: flex-start;
  max-width: 100%;
  white-space: normal;
}

.member-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  list-style: none;
}

.member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  border: 1px solid rgba(244, 219, 150, 0.1);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 6px 8px;
}

.member > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-meta {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid rgba(244, 219, 150, 0.16);
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.08);
  color: #d8c8a5;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-green {
  border-color: rgba(105, 193, 127, 0.34);
  background: var(--green-soft);
  color: #b9f4c6;
}

.badge-gold {
  border-color: rgba(240, 199, 91, 0.42);
  background: var(--gold-soft);
  color: #ffeaa0;
}

.badge-red {
  border-color: rgba(231, 101, 72, 0.34);
  background: var(--red-soft);
  color: #ffc2b6;
}

.role-fire {
  border-color: rgba(231, 101, 72, 0.4);
  background: rgba(231, 101, 72, 0.16);
  color: #ffc2b6;
}

.role-wood {
  border-color: rgba(105, 193, 127, 0.4);
  background: rgba(105, 193, 127, 0.16);
  color: #c7f7cf;
}

.role-water {
  border-color: rgba(102, 181, 216, 0.42);
  background: rgba(102, 181, 216, 0.16);
  color: #c4edff;
}

.role-metal {
  border-color: rgba(240, 199, 91, 0.42);
  background: rgba(240, 199, 91, 0.16);
  color: #ffeaa0;
}

.role-earth {
  border-color: rgba(212, 161, 91, 0.42);
  background: rgba(212, 161, 91, 0.17);
  color: #ffd7a0;
}

.match-flow {
  display: grid;
  gap: 14px;
}

.match-flow-lane {
  min-width: 0;
  border: 1px solid rgba(244, 219, 150, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(240, 199, 91, 0.075), transparent 42%),
    rgba(9, 14, 13, 0.36);
  padding: 12px;
}

.match-flow-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.match-flow-label strong {
  color: #fff5df;
  font-size: 14px;
}

.match-flow-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

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

.week-summary {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 18, 17, 0.58);
}

.week-summary-head,
.week-summary-grid {
  display: grid;
  gap: 12px;
}

.week-summary-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  margin-bottom: 12px;
}

.week-summary-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.week-summary-block h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

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

.archive-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 18, 17, 0.58);
  overflow: hidden;
}

.archive-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.archive-summary::-webkit-details-marker {
  display: none;
}

.archive-summary:hover {
  background: rgba(240, 199, 91, 0.06);
}

.archive-summary-main,
.archive-summary-meta {
  min-width: 0;
}

.archive-summary-main {
  display: grid;
  gap: 4px;
}

.archive-summary-main strong {
  color: #fff5df;
}

.archive-summary-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.archive-open-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(240, 199, 91, 0.48);
  border-radius: 999px;
  color: #ffe8a2;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
}

.archive-open-label::after {
  content: "↓";
  margin-left: 6px;
}

.archive-item[open] .archive-open-label::after {
  content: "↑";
}

.archive-detail {
  border-top: 1px solid var(--line);
  padding: 14px;
}

.archive-section {
  min-width: 0;
}

.archive-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.archive-section-head h3,
.archive-section-head p {
  margin-bottom: 0;
}

.match-card {
  padding: 15px;
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.match-card:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 199, 91, 0.32);
}

.match-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(244, 219, 150, 0.18);
}

.match-card.is-ready::before {
  background: linear-gradient(180deg, var(--gold), var(--blue));
}

.match-card.is-complete {
  border-color: rgba(105, 193, 127, 0.34);
  background:
    linear-gradient(180deg, rgba(105, 193, 127, 0.1), rgba(255, 248, 225, 0.018) 72%),
    var(--surface);
}

.match-card.is-complete::before {
  background: linear-gradient(180deg, var(--green), var(--gold));
}

.match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 10px;
}

.match-head strong {
  color: #fff5df;
}

.match-scoreline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 13px;
}

.match-team-side {
  position: relative;
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 72px;
  border: 1px solid rgba(244, 219, 150, 0.12);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.045);
  padding: 10px 34px 10px 11px;
}

.match-team-side span {
  min-width: 0;
  overflow: hidden;
  color: #fff3d6;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-team-side small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.match-team-side b {
  position: absolute;
  right: 9px;
  top: 9px;
  display: grid;
  place-items: center;
  width: 22px;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 219, 150, 0.16);
  border-radius: 999px;
  color: #d8c8a5;
  font-size: 11px;
}

.match-team-side.is-winner {
  border-color: rgba(105, 193, 127, 0.44);
  background: linear-gradient(135deg, rgba(105, 193, 127, 0.18), rgba(240, 199, 91, 0.07));
  box-shadow: inset 0 0 0 1px rgba(105, 193, 127, 0.08);
}

.match-team-side.is-winner span {
  color: #ddffe3;
}

.match-team-side.is-winner b {
  border-color: rgba(105, 193, 127, 0.38);
  background: rgba(105, 193, 127, 0.16);
  color: #c7f7cf;
}

.match-team-side.is-loser {
  opacity: 0.72;
}

.match-score-center {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-width: 70px;
  color: var(--gold);
}

.match-score-center strong {
  color: #fff1bc;
  font-size: 28px;
  line-height: 1;
  text-shadow: var(--glow-gold);
}

.match-score-center > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.score-dots {
  display: flex;
  gap: 4px;
}

.score-dot {
  display: grid;
  place-items: center;
  width: 20px;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 219, 150, 0.13);
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.05);
  color: rgba(255, 247, 231, 0.54);
  font-size: 10px;
  font-weight: 900;
}

.score-dot.is-a {
  border-color: rgba(240, 199, 91, 0.46);
  background: rgba(240, 199, 91, 0.16);
  color: #ffeaa0;
}

.score-dot.is-b {
  border-color: rgba(102, 181, 216, 0.46);
  background: rgba(102, 181, 216, 0.16);
  color: #c4edff;
}

.game-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: rgba(9, 14, 13, 0.72);
  color: #d7c6a0;
  font-weight: 800;
  transition: background 0.14s ease, color 0.14s ease;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-active {
  background: linear-gradient(180deg, #f0c75b, #9a6820);
  color: #1d1407;
}

.segmented button:not([disabled]):hover {
  background: rgba(240, 199, 91, 0.11);
  color: #ffe8a2;
}

.segmented button.is-active:not([disabled]):hover {
  background: linear-gradient(180deg, #ffd873, #a87022);
  color: #1d1407;
}

.match-highlight-control {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid rgba(244, 219, 150, 0.12);
  padding-top: 12px;
}

.highlight-choice-grid,
.match-highlight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.highlight-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  max-width: 100%;
  border: 1px solid rgba(244, 219, 150, 0.16);
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.06);
  color: #ead9b4;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.highlight-choice input {
  width: 14px;
  height: 14px;
  min-height: 0;
  accent-color: #f0c75b;
}

.highlight-choice.is-active,
.match-highlight-tag {
  border-color: rgba(240, 199, 91, 0.38);
  background: rgba(240, 199, 91, 0.13);
  color: #ffe8a2;
}

.match-highlight-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(240, 199, 91, 0.38);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(244, 219, 150, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 225, 0.035), transparent 140px),
    rgba(9, 14, 13, 0.54);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.table-wrap-compact table {
  min-width: 560px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: transparent;
}

th,
td {
  border-bottom: 1px solid rgba(244, 219, 150, 0.12);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: rgba(255, 248, 225, 0.055);
  color: #decda6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(240, 199, 91, 0.06);
}

.rank-cell {
  width: 58px;
  color: var(--gold);
  font-weight: 900;
}

.official-ranking-leaders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.official-ranking-header {
  justify-content: flex-start;
}

.official-ranking-heading {
  display: grid;
  gap: 8px;
}

.official-ranking-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.official-ranking-title-row h2,
.official-ranking-update {
  margin: 0;
}

.official-ranking-title-row .button {
  width: auto;
  flex: 0 0 auto;
}

.official-ranking-update {
  white-space: nowrap;
}

.official-ranking-leader {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  border: 1px solid rgba(244, 219, 150, 0.16);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.035);
  padding: 14px;
}

.official-ranking-leader.rank-first {
  border-color: rgba(240, 199, 91, 0.48);
  background: rgba(240, 199, 91, 0.1);
}

.official-ranking-leader > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.official-ranking-leader-name,
.official-ranking-player {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.official-ranking-leader strong {
  color: #fff5df;
  overflow-wrap: anywhere;
}

.official-ranking-leader span:not(.rank-medal) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.official-ranking-name,
.official-ranking-value {
  color: #fff5df;
}

.official-ranking-value {
  font-variant-numeric: tabular-nums;
}

.official-ranking-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.ranking-tag-first {
  border-color: rgba(240, 199, 91, 0.58);
  background: rgba(240, 199, 91, 0.17);
  color: #ffe69a;
}

.ranking-tag-second {
  border-color: rgba(185, 199, 214, 0.5);
  background: rgba(185, 199, 214, 0.13);
  color: #e1e9f0;
}

.ranking-tag-third {
  border-color: rgba(206, 145, 82, 0.52);
  background: rgba(206, 145, 82, 0.14);
  color: #efbb80;
}

.ranking-tag-top-ten {
  border-color: rgba(105, 193, 127, 0.4);
  background: rgba(105, 193, 127, 0.12);
  color: #a7e3b5;
}

.ranking-tag-rank-4 {
  border-color: rgba(105, 193, 127, 0.52);
  background: rgba(105, 193, 127, 0.17);
}

.ranking-tag-rank-5 {
  border-color: rgba(105, 193, 127, 0.48);
  background: rgba(105, 193, 127, 0.15);
}

.ranking-tag-rank-6 {
  border-color: rgba(105, 193, 127, 0.44);
  background: rgba(105, 193, 127, 0.13);
}

.ranking-tag-rank-7 {
  border-color: rgba(105, 193, 127, 0.4);
  background: rgba(105, 193, 127, 0.11);
}

.ranking-tag-rank-8 {
  border-color: rgba(105, 193, 127, 0.36);
  background: rgba(105, 193, 127, 0.1);
}

.ranking-tag-rank-9 {
  border-color: rgba(105, 193, 127, 0.32);
  background: rgba(105, 193, 127, 0.09);
}

.ranking-tag-rank-10 {
  border-color: rgba(105, 193, 127, 0.28);
  background: rgba(105, 193, 127, 0.08);
}

.official-ranking-table table {
  min-width: 540px;
}

@media (min-width: 761px) {
  .player-management-table {
    min-width: 1120px;
  }

  .player-management-table th:nth-child(2),
  .player-management-table td:nth-child(2) {
    width: 330px;
  }
}

.ranking-retry {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.standing-board {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.standing-row {
  display: grid;
  grid-template-columns: 46px minmax(180px, 1.35fr) minmax(170px, 0.9fr) minmax(126px, 0.58fr) minmax(108px, 0.6fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(244, 219, 150, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 248, 225, 0.06), rgba(255, 248, 225, 0.018)),
    rgba(9, 14, 13, 0.58);
  padding: 10px 12px;
}

.standing-row.rank-first {
  border-color: rgba(240, 199, 91, 0.45);
  background:
    linear-gradient(90deg, rgba(240, 199, 91, 0.16), rgba(255, 248, 225, 0.025)),
    rgba(9, 14, 13, 0.6);
}

.standing-row.rank-second {
  border-color: rgba(185, 167, 255, 0.34);
}

.standing-row.rank-third {
  border-color: rgba(212, 161, 91, 0.34);
}

.standing-board-compact {
  margin-bottom: 0;
}

.standing-board-compact .standing-row {
  grid-template-columns: 42px minmax(0, 1fr) minmax(84px, auto);
  gap: 10px;
  padding: 9px 10px;
}

.standing-board-compact .standing-weeks,
.standing-board-compact .standing-prize {
  display: none;
}

.standing-rank {
  display: grid;
  place-items: center;
}

.rank-medal {
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 219, 150, 0.18);
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.07);
  color: #ead9b4;
  font-size: 13px;
  font-weight: 950;
}

.rank-medal.rank-first {
  border-color: rgba(240, 199, 91, 0.66);
  background: linear-gradient(145deg, #ffe89a, #9d681e);
  color: #1d1407;
  box-shadow: var(--glow-gold);
}

.rank-medal.rank-second {
  border-color: rgba(185, 167, 255, 0.46);
  background: linear-gradient(145deg, rgba(185, 167, 255, 0.28), rgba(102, 181, 216, 0.12));
  color: #ede8ff;
}

.rank-medal.rank-third {
  border-color: rgba(212, 161, 91, 0.48);
  background: linear-gradient(145deg, rgba(212, 161, 91, 0.28), rgba(231, 101, 72, 0.1));
  color: #ffe0b3;
}

.standing-player,
.table-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.standing-player .player-avatar {
  width: 42px;
  font-size: 17px;
}

.table-player .player-avatar {
  width: 34px;
  font-size: 14px;
}

.standing-player strong,
.table-player strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fff5df;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-player span,
.table-player span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.week-point-chip {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(244, 219, 150, 0.12);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.045);
  padding: 6px 4px;
}

.week-point-chip small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.week-point-chip strong {
  color: #d8c8a5;
  font-size: 13px;
}

.week-point-chip.has-points {
  border-color: rgba(240, 199, 91, 0.32);
  background: rgba(240, 199, 91, 0.11);
}

.week-point-chip.has-points strong {
  color: #ffeaa0;
}

.standing-score {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.standing-score strong,
.score-strong {
  color: #fff1bc;
  font-size: 22px;
  font-weight: 950;
}

.standing-score span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.standing-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.08);
}

.standing-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--green), var(--blue));
}

.standing-prize {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 0;
  text-align: right;
}

.standing-prize strong {
  max-width: 100%;
  overflow: hidden;
  color: #fff5df;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.point-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 26px;
  border: 1px solid rgba(244, 219, 150, 0.13);
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.point-pill.has-points {
  border-color: rgba(240, 199, 91, 0.38);
  background: rgba(240, 199, 91, 0.13);
  color: #ffeaa0;
}

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

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

.field label,
.check-field {
  color: #ddcda7;
  font-size: 13px;
  font-weight: 800;
}

.field-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field-hint.is-warning {
  color: #ffc2b6;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.check-field input {
  width: 18px;
  min-height: 18px;
}

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

.rule-card {
  padding: 16px;
}

.rule-card ul {
  margin: 0;
  padding-left: 20px;
}

.rule-card li {
  margin: 7px 0;
}

.empty-state {
  border: 1px dashed rgba(244, 219, 150, 0.28);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.05);
  padding: 22px;
  text-align: center;
}

.log-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.055);
  padding: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(240, 199, 91, 0.38);
  border-radius: 8px;
  background: rgba(15, 21, 20, 0.96);
  color: #fff6e4;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .app-header {
    min-height: 284px;
    align-items: flex-end;
  }

  .page-grid,
  .team-grid,
  .draw-reveal-grid,
  .week-summary-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .standing-row {
    grid-template-columns: 44px minmax(0, 1.2fr) minmax(150px, 0.9fr) minmax(112px, 0.55fr);
  }

  .standing-prize {
    grid-column: 2 / -1;
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-header {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 360px;
    padding: 24px 14px 20px;
    background-position: 58% top;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 20px;
  }

  .element-ribbon span {
    width: 32px;
    height: 32px;
  }

  .header-actions {
    align-items: stretch;
    max-width: none;
    width: 100%;
    padding: 12px;
  }

  .week-picker,
  .auth-box,
  .header-actions .button {
    width: 100%;
  }

  .auth-login {
    grid-template-columns: 1fr;
  }

  select,
  input,
  textarea,
  .button {
    min-height: 44px;
  }

  .button {
    width: 100%;
    padding: 10px 12px;
  }

  .tabbar {
    gap: 7px;
    padding: 10px 14px;
  }

  .tab-button {
    min-width: 76px;
    min-height: 44px;
    padding: 10px 12px;
  }

  .official-ranking-leaders {
    grid-template-columns: 1fr;
  }

  .tab-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }

  .app-shell {
    padding: 18px 14px 42px;
  }

  .app-shell,
  .stack,
  .page-grid,
  .panel,
  .panel-header,
  .panel-body,
  .metric-grid,
  .team-grid,
  .draw-reveal,
  .draw-reveal-grid,
  .match-grid,
  .form-grid,
  .rule-grid {
    min-width: 0;
    max-width: 100%;
  }

  .panel {
    width: 100%;
  }

  .readonly-banner {
    align-items: flex-start;
  }

  .week-picker select {
    width: 100%;
    min-width: 0;
  }

  .week-picker {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .page-grid,
  .team-grid,
  .draw-reveal-grid,
  .team-poster-grid,
  .match-grid,
  .week-summary-grid,
  .form-grid,
  .rule-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .draw-reveal-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .draw-reveal-steps {
    grid-template-columns: repeat(5, minmax(34px, 1fr));
    gap: 5px;
  }

  .draw-reveal-step {
    padding: 7px 4px;
  }

  .mini-metric-grid {
    grid-template-columns: 1fr;
  }

  .poster-member-grid,
  .record-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .metric {
    min-height: 92px;
    padding: 13px 12px 12px;
  }

  .metric-value {
    font-size: 24px;
  }

  .panel-header {
    flex-direction: column;
    padding: 16px 14px 0;
  }

  .panel-header .muted,
  .panel-body .muted {
    line-height: 1.62;
    word-break: break-all;
  }

  .panel-body {
    padding: 14px;
  }

  .inline-actions,
  .section-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .archive-summary,
  .archive-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .archive-summary-meta {
    justify-content: flex-start;
    width: 100%;
  }

  .player-detail-hero {
    flex-direction: column;
  }

  .highlight-record {
    grid-template-columns: 1fr;
  }

  .record-card-hero {
    grid-template-columns: 1fr;
  }

  .player-avatar-large {
    width: min(220px, 100%);
  }

  .avatar-upload {
    align-items: stretch;
    flex-direction: column;
  }

  .versus {
    grid-template-columns: 1fr;
  }

  .versus span {
    display: none;
  }

  .match-flow-lane {
    padding: 10px;
  }

  .match-flow-label {
    display: grid;
    gap: 3px;
  }

  .match-scoreline {
    grid-template-columns: 1fr;
  }

  .match-score-center {
    min-height: 54px;
  }

  .match-team-side {
    min-height: 62px;
  }

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

  .segmented button {
    min-height: 44px;
    overflow: hidden;
    padding: 8px 5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .team-title strong,
  .member > span {
    white-space: normal;
  }

  .team-title-main {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .member {
    align-items: flex-start;
    flex-direction: column;
  }

  .member-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tr {
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid rgba(244, 219, 150, 0.14);
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(255, 248, 225, 0.055), rgba(255, 248, 225, 0.018) 72%),
      rgba(20, 28, 26, 0.9);
    box-shadow: var(--shadow-soft);
  }

  .table-wrap tr:last-child {
    margin-bottom: 0;
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(82px, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 46px;
    border-bottom: 1px solid rgba(244, 219, 150, 0.1);
    padding: 10px 12px;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: #d7c7a3;
    font-size: 12px;
    font-weight: 900;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
  }

  .table-wrap td > input,
  .table-wrap td > select {
    min-width: 0;
  }

  .table-wrap td .button {
    justify-self: stretch;
  }

  .rank-cell {
    width: auto;
    font-size: 20px;
  }

  .standing-row,
  .standing-board-compact .standing-row {
    grid-template-columns: 38px minmax(0, 1fr) minmax(72px, auto);
    gap: 9px;
    align-items: start;
    padding: 10px;
  }

  .standing-player .player-avatar {
    width: 38px;
    font-size: 16px;
  }

  .standing-weeks {
    grid-column: 2 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .standing-prize {
    grid-column: 2 / -1;
    justify-items: start;
    text-align: left;
  }

  .standing-board-compact .standing-weeks,
  .standing-board-compact .standing-prize {
    display: none;
  }

  .standing-score {
    justify-self: end;
    min-width: 72px;
    text-align: right;
  }

  .standing-score .standing-bar {
    width: 72px;
  }

  .table-player .player-avatar {
    width: 32px;
  }

  .check-field {
    justify-content: flex-start;
    min-height: 44px;
  }
}
