:root {
  color: #f8fafc;
  background: #020617;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem 0;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.28), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.22), transparent 30rem),
    #020617;
}

.app-shell {
  width: min(1320px, calc(100vw - 2rem));
  padding: clamp(1.25rem, 4vw, 3.25rem);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 2rem;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  margin: 0 0 1rem;
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.72fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.9rem);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: 0;
}

.lede {
  max-width: 46rem;
  margin: 1.5rem 0 2rem;
  color: #cbd5e1;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.coin-panel,
.history-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.5rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  background: rgba(30, 41, 59, 0.72);
}

.coin-panel {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
}

.coin {
  position: relative;
  width: min(52vw, 12rem);
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transition: transform 360ms ease, filter 360ms ease;
  will-change: transform, filter;
}

.coin--spinning {
  animation: coin-flip 900ms cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  filter: drop-shadow(0 0 2rem rgba(56, 189, 248, 0.32));
}

.coin--tails { transform: rotateY(180deg); }

.coin__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0.35rem solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  backface-visibility: hidden;
  color: #0f172a;
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 900;
  box-shadow: inset 0 0 2rem rgba(255, 255, 255, 0.45), 0 1.5rem 3rem rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.coin__face--heads { background: linear-gradient(145deg, #facc15, #f97316); }
.coin__face--tails { background: linear-gradient(145deg, #a7f3d0, #22d3ee); transform: rotateY(180deg); }

.coin__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coin-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 34rem;
}

.coin-upload-grid label {
  display: grid;
  gap: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(30, 41, 59, 0.72);
  color: #bae6fd;
  font-weight: 800;
}

.coin-upload-grid input {
  width: 100%;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.9rem;
}

.coin-reset-button { grid-column: 1 / -1; }


.result-text {
  min-height: 1.5rem;
  margin: 0;
  color: #e0f2fe;
  font-size: 1.25rem;
  font-weight: 700;
}

.wheel-panel .result-text {
  width: 100%;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(56, 189, 248, 0.14);
  text-align: center;
  overflow-wrap: anywhere;
}

.flip-button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.25rem;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #020617;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: opacity 180ms ease, transform 180ms ease;
}

.flip-button:not(:disabled):hover { transform: translateY(-2px); }
.flip-button:disabled { cursor: default; opacity: 0.55; }

.secondary-button {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.74);
  color: #e0f2fe;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: border-color 180ms ease, transform 180ms ease;
}

.secondary-button:not(:disabled):hover {
  border-color: rgba(56, 189, 248, 0.8);
  transform: translateY(-2px);
}

.secondary-button:disabled { cursor: default; opacity: 0.55; }

.history-card {
  margin-top: 1rem;
}

.history-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #bae6fd;
}

.history-card ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-card li {
  min-width: 0;
}

.history-item,
.history-empty {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.85rem;
  min-height: 4.25rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.74);
  color: #cbd5e1;
}

.history-empty {
  grid-column: 1 / -1;
  justify-content: center;
  border: 1px dashed rgba(148, 163, 184, 0.32);
  color: #94a3b8;
  text-align: center;
}

.history-card span { color: #f8fafc; font-weight: 800; }
.history-card time,
.history-card small { color: #94a3b8; }

@keyframes coin-flip {
  from { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(720deg) scale(1.08); }
  to { transform: rotateY(1440deg) scale(1); }
}

@media (max-width: 760px) {
  body { place-items: start center; padding: 1rem 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .app-shell { border-radius: 1.25rem; }
}

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(21rem, 1.08fr) minmax(21rem, 0.92fr) minmax(13rem, 0.55fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

.wheel-editor {
  min-width: 0;
}

.wheel-editor h1 { max-width: 16ch; }

.options-editor {
  display: grid;
  gap: 0.65rem;
  max-width: none;
  color: #e0f2fe;
  font-weight: 800;
}

.options-editor small {
  display: block;
  margin-top: 0.2rem;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
}

.options-editor textarea {
  width: 100%;
  min-height: clamp(18rem, 42vh, 28rem);
  resize: vertical;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font: inherit;
  line-height: 1.45;
}

.options-editor textarea:disabled { opacity: 0.6; }

.wheel-editor-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.wheel-entry-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.45rem;
  max-height: 13rem;
  margin: 0.9rem 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.wheel-entry-list li {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  border-radius: 0.75rem;
  padding: 0.5rem 0.65rem;
  background: rgba(15, 23, 42, 0.74);
  color: #e2e8f0;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.wheel-entry-list span {
  flex: 0 0 auto;
  min-width: 1.55rem;
  border-radius: 999px;
  padding: 0.15rem 0.35rem;
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
  font-size: 0.78rem;
  text-align: center;
}

.wheel-panel {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.5rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  background: rgba(30, 41, 59, 0.72);
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 22rem);
  aspect-ratio: 1;
}

.wheel-pointer {
  position: absolute;
  top: -0.25rem;
  z-index: 2;
  width: 0;
  height: 0;
  border-left: 0.85rem solid transparent;
  border-right: 0.85rem solid transparent;
  border-top: 1.7rem solid #f8fafc;
  filter: drop-shadow(0 0.35rem 0.45rem rgba(0, 0, 0, 0.35));
}

.wheel {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  border: 0.45rem solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: conic-gradient(var(--wheel-gradient));
  box-shadow: inset 0 0 2rem rgba(15, 23, 42, 0.42), 0 1.5rem 3rem rgba(0, 0, 0, 0.28);
  transform: rotate(var(--wheel-rotation));
  transition: transform var(--wheel-duration, 1600ms) cubic-bezier(0.08, 0.78, 0.14, 1);
}

.wheel::after {
  content: '';
  position: absolute;
  inset: 38%;
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: 0 0 0 0.35rem rgba(15, 23, 42, 0.34);
}

.wheel--spinning { filter: drop-shadow(0 0 2rem rgba(56, 189, 248, 0.32)); }

.wheel-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.8rem;
  transform: rotate(var(--label-rotation));
  color: rgba(15, 23, 42, 0.92);
  font-size: clamp(0.58rem, 1.2vw, 0.82rem);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.wheel-label b {
  display: block;
  max-width: clamp(4.75rem, 9vw, 7.2rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: rotate(calc(-1 * var(--label-rotation)));
}

.duration-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.75rem;
  width: 100%;
  color: #bae6fd;
  font-weight: 800;
}

.duration-control input {
  grid-column: 1 / -1;
  width: 100%;
}

.duration-control span {
  color: #f8fafc;
  font-weight: 900;
}

.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.tool-tab {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.tool-tab--active {
  border-color: rgba(56, 189, 248, 0.8);
  background: rgba(56, 189, 248, 0.16);
  color: #f8fafc;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(19rem, 0.72fr) minmax(22rem, 1fr);
  gap: clamp(1.25rem, 4vw, 2rem);
  align-items: start;
}

.tournament-form,
.team-form,
.dice-form,
.team-output,
.tournament-output,
.dice-panel,
.team-card,
.seed-card,
.round-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.5rem;
  background: rgba(30, 41, 59, 0.72);
}

.dice-form,
.team-form,
.tournament-form {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 1.5rem);
}

.dice-form label,
.team-form label,
.tournament-form label {
  display: grid;
  gap: 0.45rem;
  color: #bae6fd;
  font-weight: 800;
}

.dice-form small,
.team-form small,
.tournament-form small { color: #94a3b8; font-weight: 600; }

.dice-form select,
.dice-form input[type="number"],
.team-form select,
.team-form input[type="number"],
.team-form textarea,
.tournament-form select,
.tournament-form input[type="number"],
.tournament-form textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font: inherit;
}

.is-hidden { display: none !important; }

.tournament-form textarea { resize: vertical; }
.team-form textarea { resize: vertical; }

.dice-form fieldset {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
}

.dice-form legend {
  padding: 0 0.35rem;
  color: #bae6fd;
  font-weight: 800;
}

.radio-row {
  grid-template-columns: auto 1fr !important;
  align-items: center;
  color: #e2e8f0 !important;
}

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

.range-grid--hidden { display: none; }

.dice-panel {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding: clamp(1rem, 4vw, 1.5rem);
}

.mode-pill {
  margin: 0;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(56, 189, 248, 0.13);
  color: #e0f2fe;
  font-weight: 900;
}

.dice-tray {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.25rem, 4.25rem));
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
}

.die-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 4.25rem;
  aspect-ratio: 1;
  border: 0.18rem solid rgba(255, 255, 255, 0.52);
  border-radius: 0.9rem;
  background: linear-gradient(145deg, #ffffff, #dbeafe);
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 950;
  box-shadow: 0 0.8rem 1.6rem rgba(0, 0, 0, 0.22);
}

.die-face--pips {
  grid-template-columns: repeat(3, 0.55rem);
  grid-template-rows: repeat(3, 0.55rem);
  gap: 0.42rem;
}

.die-face--pips i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #000000;
  opacity: 0;
}

.die-face--1 i:nth-child(5),
.die-face--2 i:nth-child(1),
.die-face--2 i:nth-child(9),
.die-face--3 i:nth-child(1),
.die-face--3 i:nth-child(5),
.die-face--3 i:nth-child(9),
.die-face--4 i:nth-child(1),
.die-face--4 i:nth-child(3),
.die-face--4 i:nth-child(7),
.die-face--4 i:nth-child(9),
.die-face--5 i:nth-child(1),
.die-face--5 i:nth-child(3),
.die-face--5 i:nth-child(5),
.die-face--5 i:nth-child(7),
.die-face--5 i:nth-child(9),
.die-face--6 i:nth-child(1),
.die-face--6 i:nth-child(3),
.die-face--6 i:nth-child(4),
.die-face--6 i:nth-child(6),
.die-face--6 i:nth-child(7),
.die-face--6 i:nth-child(9) {
  opacity: 1;
}

.die-face--empty {
  background: rgba(15, 23, 42, 0.82);
  color: #94a3b8;
}

.die-face--rolling-face::before,
.die-face--rolling-face::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #0f172a;
  transform: translate(-50%, -50%);
  box-shadow:
    1.05rem 0 0 #0f172a,
    0 1.05rem 0 #0f172a,
    1.05rem 1.05rem 0 #0f172a;
}

.team-history-item button {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  min-height: 4.25rem;
  border: 0;
  border-radius: 0.85rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.74);
  color: #cbd5e1;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.team-history-item button:hover {
  outline: 1px solid rgba(56, 189, 248, 0.7);
}

.team-history-item span {
  color: #f8fafc;
  font-weight: 800;
}

.team-history-item small {
  color: #94a3b8;
  font-weight: 700;
}

.die-face--rolling-face::after {
  transform: translate(-50%, -50%) rotate(45deg) scale(0.78);
  opacity: 0.45;
}

.dice-tray--rolling .die-face {
  animation: dice-roll 720ms cubic-bezier(0.36, 0, 0.24, 1) infinite;
}

@keyframes dice-roll {
  from { transform: translateY(0) rotate(0deg) scale(1); filter: brightness(1); }
  35% { transform: translateY(-0.55rem) rotate(16deg) scale(1.04); filter: brightness(1.18); }
  70% { transform: translateY(0.15rem) rotate(-12deg) scale(0.98); filter: brightness(1.06); }
  to { transform: translateY(0) rotate(0deg) scale(1); filter: brightness(1); }
}

.checkbox-row {
  grid-template-columns: auto 1fr !important;
  align-items: center;
  color: #e2e8f0 !important;
}

.form-error {
  margin: 0;
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
  font-weight: 800;
}

.tournament-output {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 1.5rem);
}

.team-layout h1 { max-width: 12ch; }

.team-output {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  padding: clamp(1rem, 4vw, 1.5rem);
}

.team-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.team-card__header {
  display: grid;
  gap: 0.25rem;
}

.team-card h3 {
  margin: 0;
  color: #bae6fd;
  font-size: 1.05rem;
}

.team-card__header span {
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 800;
}

.team-card ol {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-card li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 0.85rem;
  padding: 0.7rem 0.75rem;
  background: rgba(15, 23, 42, 0.74);
  color: #f8fafc;
  font-weight: 800;
}

.team-card li span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-card li b {
  flex: 0 0 auto;
  color: #fde68a;
}

.seed-card { padding: 1rem; }
.seed-card h2,
.round-card h3 { margin: 0 0 0.75rem; color: #bae6fd; }
.seed-card ol,
.round-card ol { margin: 0; color: #cbd5e1; }
.seed-card ol { padding-left: 1.25rem; }
.seed-card li + li { margin-top: 0.45rem; }
.seed-card li {
  padding-right: 0.25rem;
}

.seed-card li span {
  color: #f8fafc;
  font-weight: 800;
}

.seed-card li small {
  display: block;
  color: #94a3b8;
  font-weight: 700;
}

.seed-card p {
  margin: 0.8rem 0 0;
  color: #cbd5e1;
  line-height: 1.55;
}

.seed-card .secondary-button { margin-top: 1rem; }

.copy-source {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rounds-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.round-card {
  flex: 1 0 min(18rem, 78vw);
  padding: 1rem;
}

.match-list {
  display: grid;
  gap: 0.65rem;
  padding: 0;
  list-style: none;
}

.match-card {
  display: grid;
  gap: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.9rem;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.72);
}

.match-card__label {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.match-card__side,
.match-card__bye {
  border-radius: 0.7rem;
  padding: 0.55rem 0.65rem;
  background: rgba(30, 41, 59, 0.9);
  color: #f8fafc;
  font-weight: 840;
  overflow-wrap: anywhere;
}

.match-card__bye {
  background: rgba(250, 204, 21, 0.13);
  color: #fde68a;
}

.empty-state { margin: 0; color: #94a3b8; }

.trust-page {
  display: grid;
  gap: 1.25rem;
}

.trust-intro h1 { max-width: 15ch; }

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

.trust-grid article,
.trust-section,
.info-list article,
.tool-guide article,
.faq-grid article {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.72);
}

.trust-grid article,
.info-list article,
.tool-guide article,
.faq-grid article {
  border-radius: 1.25rem;
  padding: clamp(1rem, 3vw, 1.35rem);
}

.trust-section {
  border-radius: 1.5rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.trust-grid h2,
.trust-section h2 {
  margin: 0 0 0.55rem;
  color: #bae6fd;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 760;
}

.trust-section h3 {
  margin: 0 0 0.45rem;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 760;
}

.trust-grid p,
.trust-section p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.65;
}

.trust-grid code,
.trust-section code {
  border-radius: 0.35rem;
  padding: 0.1rem 0.28rem;
  background: rgba(15, 23, 42, 0.88);
  color: #e0f2fe;
}

.fairness-runner {
  display: grid;
  gap: 1rem;
}

.fairness-runner .flip-button {
  width: min(100%, 18rem);
}

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

.fairness-result-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.25rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.56);
}

.fairness-result-card h3 {
  margin: 0 0 0.75rem;
  color: #f8fafc;
}

.fairness-result-card ol {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fairness-result-card li {
  display: grid;
  gap: 0.35rem;
}

.fairness-result-card div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: #cbd5e1;
  font-weight: 800;
}

.fairness-result-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.fairness-result-card b {
  flex: 0 0 auto;
  color: #bae6fd;
}

.fairness-result-card i {
  display: block;
  height: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8 var(--bar-width), rgba(148, 163, 184, 0.2) var(--bar-width));
}

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

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

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

.history-card--wheel {
  margin-top: 0;
}

.history-card--wheel ol {
  grid-template-columns: 1fr;
}

@media (max-width: 1120px) {
  .wheel-layout {
    grid-template-columns: minmax(20rem, 1fr) minmax(20rem, 0.9fr);
  }

  .history-card--wheel {
    grid-column: 1 / -1;
  }

  .history-card--wheel ol {
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  }

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

  .fairness-results {
    grid-template-columns: 1fr;
  }

  .info-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .trust-grid,
  .faq-grid,
  .tool-guide { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .wheel-layout { grid-template-columns: 1fr; }
  .options-editor textarea { min-height: 16rem; }
  .wheel-wrap { width: min(78vw, 20rem); }
  .wheel-editor-actions { grid-template-columns: 1fr; }
  .coin-upload-grid { grid-template-columns: 1fr; }
}

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

/* Fourth polish pass: more precise dice geometry, premium wheel, stronger tournament board. */
.dice-panel {
  min-height: 13.5rem;
  border-radius: 1.65rem;
}

.dice-tray {
  grid-template-columns: repeat(auto-fit, minmax(4.8rem, 4.8rem));
  gap: 0.8rem;
}

.die-face {
  width: 4.8rem;
  border: 0;
  border-radius: 0.85rem;
  background: radial-gradient(circle at 28% 22%, #ffffff 0 18%, #eff6ff 42%, #dbeafe 100%);
  color: #050816;
  box-shadow:
    inset 0.15rem 0.15rem 0.5rem rgba(255, 255, 255, 0.92),
    inset -0.22rem -0.24rem 0.8rem rgba(15, 23, 42, 0.14),
    0 0.9rem 1.8rem rgba(0, 0, 0, 0.32);
}

.die-face--pips {
  display: grid;
  grid-template-columns: repeat(3, 0.62rem);
  grid-template-rows: repeat(3, 0.62rem);
  place-content: center;
  place-items: center;
  gap: 0.52rem;
}

.die-face--pips i {
  display: block;
  width: 0.62rem;
  height: 0.62rem;
  margin: 0;
  border-radius: 50%;
  background: #020617;
  box-shadow: inset 0.08rem 0.08rem 0.08rem rgba(255, 255, 255, 0.16);
}

.wheel-layout {
  grid-template-columns: minmax(23rem, 1.12fr) minmax(25rem, 0.92fr) minmax(14rem, 0.56fr);
}

.wheel-panel {
  position: sticky;
  top: 1.25rem;
  border-radius: 1.6rem;
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.9)),
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.18), transparent 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1.5rem 3rem rgba(0, 0, 0, 0.28);
}

.wheel-wrap {
  width: min(100%, 23.5rem);
  padding: 0.55rem;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(248, 250, 252, 0.14) 0 49%, transparent 50%),
    conic-gradient(from 0deg, rgba(255,255,255,0.7), rgba(56,189,248,0.38), rgba(255,255,255,0.72), rgba(129,140,248,0.42), rgba(255,255,255,0.7));
  box-shadow: 0 1.3rem 2.8rem rgba(0, 0, 0, 0.38);
}

.wheel-pointer {
  top: -0.08rem;
  border-left-width: 0.72rem;
  border-right-width: 0.72rem;
  border-top: 1.75rem solid #ffffff;
  filter: drop-shadow(0 0.32rem 0.35rem rgba(0, 0, 0, 0.48));
}

.wheel {
  border: 0.28rem solid rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 0 1.8rem rgba(15, 23, 42, 0.35),
    inset 0 0 0 0.12rem rgba(255, 255, 255, 0.48),
    0 0 0 0.22rem rgba(15, 23, 42, 0.34);
  transition: transform var(--wheel-duration, 1600ms) cubic-bezier(0.12, 0.58, 0.18, 1);
  will-change: transform;
}

.wheel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.22), transparent 28%), radial-gradient(circle, transparent 0 57%, rgba(255,255,255,0.16) 58% 59%, transparent 60%);
  pointer-events: none;
}

.wheel::after {
  inset: 38.5%;
  background: radial-gradient(circle at 35% 25%, #ffffff, #e2e8f0);
  box-shadow:
    0 0 0 0.28rem rgba(15, 23, 42, 0.38),
    0 0.8rem 1.6rem rgba(0, 0, 0, 0.24);
}

.wheel--spinning {
  filter: drop-shadow(0 0 2.4rem rgba(56, 189, 248, 0.38));
}

.wheel-label {
  padding-top: 1.6rem;
  font-size: clamp(0.62rem, 1.05vw, 0.86rem);
}

.wheel-label b {
  max-width: clamp(4.2rem, 8vw, 6.4rem);
}

.duration-control {
  grid-template-columns: 1fr auto;
  align-items: center;
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.56);
}

.duration-control input[type="range"] {
  accent-color: #38bdf8;
}

.duration-control strong {
  color: #f8fafc;
}

.duration-number {
  grid-column: 1 / -1;
  width: 7.5rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: rgba(2, 6, 23, 0.65);
  color: #f8fafc;
  font: inherit;
  font-weight: 850;
}

.history-card--wheel ol {
  grid-template-columns: 1fr;
}

.format-note {
  display: grid;
  gap: 0.25rem;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(56, 189, 248, 0.1);
  color: #cbd5e1;
  line-height: 1.45;
}

.format-note b { color: #e0f2fe; }

.tournament-board {
  gap: 1.25rem;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.78));
}

.board-kicker {
  margin-bottom: 0.45rem;
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rounds-shell {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 1.25rem;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.28);
}

.rounds-grid {
  align-items: stretch;
  padding: 0.3rem 0.2rem 0.7rem;
}

.round-card {
  flex-basis: min(20rem, 80vw);
  border-color: rgba(56, 189, 248, 0.16);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.68));
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.22);
}

.round-card__topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  color: #38bdf8;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.round-card__topline small { color: #94a3b8; }

.match-card {
  position: relative;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.45);
}

.match-card__side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.7rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.match-card__side b {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
  font-size: 0.7rem;
}

.tournament-empty {
  min-width: min(22rem, 80vw);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
}

@media (max-width: 980px) {
  .wheel-layout { grid-template-columns: 1fr; }
  .wheel-panel { position: static; }
}

.rounds-grid,
.wheel-entry-list {
  scrollbar-color: rgba(56, 189, 248, 0.5) rgba(15, 23, 42, 0.72);
  scrollbar-width: thin;
}

.rounds-grid::-webkit-scrollbar,
.wheel-entry-list::-webkit-scrollbar { height: 0.65rem; width: 0.65rem; }
.rounds-grid::-webkit-scrollbar-track,
.wheel-entry-list::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.72); border-radius: 999px; }
.rounds-grid::-webkit-scrollbar-thumb,
.wheel-entry-list::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, 0.5); border-radius: 999px; }

.fallback-tool-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fallback-tool-list li {
  display: grid;
  gap: 0.25rem;
  min-height: 4.25rem;
  border-radius: 0.85rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.74);
  color: #cbd5e1;
}

.fallback-tool-list span {
  color: #f8fafc;
  font-weight: 800;
}

.fallback-tool-list small { color: #94a3b8; }

/* Feedback pass: cleaner dice results and seamless wheel segments. */
.dice-panel .mode-pill { display: none; }

.dice-history-item {
  align-items: stretch;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

.dice-history-item div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.dice-history-item span {
  color: #f8fafc;
  font-weight: 900;
}

.dice-history-item small {
  color: #94a3b8;
  font-weight: 800;
  white-space: nowrap;
}

.dice-history-item code {
  display: block;
  overflow-wrap: anywhere;
  border-radius: 0.55rem;
  padding: 0.5rem 0.6rem;
  background: rgba(2, 6, 23, 0.5);
  color: #cbd5e1;
  font-family: inherit;
  font-weight: 800;
  line-height: 1.35;
}

.wheel {
  background: conic-gradient(var(--wheel-gradient));
}

.wheel::before {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.2), transparent 28%),
    radial-gradient(circle, transparent 0 57%, rgba(255,255,255,0.14) 58% 59%, transparent 60%);
}

.duration-control input[type="range"] {
  width: 100%;
  cursor: pointer;
}


.duration-hint {
  grid-column: 1 / -1;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 760;
}

.coin-mode-grid,
.coin-custom-grid {
  display: grid;
  gap: 0.75rem;
  max-width: 42rem;
}

.coin-mode-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.coin-mode-grid legend {
  grid-column: 1 / -1;
  margin-bottom: 0.1rem;
  color: #bae6fd;
  font-weight: 900;
}

.coin-mode-card {
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(30, 41, 59, 0.72);
  cursor: pointer;
}

.coin-mode-card input { inline-size: 1rem; block-size: 1rem; }
.coin-mode-card span { color: #f8fafc; font-weight: 900; }
.coin-mode-card small { color: #94a3b8; font-weight: 650; line-height: 1.35; }

.coin-mode-card--active {
  border-color: rgba(56, 189, 248, 0.82);
  background: rgba(56, 189, 248, 0.14);
}

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

.coin-custom-grid label {
  display: grid;
  gap: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(30, 41, 59, 0.72);
  color: #bae6fd;
  font-weight: 800;
}

.coin-custom-grid input {
  width: 100%;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.9rem;
}

.coin-custom-grid input[type="text"] {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
}

.coin--classic .coin__face b {
  display: grid;
  place-items: center;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  color: #0f172a;
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1;
}

.coin--photo .coin__face {
  border-color: rgba(250, 204, 21, 0.82);
}

.coin__face img {
  display: block;
  object-position: center center;
}

@media (max-width: 760px) {
  .coin-mode-grid,
  .coin-custom-grid { grid-template-columns: 1fr; }
}

.coin--classic,
.coin--photo {
  transform: none;
}

.coin--classic .coin__face,
.coin--photo .coin__face {
  opacity: 0;
  transform: none;
  transition: opacity 180ms ease;
}

.coin--classic:not(.coin--tails) .coin__face--heads,
.coin--photo:not(.coin--tails) .coin__face--heads,
.coin--classic.coin--tails .coin__face--tails,
.coin--photo.coin--tails .coin__face--tails {
  opacity: 1;
}

.coin--classic .coin__face--tails {
  background: linear-gradient(145deg, #fde68a, #f59e0b);
}

.coin--classic .coin__face b {
  width: 78%;
  font-size: clamp(1.55rem, 6vw, 3rem);
  text-align: center;
  letter-spacing: 0.04em;
}

.coin-custom-grid label small {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
}

.upload-status {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  background: rgba(56, 189, 248, 0.1);
  color: #e0f2fe;
  font-size: 0.8rem;
  font-weight: 800;
}

.dice-tray--rolling .die-face {
  animation: dice-roll 620ms ease-in-out infinite;
}

.dice-tray--rolling .die-face:nth-child(2n) { animation-delay: 90ms; }
.dice-tray--rolling .die-face:nth-child(3n) { animation-delay: 160ms; }

@keyframes dice-roll {
  from { transform: translateY(0) scale(1); filter: brightness(1); }
  45% { transform: translateY(-0.28rem) scale(1.035); filter: brightness(1.12); }
  to { transform: translateY(0) scale(1); filter: brightness(1); }
}

.hidden-file-input {
  position: absolute;
  inline-size: 1px !important;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-upload-card {
  position: relative;
  cursor: pointer;
}

.file-upload-button {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
  border: 1px solid rgba(125, 211, 252, 0.44);
  border-radius: 999px;
  padding: 0.48rem 0.8rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(129, 140, 248, 0.18));
  color: #f8fafc;
  font-size: 0.88rem;
  font-weight: 900;
}

.file-upload-card:hover .file-upload-button {
  border-color: rgba(125, 211, 252, 0.82);
}

.die-face--rolling-generic {
  border-radius: 1.05rem;
  background: radial-gradient(circle at 28% 22%, #ffffff 0 18%, #eff6ff 42%, #dbeafe 100%);
  color: rgba(15, 23, 42, 0.86);
  font-size: 1.45rem;
  font-weight: 950;
}

.dice-tray--rolling .die-face--rolling-generic::before,
.dice-tray--rolling .die-face--rolling-generic::after {
  content: none;
}

/* Spinning coins must show both sides while rotating; only final state hides one side. */
.coin--spinning.coin--classic,
.coin--spinning.coin--photo {
  transform-style: preserve-3d;
}

.coin--spinning.coin--classic .coin__face,
.coin--spinning.coin--photo .coin__face {
  opacity: 1;
  backface-visibility: hidden;
}

.coin--spinning.coin--classic .coin__face--heads,
.coin--spinning.coin--photo .coin__face--heads {
  transform: rotateY(0deg);
}

.coin--spinning.coin--classic .coin__face--tails,
.coin--spinning.coin--photo .coin__face--tails {
  transform: rotateY(180deg);
}

/* During the throw, show a balanced preview of both sides instead of one apparent face. */
.coin--spinning {
  animation: coin-balanced-spin 900ms ease-in-out infinite;
}

.coin--spinning.coin--classic,
.coin--spinning.coin--photo {
  transform-style: flat;
}

.coin--spinning.coin--classic .coin__face,
.coin--spinning.coin--photo .coin__face {
  opacity: 1;
  backface-visibility: visible;
  transform: none !important;
  inset: 0;
  width: 100%;
  height: 100%;
}

.coin--spinning.coin--classic .coin__face--heads,
.coin--spinning.coin--photo .coin__face--heads {
  clip-path: inset(0 50% 0 0 round 999px 0 0 999px);
}

.coin--spinning.coin--classic .coin__face--tails,
.coin--spinning.coin--photo .coin__face--tails {
  clip-path: inset(0 0 0 50% round 0 999px 999px 0);
}

.coin--spinning.coin--classic .coin__face img,
.coin--spinning.coin--photo .coin__face img {
  transform: scale(1.08);
}

@keyframes coin-balanced-spin {
  from { transform: rotateZ(0deg) scale(1); filter: brightness(1); }
  50% { transform: rotateZ(180deg) scale(1.06); filter: brightness(1.12); }
  to { transform: rotateZ(360deg) scale(1); filter: brightness(1); }
}

/* Final coin throw: keep the nicer 3D flip, but hide face content while spinning. */
.coin--spinning {
  animation: coin-flip 900ms cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-style: preserve-3d;
}

.coin--spinning.coin--classic,
.coin--spinning.coin--photo {
  transform-style: preserve-3d;
}

.coin--spinning.coin--classic .coin__face,
.coin--spinning.coin--photo .coin__face {
  opacity: 1;
  backface-visibility: hidden;
  clip-path: none;
}

.coin--spinning.coin--classic .coin__face--heads,
.coin--spinning.coin--photo .coin__face--heads {
  transform: rotateY(0deg) !important;
  background: linear-gradient(145deg, #facc15, #f97316);
}

.coin--spinning.coin--classic .coin__face--tails,
.coin--spinning.coin--photo .coin__face--tails {
  transform: rotateY(180deg) !important;
  background: linear-gradient(145deg, #fde68a, #f59e0b);
}

.coin--spinning .coin__face img,
.coin--spinning .coin__face b {
  opacity: 0;
}

.language-switch {
  display: inline-flex;
  gap: 0.25rem;
  margin-left: auto;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  padding: 0.2rem;
  background: rgba(15, 23, 42, 0.72);
}

.language-button {
  border: 0;
  border-radius: 999px;
  padding: 0.48rem 0.7rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.language-button--active {
  background: rgba(56, 189, 248, 0.2);
  color: #f8fafc;
}

.match-card__side input {
  width: 4.4rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
  font-weight: 800;
  text-align: center;
}

.match-winner {
  display: block;
  margin-top: 0.35rem;
  color: #94a3b8;
  font-size: 0.78rem;
}

.standings-card {
  margin-bottom: 1rem;
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.standings-table th,
.standings-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding: 0.45rem 0.35rem;
  text-align: left;
}

.standings-table th {
  color: #93c5fd;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.match-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 0.45rem;
}

.match-meta-grid label {
  display: grid;
  gap: 0.25rem;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 800;
}

.match-meta-grid input {
  min-width: 0;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.74);
  color: #e2e8f0;
  padding: 0.45rem 0.5rem;
}

@media print {
  body { background: #fff; color: #111827; }
  .tool-tabs,
  .tournament-form,
  .history-card,
  .secondary-button,
  .copy-source { display: none !important; }
  .tool-layout,
  .tournament-output { display: block; }
  .rounds-grid { overflow: visible; flex-wrap: wrap; }
  .round-card,
  .seed-card,
  .match-card { break-inside: avoid; background: #fff; color: #111827; border-color: #cbd5e1; }
  .match-card__side,
  .match-card__bye { background: #f8fafc; color: #111827; }
}

.format-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.format-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  background: rgba(30, 41, 59, 0.74);
  color: #cbd5e1;
  font-weight: 850;
  cursor: pointer;
}

.format-pill input { accent-color: #6366f1; }

.format-pill--active {
  border-color: rgba(99, 102, 241, 0.7);
  background: rgba(99, 102, 241, 0.22);
  color: #fff;
}

.tournament-panel {
  display: grid;
  gap: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.42);
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.toggle-row small {
  display: block;
  color: #94a3b8;
  font-weight: 650;
}

.standings-table .swiss-extra {
  color: #c4b5fd;
}

.swiss-stage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.38fr);
  gap: 1rem;
  align-items: start;
}

.swiss-stage-sidebar {
  border: 1px solid rgba(250, 204, 21, 0.24);
  border-radius: 1.2rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.22);
}

.swiss-stage-sidebar h2 { margin-top: 0.2rem; }
.swiss-stage-sidebar section + section { margin-top: 1rem; }
.swiss-stage-sidebar h3 { margin: 0 0 0.45rem; color: #facc15; }
.swiss-stage-sidebar ol { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.swiss-stage-sidebar li { display: flex; justify-content: space-between; gap: 0.6rem; border-radius: 0.7rem; padding: 0.5rem 0.6rem; background: rgba(30, 41, 59, 0.82); }
.swiss-stage-sidebar b { color: #e2e8f0; white-space: nowrap; }

@media (max-width: 860px) {
  .swiss-stage-layout { grid-template-columns: 1fr; }
}

.trust-explainer {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.2rem;
  align-items: center;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 34rem),
    rgba(15, 23, 42, 0.78);
}

.trust-steps {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(30, 41, 59, 0.72);
}

.trust-steps b {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #020617;
}

.trust-steps strong {
  color: #f8fafc;
}

.trust-grid--polished article {
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: 0 20px 45px rgba(2, 6, 23, 0.18);
}

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

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.stats-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

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

.stats-grid ol {
  margin: 0;
}

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

/* Stats layout refinement: clearer columns and local-scope label. */
.stats-card {
  padding: 1.05rem;
}

.stats-panel {
  min-width: 0;
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(2, 6, 23, 0.24);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.stats-panel h3 {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.stats-panel h3 small {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 760;
}

.stats-clear-button {
  width: 100%;
  margin-top: 0.75rem;
}

/* Remove decorative wheel center cap; labels/segments should stay unobstructed. */
.wheel::after {
  content: none;
}

.wheel::before {
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.16), transparent 30%);
}

/* Keep wheel labels upright after rotation. */
.wheel-label b {
  transform: rotate(calc(var(--label-counter-rotation) - var(--wheel-rotation, 0deg)));
}
