:root {
  --bg: #f3eedf;
  --bg-deep: #e6decb;
  --ink: #102019;
  --muted: #617066;
  --line: rgba(16, 32, 25, 0.12);
  --panel: rgba(255, 250, 241, 0.84);
  --panel-strong: rgba(255, 252, 246, 0.92);
  --card-dark: rgba(19, 32, 27, 0.92);
  --accent: #ed6b2c;
  --accent-deep: #bf4b15;
  --up: #158063;
  --down: #bb5633;
  --warn: #d1a12c;
  --shadow: 0 24px 60px rgba(16, 32, 25, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(237, 107, 44, 0.28), transparent 24%),
    radial-gradient(circle at bottom right, rgba(21, 128, 99, 0.16), transparent 24%),
    linear-gradient(180deg, #f7f2e7 0%, var(--bg) 55%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 32, 25, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 32, 25, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 82%);
}

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

button,
input,
select {
  font: inherit;
}

code,
.mono {
  font-family: "IBM Plex Mono", monospace;
}

.player-shell,
.admin-shell {
  position: relative;
  width: min(1380px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff7ef;
  box-shadow: 0 10px 20px rgba(191, 75, 21, 0.22);
}

.button-stack,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wallet-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

[hidden] {
  display: none !important;
}

.card,
.hero-card,
.admin-hero {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card,
.admin-hero {
  display: grid;
  gap: 20px;
  padding: 28px;
  margin-bottom: 18px;
}

.hero-card {
  grid-template-columns: 1.45fr 0.95fr;
}

.hero-card h1,
.admin-hero h1 {
  margin: 0;
  max-width: 12ch;
  line-height: 0.98;
  font-size: clamp(2.7rem, 7vw, 5rem);
}

.hero-note {
  max-width: 58ch;
  color: rgba(16, 32, 25, 0.72);
  line-height: 1.65;
}

.micro-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-right,
.admin-role-box {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 28, 22, 0.94), rgba(30, 54, 44, 0.88));
  color: #f4efe4;
}

.disconnect-button {
  min-width: auto;
  padding: 12px 14px;
  color: var(--down);
}

.hero-visual-panel {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  background: linear-gradient(180deg, rgba(255, 245, 235, 0.96), rgba(250, 240, 229, 0.96));
  color: var(--ink);
}

.arena-visual {
  position: relative;
  min-height: 320px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 26% 16%, rgba(237, 107, 44, 0.16), transparent 26%),
    radial-gradient(circle at 74% 82%, rgba(237, 107, 44, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(245, 233, 219, 0.98));
  border: 1px solid rgba(237, 107, 44, 0.14);
}

.flow-line {
  position: absolute;
  top: 14%;
  bottom: 14%;
  left: 50%;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(237, 107, 44, 0.2), rgba(237, 107, 44, 0.56), rgba(237, 107, 44, 0.2));
  transform: translateX(-50%);
}

.flow-node {
  position: relative;
  z-index: 2;
  width: min(240px, 100%);
  margin: 0 auto;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 249, 241, 0.98);
  border: 1px solid rgba(237, 107, 44, 0.22);
  box-shadow: 0 16px 38px rgba(191, 75, 21, 0.12);
  text-align: center;
}

.flow-node span {
  display: block;
  margin-bottom: 8px;
  color: rgba(16, 32, 25, 0.64);
  font-size: 0.9rem;
}

.flow-node strong {
  color: var(--accent-deep);
  font-size: 1.3rem;
}

.flow-node-top {
  margin-top: 22px;
}

.flow-node-mid,
.flow-node-bottom {
  margin-top: 18px;
}

.flow-arrow {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--accent-deep);
  font-size: 2rem;
  line-height: 1;
}

.flow-pulse {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffb483, var(--accent));
  box-shadow: 0 0 0 8px rgba(237, 107, 44, 0.12);
  transform: translateX(-50%);
  animation: flow-drop 4.6s linear infinite;
}

.flow-pulse.pulse-1 {
  animation-delay: 0s;
}

.flow-pulse.pulse-2 {
  animation-delay: 2.3s;
}

@keyframes flow-drop {
  0% {
    top: 14%;
    opacity: 0;
    scale: 0.9;
  }

  12%,
  88% {
    opacity: 1;
    scale: 1;
  }

  100% {
    top: 84%;
    opacity: 0;
    scale: 0.9;
  }
}

.hero-stat,
.meta-chip {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stat span,
.meta-chip span,
.summary-box span,
.info-item span,
.score-box span,
.legend-item span,
.result-item span,
.prompt-preview {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-right .hero-stat span,
.hero-right .hero-stat strong,
.meta-chip span,
.meta-chip strong,
.admin-role-box span,
.admin-role-box strong,
.admin-role-box small {
  color: #f4efe4;
}

button,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

button:disabled,
input:disabled,
select:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff7ef;
  box-shadow: 0 14px 26px rgba(191, 75, 21, 0.24);
  letter-spacing: 0.01em;
}

.primary-button:hover {
  box-shadow: 0 18px 34px rgba(191, 75, 21, 0.3);
}

.secondary-button,
.ghost-button {
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink);
  border: 1px solid rgba(16, 32, 25, 0.14);
  box-shadow: 0 8px 16px rgba(16, 32, 25, 0.04);
}

.ghost-button:hover,
.secondary-button:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(16, 32, 25, 0.2);
}

.danger-button {
  color: var(--down);
}

.wide-button {
  width: 100%;
}

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

.card {
  padding: 22px;
}

.stage-card,
.scoreboard-card,
.action-card {
  grid-column: span 4;
}

.round-overview-card,
.gameplay-card {
  grid-column: span 12;
}

.results-card,
.info-card {
  grid-column: span 6;
}

.prediction-records-card {
  grid-column: span 12;
}

.contract-info-card {
  grid-column: span 12;
}

.prediction-records-card,
.recent-results-card,
.contract-info-card {
  background: rgba(255, 251, 244, 0.9);
  box-shadow: 0 20px 38px rgba(16, 32, 25, 0.055);
}

.log-card,
.admin-summary-card,
.admin-ops-card {
  grid-column: span 12;
}

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

.compact-head {
  margin-bottom: 14px;
}

.compact-head .micro-label {
  margin-bottom: 0;
}

.prediction-records-card .card-head,
.recent-results-card .card-head,
.contract-info-card .card-head {
  margin-bottom: 10px;
  padding-bottom: 2px;
}

.prediction-records-card .micro-label,
.recent-results-card .micro-label,
.contract-info-card .micro-label {
  color: rgba(16, 32, 25, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.card h2 {
  margin: 0;
}

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(16, 32, 25, 0.08);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.round-command-head {
  margin-bottom: 4px;
}

.round-command-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  line-height: 1;
}

.stage-copy {
  margin: 0 0 14px;
  color: rgba(16, 32, 25, 0.74);
  line-height: 1.6;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.progress-track {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: rgba(16, 32, 25, 0.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transition: width 250ms ease;
}

.countdown-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(237, 107, 44, 0.16);
  background: rgba(255, 248, 239, 0.98);
  color: var(--accent-deep);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  box-shadow: 0 8px 20px rgba(191, 75, 21, 0.06);
}

.stage-steps,
.summary-grid,
.score-metrics,
.wallet-summary,
.info-grid,
.form-grid,
.result-list,
.activity-log,
.admin-columns,
.quick-chip-row,
.filter-stack,
.filter-group {
  display: grid;
  gap: 14px;
}

.stage-steps {
  position: relative;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  padding: 22px 0 6px;
  isolation: isolate;
}

.stage-steps::before {
  content: "";
  position: absolute;
  left: 16.66%;
  right: 16.66%;
  top: 11px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(237, 107, 44, 0.18), rgba(237, 107, 44, 0.42), rgba(16, 32, 25, 0.12));
  pointer-events: none;
}

.stage-steps::after {
  content: "";
  position: absolute;
  left: 16.66%;
  top: 7px;
  width: 18%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 234, 213, 0.96), rgba(255, 255, 255, 0));
  opacity: 0.78;
  filter: blur(1px);
  animation: stageFlow 4.4s ease-in-out infinite;
  pointer-events: none;
}

.stage-step,
.summary-box,
.score-box,
.info-item,
.result-item,
.action-panel {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.stage-step {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  min-height: 152px;
  padding: 34px 18px 20px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(249, 243, 233, 0.98));
  box-shadow: 0 14px 26px rgba(16, 32, 25, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  overflow: hidden;
}

.stage-step::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  transform: translateX(-130%);
  opacity: 0;
  pointer-events: none;
}

.stage-step small {
  display: block;
  margin-top: 2px;
  color: rgba(16, 32, 25, 0.62);
  font-size: 0.84rem;
  line-height: 1.5;
}

.step-dot {
  position: absolute;
  top: -2px;
  left: 24px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(16, 32, 25, 0.18);
  box-shadow: 0 0 0 9px rgba(16, 32, 25, 0.05);
}

.stage-step-copy-wrap {
  display: grid;
  gap: 10px;
}

.stage-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 32, 25, 0.08);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(16, 32, 25, 0.55);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.stage-time {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(237, 107, 44, 0.08);
  color: var(--accent-deep);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  line-height: 1;
}

.stage-step.pending {
  opacity: 0.78;
}

.stage-step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(237, 107, 44, 0.12);
  animation: stepPulse 1.8s ease-in-out infinite;
}

.stage-step.done .step-dot {
  background: var(--up);
  box-shadow: 0 0 0 8px rgba(21, 128, 99, 0.12);
}

.stage-step.active {
  border-color: rgba(237, 107, 44, 0.32);
  background: linear-gradient(180deg, rgba(255, 245, 235, 0.98), rgba(255, 250, 244, 0.98));
  box-shadow: 0 18px 34px rgba(191, 75, 21, 0.12);
  transform: translateY(-2px);
}

.stage-step.active::after {
  opacity: 1;
  animation: cardSweep 2.8s ease-in-out infinite;
}

.stage-step.active .stage-step-index,
.stage-step.active .stage-time {
  border-color: rgba(237, 107, 44, 0.18);
  background: rgba(237, 107, 44, 0.12);
  color: var(--accent-deep);
}

.stage-step.done {
  border-color: rgba(21, 128, 99, 0.2);
  background: linear-gradient(180deg, rgba(240, 250, 246, 0.98), rgba(251, 255, 253, 0.98));
}

.stage-step.done .stage-step-index,
.stage-step.done .stage-time {
  border-color: rgba(21, 128, 99, 0.16);
  background: rgba(21, 128, 99, 0.1);
  color: #0f6b51;
}

.stage-step.done .stage-step-index::before {
  content: "已完成";
  margin-right: 6px;
  color: rgba(15, 107, 81, 0.72);
  font-size: 0.7rem;
  letter-spacing: 0;
}

.stage-step.active .stage-step-index::before {
  content: "进行中";
  margin-right: 6px;
  color: rgba(191, 75, 21, 0.78);
  font-size: 0.7rem;
  letter-spacing: 0;
}

.stage-step.pending .stage-step-index::before {
  content: "待开始";
  margin-right: 6px;
  color: rgba(16, 32, 25, 0.44);
  font-size: 0.7rem;
  letter-spacing: 0;
}

.stage-step strong {
  display: block;
  font-size: 1.06rem;
}

@keyframes stepPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(237, 107, 44, 0.12);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 13px rgba(237, 107, 44, 0.1);
  }
}

@keyframes cardSweep {
  0% {
    transform: translateX(-130%);
  }
  55%,
  100% {
    transform: translateX(130%);
  }
}

@keyframes stageFlow {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.4;
  }
  50% {
    transform: translateX(355%);
    opacity: 0.88;
  }
}

.pool-card {
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.92), rgba(255, 252, 246, 0.98));
  border: 1px solid var(--line);
  box-shadow: 0 14px 28px rgba(16, 32, 25, 0.045);
}

.primary-pool-card {
  padding: 18px;
  box-shadow: 0 18px 36px rgba(191, 75, 21, 0.08);
}

.round-command-body {
  margin-top: 18px;
  padding-top: 22px;
  border-top: 1px solid rgba(16, 32, 25, 0.08);
}

.pool-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

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

.pool-side {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(16, 32, 25, 0.08);
  background: rgba(255, 252, 246, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.pool-side.up {
  background: linear-gradient(180deg, rgba(239, 252, 247, 0.98), rgba(255, 252, 246, 0.98));
}

.pool-side.down {
  background: linear-gradient(180deg, rgba(255, 244, 239, 0.98), rgba(255, 252, 246, 0.98));
}

.pool-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pool-side-head span {
  color: rgba(16, 32, 25, 0.7);
  font-size: 0.94rem;
}

.pool-side-head strong {
  font-size: 1rem;
}

.pool-side.up .pool-side-head strong,
.pool-side.up .pool-side-value {
  color: var(--up);
}

.pool-side.down .pool-side-head strong,
.pool-side.down .pool-side-value {
  color: var(--down);
}

.pool-side-value {
  font-size: 1.38rem;
  line-height: 1.1;
}

.pool-side-track {
  display: flex;
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: rgba(16, 32, 25, 0.08);
}

.pool-fill {
  width: 0;
  min-width: 0;
  transition: width 240ms ease;
  border-radius: inherit;
}

.pool-up {
  background: linear-gradient(90deg, #23b086, var(--up));
}

.pool-down {
  background: linear-gradient(90deg, #ef9070, var(--down));
}

.action-panel {
  display: grid;
  gap: 14px;
}

.play-zone-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: stretch;
}

.play-main,
.play-side {
  display: grid;
  gap: 18px;
  align-content: start;
  height: 100%;
}

.play-side {
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: stretch;
}

.play-side > * {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.market-metrics,
.score-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.market-metrics .score-box {
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 4px;
  box-shadow: 0 12px 24px rgba(16, 32, 25, 0.03);
}

.play-main .market-metrics {
  align-content: stretch;
}

.score-box small {
  color: rgba(16, 32, 25, 0.54);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.ai-intel-wrapper {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel-strong);
  box-shadow: 0 18px 34px rgba(16, 32, 25, 0.045);
}

.ai-prediction-panel {
  padding: 22px;
  min-height: 505px;
}

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

.ai-panel-head span {
  color: rgba(16, 32, 25, 0.72);
  font-size: 0.94rem;
  font-weight: 600;
}

.ai-panel-head small {
  color: rgba(16, 32, 25, 0.46);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

.ai-intel-card {
  display: grid;
  gap: 12px;
  min-height: 100%;
  grid-template-rows: auto 1fr auto;
}

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

.ai-intel-primary,
.ai-intel-reason-card {
  display: grid;
  gap: 8px;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(16, 32, 25, 0.08);
  background: rgba(255, 252, 246, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.ai-intel-primary {
  align-content: center;
  min-height: 92px;
}

.ai-intel-primary span,
.ai-intel-reason-card span {
  color: rgba(16, 32, 25, 0.6);
  font-size: 0.88rem;
}

.ai-intel-primary strong {
  font-size: 1.24rem;
}

.ai-status-value.up {
  color: var(--up);
}

.ai-status-value.down {
  color: var(--down);
}

.ai-status-value.pending,
.ai-status-value.muted {
  color: rgba(16, 32, 25, 0.58);
}

.ai-status-value.live {
  color: var(--accent-deep);
}

.ai-intel-reason-card {
  align-content: start;
  flex: 1 1 auto;
  min-height: 270px;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(248, 243, 234, 0.96));
}

.ai-intel-reason-card p {
  margin: 0;
  color: rgba(16, 32, 25, 0.82);
  font-size: 0.93rem;
  line-height: 1.58;
}

.ai-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: auto;
}

.ai-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(237, 107, 44, 0.18);
  background: rgba(255, 248, 239, 0.98);
  color: var(--accent-deep);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ai-action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(237, 107, 44, 0.28);
  box-shadow: 0 10px 18px rgba(191, 75, 21, 0.09);
}

.ai-action-button.is-disabled {
  pointer-events: none;
  border-color: rgba(16, 32, 25, 0.08);
  background: rgba(16, 32, 25, 0.04);
  color: rgba(16, 32, 25, 0.4);
  box-shadow: none;
}

.ai-performance-inline {
  padding: 16px;
  gap: 12px;
  align-self: end;
}

.ai-performance-head {
  margin-bottom: 0;
}

.ai-performance-inline .ai-stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-performance-inline .score-box {
  min-height: 80px;
  padding: 12px 14px;
  box-shadow: 0 10px 20px rgba(16, 32, 25, 0.025);
}

.ai-performance-inline .score-box span {
  font-size: 0.82rem;
}

.ai-performance-inline .score-box strong {
  font-size: 1.22rem;
  line-height: 1.1;
}

.ai-performance-inline .score-box strong.up {
  color: var(--up);
}

.ai-performance-inline .score-box strong.down {
  color: var(--down);
}

.ai-performance-inline .score-box strong.muted {
  color: rgba(16, 32, 25, 0.58);
}

.amount-panel {
  display: grid;
  gap: 14px;
  padding: 14px 18px 18px;
  border-radius: 22px;
  border: 1px solid rgba(16, 32, 25, 0.08);
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 0 14px 28px rgba(16, 32, 25, 0.04);
}

.amount-input-label {
  display: grid;
  gap: 8px;
}

.amount-input-label span {
  color: rgba(16, 32, 25, 0.62);
  font-size: 0.94rem;
}

.amount-input-wrap {
  position: relative;
}

.amount-input-wrap input {
  width: 100%;
  padding-right: 96px;
  height: 66px;
  font-size: 1.06rem;
}

.amount-input-unit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #ff5d4d;
  font-size: 0.92rem;
  font-weight: 600;
}

.amount-footnote {
  margin: -4px 0 0;
  color: #ff5d4d;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: right;
}

.amount-estimate-row {
  display: grid;
  justify-items: end;
  gap: 4px;
  padding-top: 2px;
  border-top: 1px solid rgba(16, 32, 25, 0.08);
  text-align: right;
}

.amount-estimate-row span {
  color: rgba(16, 32, 25, 0.58);
  font-size: 0.9rem;
}

.amount-estimate-row strong {
  color: var(--accent-deep);
  font-size: 1rem;
}

.recent-results-card {
  grid-column: span 12;
}

.bet-action-panel {
  min-height: 100%;
}

.action-panel-head h3 {
  margin: 0 0 6px;
}

.action-panel-head p {
  margin: 0;
  color: rgba(16, 32, 25, 0.68);
  line-height: 1.55;
}

.muted-panel {
  background: rgba(245, 240, 229, 0.72);
}

.ticket-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(16, 32, 25, 0.08);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 243, 235, 0.94));
}

.prediction-records-table {
  display: grid;
  gap: 0;
  border: 1px solid rgba(16, 32, 25, 0.08);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.prediction-records-head,
.prediction-record-row {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr 1fr 1fr 1fr 1.25fr;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
}

.prediction-records-head {
  background: rgba(16, 32, 25, 0.05);
  border-bottom: 1px solid rgba(16, 32, 25, 0.08);
}

.prediction-records-head span {
  color: rgba(16, 32, 25, 0.62);
  font-size: 0.84rem;
  font-weight: 600;
}

.prediction-records-body {
  display: grid;
}

.prediction-record-row {
  border-bottom: 1px solid rgba(16, 32, 25, 0.08);
  background: rgba(255, 253, 248, 0.9);
}

.prediction-record-row:last-child {
  border-bottom: 0;
}

.prediction-record-row.empty {
  color: rgba(16, 32, 25, 0.66);
}

.prediction-cell {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: rgba(16, 32, 25, 0.78);
  font-size: 0.95rem;
  line-height: 1.42;
}

.prediction-cell.strong {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.98rem;
}

.prediction-reward-cell,
.prediction-reward-stack {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.prediction-reward-stack {
  flex-wrap: wrap;
  gap: 10px;
}

.history-ticket-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 32, 25, 0.06);
  color: var(--ink);
  font-size: 0.8rem;
}

.history-ticket-status.up {
  background: rgba(21, 128, 99, 0.12);
  color: var(--up);
}

.history-ticket-status.down {
  background: rgba(187, 86, 51, 0.12);
  color: var(--down);
}

.history-ticket-status.warn {
  background: rgba(237, 107, 44, 0.12);
  color: var(--accent-deep);
}

.history-claim-button {
  width: fit-content;
}

.quick-chip-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-chip {
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.96);
  border: 1px solid rgba(16, 32, 25, 0.12);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1rem;
  box-shadow: 0 10px 20px rgba(16, 32, 25, 0.04);
}

.recent-results-card .result-list,
.ai-performance-card .score-metrics,
.contract-info-card .contract-info-grid {
  gap: 16px;
}

.recent-results-card .result-item {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 243, 235, 0.92));
  box-shadow: 0 12px 24px rgba(16, 32, 25, 0.035);
  padding: 18px 20px;
  border-radius: 22px;
}

.recent-results-card .result-item > div {
  display: grid;
  gap: 6px;
}

.recent-results-card .result-item span {
  color: rgba(16, 32, 25, 0.56);
  font-size: 0.8rem;
  font-weight: 600;
}

.recent-results-card .result-item strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.recent-results-card .result-item > div:first-child strong,
.recent-results-card .result-item > div:last-child strong {
  font-size: 1.06rem;
}

.recent-results-card .result-item > div:nth-child(4) strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
}

.ai-stats-grid .score-box {
  min-height: 120px;
  display: grid;
  align-content: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 243, 235, 0.94));
  box-shadow: 0 12px 24px rgba(16, 32, 25, 0.03);
}

.ai-stats-grid .score-box strong {
  font-size: 1.5rem;
}

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

.contract-info-grid .info-item {
  min-height: 142px;
  display: grid;
  align-content: start;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 243, 235, 0.92));
  box-shadow: 0 12px 24px rgba(16, 32, 25, 0.03);
  padding: 18px;
  border-radius: 22px;
}

.contract-info-grid .info-item span {
  color: rgba(16, 32, 25, 0.56);
  font-size: 0.8rem;
  font-weight: 600;
}

.contract-info-grid code {
  word-break: break-all;
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(16, 32, 25, 0.045);
}

.contract-info-grid .info-item .inline-link {
  margin-top: auto;
}

.filter-group {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.filter-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.helper-copy {
  margin: 2px 0 0;
  color: rgba(16, 32, 25, 0.66);
  line-height: 1.55;
  font-size: 0.92rem;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 25, 0.42);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 28px));
  margin: 56px auto;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 244, 0.98);
  box-shadow: 0 30px 70px rgba(16, 32, 25, 0.18);
}

.rules-copy {
  display: grid;
  gap: 12px;
  color: rgba(16, 32, 25, 0.78);
  line-height: 1.65;
}

.filter-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(16, 32, 25, 0.05);
  border: 1px solid var(--line);
  color: var(--ink);
}

.filter-pill.active {
  background: rgba(237, 107, 44, 0.14);
  border-color: rgba(237, 107, 44, 0.32);
  color: var(--accent-deep);
}

.inline-link {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tone-up {
  color: var(--up);
}

.tone-down {
  color: var(--down);
}

.tone-warn {
  color: var(--warn);
}

.tone-neutral {
  color: var(--ink);
}

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

.side-option {
  position: relative;
  display: grid;
  cursor: pointer;
}

.side-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.side-option span {
  display: block;
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  text-align: center;
  font-weight: 700;
  background: #fffdf8;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 10px 20px rgba(16, 32, 25, 0.03);
}

.side-up input:checked + span {
  border-color: rgba(21, 128, 99, 0.36);
  background: rgba(21, 128, 99, 0.12);
  color: var(--up);
  box-shadow: 0 14px 26px rgba(21, 128, 99, 0.12);
  transform: translateY(-1px);
}

.side-down input:checked + span {
  border-color: rgba(187, 86, 51, 0.36);
  background: rgba(187, 86, 51, 0.12);
  color: var(--down);
  box-shadow: 0 14px 26px rgba(187, 86, 51, 0.12);
  transform: translateY(-1px);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

input,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(16, 32, 25, 0.16);
  background: #fffdf7;
  color: var(--ink);
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

input:focus,
select:focus {
  outline: 2px solid rgba(237, 107, 44, 0.24);
  border-color: rgba(237, 107, 44, 0.4);
}

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

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

.wallet-summary,
.score-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-box.highlight {
  background: linear-gradient(135deg, rgba(237, 107, 44, 0.14), rgba(255, 252, 246, 0.92));
}

.result-item {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1fr 1.35fr 1fr 1fr;
  gap: 14px;
  align-items: center;
}

.result-badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-family: "IBM Plex Mono", monospace;
  background: rgba(16, 32, 25, 0.08);
}

.result-badge.up {
  color: var(--up);
}

.result-badge.down {
  color: var(--down);
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--accent-deep);
  font-size: 0.9rem;
  text-decoration: underline;
}

.prompt-preview {
  margin-bottom: 0;
  line-height: 1.55;
  color: rgba(16, 32, 25, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-log {
  max-height: 280px;
  overflow: auto;
}

.log-entry {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(16, 32, 25, 0.08);
  background: rgba(16, 32, 25, 0.05);
}

.log-entry.success {
  background: rgba(21, 128, 99, 0.12);
  border-color: rgba(21, 128, 99, 0.18);
}

.log-entry.error {
  background: rgba(187, 86, 51, 0.12);
  border-color: rgba(187, 86, 51, 0.18);
}

.log-entry strong {
  display: block;
  margin-bottom: 6px;
}

.button-stack {
  display: grid;
}

.admin-body .hero-note,
.admin-body .action-panel-head p {
  max-width: none;
}

@media (max-width: 1120px) {
  .hero-card,
  .admin-hero {
    grid-template-columns: 1fr;
  }

  .stage-card,
  .scoreboard-card,
  .action-card,
  .round-overview-card,
  .gameplay-card,
  .results-card,
  .info-card {
    grid-column: span 12;
  }

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

  .play-zone-grid {
    grid-template-columns: 1fr;
  }

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

  .stage-steps {
    grid-template-columns: 1fr;
  }

  .stage-steps::before {
    display: none;
  }

  .stage-steps::after {
    display: none;
  }

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

@media (max-width: 760px) {
  .player-shell,
  .admin-shell {
    width: min(100% - 20px, 100%);
    padding: 14px 0 26px;
  }

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

  .hero-actions,
  .wallet-action-group {
    flex-direction: column;
  }

  .hero-card,
  .admin-hero,
  .card {
    padding: 18px;
    border-radius: 22px;
  }

  .hero-card h1,
  .admin-hero h1 {
    font-size: 2.7rem;
  }

  .compact,
  .summary-grid,
  .wallet-summary,
  .pool-sides,
  .market-metrics,
  .score-metrics,
  .contract-info-grid,
  .info-grid,
  .admin-columns,
  .play-zone-grid,
  .result-item,
  .side-toggle,
  .quick-chip-row,
  .stage-steps {
    grid-template-columns: 1fr;
  }

  .ai-intel-top {
    grid-template-columns: 1fr;
  }

  .ai-action-buttons {
    flex-direction: column;
  }

  .prediction-records-head {
    display: none;
  }

  .prediction-record-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .prediction-cell {
    display: grid;
    gap: 4px;
    min-height: unset;
  }

  .prediction-cell::before {
    content: attr(data-label);
    color: rgba(16, 32, 25, 0.52);
    font-size: 0.82rem;
  }

  button {
    width: 100%;
  }

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

  .countdown-pill {
    justify-content: center;
  }

  .flow-line,
  .flow-pulse {
    display: none;
  }

  .arena-visual {
    display: grid;
    gap: 12px;
    min-height: auto;
  }

  .flow-node {
    width: 100%;
  }

  .stage-step {
    min-height: unset;
    padding-top: 26px;
  }
}
