:root {
  color-scheme: light;
  --bg: #fdfbf7;
  --bg-soft: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --ink: #101827;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: rgba(29, 41, 57, 0.1);
  --brand: #3b82f6;
  --brand-strong: #1d4ed8;
  --brand-soft: #e8f1ff;
  --success: #10b981;
  --success-soft: #e7f8f1;
  --warning: #f59e0b;
  --warning-soft: #fff4db;
  --danger: #f43f5e;
  --danger-soft: #fff1f4;
  --cyan: #06b6d4;
  --violet: #7c3aed;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 26px rgba(59, 130, 246, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui,
    -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: contain;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(120deg, rgba(59, 130, 246, 0.08), transparent 38%),
    radial-gradient(circle at 78% 8%, rgba(16, 185, 129, 0.13), transparent 26%),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.045;
  background-image: radial-gradient(#3b82f6 1.2px, transparent 1.2px);
  background-size: 30px 30px;
  pointer-events: none;
}

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

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
}

.phone-frame {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(88px + var(--safe-bottom));
  overflow-x: hidden;
}

.login-page {
  min-height: 100vh;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 28px 18px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.login-brand {
  display: grid;
  gap: 12px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #111827;
  color: #fff;
  box-shadow: 0 16px 30px rgba(17, 24, 39, 0.18);
}

.login-brand h1,
.page-title h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.14;
  font-weight: 900;
}

.login-brand p,
.page-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.panel,
.card,
.modal-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.panel {
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 0;
}

.card {
  border-radius: var(--radius);
  padding: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: rgba(253, 251, 247, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(29, 41, 57, 0.06);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  display: block;
  color: var(--brand);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 900;
  text-transform: uppercase;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.nav-item,
.quick-btn,
.chip,
.btn {
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.icon-btn:active,
.nav-item:active,
.quick-btn:active,
.chip:active,
.btn:active,
.card-action:active {
  transform: scale(0.97);
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(29, 41, 57, 0.08);
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: 0 0 auto;
}

.content {
  display: grid;
  gap: 14px;
  padding: 14px;
  overflow-x: hidden;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 520px);
  transform: translateX(-50%);
  padding: 8px 10px calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(29, 41, 57, 0.08);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(var(--nav-count, 2), 1fr);
  gap: 6px;
}

.nav-item {
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 4px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
}

.nav-item span {
  font-size: 11px;
  font-weight: 800;
}

.nav-item.is-active {
  color: var(--brand);
  background: var(--brand-soft);
}

.hero-panel {
  display: grid;
  gap: 14px;
  color: #fff;
  border: 0;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(30, 64, 175, 0.9)),
    #111827;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.18);
}

.hero-panel .eyebrow,
.hero-panel p,
.hero-panel .meta-label {
  color: rgba(255, 255, 255, 0.72);
}

.hero-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.meta-cell {
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.11);
}

.meta-label {
  font-size: 10px;
  font-weight: 800;
}

.meta-value {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 900;
}

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

.stat-card {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.stat-value {
  font-size: 26px;
  line-height: 1;
  font-weight: 950;
}

.stat-label,
.muted,
.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.section-head h2,
.section-head h3,
.modal-title {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.quick-btn {
  min-height: 82px;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 10px 6px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(29, 41, 57, 0.08);
}

.quick-btn .stat-icon {
  width: 36px;
  height: 36px;
}

.quick-btn span {
  font-size: 11px;
  font-weight: 850;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
}

.timeline-item.is-done .timeline-dot {
  background: var(--success-soft);
  color: var(--success);
}

.timeline-item.is-current .timeline-dot {
  background: var(--brand-soft);
  color: var(--brand);
}

.timeline-title {
  font-size: 13px;
  font-weight: 900;
}

.timeline-desc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.badge,
.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  background: var(--bg-soft);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.badge.brand {
  color: var(--brand);
  background: var(--brand-soft);
}

.badge.success {
  color: #047857;
  background: var(--success-soft);
}

.badge.warning {
  color: #b45309;
  background: var(--warning-soft);
}

.badge.danger {
  color: #be123c;
  background: var(--danger-soft);
}

.badge.dark {
  color: #fff;
  background: #111827;
}

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

.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.event-card,
.stage-card,
.player-card,
.match-card,
.report-card {
  display: grid;
  gap: 12px;
}

.event-card {
  cursor: pointer;
}

.event-card.is-current,
.stage-card.is-current {
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.92)),
    var(--surface);
  box-shadow:
    inset 0 0 0 1px rgba(59, 130, 246, 0.16),
    0 16px 34px rgba(59, 130, 246, 0.12);
}

.stage-card .three-col {
  gap: 10px;
}

.stage-card .table-chip {
  min-height: 62px;
}

.card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 900;
}

.card-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.card-footer,
.inline-actions,
.chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-footer {
  justify-content: space-between;
}

.manage-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(29, 41, 57, 0.1);
  font-size: 13px;
  font-weight: 900;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.23);
}

.btn.success {
  color: #fff;
  background: var(--success);
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.2);
}

.btn.danger {
  color: #fff;
  background: var(--danger);
  box-shadow: 0 10px 22px rgba(244, 63, 94, 0.18);
}

.btn.ghost {
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.btn.sm {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 12px;
}

.btn.full {
  width: 100%;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible,
.chip:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.22);
  outline-offset: 2px;
}

.chip {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 13px;
  color: var(--muted);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(29, 41, 57, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.chip.is-active {
  color: #fff;
  background: #111827;
  box-shadow: none;
}

.search-box {
  position: relative;
}

.search-box .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  color: var(--subtle);
  transform: translateY(-50%);
}

.search-box input {
  padding-left: 42px;
}

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

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

.field label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(29, 41, 57, 0.1);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.textarea {
  min-height: 86px;
  padding-top: 11px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #a8b0bd;
}

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

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.table-chip {
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(29, 41, 57, 0.08);
}

.table-chip strong {
  font-size: 14px;
}

.table-chip span {
  color: var(--muted);
  font-size: 11px;
}

.bracket-wrap {
  width: calc(100% + 28px);
  max-width: calc(100% + 28px);
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -14px;
  padding: 2px 14px 8px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.bracket-board {
  min-width: 760px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 230px;
  gap: 10px;
  align-items: start;
}

.round-col {
  display: grid;
  gap: 10px;
}

.round-head {
  position: sticky;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 0 2px;
}

.round-head h3 {
  margin: 0;
  font-size: 13px;
}

.match-card {
  min-height: 144px;
}

.advancement-section .section-head {
  align-items: flex-start;
}

.advancement-wrap {
  width: calc(100% + 28px);
  max-width: calc(100% + 28px);
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -14px;
  padding: 2px 14px 8px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.advancement-wrap.is-modal {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 0 8px;
}

.advancement-board {
  min-width: 840px;
  display: grid;
  gap: 18px;
}

.advancement-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #1d4ed8);
}

.advancement-title strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.25;
}

.advance-lane {
  display: grid;
  gap: 10px;
}

.advance-lane-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.advance-lane-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.advance-lane-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.advance-rounds {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 248px;
  gap: 14px;
  align-items: start;
}

.advance-round {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.advance-round-title {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
}

.advance-nodes {
  display: grid;
  gap: 12px;
}

.advance-node {
  position: relative;
  min-height: 142px;
  display: grid;
  gap: 8px;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(29, 41, 57, 0.08), var(--shadow-soft);
}

.advance-round:not(:last-child) .advance-node::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  width: 14px;
  border-top: 2px dashed #cbd5e1;
}

.advance-node.is-final {
  color: #fff;
  background: #111827;
  box-shadow: 0 16px 32px rgba(17, 24, 39, 0.18);
}

.advance-node-head,
.advance-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.advance-node-head strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advance-player {
  min-height: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 6px 9px;
  background: var(--bg-soft);
  color: var(--ink);
}

.advance-node.is-final .advance-player {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.1);
}

.advance-player.is-winner {
  color: #047857;
  background: var(--success-soft);
}

.advance-player span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advance-player b {
  font-size: 13px;
  font-weight: 950;
}

.advance-route {
  align-items: flex-start;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.advance-node.is-final .advance-route {
  color: #cbd5e1;
}

.advance-route span {
  color: inherit;
  font-weight: 900;
}

.advance-route small {
  max-width: 120px;
  text-align: right;
}

.advance-map-lane {
  display: grid;
  gap: 10px;
}

.advance-map-canvas {
  position: relative;
  min-width: 100%;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(59, 130, 246, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.55);
  background-size: 28px 28px;
}

.advance-map-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.advance-link {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 7 7;
}

.advance-link.is-done {
  stroke: var(--success);
  stroke-dasharray: none;
}

.advance-link.is-final {
  stroke: #111827;
  stroke-width: 3.5;
}

.advance-map-round-label {
  position: absolute;
  z-index: 2;
  height: 28px;
  display: inline-flex;
  align-items: center;
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
}

.advance-map-node {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 8px;
  border-radius: 15px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(29, 41, 57, 0.08),
    0 12px 26px rgba(15, 23, 42, 0.08);
}

.advance-map-node::before,
.advance-map-node::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cbd5e1;
  transform: translateY(-50%);
}

.advance-map-node::before {
  left: -5px;
}

.advance-map-node::after {
  right: -5px;
}

.advance-map-node.is-done {
  box-shadow:
    inset 0 0 0 1px rgba(16, 185, 129, 0.18),
    0 12px 26px rgba(16, 185, 129, 0.09);
}

.advance-map-node.is-done::before,
.advance-map-node.is-done::after {
  border-color: var(--success);
}

.advance-map-node.is-final {
  color: #fff;
  background: #111827;
  box-shadow: 0 16px 32px rgba(17, 24, 39, 0.18);
}

.advance-map-node.is-final::before,
.advance-map-node.is-final::after {
  background: #111827;
  border-color: #fff;
}

.advance-map-node.is-final .badge.dark,
.advance-map-node.is-final .badge.brand {
  color: #111827;
  background: #fff;
}

.advance-map-node.is-final .advance-player {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.1);
}

.advance-map-node.is-final .advance-player.is-winner {
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.18);
}

.advance-map-node.is-final .advance-route {
  color: #cbd5e1;
}

.match-player {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-radius: 10px;
  padding: 7px 9px;
  background: var(--bg-soft);
}

.match-player.is-winner {
  color: #047857;
  background: var(--success-soft);
}

.match-player.is-loser {
  color: #be123c;
  background: var(--danger-soft);
}

.player-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  font-size: 13px;
  font-weight: 950;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #3b82f6);
  font-size: 14px;
  font-weight: 950;
}

.player-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-info {
  min-width: 0;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--success));
}

.ranking-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
}

.rank-no {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 950;
}

.rank-no.top {
  color: #fff;
  background: #111827;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 16px 12px calc(16px + var(--safe-bottom));
  background: rgba(15, 23, 42, 0.38);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(86vh, 820px);
  overflow: auto;
  border-radius: 18px;
  padding: 16px;
}

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

.modal-actions {
  position: sticky;
  bottom: -16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 0 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface-strong) 28%);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-bottom));
  z-index: 80;
  max-width: min(92vw, 440px);
  min-height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  background: #111827;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 850;
}

.toast.show {
  display: flex;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 160px;
  color: var(--muted);
  text-align: center;
}

.compact-empty {
  min-height: 76px;
  border-radius: 14px;
  padding: 16px 12px;
  background: rgba(59, 130, 246, 0.04);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.empty-state .icon {
  width: 38px;
  height: 38px;
  color: var(--subtle);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .phone-frame,
  .login-page,
  .bottom-nav {
    max-width: 480px;
  }

  .phone-frame,
  .login-page {
    margin-top: 18px;
    margin-bottom: 18px;
    min-height: calc(100vh - 36px);
    border-radius: 26px;
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    background: rgba(253, 251, 247, 0.74);
  }

  .bottom-nav {
    bottom: 18px;
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
}

@media (max-width: 360px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-meta,
  .three-col {
    grid-template-columns: 1fr;
  }

  .two-col,
  .table-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
