/* Poker Golf — the felt, ported from DesignSystem.swift.
   Colours sampled from the shipped iOS build so the two read as one app. */
:root {
  --felt:        #1F6B52;
  --felt-deep:   #14503B;
  --felt-dark:   #0F3E2E;
  --cream:       #F5F2E8;
  --gold:        #E4C87B;
  --gold-deep:   #8A6D1A;
  --ink:         #16261E;
  --muted:       #7C8A82;
  --red:         #C2413B;
  --blue:        #4A6FA5;
  --white:       #FFFFFF;
  --radius:      18px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font: 400 16px/1.4 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--felt-deep);
  overscroll-behavior-y: none;
}

/* The felt: a vertical gradient with the app's 45° pinstripes over it. */
.felt {
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,.035) 0 2px, transparent 2px 26px),
    linear-gradient(180deg, var(--felt) 0%, var(--felt-deep) 55%, var(--felt-dark) 100%);
}

.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---- Round header ---- */
.round-head { padding: 14px 18px 10px; color: var(--white); }

.round-top {
  display: flex; align-items: center; gap: 10px;
  font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.85);
}
.pill {
  background: rgba(255,255,255,.14); border-radius: 999px;
  padding: 7px 12px; white-space: nowrap;
}
.pill.hot { background: var(--gold); color: var(--ink); }
.spacer { flex: 1; }

.pot-row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 12px; }
.pot-label {
  font: 600 11px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .16em; color: var(--gold); text-transform: uppercase;
}
.pot { font-size: 46px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.dealt { text-align: right; }
.dealt b { display: block; font-size: 28px; font-weight: 700; line-height: 1; }
.dealt span {
  font: 600 10px/1.6 ui-monospace, Menlo, monospace;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.7);
}

/* Hole progress: one dash per hole, gold once posted. */
.progress { display: flex; gap: 5px; margin: 16px 0 8px; }
.progress i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); }
.progress i.done { background: var(--gold); }
.progress-meta {
  display: flex; justify-content: space-between;
  font: 600 10px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.72);
}

/* ---- Sheet ---- */
.sheet {
  flex: 1; background: var(--white);
  border-radius: 22px 22px 0 0; margin-top: 14px;
  padding: 8px 0 96px; overflow-y: auto;
}

.col-head {
  display: grid; grid-template-columns: 1fr 92px 62px 78px;
  padding: 12px 18px 8px; align-items: center;
  font: 600 10px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.col-head span:not(:first-child) { text-align: center; }

.row {
  display: grid; grid-template-columns: 1fr 92px 62px 78px;
  align-items: center; padding: 14px 18px;
  border-top: 1px solid rgba(0,0,0,.07);
}
.row:first-of-type { border-top: none; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center; font-size: 26px;
  background: var(--felt); border-radius: 50%;
}
.avatar.emoji { background: transparent; font-size: 34px; }
.name { font-weight: 600; font-size: 17px; }
.name .dot { color: var(--gold); font-size: 13px; }
.sub {
  font: 500 12px/1.3 ui-monospace, Menlo, monospace;
  color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.score { text-align: center; font-weight: 700; font-size: 17px; }
.score small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.paid { text-align: center; font-size: 16px; color: #3C4A42; }
.cards-cell { display: flex; align-items: center; justify-content: center; gap: 6px; }

.mini {
  width: 30px; height: 42px; border-radius: 5px;
  background: repeating-linear-gradient(45deg, #1B5A44 0 3px, #17503C 3px 7px);
  border: 1.5px solid rgba(255,255,255,.85);
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
  display: grid; place-items: center; color: var(--gold); font-size: 13px;
}
.mini.gold {
  background: linear-gradient(145deg, #E8C765, #B8901F);
  border-color: #F2DFA0; color: #EAF7FF;
}
.count { font-weight: 700; font-size: 15px; }

/* ---- Playing cards ---- */
.hand { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 18px 18px; }
.card {
  width: 58px; height: 80px; background: var(--white); border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,.22); position: relative; flex: none;
  border: 1px solid rgba(0,0,0,.08);
}
.card b { position: absolute; top: 5px; left: 7px; font-size: 17px; font-weight: 700; }
.card i { position: absolute; bottom: 6px; right: 7px; font-size: 22px; font-style: normal; }
.card.red { color: var(--red); }
.card.dim { opacity: .34; }

.section-label {
  font: 600 11px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: 18px 18px 10px;
}
.hand-name { text-align: center; font-size: 24px; font-weight: 700; padding: 6px 18px 2px; }
.hand-note { text-align: center; color: var(--muted); font-size: 13px; padding-bottom: 10px; }

.ladder { padding: 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.ladder div {
  display: flex; gap: 10px; align-items: center; padding: 7px 10px;
  border-radius: 8px; font-size: 14px; color: var(--muted);
}
.ladder div.you { background: var(--gold); color: var(--ink); font-weight: 600; }
.ladder em { font-style: normal; width: 18px; text-align: right; opacity: .6; }

/* ---- Scorecard ---- */
.card-scroll { overflow-x: auto; padding: 0 18px 12px; }
table { border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 9px; text-align: center; white-space: nowrap; }
thead th {
  font: 600 10px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
tbody th { text-align: left; font-weight: 600; padding-right: 14px; }
tbody tr { border-top: 1px solid rgba(0,0,0,.07); }
.mark { display: inline-grid; place-items: center; width: 26px; height: 26px; }
.mark.birdie { border: 2px solid var(--red); border-radius: 50%; }
.mark.eagle  { border: 2px solid var(--gold); border-radius: 50%; }
.mark.bogey  { border: 2px solid var(--blue); }
.mark.blob   { border: 2.5px solid var(--ink); }
.pts { display: block; font-size: 10px; color: var(--muted); }

/* ---- Tabs ---- */
.tabs {
  position: fixed; left: 12px; right: 12px; bottom: 12px;
  display: flex; gap: 4px; padding: 5px;
  background: var(--white); border-radius: 999px;
  box-shadow: 0 6px 22px rgba(0,0,0,.28);
}
.tabs button {
  flex: 1; border: 0; background: transparent; border-radius: 999px;
  padding: 13px 8px; font: 600 15px/1 inherit; color: #55635B; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--felt); color: var(--white); }
.tabs .badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px;
  margin-left: 6px; border-radius: 999px;
  background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 700;
}

.warn {
  margin: 14px 18px; padding: 12px 14px; border-radius: 12px;
  background: rgba(228,200,123,.28); border: 1.5px solid rgba(138,109,26,.55);
  font-size: 13px; line-height: 1.45;
}
.warn b { display: block; margin-bottom: 3px; }

/* ---- Entry screens (sign in, join) ---- */
.entry { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 26px 48px; }
.brand { text-align: center; margin-bottom: 34px; }
.brand h1 {
  margin: 0; font-size: 52px; line-height: .92; font-weight: 800;
  color: #DFF5EA; letter-spacing: -.02em;
  text-shadow: 0 3px 0 #0C3427, 0 6px 18px rgba(0,0,0,.35);
}
.brand p {
  margin: 12px 0 0;
  font: 600 11px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.66);
}
.panel {
  background: var(--cream); border-radius: var(--radius);
  padding: 20px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.panel h2 { margin: 0 0 6px; font-size: 21px; }
.panel .hint { margin: 0 0 16px; color: #5D6B62; font-size: 14px; line-height: 1.45; }
.field { width: 100%; padding: 15px 14px; font: 500 17px/1 inherit;
  border: 1.5px solid rgba(0,0,0,.14); border-radius: 12px; background: #fff; color: var(--ink); }
.field:focus { outline: none; border-color: var(--felt); }
.field.code {
  font: 700 26px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .32em; text-align: center; text-transform: uppercase;
}
.btn {
  width: 100%; margin-top: 12px; padding: 16px; border: 0; border-radius: 13px;
  font: 700 17px/1 inherit; cursor: pointer;
  background: var(--gold); color: #2A2418;
}
.btn.ghost { background: transparent; color: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.24); }
.btn[disabled] { opacity: .5; cursor: default; }
.err { margin-top: 12px; color: var(--red); font-size: 14px; }
.foot { margin-top: 22px; text-align: center; color: rgba(255,255,255,.55); font-size: 12px; line-height: 1.5; }
.status {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  background: var(--red); color: #fff; text-align: center;
  font: 600 12px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .1em; text-transform: uppercase; padding: 8px;
}

/* ---------------------------------------------------------------- rules */
/* The "what are we playing" button sits under the pot, because that is the
   moment someone wonders — they have just seen a number move. */
.rules-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; margin-top: 10px; padding: 9px 12px;
  background: rgba(255,255,255,.08); border: 0; border-radius: 10px;
  color: #EFEDE4; font: 600 13px/1 inherit; text-align: left; cursor: pointer;
}
.rules-btn .chev { margin-left: auto; opacity: .6; font-size: 16px; }
.rules-btn:active { background: rgba(255,255,255,.14); }

.modal-back {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8,22,17,.72);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: #F7F6F1; color: #22271F;
  border-radius: 18px; padding: 18px;
}
.modal h2 { margin: 0 0 4px; font-size: 20px; }
.rule-cols { display: grid; gap: 10px; margin: 14px 0; }
/* One column on a phone, two once there is room. The iOS app takes turns with
   a tab picker because a phone cannot hold both; the web client gets to stack
   instead, which is better when it fits. */
@media (min-width: 420px) { .rule-cols { grid-template-columns: 1fr 1fr; } }
.rule-col { border-radius: 12px; padding: 10px 12px; }
.rule-col.earn { background: #EDF5F0; }
.rule-col.pay  { background: #FAEEED; }
.rule-col .section-label { font: 700 9px/1.4 inherit; letter-spacing: 1.4px; opacity: .55; }
.rule { margin-top: 8px; }
.rule b { display: block; font-size: 14px; }
.rule span { display: block; font-size: 10.5px; opacity: .62; }

/* ---------------------------------------------------------------- seats */
.seats { display: grid; gap: 8px; margin: 12px 0; }
.seat {
  display: flex; width: 100%; padding: 10px 12px;
  background: #fff; border: 0; border-radius: 12px;
  text-align: left; cursor: pointer; font: inherit; color: #22271F;
}
.seat:active { transform: scale(.995); }
/* A taken seat is dimmed, never disabled — a player whose phone died has to
   be able to take their own seat back. */
.seat.taken { opacity: .55; }
.seat .who { display: flex; align-items: center; gap: 10px; }
.seat .name { font-weight: 600; }
.seat .sub { font-size: 11px; opacity: .6; }

/* ------------------------------------------------------ taking a seat */
/* The form for someone the Dealer never added — the door that did not
   exist, and the one every "when is it on Android" message is about. */
.newseat { display: grid; gap: 8px; margin-top: 10px; }
.newseat .field { margin: 0; }
.newseat .hint { margin-top: 2px; }
.seat:disabled { cursor: default; }
/* A long status line used to sit on one monospace row and push the whole
   card off the right edge. Flex children need min-width:0 to be allowed to
   shrink below their content. */
.seat .who { min-width: 0; flex: 1; }
.seat .name, .seat .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
