:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #070907;
  color: #f4f7f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(24, 98, 63, 0.3), transparent 36rem),
    #070907;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid #355f46;
  border-radius: 8px;
  background: #123522;
  color: #f4f7f2;
  padding: 0.65rem 0.85rem;
  font-weight: 700;
}

button:disabled {
  opacity: 0.45;
}

input {
  min-height: 44px;
  border: 1px solid #355f46;
  border-radius: 8px;
  background: #0c150f;
  color: #f4f7f2;
  padding: 0.65rem;
  width: 100%;
}

.app {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 1rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#currentUser {
  color: #aec8b6;
  font-size: 0.85rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1rem;
}

#status {
  color: #aec8b6;
  margin-top: 0.2rem;
}

.controls,
.action-panel,
.history,
.study-view,
.login-view {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.login-view {
  min-height: 70vh;
  align-content: center;
}

#loginError {
  min-height: 1.2rem;
  color: #ffb0a3;
}

.hidden {
  display: none !important;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

.tab {
  background: #0c150f;
  border-color: #23442f;
}

.tab.active {
  background: #1f5b37;
  border-color: #f1c45c;
}

.controls {
  grid-template-columns: 1fr 1fr;
}

.controls input {
  grid-column: 1 / -1;
}

.table-surface {
  margin-top: 1rem;
  min-height: 360px;
  border: 1px solid #23442f;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(14, 63, 38, 0.96), rgba(9, 35, 25, 0.98)),
    #102f20;
  padding: 1rem;
}

.street {
  display: flex;
  justify-content: space-between;
  color: #d9eadb;
  text-transform: uppercase;
  letter-spacing: 0;
}

.cards {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  min-height: 74px;
  margin: 1.2rem 0;
}

.card {
  display: grid;
  place-items: center;
  width: 46px;
  height: 64px;
  border-radius: 7px;
  background: #f4f2e8;
  color: #111411;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
}

.card.hidden {
  background: repeating-linear-gradient(45deg, #183c2a, #183c2a 5px, #215235 5px, #215235 10px);
  color: transparent;
  border: 1px solid #4b8060;
}

.seats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.seat {
  border: 1px solid rgba(209, 231, 214, 0.2);
  border-radius: 8px;
  padding: 0.7rem;
  background: rgba(4, 15, 10, 0.55);
}

.seat.active {
  border-color: #f1c45c;
}

.seat header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.badges {
  color: #f1c45c;
  font-size: 0.8rem;
}

.hole {
  justify-content: flex-start;
  min-height: 48px;
  margin-top: 0.55rem;
}

.hole .card {
  width: 34px;
  height: 46px;
  font-size: 0.85rem;
}

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

#activePlayer {
  min-height: 1.4rem;
  color: #d9eadb;
}

#error {
  min-height: 1.2rem;
  color: #ffb0a3;
}

.error-text {
  min-height: 1.2rem;
  color: #ffb0a3;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.section-head p {
  color: #aec8b6;
  margin-top: 0.2rem;
}

.strategy-list,
.node-list,
.action-list,
.range-list,
.filters,
.summary-grid {
  display: grid;
  gap: 0.65rem;
}

.filters {
  grid-template-columns: 1fr;
}

.strategy-card,
.node-card,
.range-list-item {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  background: rgba(4, 15, 10, 0.72);
  border-color: rgba(209, 231, 214, 0.18);
}

.strategy-card.selected,
.node-card:focus-visible {
  border-color: #f1c45c;
  outline: 2px solid rgba(241, 196, 92, 0.25);
}

.strategy-card span,
.node-card span,
.range-list-item span,
.strategy-card small,
.node-card small,
.action-card small {
  color: #aec8b6;
  overflow-wrap: anywhere;
}

.study-panel {
  display: grid;
  gap: 0.75rem;
  border: 1px solid rgba(209, 231, 214, 0.18);
  border-radius: 8px;
  padding: 0.85rem;
  background: rgba(4, 15, 10, 0.55);
}

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

.summary-grid div,
.action-card,
.empty-state {
  border: 1px solid rgba(209, 231, 214, 0.14);
  border-radius: 8px;
  background: rgba(12, 21, 15, 0.78);
  padding: 0.7rem;
}

.inline-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.hint {
  color: #f1c45c;
  min-height: 1.2rem;
  overflow-wrap: anywhere;
}

.range-grid-wrap {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.range-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(54px, 1fr));
  gap: 0.28rem;
  min-width: 760px;
}

.range-cell {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: 54px;
  padding: 0.42rem;
  text-align: left;
  border-color: rgba(209, 231, 214, 0.16);
  background: #0c150f;
  overflow-wrap: anywhere;
}

.range-cell strong {
  font-size: 0.85rem;
}

.range-cell span,
.range-cell em {
  color: #aec8b6;
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.range-cell.estimated {
  border-style: dashed;
}

.range-cell.selected,
.range-list-item.selected {
  border-color: #f1c45c;
  outline: 2px solid rgba(241, 196, 92, 0.25);
}

.range-list-item {
  grid-template-columns: minmax(3.5rem, auto) 1fr;
  align-items: center;
}

.range-cell.action-raise,
.range-cell.action-bet,
.range-cell.action-all_in {
  background: #173a2a;
}

.range-cell.action-call,
.range-cell.action-check {
  background: #12302c;
}

.range-cell.action-fold {
  background: #241f1b;
}

.summary-grid span {
  display: block;
  color: #aec8b6;
  font-size: 0.82rem;
}

.summary-grid strong {
  display: block;
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}

.action-card {
  display: grid;
  gap: 0.45rem;
}

.frequency {
  color: #f1c45c;
  font-weight: 800;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #102016;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: #f1c45c;
}

details {
  border-top: 1px solid rgba(209, 231, 214, 0.14);
  padding-top: 0.6rem;
}

summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: #d9eadb;
  font-weight: 700;
}

pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #cfe1d3;
  background: #070907;
  border-radius: 8px;
  padding: 0.75rem;
}

.history ol {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding-left: 1.4rem;
  color: #cfe1d3;
}

@media (min-width: 640px) {
  .controls,
  .actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .controls input {
    grid-column: auto;
  }

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

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

  .summary-grid,
  .action-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
