:root {
  --bg: #0b1220;
  --surface: #111a2c;
  --text: #eaf0ff;
  --muted: #a8b6d0;
  --line: #22304a;
  --accent: #8b5cf6;
  --accent-soft: #241d3f;
  --success: #58c286;
  --error: #ff7a73;
  --danger: #ff8e8e;
  --shadow: 0 12px 30px rgba(3, 8, 18, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -200px, rgba(139, 92, 246, 0.08), transparent 65%),
    var(--bg);
  font: 15px/1.45 "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

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

a:hover {
  opacity: 0.92;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
}

.play-shell {
  max-width: 620px;
  margin: 0 auto;
}

.page-shell {
  max-width: 620px;
  margin: 0 auto;
}

.page-header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0.35rem 0 1.2rem;
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.actions a.active {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
  min-width: 12rem;
  margin-bottom: 0.35rem;
}

input[type="text"] {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
}

button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

button.hold-submit {
  position: relative;
  overflow: hidden;
}

button.hold-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  pointer-events: none;
}

button.hold-submit.is-holding::before {
  transition: transform 600ms linear;
  transform: scaleX(1);
}

button.hold-submit.is-ready::before {
  transition: none;
  transform: scaleX(1);
  background: color-mix(in srgb, var(--success) 30%, transparent);
}

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

.messages {
  margin: 0.75rem 0;
}

.message {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin: 0 0 0.4rem;
  background: var(--surface);
}

.message.success {
  color: var(--success);
}

.message.error {
  color: var(--error);
}

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

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-top: 0;
  font-size: 1.08rem;
}

.play-feed {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.play-feed-title {
  text-align: left;
}

.onboarding-step {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}

.onboarding-step p:last-child {
  margin-bottom: 0;
}

dialog.claim-modal {
  width: min(520px, calc(100vw - 2rem));
  border: 1px solid #22304a;
  border-radius: 14px;
  padding: 0.95rem 1rem 1rem;
  background: #0f182b !important;
  color: #eaf0ff !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

dialog.claim-modal::backdrop {
  background: rgba(2, 8, 20, 0.72);
}

.claim-modal-title {
  margin: 0 0 0.6rem;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  color: #f3f8ff;
}

.claim-modal label {
  color: #d7e4ff;
}

.claim-modal input[name="nickname"] {
  width: 100%;
  border: 1px solid #2e436e;
  background: #0a1324;
  color: #f1f7ff;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
}

.claim-modal .stack {
  min-width: 0;
}

.claim-modal input[name="nickname"]::placeholder {
  color: #8ea1c7;
}

.claim-modal-submit {
  width: 100%;
  border: 1px solid #365ea4;
  background: #13274d;
  color: #f1f7ff;
  font-weight: 700;
}

.claim-modal-submit:hover {
  border-color: #4d7bd2;
  background: #1a3569;
}

.panel ul,
.panel ol {
  margin: 0;
  padding-left: 1.1rem;
}

li {
  margin-bottom: 0.7rem;
}

li p {
  margin: 0.15rem 0;
  color: var(--muted);
}

.separator {
  list-style: none;
  margin: 0.9rem 0 0.5rem -1.1rem;
  padding: 0.35rem 0.6rem;
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-weight: 600;
  background: var(--accent-soft);
  border-radius: 8px;
}

.meta {
  margin: 0.25rem 0;
  color: var(--muted);
}

.market-details {
  margin-top: 0.45rem;
}

.market-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin: 0 0.25rem 0.25rem 0;
  background: var(--accent-soft);
  font-size: 0.85rem;
  white-space: nowrap;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 82px;
}

.question.closed {
  opacity: 0.55;
}

.countdown {
  font-variant-numeric: tabular-nums;
}

.swipe-counter {
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.swipe-deck {
  list-style: none;
  margin: 0;
  padding: 0;
}

.swipe-card {
  margin-bottom: 0;
}

.swipe-card:not(.is-active) {
  display: none;
}

.swipe-card.is-active {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
  padding: 0.25rem 0;
}

.question-main {
  text-align: left;
}

.question-kicker {
  letter-spacing: 0.02em;
  text-align: center;
}

.question-title {
  margin: 0.3rem 0 0.4rem;
  font-size: clamp(1.38rem, 1.9vw, 1.75rem);
  letter-spacing: -0.02em;
  text-align: center;
}

.question-main .market-details {
  text-align: left;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

.question-main .market-details summary {
  text-align: left;
}

.question-actions {
  width: min(420px, 100%);
  margin: 0 auto;
  gap: 0.5rem;
}

.question-actions form,
.question-actions details {
  width: 100%;
}

.question-actions button {
  width: 100%;
}

.question-actions details .stack {
  width: 100%;
  min-width: 0;
}

.swipe-nav button {
  min-width: 100px;
}

@media (max-width: 980px) {
  .swipe-card.is-active {
    max-width: 100%;
  }

  .swipe-card .stack {
    width: 100%;
  }
}

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