:root {
  color-scheme: light;
  --felt: #187448;
  --felt-dark: #0d5134;
  --ink: #17211c;
  --paper: #f6f2e8;
  --button: #f2c94c;
  --button-hover: #ffd966;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at center, var(--felt) 0%, var(--felt-dark) 72%);
  color: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

.back-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 2;
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
}

.app {
  width: min(100%, 1280px);
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 460px);
  align-items: center;
  gap: 22px;
  margin: 0 auto;
  padding: 28px 18px;
}

.table {
  min-width: 0;
  text-align: center;
}

h1 {
  margin: 0 0 28px;
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.cards {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2vw, 18px);
  margin: 0 auto 22px;
  min-height: clamp(81px, 22vw, 192px);
}

.card {
  width: clamp(56px, 9.5vw, 118px);
  aspect-ratio: 184 / 256;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.28));
}

.hand-value {
  min-height: 1.5em;
  margin: 0 0 20px;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  font-weight: 700;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

button {
  min-width: 112px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--button);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 5px 0 #a47714;
}

button:hover {
  background: var(--button-hover);
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #a47714;
}

button:focus-visible {
  outline: 3px solid var(--paper);
  outline-offset: 4px;
}

.session-panel {
  width: 100%;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(246, 242, 232, 0.26);
  border-radius: 8px;
  background: rgba(12, 52, 35, 0.72);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.session-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.hands-dealt {
  margin: 0;
  color: rgba(246, 242, 232, 0.84);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.results-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--paper);
  font-size: 0.84rem;
}

.results-table th,
.results-table td {
  padding: 9px 5px;
  border-bottom: 1px solid rgba(246, 242, 232, 0.18);
  text-align: right;
  white-space: nowrap;
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
}

.results-table th {
  color: rgba(246, 242, 232, 0.78);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-table .odds-good th,
.results-table .odds-good td {
  color: #64e08a;
}

.results-table .odds-bad th,
.results-table .odds-bad td {
  color: #ff7676;
}

.results-table .odds-neutral th,
.results-table .odds-neutral td {
  color: var(--paper);
}

.odds-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(246, 242, 232, 0.18);
  color: rgba(246, 242, 232, 0.82);
  font-size: 0.82rem;
  font-weight: 700;
}

.odds-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.odds-good-dot {
  background: #64e08a;
}

.odds-neutral-dot {
  background: var(--paper);
}

.odds-bad-dot {
  background: #ff7676;
}

@media (max-width: 1160px) {
  body {
    display: block;
  }

  .app {
    min-height: 100vh;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 32px;
  }

  .session-panel {
    max-width: 620px;
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  button {
    width: min(100%, 190px);
  }

  .session-heading {
    display: block;
  }

  .hands-dealt {
    margin-top: 6px;
  }

  .results-table {
    font-size: 0.86rem;
  }

  .results-table th,
  .results-table td {
    padding: 8px 6px;
  }
}
