:root {
  --ink: #182233;
  --navy: #dbe4ef;
  --mint: #2563eb;
  --coral: #c1121f;
  --sun: #f6c343;
  --pink: #b91c1c;
  --cream: #f7fbff;
  --card: #ffffff;
  --panel: #eef3f8;
  --line: rgba(24, 34, 51, 0.12);
  --shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
  --muted: #5f6c80;
  --surface: #f4f7fb;
  --surface-strong: #e8eef6;
  --code-bg: #f7f9fc;
  --code-line: rgba(24, 34, 51, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 55%, #fbfdff 100%);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "Bungee", "Trebuchet MS", sans-serif;
  margin: 0 0 12px;
}

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

.bg-orbit {
  position: absolute;
  top: -120px;
  right: -140px;
  width: 320px;
  height: 320px;
  background: var(--sun);
  border-radius: 40px;
  transform: rotate(18deg);
  z-index: 0;
  opacity: 0.12;
}

.bg-orbit-secondary {
  top: 60%;
  left: -140px;
  background: #1d3557;
  width: 280px;
  height: 280px;
  transform: rotate(-12deg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 8vw;
  background: rgba(8, 8, 8, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 1px;
  color: #1a1a1a;
  background: linear-gradient(135deg, #f6c343 0%, #e0a800 100%);
  box-shadow: var(--shadow);
}

.brand-title {
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: #b0b0b0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 600;
}

.site-nav a {
  padding: 8px 10px;
  border-radius: 10px;
  transition: transform 0.2s ease;
}

.site-nav a:hover {
  transform: translateY(-2px);
}

main.page {
  position: relative;
  z-index: 1;
  padding: 40px 8vw 80px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: center;
  margin-top: 40px;
  animation: popIn 0.8s ease;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sun);
  margin: 0 0 16px;
}

.hero-copy h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.05;
}

.hero-text {
  margin-top: 12px;
  font-size: 1.1rem;
  color: #c7c7c7;
  max-width: 560px;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.login-actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, #c1121f 0%, #a30f1a 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #fff;
}

.btn-secondary:hover {
  transform: translateY(-2px);
}

.hero-strip {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.hero-strip > div {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  border: 2px solid var(--navy);
  box-shadow: var(--shadow);
}

.strip-label {
  font-size: 0.8rem;
  color: #b0b0b0;
}

.strip-value {
  font-weight: 700;
  margin-top: 6px;
}

.section-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: start;
}

.comparison {
  margin-top: 70px;
  display: grid;
  gap: 24px;
}

.comparison-header p {
  color: #b0b0b0;
  margin: 0;
}

.comparison-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.comparison-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 2px solid var(--navy);
  box-shadow: var(--shadow);
  padding: 18px;
}

.comparison-card.highlight {
  background: var(--sun);
}

.comparison-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.section-intro p {
  color: #b0b0b0;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 2px solid var(--navy);
  display: grid;
  gap: 16px;
}

.panel h2 {
  margin: 0;
}

.panel-highlight {
  background: linear-gradient(135deg, rgba(246, 195, 67, 0.16) 0%, rgba(246, 195, 67, 0.08) 55%, rgba(193, 18, 31, 0.06) 100%);
  border: 2px solid rgba(246, 195, 67, 0.28);
}

.field-group {
  display: grid;
  gap: 6px;
}

label {
  font-weight: 700;
  font-size: 0.85rem;
}

input, select, textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--line);
  font-family: "Nunito", sans-serif;
  background: #141414;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(255, 77, 109, 0.3);
}

.divider {
  height: 2px;
  background: var(--line);
  margin: 4px 0;
}

.output {
  background: #0d0d0d;
  color: #f1f1f1;
  border-radius: 14px;
  padding: 14px;
  font-size: 0.85rem;
  max-height: 220px;
  overflow: auto;
}

.hint {
  font-size: 0.85rem;
  color: #c7c7c7;
}

.hint a {
  color: var(--pink);
  font-weight: 700;
}

.callout {
  background: rgba(246, 195, 67, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(246, 195, 67, 0.3);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset, 0 18px 40px rgba(0, 0, 0, 0.55);
  font-size: 0.9rem;
}

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

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 24px;
}

.side-menu {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 2px solid var(--navy);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  align-content: start;
}

.menu-title {
  font-family: "Bungee", sans-serif;
  font-size: 1.1rem;
}

.menu-button {
  border: 2px solid var(--line);
  background: #141414;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  color: #d9d9d9;
}

.menu-button.is-active {
  background: linear-gradient(135deg, #c1121f 0%, #a30f1a 100%);
  color: white;
  border-color: transparent;
}

.dashboard-content {
  display: grid;
  gap: 24px;
}

.dashboard-section {
  display: none;
}

.dashboard-section.is-active {
  display: grid;
  gap: 18px;
}

.section-text {
  color: #b0b0b0;
  margin-top: -6px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  border: 2px solid var(--navy);
  box-shadow: var(--shadow);
}

.info-card-wide {
  grid-column: 1 / -1;
}

.info-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b0b0b0;
}

.info-value {
  font-weight: 700;
  margin-top: 6px;
  font-size: 1.05rem;
}

.info-note {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #b0b0b0;
}

.access-key-row {
  display: grid;
  gap: 12px;
}

.access-key-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.access-key-error {
  color: #ff4d4f;
  font-size: 0.85rem;
  margin-top: 6px;
  min-height: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(480px, 90vw);
  background: var(--card);
  border-radius: var(--radius);
  border: 3px solid var(--navy);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 24px rgba(255, 255, 255, 0.08), var(--shadow);
  padding: 22px;
  display: grid;
  gap: 16px;
  z-index: 1;
}

.modal-card-wide {
  width: min(980px, 94vw);
}

.modal-card-tall {
  max-height: 90vh;
  overflow-y: auto;
}

.modal-subtitle {
  margin: 0;
  color: #b0b0b0;
  font-size: 0.9rem;
}

.modal-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.modal-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.tab-button {
  border: 1px solid var(--line);
  background: #141414;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}

.tab-button.is-active {
  background: #1a1a1a;
  color: #f1f1f1;
}

.tab-panel.is-hidden {
  display: none;
}

.modal-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  border: 2px solid var(--navy);
  background: var(--sun);
  border-radius: 10px;
  padding: 4px 10px;
  font-weight: 700;
  cursor: pointer;
}

.modal-body p {
  margin: 0 0 12px;
  color: #c7c7c7;
}

.modal-body {
  display: grid;
  gap: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.mono {
  font-family: "Courier New", monospace;
}

.tester-panel {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tester-panel .output {
  grid-column: 1 / -1;
}

.tester-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.security-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

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

.api-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.api-subnav-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.api-subnav-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.api-subnav-button.is-active {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.optional-endpoints {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
}

.optional-endpoints > summary {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 800;
  color: #d9d9d9;
}

.optional-endpoints > summary::-webkit-details-marker {
  display: none;
}

.optional-endpoints > summary::before {
  content: "▸";
  display: inline-block;
  transform-origin: center;
  transition: transform 0.2s ease;
  color: rgba(246, 195, 67, 0.9);
}

.optional-endpoints[open] > summary::before {
  transform: rotate(90deg);
}

.optional-endpoints .endpoint-grid {
  margin-top: 12px;
}

.field-guide {
  font-size: 0.82rem;
  color: #c7c7c7;
}

.field-example {
  font-size: 0.8rem;
  color: #b0b0b0;
  font-family: "Courier New", monospace;
}

.field-doc {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.12);
  background: #141414;
  display: grid;
  gap: 10px;
}

.field-doc .doc-title {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.field-doc pre {
  margin: 0;
  font-size: 0.8rem;
  background: #0d0d0d;
  color: #f1f1f1;
  padding: 10px;
  border-radius: 10px;
  overflow-x: auto;
}

.endpoint-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.endpoint-status {
  font-weight: 700;
  color: #c7c7c7;
}

.signing-secret-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid var(--navy);
  box-shadow: var(--shadow);
  background: var(--card);
  margin-bottom: 16px;
}

.secret-value {
  font-family: "Courier New", monospace;
  font-weight: 700;
  margin-top: 6px;
}

.signing-doc {
  margin-bottom: 18px;
}

.games-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(260px, 1fr) minmax(320px, 1.3fr);
  gap: 20px;
  align-items: start;
}

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

.panel-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #b0b0b0;
}

.launch-guide-panel {
  gap: 12px;
}

.launch-steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #c7c7c7;
  font-weight: 600;
}

.game-card-list,
.table-list {
  display: grid;
  gap: 12px;
}

#poker-table-list {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 6px;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.history-list-pane,
.history-detail-pane {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 6px;
}

.history-breadcrumb {
  font-size: 0.85rem;
  color: #b0b0b0;
  margin-bottom: 10px;
}

.history-hands-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.history-hands-header p {
  margin: 0;
  font-size: 0.85rem;
  color: #b0b0b0;
}

.history-hands-list {
  display: grid;
  gap: 8px;
}

.history-hand-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #141414;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
  color: #e6e6e6;
}

.history-hand-card button {
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.history-card {
  border: 2px solid var(--navy);
  border-radius: 14px;
  padding: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.history-card h4 {
  margin: 0;
  font-size: 0.95rem;
}

.history-card pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.history-intro h3 {
  margin: 0;
}

.history-detail {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}

.history-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.history-detail-title {
  font-weight: 700;
}

.history-detail-grid {
  display: grid;
  gap: 12px;
}

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

.history-events {
  display: grid;
  gap: 8px;
}

.history-event {
  border-radius: 10px;
  padding: 8px 10px;
  background: #141414;
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.history-timeline {
  display: grid;
  gap: 8px;
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 4px;
}

.history-timeline-item {
  border-radius: 12px;
  padding: 10px 12px;
  background: #141414;
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}

.history-timeline-item .history-timeline-title {
  font-weight: 700;
}

.history-table {
  display: grid;
  gap: 6px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
}

.game-card {
  border: 2px solid var(--navy);
  border-radius: 14px;
  padding: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.game-image {
  width: 100%;
  height: 110px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.game-card:hover {
  transform: translateY(-2px);
}

.game-card.is-active {
  background: var(--sun);
}

.game-title {
  font-weight: 700;
}

.game-meta {
  font-size: 0.8rem;
  color: #b0b0b0;
}

/* Poker history dedicated pages */
.history-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.history-panel .panel-title {
  margin: 0;
}

.panel-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 420px) minmax(160px, 220px) 1fr;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.history-status {
  font-size: 0.9rem;
  color: #d1d5db;
  padding-bottom: 8px;
  text-align: right;
}

.breadcrumb {
  color: #b0b0b0;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.table-wrap {
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: auto;
  background: rgba(12, 12, 12, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.55);
  cursor: grab;
}

.table-wrap.compact {
  margin-top: 10px;
}

.table-wrap.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.history-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.history-page-label {
  font-size: 0.9rem;
  color: #b0b0b0;
}

.history-pager-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.audit-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
  color: #e5e7eb;
  font-size: 0.92rem;
}

.audit-table.compact {
  min-width: 520px;
  font-size: 0.88rem;
}

.audit-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  background: rgba(20, 20, 20, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #f3f4f6;
}

.audit-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.audit-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.status-stack {
  display: grid;
  gap: 4px;
  align-items: start;
}

.status-note {
  font-size: 0.78rem;
  color: #b0b0b0;
  line-height: 1.2;
}

.cell-stack {
  display: grid;
  gap: 4px;
}

.cell-sub {
  font-size: 0.78rem;
  color: #b0b0b0;
  line-height: 1.2;
}

.winner-entry {
  display: grid;
  gap: 3px;
}

.winner-entry + .winner-entry {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.audit-table .num {
  text-align: right;
  white-space: nowrap;
}

.audit-table .actions {
  text-align: right;
  white-space: nowrap;
}

.audit-table th.actions,
.audit-table td.actions {
  position: sticky;
  right: 0;
  min-width: 148px;
  background: #ffffff;
  box-shadow: -10px 0 16px rgba(15, 23, 42, 0.08);
}

.audit-table thead th.actions {
  z-index: 3;
  background: var(--surface);
}

.audit-table tbody td.actions {
  z-index: 1;
}

.btn.btn-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 999px;
}

.panel-meta {
  font-size: 0.9rem;
  color: #b0b0b0;
  margin-top: 6px;
}

.hand-audit-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.hand-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 14px;
  background: rgba(12, 12, 12, 0.65);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.55);
}

.hand-card h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.kv-grid {
  display: grid;
  gap: 8px;
}

.kv-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  align-items: baseline;
}

.kv-k {
  color: #b0b0b0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kv-v {
  font-weight: 700;
  color: #f3f4f6;
  word-break: break-word;
}

.hand-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 12px;
  background: rgba(20, 20, 20, 0.7);
  margin-bottom: 12px;
}

.hand-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.hand-section-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.board-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #b0b0b0;
  font-size: 0.9rem;
}

.hand-lines {
  display: grid;
  gap: 8px;
}

.hand-line {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.9rem;
}

.hand-line .time {
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.hand-line .msg {
  color: #e5e7eb;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f3f4f6;
  font-size: 0.8rem;
  margin-left: 6px;
}

.card-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #f9fafb;
  font-weight: 800;
  font-size: 0.85rem;
  margin-left: 6px;
}

.hand-raw {
  margin-top: 14px;
  color: #d1d5db;
}

.hand-raw pre {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 40vh;
  overflow: auto;
}

.muted {
  color: #9ca3af;
}

.callout.callout-warning {
  background: rgba(193, 18, 31, 0.16);
  border: 1px solid rgba(193, 18, 31, 0.45);
  color: #f3f4f6;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.55);
}

.callout.callout-warning ul {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

@media (max-width: 920px) {
  .history-toolbar {
    grid-template-columns: 1fr;
  }
  .history-status {
    text-align: left;
  }
  .hand-audit-grid {
    grid-template-columns: 1fr;
  }
  .hand-line {
    grid-template-columns: 1fr;
  }
}

.table-card {
  border: 2px solid var(--navy);
  border-radius: 14px;
  padding: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.table-card-title {
  font-weight: 700;
}

.table-card-meta {
  font-size: 0.8rem;
  color: #b0b0b0;
}

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

.match-size-panel {
  margin: 4px 0 12px;
  padding: 12px;
  border-radius: 16px;
  background: #141414;
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.vip-room-panel {
  background: var(--card);
  box-shadow: var(--shadow);
}

.match-size-list {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

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

.match-size-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.match-size-title {
  font-weight: 700;
}

.match-size-meta {
  font-size: 0.8rem;
  color: #b0b0b0;
}

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

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #1c1c1c;
  color: #d0d0d0;
}

.status-pill.is-active {
  background: rgba(34, 197, 94, 0.2);
  color: #7ee787;
}

.status-pill.is-pending {
  background: rgba(246, 195, 67, 0.22);
  color: #f6c343;
}

.status-pill.is-final {
  background: rgba(37, 99, 235, 0.22);
  color: #93c5fd;
}

.status-pill.is-closed {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
}

.status-pill.is-inactive {
  background: rgba(220, 38, 38, 0.2);
  color: #ff6b6b;
}

.empty-state {
  font-size: 0.85rem;
  color: #b0b0b0;
  padding: 8px 0;
}

.table-detail-panel {
  min-height: 520px;
}

.game-setup-card {
  border-radius: 16px;
  border: 2px solid var(--navy);
  padding: 16px;
  background: #141414;
  display: grid;
  gap: 12px;
}

.game-setup-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.game-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.game-setup-status {
  min-height: 18px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #c7c7c7;
}

.poker-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.field-toggle {
  align-content: start;
}

.field-toggle input {
  width: 18px;
  height: 18px;
  justify-self: start;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-light {
  background: #141414;
  border: 2px solid rgba(255, 255, 255, 0.12);
  color: #f1f1f1;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-light:hover {
  transform: translateY(-2px);
}

.site-footer {
  padding: 40px 8vw 60px;
  display: flex;
  justify-content: space-between;
  color: #b0b0b0;
  font-size: 0.9rem;
}

/* Light theme overrides */

.bg-orbit {
  opacity: 0.18;
}

.bg-orbit-secondary {
  background: #cfe0ff;
}

.site-header {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.brand-subtitle,
.strip-label,
.comparison-header p,
.section-intro p,
.hint,
.section-text,
.info-label,
.info-note,
.modal-subtitle,
.modal-body p,
.panel-subtitle,
.history-breadcrumb,
.history-hands-header p,
.breadcrumb,
.history-page-label,
.status-note,
.cell-sub,
.kv-k,
.hand-line .time,
.muted,
.table-card-meta,
.match-size-meta,
.empty-state,
.panel-meta,
.game-meta,
.field-example {
  color: var(--muted);
}

.eyebrow {
  color: var(--coral);
}

.hero-text,
.field-guide,
.launch-steps,
.endpoint-status,
.game-setup-status {
  color: #334155;
}

.hero-strip > div,
.comparison-card,
.panel,
.side-menu,
.info-card,
.history-card,
.game-card,
.table-card,
.match-size-card,
.signing-secret-card {
  border-color: var(--navy);
}

.comparison-card.highlight,
.game-card.is-active {
  background: linear-gradient(135deg, #fff6dc 0%, #ffeab7 100%);
  border-color: rgba(246, 195, 67, 0.55);
  color: var(--ink);
}

.panel-highlight {
  background: linear-gradient(135deg, rgba(246, 195, 67, 0.18) 0%, rgba(246, 195, 67, 0.1) 55%, rgba(193, 18, 31, 0.04) 100%);
  border-color: rgba(246, 195, 67, 0.36);
}

input,
select,
textarea,
.menu-button,
.tab-button,
.history-hand-card,
.history-event,
.history-timeline-item,
.match-size-panel,
.game-setup-card,
.btn-light {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
}

.output,
.field-doc,
.field-doc pre,
.hand-raw pre {
  background: var(--code-bg);
  color: var(--ink);
  border-color: var(--code-line);
}

.callout {
  background: #fff7dd;
  border-color: rgba(246, 195, 67, 0.42);
  box-shadow: 0 10px 22px rgba(246, 195, 67, 0.14);
  color: #5b4300;
}

.callout.callout-warning {
  background: #fff1f1;
  border-color: rgba(193, 18, 31, 0.25);
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(193, 18, 31, 0.1);
}

.access-key-error {
  color: #b91c1c;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.22);
}

.modal-card {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72), 0 20px 44px rgba(15, 23, 42, 0.16);
}

.tab-button.is-active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22);
}

.optional-endpoints {
  border-color: var(--line);
  background: var(--surface);
}

.optional-endpoints > summary {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.optional-endpoints > summary::before {
  content: ">";
  color: var(--coral);
}

.field-doc {
  border-color: rgba(24, 34, 51, 0.12);
}

.game-image {
  border-color: rgba(24, 34, 51, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.history-status {
  color: var(--muted);
}

.table-wrap,
.hand-card,
.hand-section {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

.audit-table {
  color: var(--ink);
}

.audit-table thead th {
  background: var(--surface);
  border-bottom-color: var(--line);
  color: #334155;
}

.audit-table tbody td,
.winner-entry + .winner-entry {
  border-bottom-color: var(--line);
  border-top-color: var(--line);
}

.audit-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.05);
}

.audit-table tbody tr:hover td.actions {
  background: #edf4ff;
}

.kv-v,
.hand-line .msg,
.pill,
.card-chip {
  color: var(--ink);
}

.pill,
.card-chip {
  background: var(--surface);
  border-color: var(--line);
}

.card-chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  vertical-align: middle;
}

.card-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 44px;
  padding: 4px 2px 3px;
  margin-left: 0;
  border-radius: 9px;
  border: 1px solid rgba(24, 34, 51, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
  font-weight: 900;
  line-height: 1;
}

.card-chip-rank {
  font-size: 0.82rem;
  letter-spacing: -0.02em;
}

.card-chip-suit {
  margin-top: 3px;
  font-size: 1rem;
}

.card-chip.is-red {
  color: #c1121f;
}

.card-chip.is-black {
  color: #1f2937;
}

.card-chip.is-raw {
  width: auto;
  min-width: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
  color: var(--ink);
}

.hand-raw {
  color: #334155;
}

.status-pill {
  background: var(--surface-strong);
  color: #475569;
}

.status-pill.is-active {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.status-pill.is-pending {
  background: rgba(246, 195, 67, 0.2);
  color: #b45309;
}

.status-pill.is-final {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}

.status-pill.is-closed {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.status-pill.is-inactive {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}

.btn-light {
  background: #ffffff;
  color: var(--ink);
}

.site-footer {
  color: var(--muted);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    gap: 16px;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-actions {
    flex-direction: column;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .games-layout {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    gap: 12px;
  }
}
