/**
 * styles.css — OBOS Poker odds calculator.
 *
 * Mobile-first, no framework, no build step. Everything is driven by the custom
 * properties in :root so a designer can re-skin the tool by overriding tokens
 * instead of rewriting rules.
 */

:root {
  --poc-felt: #0d3b2e;
  --poc-felt-deep: #072019;
  --poc-gold: #d8b45a;
  --poc-gold-strong: #b8922f;
  --poc-ivory: #f7f4ec;
  --poc-paper: #ffffff;
  --poc-ink: #16201c;
  --poc-ink-soft: #4a5a53;
  --poc-line: #d9d4c6;
  --poc-red: #b3252b;
  --poc-win: #1f9d55;
  --poc-tie: #c98a17;
  --poc-lose: #8a1f25;
  --poc-radius: 12px;
  --poc-radius-sm: 8px;
  --poc-shadow: 0 2px 10px rgba(7, 32, 25, 0.12);
  --poc-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --poc-font-display: Georgia, "Times New Roman", serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--poc-ivory);
  color: var(--poc-ink);
  font-family: var(--poc-font);
  font-size: 17px;
  line-height: 1.65;
}

.poc-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- header / footer ---------- */

.poc-topbar {
  background: var(--poc-felt-deep);
  color: var(--poc-ivory);
  padding: 12px 0;
}

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

.poc-brand {
  color: var(--poc-ivory);
  font-family: var(--poc-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.poc-brand span {
  color: var(--poc-gold);
}

.poc-topbar__link {
  color: var(--poc-ivory);
  font-size: 0.9rem;
  text-decoration: underline;
}

.poc-hero {
  background: var(--poc-felt);
  color: var(--poc-ivory);
  padding: 24px 0 28px;
}

.poc-hero h1 {
  font-family: var(--poc-font-display);
  font-size: 1.7rem;
  line-height: 1.25;
  margin: 0 0 8px;
}

.poc-hero p {
  margin: 0;
  color: #e4ddc9;
}

.poc-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border: 1px solid var(--poc-gold);
  border-radius: 999px;
  color: var(--poc-gold);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.poc-footer {
  margin-top: 48px;
  padding: 24px 0 40px;
  background: var(--poc-felt-deep);
  color: #cfd9d4;
  font-size: 0.9rem;
}

.poc-footer a {
  color: var(--poc-gold);
}

/* ---------- tool panel ---------- */

.poc-tool {
  margin: -18px 0 8px;
  padding: 18px 16px 20px;
  background: var(--poc-paper);
  border: 1px solid var(--poc-line);
  border-radius: var(--poc-radius);
  box-shadow: var(--poc-shadow);
}

.poc-field + .poc-field {
  margin-top: 18px;
}

.poc-field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--poc-ink-soft);
}

.poc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* card slots — the primary control, so they stay large and obviously tappable */
.poc-slot {
  width: 58px;
  height: 80px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--poc-paper);
  border: 2px dashed #9aa8a1;
  border-radius: var(--poc-radius-sm);
  color: var(--poc-ink);
  font-family: var(--poc-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.poc-slot::after {
  content: "+";
  color: #7c8d85;
  font-size: 1.4rem;
  font-weight: 400;
}

.poc-slot.is-filled {
  border-style: solid;
  border-color: var(--poc-ink);
  box-shadow: var(--poc-shadow);
}

.poc-slot.is-filled::after {
  content: none;
}

.poc-slot.is-red {
  color: var(--poc-red);
}

.poc-slot.is-active {
  border-color: var(--poc-gold-strong);
  box-shadow: 0 0 0 3px rgba(184, 146, 47, 0.35);
}

.poc-slot:focus-visible {
  outline: 3px solid var(--poc-felt);
  outline-offset: 2px;
}

.poc-slot--board {
  width: 52px;
  height: 72px;
  font-size: 1.3rem;
}

/* opponent count — segmented control */
.poc-seg {
  display: inline-flex;
  border: 2px solid var(--poc-felt);
  border-radius: var(--poc-radius-sm);
  overflow: hidden;
}

.poc-seg button {
  min-width: 56px;
  min-height: 48px;
  padding: 0 14px;
  background: var(--poc-paper);
  border: 0;
  border-right: 1px solid var(--poc-felt);
  color: var(--poc-felt);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.poc-seg button:last-child {
  border-right: 0;
}

.poc-seg button.is-on {
  background: var(--poc-felt);
  color: #ffffff;
}

.poc-seg button:focus-visible {
  outline: 3px solid var(--poc-gold-strong);
  outline-offset: -3px;
}

.poc-btn {
  min-height: 48px;
  padding: 0 18px;
  background: var(--poc-gold);
  border: 2px solid var(--poc-gold-strong);
  border-radius: var(--poc-radius-sm);
  color: #2a2003;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Hover must not drop below WCAG AA. White on gold measures 2.92:1, so the
   hover state goes dark-on-felt (12.5:1) instead of light-on-gold. */
.poc-btn:hover {
  background: var(--poc-felt);
  border-color: var(--poc-felt-deep);
  color: #ffffff;
}

.poc-btn--quiet {
  background: var(--poc-paper);
  border-color: var(--poc-felt);
  color: var(--poc-felt);
}

.poc-btn--quiet:hover {
  background: var(--poc-felt);
  color: #ffffff;
}

.poc-btn:focus-visible {
  outline: 3px solid var(--poc-felt);
  outline-offset: 2px;
}

/* ---------- card picker ---------- */

.poc-picker {
  margin-top: 18px;
  padding: 14px 12px;
  background: #f2efe6;
  border: 1px solid var(--poc-line);
  border-radius: var(--poc-radius-sm);
}

.poc-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.poc-picker__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.poc-picker__remove {
  min-height: 40px;
  padding: 0 12px;
  background: var(--poc-paper);
  border: 2px solid var(--poc-red);
  border-radius: var(--poc-radius-sm);
  color: var(--poc-red);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.poc-picker__suit {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.poc-picker__suit + .poc-picker__suit {
  margin-top: 8px;
}

.poc-picker__suit-label {
  width: 20px;
  padding-top: 8px;
  font-size: 1.15rem;
  color: var(--poc-ink-soft);
}

.poc-picker__suit--h .poc-picker__suit-label,
.poc-picker__suit--d .poc-picker__suit-label {
  color: var(--poc-red);
}

.poc-picker__grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}

.poc-picker__card {
  min-height: 46px;
  padding: 0 2px;
  background: var(--poc-paper);
  border: 1px solid #b9c2bd;
  border-radius: 6px;
  color: var(--poc-ink);
  font-family: var(--poc-font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.poc-picker__card.is-red {
  color: var(--poc-red);
}

.poc-picker__card:hover:not(:disabled) {
  border-color: var(--poc-felt);
  box-shadow: inset 0 0 0 1px var(--poc-felt);
}

.poc-picker__card.is-chosen {
  border-color: var(--poc-gold-strong);
  box-shadow: inset 0 0 0 2px var(--poc-gold-strong);
}

.poc-picker__card.is-taken {
  opacity: 0.35;
  cursor: not-allowed;
}

.poc-picker__card:focus-visible {
  outline: 3px solid var(--poc-felt);
  outline-offset: 1px;
}

/* ---------- results ---------- */

.poc-message {
  margin-top: 16px;
  padding: 10px 12px;
  background: #fdf6e0;
  border-left: 4px solid var(--poc-gold-strong);
  border-radius: 4px;
  color: #4a3c10;
  font-size: 0.95rem;
}

.poc-results {
  margin-top: 18px;
  padding: 16px;
  background: var(--poc-felt-deep);
  border-radius: var(--poc-radius);
  color: var(--poc-ivory);
}

.poc-results__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.poc-stat__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b9c9c2;
}

.poc-stat__value {
  display: block;
  font-family: var(--poc-font-display);
  font-size: 2.1rem;
  line-height: 1.15;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.poc-stat--win .poc-stat__value {
  color: #7ee3a6;
}

.poc-stat--tie .poc-stat__value {
  color: var(--poc-gold);
}

.poc-stat--lose .poc-stat__value {
  color: #f0a3a7;
}

/* --poc-win/tie/lose are colours; the *lengths* are separate `-pct` variables.
   Sharing one name for both made the gradient parse as garbage and the bar
   rendered blank. */
.poc-bar {
  --poc-win-pct: 0%;
  --poc-tie-pct: 0%;
  height: 12px;
  margin: 14px 0 10px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(
    to right,
    var(--poc-win) 0 var(--poc-win-pct),
    var(--poc-tie) var(--poc-win-pct) calc(var(--poc-win-pct) + var(--poc-tie-pct)),
    var(--poc-lose) calc(var(--poc-win-pct) + var(--poc-tie-pct)) 100%
  );
}

.poc-results__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: #b9c9c2;
}

.poc-results__equity strong {
  color: var(--poc-ivory);
  font-size: 1.05rem;
}

.poc-results.is-running .poc-stat__value {
  opacity: 0.75;
}

/* Lives inside the dark results panel, so it must be light-on-dark. */
.poc-made-hand {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(247, 244, 236, 0.18);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--poc-gold);
}

/* ---------- article body ---------- */

.poc-content {
  margin-top: 28px;
}

.poc-content h2 {
  margin: 32px 0 10px;
  font-family: var(--poc-font-display);
  font-size: 1.4rem;
  line-height: 1.3;
}

.poc-content h3 {
  margin: 22px 0 6px;
  font-size: 1.08rem;
}

.poc-content p,
.poc-content li {
  color: #253029;
}

.poc-content ul,
.poc-content ol {
  padding-left: 20px;
}

.poc-example {
  margin: 14px 0;
  padding: 14px;
  background: var(--poc-paper);
  border: 1px solid var(--poc-line);
  border-left: 4px solid var(--poc-felt);
  border-radius: var(--poc-radius-sm);
}

.poc-example h3 {
  margin-top: 0;
}

.poc-example__cards {
  font-family: var(--poc-font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.poc-table-wrap {
  overflow-x: auto;
}

table.poc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.95rem;
}

table.poc-table th,
table.poc-table td {
  padding: 8px 10px;
  border: 1px solid var(--poc-line);
  text-align: left;
}

table.poc-table th {
  background: #ece8dc;
}

.poc-faq h3 {
  margin-top: 20px;
}

.poc-note {
  font-size: 0.9rem;
  color: var(--poc-ink-soft);
}

[hidden] {
  display: none !important;
}

/* ---------- larger screens ---------- */

@media (min-width: 560px) {
  .poc-hero h1 {
    font-size: 2.1rem;
  }

  .poc-slot {
    width: 66px;
    height: 92px;
    font-size: 1.7rem;
  }

  .poc-slot--board {
    width: 60px;
    height: 84px;
    font-size: 1.5rem;
  }

  .poc-stat__value {
    font-size: 2.8rem;
  }

  .poc-tool {
    padding: 22px 24px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
