@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Oxanium:wght@400;600;700&display=swap");

:root {
  --felt-dark: #06261b;
  --felt-mid: #0b3b2a;
  --felt-bright: #115038;
  --gold: #d9b15d;
  --gold-soft: #f2e2b7;
  --cream: #f7f2d8;
  --ink: #101d17;
  --player: #2a6dd9;
  --banker: #cf3b3b;
  --tie: #2f9b63;
  --panel-bg: rgba(6, 20, 15, 0.8);
  --panel-border: rgba(217, 177, 93, 0.35);
  --cell-size: 36px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Oxanium", "Trebuchet MS", sans-serif;
  color: var(--cream);
  background: #0d1410;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  position: relative;
}

.site-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.user-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 30, 22, 0.6);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.6;
}

.user-name {
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.title-block {
  font-family: "Cinzel", "Garamond", serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.brand {
  font-size: clamp(28px, 7vw, 42px);
  font-weight: 700;
  color: var(--gold);
  margin: 0;
  line-height: 1.1;
}

.subtitle {
  font-size: 14px;
  color: var(--gold-soft);
  letter-spacing: 0.35em;
  margin: 0;
  line-height: 1.5;
}

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

.stat-pill {
  background: rgba(8, 30, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.stat-pill.player {
  border-color: rgba(42, 109, 217, 0.5);
}

.stat-pill.banker {
  border-color: rgba(207, 59, 59, 0.5);
}

.stat-pill.tie {
  border-color: rgba(47, 155, 99, 0.5);
}

.stat-label {
  opacity: 0.7;
}

.stat-value {
  font-weight: 700;
  font-size: 18px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "control"
    "road";
  gap: 18px;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
  animation: rise 700ms ease both;
  animation-delay: var(--delay, 0ms);
}

.control-panel {
  grid-area: control;
}

.road-panel {
  grid-area: road;
}

.ad-slot {
  border-radius: 16px;
  border: 1px dashed rgba(217, 177, 93, 0.5);
  padding: 12px;
  background: rgba(8, 30, 22, 0.5);
  display: grid;
  gap: 8px;
  text-align: center;
  width: 100%;
}

.ad-banner {
  margin: 12px 0 22px;
}

.ad-rectangle {
  margin-top: 18px;
}

.ad-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: 0.7;
}

.ad-frame {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ad-rectangle .ad-frame {
  min-height: 250px;
}

.ad-frame .adsbygoogle {
  display: block;
  width: 100%;
}

.ad-placeholder {
  font-size: 12px;
  opacity: 0.6;
}

.intro-panel {
  display: grid;
  gap: 12px;
}

.intro-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.85;
}

.intro-highlights {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.85;
  display: grid;
  gap: 6px;
}

.intro-link {
  justify-self: start;
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 120ms ease, color 120ms ease;
}

.intro-link:hover,
.intro-link:focus {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.content-panel {
  display: grid;
  gap: 16px;
}

.content-grid {
  display: grid;
  gap: 14px;
}

.content-block {
  background: rgba(8, 30, 22, 0.6);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
}

.content-title {
  margin: 0 0 8px;
  font-family: "Cinzel", "Garamond", serif;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.content-block p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.85;
}

.content-block p:last-child {
  margin-bottom: 0;
}

.content-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.85;
}

.content-list li {
  margin-bottom: 6px;
}

.content-list li:last-child {
  margin-bottom: 0;
}

.content-callout {
  border-left: 3px solid var(--gold);
  background: rgba(8, 30, 22, 0.7);
  border-radius: 14px;
  padding: 12px 14px;
}

.callout-title {
  display: block;
  margin-bottom: 6px;
  font-family: "Cinzel", "Garamond", serif;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}

.content-callout p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.85;
}

.panel-header {
  font-family: "Cinzel", "Garamond", serif;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--gold-soft);
  margin: 0 0 12px;
}

.panel-header.subtle {
  margin-top: 18px;
  opacity: 0.7;
}

.session-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 10px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
}

.field-input {
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 16, 12, 0.75);
  color: var(--cream);
  font-family: inherit;
  letter-spacing: 0.08em;
}

.field-input:focus {
  outline: none;
  border-color: rgba(217, 177, 93, 0.7);
  box-shadow: 0 0 0 2px rgba(217, 177, 93, 0.2);
}

.session-meta {
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 14px;
}

.entry-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chip {
  border: none;
  border-radius: 16px;
  padding: 14px 10px;
  font-family: "Cinzel", "Garamond", serif;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.chip.player {
  background: linear-gradient(145deg, #1c3e79, #2a6dd9);
  box-shadow: 0 10px 20px rgba(42, 109, 217, 0.35);
}

.chip.banker {
  background: linear-gradient(145deg, #7c1c1c, #cf3b3b);
  box-shadow: 0 10px 20px rgba(207, 59, 59, 0.35);
}

.chip.tie {
  background: linear-gradient(145deg, #14573a, #2f9b63);
  box-shadow: 0 10px 20px rgba(47, 155, 99, 0.35);
}

.chip:active {
  transform: translateY(2px) scale(0.98);
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.action-row.single {
  grid-template-columns: minmax(0, 1fr);
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--cream);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border 120ms ease, color 120ms ease;
}

.ghost-btn.danger {
  border-color: rgba(207, 59, 59, 0.6);
  color: #f3c5c5;
}

.ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.status-card {
  background: rgba(8, 30, 22, 0.6);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}

.status-value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-value.player {
  color: #9bc0ff;
}

.status-value.banker {
  color: #ffb0b0;
}

.status-value.tie {
  color: #a6e8c9;
}

.road-legend {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 12px;
}

.road-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

.road-scroll::-webkit-scrollbar {
  height: 8px;
}

.road-scroll::-webkit-scrollbar-track {
  background: rgba(10, 24, 18, 0.4);
  border-radius: 999px;
}

.road-scroll::-webkit-scrollbar-thumb {
  background: rgba(217, 177, 93, 0.7);
  border-radius: 999px;
}

.big-road-grid {
  --cols: 12;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell-size));
  grid-template-rows: repeat(6, var(--cell-size));
  gap: 6px;
  min-width: calc(var(--cols) * (var(--cell-size) + 6px));
}

.road-cell {
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  position: relative;
}

.road-cell.player {
  background: rgba(42, 109, 217, 0.9);
  color: #edf4ff;
}

.road-cell.banker {
  background: rgba(207, 59, 59, 0.9);
  color: #fff1f1;
}

.tie-mark {
  position: absolute;
  right: -4px;
  bottom: -4px;
  background: #f5e4b8;
  color: #3a2a0b;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 8, 0.7);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  width: min(520px, 90vw);
  max-height: 80vh;
  overflow: auto;
  background: rgba(10, 30, 22, 0.95);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

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

.modal-title {
  font-family: "Cinzel", "Garamond", serif;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--gold-soft);
  font-size: 14px;
}

.modal-body {
  font-size: 14px;
  line-height: 1.5;
}

.modal-body ul {
  padding-left: 18px;
  margin: 10px 0;
}

.modal-body li {
  margin-bottom: 6px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.form-note {
  font-size: 12px;
  opacity: 0.7;
  margin: 0;
}

.form-error {
  color: #ffb0b0;
  font-size: 12px;
  margin: 0;
  min-height: 16px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .header-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .entry-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .session-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

@media (max-width: 600px) {
  .app {
    padding: 16px 12px 32px;
  }

  .title-block {
    letter-spacing: 0.16em;
  }

  .subtitle {
    font-size: 12px;
    letter-spacing: 0.25em;
  }

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

  .stat-pill {
    padding: 8px 10px;
    font-size: 12px;
  }

  .stat-value {
    font-size: 16px;
  }

  .panel {
    padding: 14px;
    border-radius: 16px;
  }

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

  .chip {
    padding: 12px 8px;
    font-size: 12px;
    letter-spacing: 0.14em;
  }

  .action-row {
    gap: 8px;
  }

  .ghost-btn {
    padding: 9px 10px;
    font-size: 12px;
  }

  .status-row {
    gap: 10px;
  }

  .status-value {
    font-size: 16px;
  }

  :root {
    --cell-size: 30px;
  }
}

@media (max-width: 420px) {
  .entry-buttons,
  .action-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .chip {
    width: 100%;
  }

  :root {
    --cell-size: 26px;
  }
}

@media (min-width: 960px) {
  :root {
    --cell-size: 42px;
  }

  .layout {
    grid-template-columns: 2fr 1fr;
    grid-template-areas: "road control";
    align-items: start;
  }

  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 1100px) {
  .content-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
