:root {
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --panel: #ffffff;
  --bg: #f3f6f8;
  --blue: #175cd3;
  --blue-dark: #123c7c;
  --green: #067647;
  --red: #b42318;
  --gold: #ad7a03;
  --teal: #0e7490;
  --soft-blue: #eaf2ff;
  --soft-green: #e9f8f0;
  --soft-gold: #fff6df;
  --shadow: 0 12px 30px rgba(19, 33, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  overflow-x: hidden;
}

.store-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef3f7;
}

.store-auth-gate[hidden] {
  display: none;
}

.store-login-panel {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.store-login-panel img {
  width: 180px;
  height: 96px;
  display: block;
  object-fit: contain;
  margin-bottom: 20px;
}

.store-login-panel h1 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.store-login-panel p:not(.eyebrow) {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.store-login-panel label {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    color: var(--ink);
    font-weight: 700;
  }

.store-login-panel input,
.store-login-panel button {
  width: 100%;
  min-height: 48px;
}

.store-login-panel button {
  margin-top: 16px;
}

.store-login-message {
    display: block;
  min-height: 22px;
  margin-top: 12px;
  color: var(--red);
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #101828;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
}

.brand img {
  width: 96px;
  height: 58px;
  border-radius: 8px;
  object-fit: contain;
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #b8c1d3;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #d8e0ee;
  text-align: left;
}

.nav-button.active,
.nav-button:hover {
  background: #ffffff;
  color: #101828;
}

.season-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.season-card span,
.season-card small {
  display: block;
  color: #b8c1d3;
  font-size: 12px;
}

.season-card strong {
  display: block;
  margin: 8px 0;
  font-size: 18px;
}

main {
  padding: 24px;
  overflow: auto;
}

.icp-footer {
  padding: 22px 8px 4px;
  color: #667085;
  font-size: 12px;
  text-align: center;
}

.icp-footer a {
  color: inherit;
  text-decoration: none;
}

.icp-footer a:hover {
  color: #1570ef;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

.top-actions,
.button-row,
.match-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary,
.secondary,
.ghost,
.danger-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 700;
}

.primary {
  background: var(--blue);
  color: white;
}

.secondary {
  background: var(--soft-blue);
  color: var(--blue-dark);
}

.ghost {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger-button {
  background: #fee4e2;
  color: var(--red);
}

button.is-active {
  border: 1px solid #1d72d2;
  background: #ddecff;
  color: #155a9f;
}

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

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.wide {
  width: 100%;
}

.deploy-panel {
  border-color: #bcd2ff;
}

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

.deploy-card {
  min-height: 210px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.deploy-card img {
  display: block;
  width: min(150px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.deploy-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.deploy-card span {
  display: block;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  word-break: break-all;
}

.screen-address-card {
  display: grid;
  align-content: center;
}

.screen-address-mark {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  border-radius: 8px;
  background: #101828;
  color: white;
  font-size: 30px;
  font-weight: 900;
}

.mobile-hero {
  display: none;
}

.compact-title {
  margin-bottom: 12px;
}

.client-player-card {
  margin-top: 14px;
}

.client-empty,
.client-player-card,
.broadcast-item,
.alert-item,
.alert-empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.client-empty strong,
.client-empty span {
  display: block;
}

.client-empty strong {
  margin-bottom: 5px;
  color: var(--ink);
}

.client-player-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.client-player-main span,
.client-player-main small,
.client-status,
.broadcast-item span,
.alert-item span,
.alert-empty {
  color: var(--muted);
  font-size: 13px;
}

.client-player-main strong {
  display: block;
  margin: 4px 0;
  font-size: 22px;
}

.client-score {
  min-width: 94px;
  padding: 10px;
  border-radius: 8px;
  background: var(--soft-blue);
  text-align: center;
}

.client-score strong {
  display: block;
  margin: 0;
  color: var(--blue-dark);
  font-size: 24px;
}

.client-player-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.client-player-stats div {
  padding: 10px 8px;
  border-radius: 8px;
  background: #f3f6f8;
  text-align: center;
}

.client-player-stats strong {
  display: block;
  font-size: 18px;
}

.client-player-stats span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.client-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--soft-gold);
  color: #694b00;
  font-weight: 800;
}

.client-status.waiting {
  background: var(--soft-blue);
  color: var(--blue-dark);
}

.client-status.ready {
  background: var(--soft-green);
  color: var(--green);
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(108px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented-control button {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: #f3f6f8;
  color: var(--muted);
}

.segmented-control button + button {
  border-left: 1px solid var(--line);
}

.segmented-control button.active {
  background: var(--blue);
  color: #ffffff;
}

.wallet-entry {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid #dfbf65;
  border-radius: 8px;
  background: #fff8dc;
  color: #59420a;
  text-align: left;
}

.wallet-entry strong {
  color: #8a5d00;
  font-size: 22px;
}

.wallet-entry small {
  color: #71591d;
  font-weight: 800;
}

.client-shop-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow-y: auto;
  padding: 18px;
  background: rgba(9, 16, 26, 0.72);
}

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

.client-shop-sheet {
  width: min(760px, 100%);
  min-height: calc(100vh - 36px);
  margin: 0 auto;
  padding: 20px;
  border-radius: 8px;
  background: #f7f8fa;
  color: var(--ink);
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: #e9edf2;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.shop-balance {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin: 14px 0 18px;
  padding: 16px;
  border-left: 4px solid #d9a900;
  background: #fff8dc;
}

.shop-balance strong {
  color: #8a5d00;
  font-size: 30px;
}

.shop-balance small {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: var(--muted);
}

.shop-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.shop-product {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.shop-product.inactive {
  opacity: 0.58;
}

.shop-product-image {
  display: grid;
  place-items: center;
  width: 70px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #edf2f6;
  color: var(--blue-dark);
  font-size: 28px;
  font-weight: 900;
}

.shop-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-product-copy {
  min-width: 0;
}

.shop-product-copy strong,
.shop-product-copy p {
  overflow-wrap: anywhere;
}

.shop-product-copy p {
  min-height: 34px;
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.shop-product-copy div,
.shop-product-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}

.shop-product-copy b {
  color: #9a6800;
}

.shop-product > button,
.shop-product-actions {
  grid-column: 1 / -1;
}

.shop-product-actions button {
  flex: 1;
}

.shop-redemption-title,
.shop-history {
  margin-top: 20px;
}

.shop-redemption-list,
.shop-history > div {
  display: grid;
  gap: 8px;
}

.shop-redemption-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.shop-redemption-row > div:first-child span,
.shop-redemption-row > div:nth-child(2) small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.shop-redemption-row > div:nth-child(2) b {
  font-size: 20px;
  letter-spacing: 0;
}

.shop-redemption-row.issued,
.shop-redemption-row.canceled {
  opacity: 0.62;
}

.shop-empty {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 680px) {
  .client-shop-overlay {
    padding: 0;
  }

  body.store-locked .app-shell {
    visibility: hidden;
  }

  .client-shop-sheet {
    min-height: 100vh;
    border-radius: 0;
  }

  .shop-product-grid {
    grid-template-columns: 1fr;
  }

  .shop-redemption-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .shop-redemption-row .button-row {
    grid-column: 1 / -1;
  }
}

.broadcast-list,
.alert-list {
  display: grid;
  gap: 10px;
}

.broadcast-item strong,
.alert-item strong {
  display: block;
  margin-bottom: 5px;
}

.broadcast-item.hot {
  background: var(--soft-gold);
  border-color: #f5d58b;
}

.voice-panel {
  border: 1px solid #26364a;
  background: #121a24;
  color: #f8fafc;
  box-shadow: 0 18px 36px rgba(18, 26, 36, 0.18);
}

.voice-control-center .panel-title p:not(.eyebrow) {
  color: #b8c4d3;
}

.voice-control-center .eyebrow {
  color: #54d5ef;
}

.voice-control-center .secondary {
  border-color: #52708f;
  background: #1d2a39;
  color: #f8fafc;
}

.voice-control-center .primary {
  background: #0e91ad;
}

.voice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: center;
}

.toggle-line {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  font-weight: 800;
}

.voice-control-center .toggle-line,
.voice-control-center .voice-grid > label:not(.toggle-line) {
  border-color: #34475d;
  background: #192432;
  color: #edf4fa;
}

.voice-control-center .voice-grid > label:not(.toggle-line) {
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid #34475d;
  border-radius: 8px;
  font-weight: 800;
}

.voice-control-center select {
  margin-top: 8px;
  background: #ffffff;
  color: #172033;
}

.toggle-line input {
  width: auto;
  margin-right: 8px;
}

.voice-grid input[type="range"] {
  width: 100%;
  margin-top: 8px;
}

.voice-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
}

.voice-scheduler-status {
  margin-top: 8px;
  color: #f9c74f;
  font-size: 13px;
  font-weight: 800;
}

.alert-item {
  width: 100%;
  text-align: left;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  white-space: nowrap;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.pill.danger {
  background: #fff1f0;
  color: var(--red);
}

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

.score-form {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

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

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.member-name-input,
.member-phone-input,
.member-code-input {
  min-width: 140px;
}

.member-name-input {
  margin-bottom: 6px;
}

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

.member-reward-details summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 800;
}

.member-reward-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 250px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.member-reward-row span,
.member-reward-row small {
  display: block;
}

.member-reward-row.issued {
  opacity: 0.65;
}

.member-reward-row.duplicate {
  opacity: 0.58;
  text-decoration: line-through;
}

.match-tools {
  margin-top: 14px;
  align-items: center;
}

.match-tools select {
  width: min(360px, 100%);
}

.notice {
  display: none;
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft-gold);
  color: #694b00;
  font-weight: 700;
}

.notice.show {
  display: block;
}

.table-wrap {
  overflow: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  background: #f8fafc;
}

.queue-list,
.challenge-list,
.referee-list,
.reward-list,
.dispute-list,
.rule-list,
.settlement-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.queue-item,
.challenge-item,
.referee-item,
.reward-item,
.dispute-item,
.rule-list div,
.settlement-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.queue-item strong,
.challenge-item strong,
.referee-item strong,
.reward-item strong,
.dispute-item strong,
.rule-list strong,
.settlement-item strong {
  display: block;
  margin-bottom: 4px;
}

.queue-item span,
.challenge-item span,
.referee-item span,
.reward-item span,
.dispute-item span,
.rule-list span,
.settlement-item span,
.settlement-item p {
  color: var(--muted);
  font-size: 13px;
}

.queue-item .compact {
  margin-top: 8px;
}

.challenge-host-pending {
  margin-top: 10px;
}

.challenge-host-note {
  align-self: center;
  color: #1d4ed8;
  font-weight: 700;
}

.challenge-item.requested,
.referee-item.pending {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
}

.challenge-item.running,
.referee-item.approved {
  border-color: rgba(12, 122, 73, 0.28);
  background: #ecfdf5;
}

.challenge-item.closed,
.challenge-item.done,
.referee-item.rejected,
.referee-item.revoked {
  opacity: 0.72;
}

.referee-auth-ready {
  display: grid;
  gap: 6px;
}

.referee-auth-ready strong {
  font-size: 18px;
}

.referee-auth-ready span {
  color: var(--muted);
}

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

.referee-stat-grid > div {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  text-align: center;
}

.referee-stat-grid strong,
.referee-stat-grid span {
  display: block;
}

.referee-stat-grid strong {
  font-size: 22px;
  color: var(--blue-dark);
}

.referee-stat-grid span,
.referee-stat-note,
.referee-performance {
  color: var(--muted);
  font-size: 12px;
}

.referee-stat-note {
  margin-top: 9px;
  color: #a15c00;
}

.referee-item .referee-performance {
  display: block;
  margin-top: 6px;
  color: #0c7a49;
  font-weight: 700;
}

.reward-item small {
  display: block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

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

.reward-card {
  min-height: 132px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.reward-card span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.reward-card strong {
  display: block;
  margin-top: 10px;
  font-size: 18px;
}

.reward-card p {
  margin: 7px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.reward-card em {
  color: var(--gold);
  font-style: normal;
  font-weight: 900;
}

.reward-config {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.season-form {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.reward-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

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

.settlement-item {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.settlement-item p {
  margin: 0;
  font-weight: 700;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.pending {
  background: var(--soft-gold);
  color: var(--gold);
}

.status.confirmed {
  background: var(--soft-green);
  color: var(--green);
}

.status.disputed {
  background: #fee4e2;
  color: var(--red);
}

.screen-view.active {
  display: block;
}

.screen-view {
  background: #07111f;
  color: white;
  border-radius: 12px;
  padding: 18px;
  min-height: calc(100vh - 170px);
}

.screen-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0e2747 0%, #123c7c 48%, #0f766e 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.screen-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.screen-brand > div {
  min-width: 0;
}

.screen-brand > img {
  width: 132px;
  height: 88px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 6px;
  background: white;
}

.screen-hero h2 {
  margin: 3px 0 6px;
  font-size: 34px;
  color: white;
}

.screen-hero span {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.screen-clock {
  font-size: 42px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.screen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
  margin-top: 16px;
}

.screen-side {
  display: grid;
  gap: 16px;
}

.screen-panel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 16px;
}

.screen-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.screen-panel-title h2 {
  color: white;
  font-size: 22px;
}

.screen-panel-title span {
  color: #9fe6d8;
  font-weight: 800;
}

.screen-ranking {
  display: grid;
  gap: 10px;
}

.screen-rank-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 100px 90px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.screen-rank-row.top {
  background: linear-gradient(90deg, rgba(255, 210, 87, 0.26), rgba(255, 255, 255, 0.09));
  border-color: rgba(255, 210, 87, 0.5);
}

.rank-num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 22px;
  font-weight: 900;
}

.screen-player strong {
  display: block;
  font-size: 20px;
}

.screen-player span,
.screen-score span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.screen-division {
  color: #9fe6d8;
  font-weight: 900;
}

.screen-score {
  text-align: right;
}

.screen-score strong {
  display: block;
  font-size: 24px;
}

.screen-matches,
.screen-rewards,
.screen-winners,
.screen-challenges {
  display: grid;
  gap: 10px;
}

.screen-match-card,
.screen-reward-card,
.screen-winner-card,
.screen-challenge-card {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.screen-match-card strong,
.screen-reward-card strong,
.screen-winner-card strong,
.screen-challenge-card strong {
  display: block;
  font-size: 17px;
}

.screen-match-card span,
.screen-reward-card span,
.screen-winner-card span,
.screen-challenge-card span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

body.role-screen {
  background: #07111f;
  overflow: hidden;
}

body.role-screen .app-shell {
  display: block;
  min-height: 100vh;
}

body.role-screen .sidebar,
body.role-screen .topbar,
body.role-screen .dashboard-grid {
  display: none;
}

body.role-screen main {
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

body.role-screen .icp-footer {
  position: fixed;
  right: 12px;
  bottom: 5px;
  z-index: 20;
  padding: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
}

body.role-screen .view:not(.active) {
  display: none;
}

body.role-screen .screen-view {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  padding: 18px;
  border-radius: 0;
  overflow: hidden;
}

body.role-screen .screen-grid,
body.role-screen .screen-tournament-layout {
  height: calc(100vh - 118px);
  overflow: hidden;
}

body.role-client,
body.role-referee {
  background: #eef3f7;
}

body.role-client .app-shell,
body.role-referee .app-shell {
  display: block;
  min-height: 100vh;
}

body.role-client .sidebar,
body.role-referee .sidebar,
body.role-client .topbar,
body.role-referee .topbar,
body.role-client .dashboard-grid,
body.role-referee .dashboard-grid {
  display: none;
}

body.role-client main,
body.role-referee main {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px;
  overflow: visible;
}

body.role-client .icp-footer,
body.role-referee .icp-footer {
  padding: 14px 8px calc(8px + env(safe-area-inset-bottom));
}

body.role-client *,
body.role-referee * {
  max-width: 100%;
}

body.role-client .view.active,
body.role-referee .view.active {
  gap: 12px;
  min-width: 0;
  width: 100%;
}

body.role-client .view.active > *,
body.role-referee .view.active > * {
  min-width: 0;
  width: 100%;
}

body.role-client .mobile-hero,
body.role-referee .mobile-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

body.role-client .mobile-hero > div,
body.role-referee .mobile-hero > div {
  min-width: 0;
}

body.role-client .mobile-hero img,
body.role-referee .mobile-hero img {
  width: 112px;
  height: 54px;
  border-radius: 8px;
  object-fit: contain;
  background: white;
}

body.role-client .mobile-hero h2,
body.role-referee .mobile-hero h2 {
  color: var(--ink);
  font-size: 21px;
}

body.role-client .mobile-hero span,
body.role-referee .mobile-hero span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

body.role-client .panel,
body.role-referee .panel {
  padding: 12px;
  box-shadow: none;
}

body.role-client .panel-title,
body.role-referee .panel-title {
  gap: 8px;
  margin-bottom: 10px;
}

body.role-client h2,
body.role-referee h2 {
  font-size: 18px;
}

body.role-client .form-grid,
body.role-referee .form-grid,
body.role-referee .score-form {
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

body.role-client input,
body.role-client select,
body.role-referee input,
body.role-referee select {
  min-height: 46px;
  font-size: 16px;
}

body.role-client .primary,
body.role-client .secondary,
body.role-client .ghost,
body.role-client .danger-button,
body.role-referee .primary,
body.role-referee .secondary,
body.role-referee .ghost,
body.role-referee .danger-button {
  width: 100%;
  min-height: 48px;
}

body.role-client .client-match-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

#continuousParticipation.active {
  border-color: #1b8f5a;
  background: #e9f8f0;
  color: #116b43;
}

body.role-client #queuePlayer,
body.role-client #clearQueue {
  display: none;
}

body.role-client.client-bound .client-signup-form,
body.role-client.client-bound .client-entry-panel .panel-title {
  display: none;
}

body.role-client .client-main-list {
  gap: 10px;
}

body.role-client:not(.client-bound) .client-main-list,
body.role-client:not(.client-bound) #client .panel:last-child {
  display: none;
}

body.role-client .client-main-list .panel:nth-child(2) {
  display: none;
}

body.role-client .split {
  grid-template-columns: 1fr;
}

body.role-client .table-wrap table {
  min-width: 0;
}

body.role-client #rankingBody tr {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 54px 58px;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

body.role-client #rankingBody td {
  border: 0;
  padding: 9px 3px;
  font-size: 12px;
}

body.role-client #rankingBody td strong {
  font-size: 14px;
}

body.role-client #rankingBody td small {
  display: none;
}

body.role-client #rankingBody td:nth-child(5),
body.role-client #rankingBody td:nth-child(6),
body.role-client table thead {
  display: none;
}

body.role-client .reward-showcase {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 3px;
}

body.role-client .reward-card {
  min-width: 190px;
  min-height: 116px;
  padding: 12px;
}

body.role-referee .button-row {
  display: grid;
  grid-template-columns: 1fr;
}

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

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

.tournament-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}

.tournament-control-row label {
  flex: 1 1 260px;
}

.tournament-store-list {
  display: grid;
  gap: 14px;
}

.tournament-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.tournament-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 14px;
  align-items: start;
}

.tournament-card-head strong {
  display: block;
  font-size: 19px;
}

.tournament-card-head span,
.signup-row span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.tournament-card-head img {
  width: 116px;
  height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.tournament-qr-box {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.tournament-qr-box small {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

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

.tournament-info-grid div {
  min-height: 70px;
  padding: 10px;
  border-radius: 8px;
  background: #f3f6f8;
}

.tournament-info-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.tournament-info-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.tournament-info-grid.compact div {
  min-height: 58px;
}

.copy-box {
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: white;
  border: 1px dashed var(--line);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.signup-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.signup-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.tournament-client-actions {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.tournament-client-actions span {
  color: var(--muted);
  font-size: 13px;
}

.bracket-preview {
  margin-top: 12px;
  overflow-x: auto;
}

.bracket {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: max-content;
}

.bracket-round {
  width: 220px;
  display: grid;
  gap: 8px;
}

.bracket-round h3 {
  margin: 0;
  font-size: 15px;
}

.bracket-match {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.bracket-match div {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.bracket-match span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bracket-match strong {
  overflow-wrap: anywhere;
}

.bracket-match em {
  color: var(--blue-dark);
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}

.bracket-match.done {
  background: var(--soft-green);
}

.bracket-match.bye {
  background: var(--soft-gold);
}

.bracket-empty {
  padding: 14px;
  border-radius: 8px;
  background: #f3f6f8;
  color: var(--muted);
}

.compact-buttons {
  margin-top: 8px;
}

.screen-tournament-layout {
  display: none;
}

.screen-bracket-panel {
  min-height: calc(100vh - 150px);
  overflow: auto;
}

.screen-bracket {
  gap: 18px;
}

.screen-bracket .bracket-round {
  width: 300px;
}

.screen-bracket .bracket-round h3 {
  color: white;
  font-size: 24px;
}

.screen-bracket .bracket-match {
  min-height: 130px;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.screen-bracket .bracket-match span {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.8);
}

.screen-bracket .bracket-match strong {
  color: white;
  font-size: 22px;
}

.screen-bracket .bracket-match em {
  color: #9bdcff;
  font-size: 18px;
}

.tournament-card-actions {
  margin: 12px 0;
}

.screen-mode-status {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #b7d5ff;
  border-radius: 8px;
  background: #eef6ff;
  color: #155a9f;
  font-weight: 800;
}

.tournament-details {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.tournament-details summary {
  min-height: 42px;
  padding: 11px 12px;
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 900;
}

.tournament-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.management-grid,
.podium-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.management-grid div,
.podium-strip div {
  min-height: 64px;
  padding: 10px;
  border-radius: 8px;
  background: #f3f6f8;
}

.management-grid strong,
.podium-strip strong,
.management-grid span,
.podium-strip span {
  display: block;
}

.management-grid span,
.podium-strip span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.tournament-registration-list {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.tournament-registration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.tournament-registration-row .danger-button {
  flex: 0 0 auto;
}

.podium-strip {
  padding: 0;
  margin: 10px 0;
}

.podium-strip div {
  background: var(--soft-gold);
}

.history-note {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfe;
}

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

.store-match-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.store-match-card strong,
.store-match-card span {
  display: block;
}

.store-match-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.screen-tournament-layout {
  gap: 16px;
}

.screen-tournament-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.screen-tournament-header h2 {
  color: white;
  font-size: 38px;
}

.screen-tournament-header span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 800;
}

.screen-tournament-header strong {
  display: grid;
  place-items: center;
  min-width: 120px;
  min-height: 84px;
  border-radius: 10px;
  background: #ffffff;
  color: #101828;
  font-size: 34px;
}

.screen-current-panel,
.screen-progress-panel {
  min-height: 0;
}

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

.screen-current-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.screen-current-match {
  min-height: 132px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.screen-current-match strong {
  display: block;
  color: white;
  font-size: 24px;
  line-height: 1.25;
}

.screen-current-match span {
  display: block;
  margin-top: 12px;
  color: #9bdcff;
  font-size: 18px;
  font-weight: 900;
}

.screen-current-match.done {
  background: rgba(12, 122, 73, 0.45);
}

.screen-current-match.bye {
  background: rgba(173, 122, 3, 0.45);
}

.screen-double-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.screen-double-grid .screen-panel:last-child {
  grid-column: 1 / -1;
}

.screen-champion {
  display: grid;
  place-items: center;
  min-height: 360px;
  color: white;
  font-size: 72px;
  font-weight: 900;
}

.screen-podium {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 18px;
  align-items: end;
  min-height: 430px;
}

.screen-podium div {
  display: grid;
  place-items: center;
  min-height: 270px;
  padding: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-align: center;
}

.screen-podium .gold {
  min-height: 360px;
  background: rgba(173, 122, 3, 0.55);
}

.screen-podium span {
  color: #9bdcff;
  font-size: 28px;
  font-weight: 900;
}

.screen-podium strong {
  color: white;
  font-size: 52px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .store-match-list,
  .screen-current-grid,
  .screen-current-grid.compact,
  .screen-double-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .tournament-form,
  .tournament-info-grid {
    grid-template-columns: 1fr;
  }

  .tournament-card-head {
    grid-template-columns: 1fr;
  }

  .tournament-card-head img {
    width: 150px;
    height: 150px;
  }

  .tournament-qr-box {
    justify-items: start;
  }

  .management-grid,
  .podium-strip {
    grid-template-columns: 1fr;
  }
}

.next-round-ready {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid #d99b21;
  background: #fff8e7;
  color: #342408;
}

.next-round-ready div {
  display: grid;
  gap: 3px;
}

.next-round-ready span {
  font-size: 13px;
  color: #6c5221;
}

@media (max-width: 680px) {
  .next-round-ready {
    align-items: stretch;
    flex-direction: column;
  }

  .referee-stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
