:root {
  --bg: #eef5ff;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-soft: rgba(233, 242, 255, 0.92);
  --line: rgba(43, 102, 184, 0.16);
  --text: #0d2952;
  --muted: #5e79a5;
  --accent: #2b66b8;
  --accent-strong: #184996;
  --danger: #d64949;
  --success: #1f8b68;
  --font-display: "Georgia", "Times New Roman", serif;
  --font-body: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(43, 102, 184, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(129, 179, 255, 0.18), transparent 24%),
    linear-gradient(160deg, #f9fcff, #eef5ff 52%, #e6f0ff);
  color: var(--text);
  font-family: var(--font-body);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(43, 102, 184, 0.55) rgba(24, 73, 150, 0.08);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: rgba(24, 73, 150, 0.08);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(67, 129, 219, 0.88), rgba(24, 73, 150, 0.85));
  border: 2px solid rgba(238, 245, 255, 0.95);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(82, 146, 239, 0.95), rgba(24, 73, 150, 0.92));
}

.shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero,
.board {
  display: grid;
  gap: 20px;
}

.hero {
  grid-template-columns: 1.5fr 1fr;
  align-items: start;
}

.hero-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 7vw, 6rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: #103768;
  text-shadow: 0 12px 28px rgba(43, 102, 184, 0.14);
}

.title-glyph {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
}

.title-mark {
  position: absolute;
  left: -0.1em;
  top: -0.24em;
  width: 0.2em;
  height: 0.2em;
  user-select: none;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%233f8cff' stroke-width='9' stroke-linejoin='round'%3E%3Cpath d='M50 12 L84 70 H16 Z'/%3E%3Cpath d='M50 88 L16 30 H84 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 4px 10px rgba(43, 102, 184, 0.18));
}

.subtitle,
.hero-note,
.muted {
  color: var(--muted);
}

.hero-warning {
  margin: 16px 0 0;
  max-width: 44ch;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(233, 242, 255, 0.88));
  box-shadow: 0 12px 26px rgba(43, 102, 184, 0.08);
  color: var(--text);
  font-size: 0.98rem;
}

.hero-card,
.metric-card,
.status-card,
.selected-card,
.tab-panel,
.wallet-card,
.list-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(66, 112, 179, 0.1);
  backdrop-filter: blur(16px);
  border-radius: 20px;
}

.hero-card,
.status-card,
.selected-card,
.tab-panel {
  padding: 20px;
}

.wallet-row,
.status-heading,
.section-heading,
.wallet-card,
.wallet-side,
.wallet-main,
.checker-row,
.tabs,
.mock-row {
  display: flex;
  align-items: center;
}

.wallet-row,
.status-heading,
.section-heading,
.wallet-card,
.checker-row,
.mock-row {
  justify-content: space-between;
}

.section-heading {
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

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

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

.x-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(224, 236, 255, 0.94));
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(43, 102, 184, 0.12);
}

.wallet-row code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #69a7ff, var(--accent-strong));
  color: #f8fbff;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(43, 102, 184, 0.18);
}

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

button.secondary {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 10px 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.metric-card {
  padding: 18px;
}

.metric-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.metric-card strong {
  font-size: 1.45rem;
}

.board {
  grid-template-columns: 1.25fr 1fr;
  align-items: start;
}

.board-main,
.board-side,
.selected-list,
.stack-list {
  display: grid;
  gap: 18px;
}

.board-side {
  position: sticky;
  top: 24px;
  align-self: start;
  grid-template-rows: auto 1fr;
}

.phase-pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.phase-pill.collecting,
.status-chip {
  background: rgba(31, 139, 104, 0.12);
  color: var(--success);
}

.status-chip-live {
  background: linear-gradient(135deg, rgba(105, 167, 255, 0.22), rgba(24, 73, 150, 0.14));
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(43, 102, 184, 0.16);
}

.phase-pill.active,
.offer-display {
  background: rgba(43, 102, 184, 0.12);
  color: var(--accent);
}

#countdown {
  font-size: 1.2rem;
  font-weight: 700;
}

.wallet-card,
.list-card {
  padding: 16px 18px;
}

.offer-display {
  min-width: 168px;
  padding: 12px 14px;
  border: 1px solid rgba(43, 102, 184, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(115, 176, 255, 0.2), rgba(255, 255, 255, 0.95));
  box-shadow: 0 14px 28px rgba(43, 102, 184, 0.16);
  text-align: right;
}

.offer-display.idle {
  background: linear-gradient(180deg, rgba(232, 241, 255, 0.72), rgba(255, 255, 255, 0.95));
  box-shadow: none;
}

.offer-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.offer-display strong {
  display: block;
  margin-top: 4px;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent-strong);
}

.offer-sol {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--text);
}

.turn-timer {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(43, 102, 184, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 22px rgba(43, 102, 184, 0.08);
}

.turn-timer-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.turn-timer strong {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--accent-strong);
}

.recap-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(233, 242, 255, 0.9)),
    var(--panel);
}

.last-round-body strong,
.last-round-body p {
  margin: 0;
}

.last-round-body p {
  margin-top: 10px;
}

.section-note {
  margin: 6px 0 0;
  font-size: 0.92rem;
  max-width: 40ch;
}

.wallet-card.active-wallet {
  border-color: rgba(24, 73, 150, 0.42);
  background:
    linear-gradient(135deg, rgba(88, 154, 255, 0.18), rgba(255, 255, 255, 0.96) 34%, rgba(255, 255, 255, 0.98)),
    var(--panel);
  box-shadow:
    0 0 0 2px rgba(43, 102, 184, 0.26),
    0 0 0 8px rgba(115, 176, 255, 0.12),
    0 22px 42px rgba(43, 102, 184, 0.22);
  transform: translateY(-2px) scale(1.01);
}

.wallet-order {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.live-turn-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #69a7ff, var(--accent-strong));
  color: #f8fbff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(43, 102, 184, 0.22);
}

.wallet-balance {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.wallet-proof {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 0.9rem;
}

.proof-link,
.proof-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(234, 242, 255, 0.9);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.78rem;
}

.wallet-side {
  gap: 12px;
}

.eligibility-checker {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(233, 242, 255, 0.9));
}

.checker-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
}

.checker-copy p:last-child {
  margin: 0;
}

.checker-row {
  gap: 10px;
  margin-top: 14px;
}

.checker-row input {
  flex: 1;
}

.wallet-check-result {
  margin-top: 14px;
}

.wallet-check-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.wallet-check-card strong,
.wallet-check-card p {
  margin: 0;
}

.wallet-check-card p {
  margin-top: 6px;
  color: var(--muted);
}

.wallet-check-card.eligible {
  box-shadow: inset 0 0 0 1px rgba(31, 139, 104, 0.22);
}

.wallet-check-card.over-cap,
.wallet-check-card.below-minimum,
.wallet-check-card.unknown {
  box-shadow: inset 0 0 0 1px rgba(214, 73, 73, 0.18);
}

.wallet-check-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.eligible-pool {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.eligible-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.eligible-rank {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.eligible-main p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.eligible-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.tabs {
  gap: 10px;
  flex-wrap: wrap;
}

.tab {
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  border: 1px solid var(--line);
}

.tab.active {
  background: linear-gradient(135deg, #73b0ff, var(--accent-strong));
  color: #f8fbff;
}

.tab-panel {
  display: none;
  min-height: 620px;
  max-height: 620px;
  overflow: auto;
}

.tab-panel.active {
  display: block;
}

.rule-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.table-shell {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.95rem;
}

a {
  color: var(--accent);
}

.hidden {
  display: none;
}

.mock-controls {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.mock-row {
  gap: 10px;
  margin: 12px 0;
}

code {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(232, 241, 255, 0.95);
}

@media (max-width: 900px) {
  .hero,
  .board,
  .metrics {
    grid-template-columns: 1fr;
  }

  .board-side {
    position: static;
  }

  .eligible-pool {
    grid-template-columns: 1fr;
  }

  .checker-row,
  .wallet-check-card {
    flex-direction: column;
    align-items: stretch;
  }

  .offer-display {
    width: 100%;
    text-align: left;
  }

  .wallet-check-side {
    justify-items: start;
  }

  .mock-row {
    flex-direction: column;
    align-items: stretch;
  }
}
