:root {
  --felt: #1f5f3f;
  --felt-dark: #174a31;
  --felt-line: #2f7a54;
  --paper: #fbfaf6;
  --ink: #1d232a;
  --muted: #5d6670;
  --red: #c0262d;
  --black: #1d232a;
  --accent: #f2c14e;
  --panel: #ffffff;
  --page: #eef1ee;
  --border: #d5dbd6;
  --plus: #1d7a3e;
  --minus: #b3261e;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-size: 15px;
}

/* Thai: the vowel and tone marks above and below the letters need more
   room between lines than English. html[lang] is set by the language switch
   (app.js). Only text lines are changed, not the cards. */
/* (Not the whole page: buttons copy the page's line spacing, and the
   bidding box would grow.) */
html:lang(th) :is(
  .help-line, .help-answer, .call-meaning, .told-line, .callout-text, .callout-end,
  .feedback-line, .review-lines, .mini-info p, .small-print, .guide, .check-note ul,
  .watch-why, .lesson-text p, .lesson-coming, .bid-help-0
) { line-height: 1.45; }

button {
  font: inherit;
  cursor: pointer;
}

/* --- Top bar and toolbar --- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 18px;
  padding: 8px 16px 2px;
}
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: 0.2px; }
.deal-info { color: var(--muted); font-size: 14px; }
.mode-note { color: var(--muted); font-size: 14px; }
.mode-note .link-btn { font-size: 14px; }

/* EN | ไทย, at the right of the top bar */
.lang-switch {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  border: 1px solid var(--felt);
  border-radius: 8px;
  overflow: hidden;
}
.lang-switch button {
  border: none;
  border-radius: 0;
  padding: 3px 12px;
  background: #fff;
  color: var(--felt-dark);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
}
.lang-switch button + button { border-left: 1px solid var(--felt); }
.lang-switch button[aria-pressed="true"] { background: var(--felt); color: #fff; }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 4px 16px 8px;
}
.toolbar button {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}
.toolbar button:hover:not(:disabled) { border-color: var(--felt); }
.toolbar button:disabled { color: #9aa2a8; cursor: default; }
.goto { display: flex; align-items: center; gap: 6px; }
.goto label { color: var(--muted); font-size: 14px; }
.goto input {
  width: 9.5em;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.switch { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

/* --- Layout --- */
.layout {
  display: grid;
  /* the table is capped so the panel on the right has room for text */
  grid-template-columns: minmax(460px, 760px) minmax(340px, 600px);
  justify-content: center;
  gap: 16px;
  padding: 0 16px 12px;
  align-items: start;
}

/* --- The table --- */
.table {
  display: grid;
  /* equal side columns keep North and South centred */
  grid-template-columns: minmax(max-content, 1fr) minmax(220px, 1.6fr) minmax(max-content, 1fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "tally top    ."
    "left  centre right"
    "bottom bottom bottom";
  gap: 8px;
  padding: 12px;
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 100%);
  border-radius: 14px;
  min-height: 560px; /* keeps its size when the hands are empty at the end */
  position: relative;
}

/* The tricks scoreboard, in the top-left corner of the table */
.tally {
  grid-area: tally;
  align-self: start;
  justify-self: start;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--felt-line);
  border-radius: 10px;
  padding: 6px 10px 7px;
  color: #fff;
}
.tally[hidden] { display: none; }
.tally-head { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.tally-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.8; }
.tally-big { font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.tally-of { font-size: 15px; font-weight: 600; }
.tally-dots { display: flex; align-items: center; gap: 2px; margin: 5px 0 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.dot-mine { background: #46d17a; }
.dot-theirs { background: #e5484d; }
.tally-line { width: 3px; height: 17px; background: var(--accent); border-radius: 2px; margin: 0 1px; }
.tally-foot { font-size: 13px; opacity: 0.9; white-space: nowrap; }
.tally-goal { font-weight: 700; opacity: 1; }
.tally-skill { font-size: 13px; margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.18); white-space: nowrap; }
.tally-skill strong { font-size: 16px; color: var(--accent); }
.tally-checking { font-size: 12px; opacity: 0.75; }
.pos-top { grid-area: top; justify-self: center; align-self: start; }
.pos-left { grid-area: left; align-self: center; justify-self: start; }
.pos-right { grid-area: right; align-self: center; justify-self: end; }
.pos-bottom { grid-area: bottom; justify-self: center; align-self: end; }
.centre { grid-area: centre; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.seat {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--felt-line);
  border-radius: var(--radius);
  padding: 6px 10px 8px;
  color: #fff;
  min-width: 0;
}
.seat.to-play { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.35); }

.seat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.seat-name { font-weight: 600; }
.tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
}
.tag-you { background: var(--accent); color: #3a2c00; }
.tag-declarer { background: #ffffff; color: var(--felt-dark); }
.hcp { margin-left: auto; font-size: 13px; opacity: 0.85; }

.hand { display: flex; flex-direction: column; gap: 3px; }
.suit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-height: 30px; }
.suit-symbol {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  line-height: 1;
  background: var(--paper);
  border-radius: 50%;
  margin-right: 3px;
  flex: none;
}
.void { opacity: 0.6; padding-left: 4px; }

.card {
  min-width: 29px;
  height: 30px;
  padding: 0 5px;
  border: 1px solid #c9c6bb;
  border-radius: 5px;
  background: var(--paper);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}
.red { color: var(--red); }
.black { color: var(--black); }
.card:disabled { cursor: default; }
.card.not-legal { opacity: 0.38; }
.card.playable { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card.playable:hover, .card.playable:focus-visible {
  transform: translateY(-3px);
  background: #fff7dc;
  outline: none;
}
.pos-bottom .card { min-width: 33px; height: 36px; font-size: 17px; }
.pos-bottom .suit-symbol { width: 34px; height: 34px; font-size: 26px; }

.backs { display: flex; align-items: center; }
/* hidden cards overlap like a fanned hand */
.back + .back { margin-left: -11px; }
.back {
  width: 16px;
  height: 24px;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, #3c5a8a 0 3px, #2c4670 3px 6px);
  border: 1px solid #c8d2e4;
}
.count { white-space: nowrap; margin-left: 8px; font-size: 13px; opacity: 0.85; }

/* --- The trick in the middle --- */
.trick {
  position: relative;
  width: 170px;
  height: 166px;
}
.trick[hidden] { display: none; }
.trick.compact { height: 140px; }
.slot { position: absolute; }
.slot-top { top: 0; left: 50%; transform: translateX(-50%); }
.slot-bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
.slot-left { left: 0; top: 50%; transform: translateY(-50%); }
.slot-right { right: 0; top: 50%; transform: translateY(-50%); }
.face {
  width: 46px;
  height: 64px;
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid #c9c6bb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.face-rank { font-size: 19px; line-height: 1; }
.face-suit { font-size: 21px; line-height: 1.1; }
.face.led { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.25); }
.trick.finished .face { opacity: 0.6; }
.trick.finished .face.winner { opacity: 1; box-shadow: 0 0 0 3px var(--accent); }
.trick-caption { color: #fff; margin-top: 4px; font-size: 13px; min-height: 1.3em; opacity: 0.9; }
.trick-info { color: #fff; text-align: center; font-size: 14px; margin-top: 2px; }
.trick-info:empty { display: none; }
.trick-count strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.trick-goal { opacity: 0.92; margin-top: 1px; }
.peek-btn { color: #ffe9a8; font-size: 13px; }
.bid-box {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  padding: 8px;
  width: 270px;
  max-width: 100%;
}
.all-played { margin: 4px 2px 2px; font-size: 13px; opacity: 0.8; font-style: italic; }
.tag-dealt { background: #c8d2e4; color: #1d2a44; }
.over-box {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  min-width: 240px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.over-box p { margin: 0 0 4px; }
.over-title { font-size: 18px; font-weight: 700; color: var(--felt-dark); }
.over-result { font-size: 15px; font-weight: 600; }
.over-tricks { font-size: 14px; color: var(--muted); }
.over-score { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.over-buttons { display: flex; gap: 8px; justify-content: center; margin: 8px 0 6px; }
.over-buttons button { padding: 6px 12px; border-radius: 6px; font-weight: 600; }
.over-next { background: var(--felt); color: #fff; border: 1px solid var(--felt); }
.over-next:hover { background: var(--felt-dark); }
.over-again { background: #fff; color: var(--felt-dark); border: 1px solid var(--felt); }
.over-box .link-btn { font-size: 13px; }
.over-review { font-size: 13px; color: var(--muted); font-style: italic; }
.over-grade { font-size: 19px; font-weight: 800; margin-top: 6px !important; }
.over-luck { font-size: 13px; color: var(--muted); max-width: 260px; margin: 0 auto 4px !important; }
.grade-best { color: var(--plus); }
.grade-good { color: #2e7d4f; }
.grade-fair { color: #8a6d00; }
.grade-costly { color: #a86400; }
.grade-poor { color: var(--minus); }
.review { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.review-head { font-size: 15px; margin: 0 0 4px; }
.review-grade { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.review-luck { margin: 0 0 4px; font-size: 14px; }
.review-lines { margin: 4px 0; padding-left: 0; list-style: none; font-size: 14px; line-height: 1.4; }
.review-lines li { margin: 3px 0; }
.review-line {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 6px;
  margin-left: -6px;
  display: block;
  width: calc(100% + 6px);
  text-align: left;
  color: var(--ink);
  line-height: 1.4;
}
.review-line:hover { border-color: var(--border); background: #f6f7f5; }
.review-line.active { border-color: var(--felt); background: #eef6f0; }
.sev {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: 10px;
  vertical-align: 1px;
}
.sev-costly { background: #f8d7d5; color: #9b1c15; }
.sev-weaker { background: #fbe3cf; color: #8a4a00; }
.sev-close { background: #e8ece9; color: #4a5560; }
.card-wrap { display: inline-flex; flex-direction: column; align-items: center; }
.chance { font-size: 11px; font-weight: 700; color: #fff; margin-top: 1px; line-height: 1.1; }
.card.was-played { box-shadow: 0 0 0 3px #e5484d; }
.card.was-best { box-shadow: 0 0 0 3px #46d17a; }
.card.was-played.was-best { box-shadow: 0 0 0 3px #46d17a; }
.look-box {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 6px;
  max-width: 330px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.look-box p { margin: 0 0 4px; }
.look-title { font-weight: 700; font-size: 15px; color: var(--felt-dark); }
.look-line { font-size: 14px; }
.look-key { font-size: 12px; color: var(--muted); }
.look-buttons { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.look-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--felt);
  background: #fff;
  color: var(--felt-dark);
  font-weight: 600;
  font-size: 13px;
}
.look-btn:disabled { opacity: 0.4; cursor: default; }
.bid-box-title { margin: 0 0 6px; font-weight: 700; font-size: 14px; text-align: center; }
.bid-box-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* --- Side panel --- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 8px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}
.status { font-weight: 600; min-height: 1.4em; }
#miniInfo:empty { display: none; }
.mini-info {
  background: #f4f8f1;
  border: 1px solid #cfe0c8;
  border-left: 4px solid var(--felt);
  border-radius: 8px;
  padding: 10px 12px;
}
.mini-info h2 { font-size: 15px; margin: 0 0 4px; }
.mini-info p { margin: 0 0 4px; font-size: 13.5px; line-height: 1.4; }
.scoreboard:empty { display: none; }
.scoreboard { border-top: 1px solid var(--border); padding-top: 10px; }
.contract-line { font-size: 17px; }
.contract-line strong { font-size: 20px; }
.need { color: var(--muted); font-size: 14px; margin: 3px 0 6px; }
.tricks { display: flex; gap: 16px; font-variant-numeric: tabular-nums; font-weight: 600; }

.chooser-title { font-size: 15px; margin: 0 0 6px; }
.mini-line { margin: 0; font-size: 13px; color: var(--muted); }
.mini-line .link-btn { font-size: 13px; }
.step { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.step-head { font-size: 14px; margin: 0 0 4px; color: var(--felt-dark); }
.step-line { margin: 0 0 4px; font-size: 14px; }
.aside { color: var(--muted); font-size: 12.5px; }
.verdict { margin: 4px 0 0; font-weight: 700; font-size: 14.5px; }
.verdict.has-fit { color: var(--plus); }
.verdict.no-fit { color: #8a5a00; }
.fit-table { border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.fit-table th, .fit-table td { padding: 2px 10px; text-align: center; }
.fit-table th { font-weight: 600; }
.fit-table .row-label { text-align: left; padding-left: 0; color: var(--muted); font-weight: 500; }
.fit-table tr.total td, .fit-table tr.total .row-label { border-top: 1px solid var(--border); font-weight: 700; color: var(--ink); }
.fit-table .fit-col { background: #e3f3e7; }
.fit-table tr.total td.fit-col { color: var(--plus); }
.small-print { font-size: 13px; color: var(--muted); margin: 0 0 8px; line-height: 1.4; }
.facts { background: #f6f7f5; border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; }
.facts p { margin: 3px 0; font-size: 14px; }
.len { white-space: nowrap; }
.len.fit { font-weight: 700; background: #fff3c4; border-radius: 4px; padding: 0 4px; }
.guide-head { font-size: 14px; margin: 8px 0 4px; }
.guide { margin: 0 0 6px; padding-left: 18px; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.guide li { margin: 2px 0; }
.guide li.applies { color: var(--ink); font-weight: 600; }
.suggest-btn {
  padding: 7px 14px;
  border: 1px solid var(--felt);
  border-radius: 6px;
  background: var(--felt);
  color: #fff;
  font-weight: 600;
  margin-bottom: 4px;
}
.suggest-btn:hover { background: var(--felt-dark); }
.suggestion {
  background: #eef6f0;
  border-left: 4px solid var(--felt);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  margin: 0 0 4px;
}
.chooser-intro { margin: 10px 0 8px; font-size: 14px; font-weight: 600; }
.bid-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.bid {
  padding: 4px 0;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fafbfa;
  font-weight: 600;
}
.bid:hover { border-color: var(--felt); background: #eef6f0; }
.bid.suggested { border: 2px solid var(--felt); background: #e1efe5; }
.rules-note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.check-note {
  background: #fff6e3;
  border-left: 4px solid #d99a26;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
}
.check-note p { margin: 0; }
.check-head { font-weight: 600; }
.check-note ul { margin: 6px 0; padding-left: 18px; line-height: 1.4; }
.check-tail { font-size: 13px; color: var(--muted); }
.check-ok { margin: 0; color: var(--plus); font-weight: 600; font-size: 14px; }

.result { border-top: 1px solid var(--border); padding-top: 10px; }
.result p { margin: 0 0 6px; }
.result-head { font-weight: 600; }
.result-score { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plus { color: var(--plus); }
.minus { color: var(--minus); }
.note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #1c5fae;
  text-decoration: underline;
}

.session { border-top: 1px solid var(--border); padding-top: 10px; }
.session h2 { font-size: 15px; margin: 0 0 6px; }
.session-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.session-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 3px 4px; }
.session-table td { padding: 3px 4px; border-top: 1px solid #edf0ee; }
.session-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.session-table th:last-child { text-align: right; }
.session-table tr.practice td { color: var(--muted); }
.session-table tr.total td { font-weight: 700; border-top: 2px solid var(--border); }

/* --- Watch a hand / Play a hand --- */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tools[hidden], .panel-part[hidden], [hidden] { display: none !important; }
.panel-part { display: flex; flex-direction: column; gap: 10px; }
.w-speed { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.w-speed select { font: inherit; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; }
.toolbar .w-play { min-width: 6.5em; font-weight: 600; }
.toolbar .w-stop { color: var(--minus); border-color: #e6b8b5; font-weight: 600; }
.w-practice, .toolbar .w-practice {
  background: var(--felt);
  color: #fff;
  border: 1px solid var(--felt);
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 600;
}
.w-practice:hover, .toolbar .w-practice:hover { background: var(--felt-dark); }

.seat.just-played { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.35); }
.tag-dummy { background: rgba(255, 255, 255, 0.28); }
.face.new { box-shadow: 0 0 0 3px #fff, 0 0 12px 4px rgba(242, 193, 78, 0.9); }
.trick.finished .face.new { opacity: 1; }

/* While watching, the panel fits below the toolbar so the page never scrolls,
   and the table is wider so the pop-up has room */
body.watching .panel, body.learning .panel { max-height: calc(100vh - 108px); }
body.watching .layout, body.learning .layout { grid-template-columns: minmax(460px, 900px) minmax(340px, 520px); }
body.watching .table, body.learning .table { grid-template-columns: max-content minmax(220px, 1fr) max-content; }
/* While watching, a smaller trick leaves room for the pop-up under it */
body.watching .trick { width: 160px; height: 140px; }
body.watching .trick-caption { display: none; }
body.watching #centreChooser { width: 100%; display: flex; justify-content: center; }
body.learning #centreChooser { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* The pop-up that explains each card */
.callout {
  position: relative;
  background: #fffdf5;
  color: var(--ink);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 8px 12px 6px;
  margin-top: 8px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  animation: pop 0.25s ease-out;
}
.callout::before {
  /* a small pointer up towards the trick */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top: none;
  border-bottom-color: var(--accent);
}
.callout-intro::before { display: none; }
.callout p { margin: 0 0 5px; }
.callout-head { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; }
.callout-who { font-weight: 700; color: var(--ink); }
.callout-card { font-weight: 800; font-size: 16px; }
.callout-key {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--accent);
  color: #3a2c00;
}
.callout-title { font-size: 17px; font-weight: 800; color: var(--felt-dark); }
.callout-text { font-size: 14.5px; line-height: 1.4; }
.callout-end { font-size: 14px; font-weight: 600; color: var(--felt-dark); }
/* Partner's line on the table while bidding: a little smaller (room). */
.practice-box .callout-end, .auction-box .callout-end { font-size: 13px; line-height: 1.3; margin-bottom: 4px; }
.practice-box .mark, .auction-box .mark { margin-bottom: 3px; }
.callout-progress { font-size: 12px; color: var(--muted); margin-left: auto; padding-left: 8px; }
.callout-note { font-size: 12px; color: var(--muted); }
.callout-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.callout-buttons button { border-radius: 6px; padding: 6px 12px; font-weight: 600; }
.w-big { background: var(--accent); color: #3a2c00; border: 1px solid #d9a92f; font-size: 15px; }
.w-big:hover { background: #f5cd6a; }
.w-plain { background: #fff; color: var(--felt-dark); border: 1px solid var(--felt); }
.callout-buttons .w-stop { background: #fff; color: var(--minus); border: 1px solid #e6b8b5; }
@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .callout { animation: none; } }

/* The panel while watching */
.watch-head { font-size: 17px; margin: 0; }
.watch-lead { margin: 0; }
.watch-sub { font-size: 15px; margin: 0 0 4px; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lesson-btn {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--ink);
}
.lesson-btn:hover { border-color: var(--felt); background: #f6faf7; }
.lesson-btn.active { border-color: var(--felt); background: #eef6f0; box-shadow: inset 4px 0 0 var(--felt); }
.lesson-num {
  align-self: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--felt);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lesson-title { font-weight: 700; font-size: 14px; }
.lesson-idea { font-size: 12.5px; color: var(--muted); }
.watch-about, .watch-story, .watch-cta { border-top: 1px solid var(--border); padding-top: 8px; }
.watch-why { margin: 0; font-size: 14px; line-height: 1.4; }
.story-list { position: relative; list-style: none; margin: 0; padding: 0; max-height: 170px; overflow-y: auto; font-size: 13.5px; }
.story-trick { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 6px 0 1px; }
.story-line {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--ink);
}
.story-line:hover { border-color: var(--border); background: #f6f7f5; }
.story-line.active { border-color: var(--felt); background: #eef6f0; }
.story-line.key { font-weight: 600; }
.story-who { font-weight: 700; display: inline-block; min-width: 5.6em; }
.watch-cta p { margin: 0 0 6px; font-size: 14px; }

/* --- Learn bidding --- */
.learn-box { max-width: 480px; max-height: calc(100vh - 330px); min-height: 0; overflow-y: auto; }
.learn-box.learn-box-tight { max-height: calc(100vh - 540px); min-height: 200px; }
.callout-note-big { font-size: 14px; background: #f4f8f1; border-left: 4px solid var(--felt); border-radius: 6px; padding: 6px 9px; }
body.learning .tally, .tally.tally-auction { background: none; border: none; padding: 0; }
/* Contested auctions run to more rows. The auction grid is pinned in the
   corner rather than taking up a row of the table; a long auction scrolls
   inside it, the newest call kept in view. Where pinning would cover
   North's or West's hand, placeCornerGrid (draw.js) adds .tally-inflow and
   the grid goes back into the table's top row, shorter. */
@media (min-width: 621px) {
  body.learning .tally, .tally.tally-auction {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    max-height: 214px; overflow-y: auto; border-radius: 8px;
  }
  body.learning .tally.tally-inflow, .tally.tally-auction.tally-inflow { position: static; max-height: 140px; }
  body.learning .tally .auction-table th, .tally.tally-auction .auction-table th { position: sticky; top: 0; }
}
.scoreboard .auction-table { margin: 4px 0 6px; font-size: 13px; min-width: 0; }
.scoreboard .auction-table td { font-size: 13px; padding: 1px 8px; min-width: 40px; }
.review .auction-table { margin: 4px 0 6px; min-width: 0; }
.learn-box.auction-box { max-width: 330px; max-height: calc(100vh - 440px); min-height: 240px; }
.auction-table {
  border-collapse: separate;
  border-spacing: 0;
  background: #fffdf5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  font-variant-numeric: tabular-nums;
  min-width: 260px;
  color: var(--ink);
}
.auction-table td.red { color: var(--red); }
/* A call you can click to see what it meant (PLAN.md section 18.1). */
.auction-table td.has-meaning { cursor: pointer; }
.auction-table td.has-meaning:hover, .auction-table td.chosen { background: #fff3c4; }
.call-meaning { margin: 3px 0 0; padding: 4px 7px; max-width: 300px; font-size: 12.5px; line-height: 1.35;
  background: var(--paper); color: var(--ink); border: 1px solid var(--border); border-radius: 6px; white-space: normal; }
/* "What should I bid?" (PLAN.md section 18.2). */
.bid-help { margin: 2px 0 5px; }
.bid-help-1, .bid-help-2 { background: #f4f1e6; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }
.help-btn { font-size: 13px; padding: 3px 10px; }
.bid-help-0 { margin: 0 0 3px; line-height: 1.2; }
.bid-help-0 .help-btn { font-size: 12.5px; padding: 1px 8px; }
.callout-head .help-inline { display: inline; margin: 0 0 0 8px; }
/* In the game the button ends the bidding box's top row. */
.bidbox-top.with-extra { grid-template-columns: 1fr 1fr 1fr auto; }
.bidbox-top .bid-help { margin: 0; }
.bidbox-top .help-btn { height: 100%; white-space: nowrap; }
.callout-head .help-inline .help-note { display: none; }
.help-head { margin: 0 0 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--felt-dark); }
.help-line { margin: 0 0 2px; font-size: 12.5px; line-height: 1.3; }
.help-answer { margin: 3px 0 0; font-size: 13px; line-height: 1.3; }
.help-answer strong.red { color: var(--red); }
.help-note { font-size: 11.5px; color: var(--muted); }
/* With the help open, the box on the table is wider (fewer wrapped lines). */
.help-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.bid-help-0 .help-answer { display: inline; margin-right: 6px; }
/* While the help is open, your last bid's score line makes way for it. */
.learn-box:has(.bid-help-1) > .mark, .learn-box:has(.bid-help-2) > .mark { display: none; }
/* "Which card?" (18.3): in the panel, and the best card(s) outlined. */
.card-help { margin: 6px 0; }
.card.playable.advised { outline: 3px solid #2e9d5b; outline-offset: 1px; }
/* During the play: what the bidding told you. */
.told-you { margin: 6px 0 4px; font-size: 13px; }
.told-you summary { cursor: pointer; font-weight: 700; color: var(--felt-dark); }
.told-line { margin: 3px 0; line-height: 1.35; }
.auction-table th { background: #e9efe9; color: var(--felt-dark); font-size: 12px; font-weight: 700; padding: 3px 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.auction-table td { text-align: center; padding: 3px 10px; font-weight: 700; font-size: 15px; min-width: 52px; border-top: 1px solid #eee8d8; }
.auction-call.current { background: var(--accent); border-radius: 4px; }
.auction-call.pending { color: var(--felt); background: #e3f3e7; }
.answer-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.answer-opening { display: grid; grid-template-columns: repeat(5, minmax(48px, 1fr)); }
.answer-opening .ans-btn:first-child { grid-column: 1 / -1; }
.ans-btn {
  min-width: 52px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fafbfa;
  font-weight: 700;
  font-size: 15px;
}
.ans-btn:hover:not(:disabled) { border-color: var(--felt); background: #eef6f0; }
.ans-btn:disabled { cursor: default; opacity: 0.55; }
.ans-btn.ans-right { opacity: 1; border: 2px solid var(--plus); background: #e3f3e7; }
.ans-btn.ans-wrong { opacity: 1; border: 2px solid var(--minus); background: #fbe4e2; }
.feedback { border-radius: 8px; padding: 6px 10px; margin-top: 4px; }
.feedback.ok { background: #eef6f0; border-left: 4px solid var(--plus); }
.feedback.bad { background: #fff3ec; border-left: 4px solid #d9822b; }
.feedback-head { font-weight: 800; font-size: 15px; }
.feedback-line { font-size: 14px; line-height: 1.4; }
.learn-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.learn-tab {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--felt);
  border-radius: 6px;
  background: #fff;
  color: var(--felt-dark);
  font-weight: 600;
}
.learn-tab.active { background: var(--felt); color: #fff; }
.lesson-text { border-top: 1px solid var(--border); padding-top: 8px; }
.lesson-text p { margin: 0 0 6px; font-size: 14px; line-height: 1.45; }
.bidbox { display: flex; flex-direction: column; gap: 3px; margin: 4px 0; }
.bidbox-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3px; }
.bidbox-x:not(:disabled) { color: var(--minus); }
.bidbox-xx:not(:disabled) { color: #1c5fae; }
.bidbox-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.bidbox .ans-btn { min-width: 0; padding: 3px 4px; font-size: 14px; }
.bidbox .ans-btn:disabled { opacity: 0.25; }
.mark { border-radius: 6px; padding: 3px 8px; margin: 0 0 5px; font-size: 14px; }
.mark summary { cursor: pointer; font-weight: 700; }
.mark .feedback-line { margin: 4px 0 2px; }
.mark-best { background: #e3f3e7; }
.mark-close { background: #eef4e3; }
.mark-weaker { background: #fbf0dc; }
.mark-costly { background: #fbe4e2; }
.mark.callout-opp { background: #eef0f3; padding: 2px 8px; margin-bottom: 3px; }
.mark.callout-opp summary { font-weight: 500; color: var(--ink); }
.practice-btn { margin-top: 2px; }
.practice-btn .lesson-num { background: var(--accent); color: #3a2c00; }
.practice-tally { font-weight: 700; color: var(--felt-dark); }
.agreements { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.agreements-head { font-weight: 700; font-size: 14px; margin: 0 0 4px !important; }
.agreements-switch { margin: 2px 0; }
.agreements-note { margin: 0 0 4px 22px !important; font-size: 12.5px; }
.notice { background: #fff6e3; border-left: 4px solid var(--accent); border-radius: 6px; padding: 6px 9px; font-size: 13.5px; }
.lesson-coming { font-size: 12.5px; color: var(--muted); padding: 2px 4px; line-height: 1.4; }
.lesson-coming-head { font-weight: 600; }

/* --- Narrow screens --- */
@media (max-width: 940px) {
  .layout, body.watching .layout, body.learning .layout { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 620px) {
  body.watching .table, body.learning .table { grid-template-columns: 1fr 1fr; }
  .pos-top, .pos-bottom { justify-self: stretch; }
  .tally { justify-self: stretch; }
  .table {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
      "tally  tally"
      "top    top"
      "left   right"
      "centre centre"
      "bottom bottom";
    padding: 10px;
    min-height: 0;
  }
  .pos-left .card, .pos-right .card { min-width: 22px; height: 28px; padding: 0 3px; font-size: 14px; }
  .pos-left .suit-symbol, .pos-right .suit-symbol { width: 24px; height: 24px; font-size: 18px; margin-right: 1px; }
  .suit-row { min-height: 28px; gap: 2px; }
  .back { width: 12px; height: 18px; }
  .back + .back { margin-left: -8px; }
  .trick { width: 170px; height: 180px; }
  .face { width: 44px; height: 64px; }
}

/* --- Shorter screens (e.g. laptops): smaller cards so it all fits --- */
@media (max-height: 800px) and (min-width: 941px) {
  .topbar { padding-top: 4px; }
  .toolbar { padding-bottom: 4px; }
  .table { padding: 8px; gap: 6px; }
  .seat { padding: 4px 8px 6px; }
  .suit-row { min-height: 26px; gap: 2px; }
  .card { height: 26px; min-width: 26px; font-size: 14px; }
  .pos-bottom .card { height: 30px; min-width: 29px; font-size: 15px; }
  .suit-symbol { width: 26px; height: 26px; font-size: 20px; }
  .pos-bottom .suit-symbol { width: 29px; height: 29px; font-size: 22px; }
  .trick { width: 150px; height: 140px; }
  .face { width: 40px; height: 54px; }
  .face-rank { font-size: 16px; }
  .face-suit { font-size: 18px; }
  .bid { padding: 2px 0; }
  .bid-grid { gap: 3px; }
  .panel { gap: 8px; padding: 10px 12px; }
  .mini-info p, .guide { font-size: 13px; line-height: 1.35; }
  .step { padding: 5px 8px; margin-bottom: 5px; }
  .layout { padding-bottom: 4px; }
  .review .note, .session .note { margin-top: 3px; }
  .fit-table th, .fit-table td { padding: 1px 8px; }
  .guide li { margin: 1px 0; }
  body.watching .trick { width: 150px; height: 116px; }
  .callout { padding: 6px 10px 4px; margin-top: 4px; }
  .callout p { margin-bottom: 3px; }
  .callout-title { font-size: 15.5px; }
  .callout-text { font-size: 13.5px; line-height: 1.35; }
  .callout-end { font-size: 13px; }
  .lesson-btn { padding: 3px 8px; }
  .story-list { max-height: 130px; }
  .ans-btn { padding: 2px 8px; font-size: 14px; }
  .bidbox .ans-btn { padding: 1px 4px; font-size: 13px; }
  .learn-box { max-height: calc(100vh - 360px); }
  .learn-box.learn-box-tight { max-height: calc(100vh - 450px); }
  .learn-box.auction-box { max-height: calc(100vh - 360px); }
  .bidbox-grid { gap: 2px; }
  .answer-row { gap: 4px; margin: 2px 0 4px; }
  .feedback { padding: 4px 8px; }
  .feedback-line { font-size: 13px; line-height: 1.3; margin-bottom: 2px !important; }
  .callout-buttons { margin: 4px 0 2px; }
}

/* ==========================================================================
   App stage 2 (PLAN.md section 19.3): the five places, the pages, the
   first-visit screens, the four-colour deck and card size, and the phone
   layout (the table fills the screen; the side panel is a sheet).
   ========================================================================== */

/* --- The five places: along the top on a computer ------------------------ */
.places { display: inline-flex; border: 1px solid var(--felt); border-radius: 8px; overflow: hidden; margin-right: 6px; }
.toolbar .place-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: none;
  border-radius: 0;
  background: #fff;
  color: var(--felt-dark);
  font-weight: 600;
}
.toolbar .place-btn + .place-btn { border-left: 1px solid var(--felt); }
.place-btn svg { width: 18px; height: 18px; flex: none; }
.toolbar .place-btn.active { background: var(--felt); color: #fff; }
.toolbar .place-btn:hover:not(.active) { background: #eef6f0; }

/* On a page (Home, a hub, Daily, Me) the table and its tools are away. */
body.on-page .layout, body.on-page .deal-info, body.on-page .mode-note { display: none; }

/* --- The pages ------------------------------------------------------------ */
.page { padding: 4px 16px 28px; }
.page-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.page-title { margin: 6px 0 2px; font-size: 24px; color: var(--felt-dark); }
.page-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.page-card-next {
  background: radial-gradient(ellipse at top left, var(--felt) 0%, var(--felt-dark) 100%);
  border-color: var(--felt-dark);
  color: #fff;
}
.page-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent); }
.page-next-title { margin: 4px 0 0; font-size: 15px; opacity: 0.9; }
.page-next-line { margin: 2px 0 12px; font-size: 21px; font-weight: 700; line-height: 1.3; }
.page-h3 { margin: 0 0 4px; font-size: 18px; color: var(--felt-dark); }
.page-line { margin: 0 0 10px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.page-note { margin: 10px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.page-go, .page-link {
  display: inline-block;
  min-height: 44px; /* a comfortable size to tap */
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
}
.page-go { border: none; background: var(--accent); color: #3a2c00; }
.page-go:hover { background: #f5cd6c; }
.page-link { border: 1px solid var(--felt); background: #fff; color: var(--felt-dark); }
.page-link:hover { background: #eef6f0; }
.page-soon {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 9px;
  border-radius: 10px;
  background: #fff3c4;
  color: #6b5200;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.page-card-soon .page-h3 { display: inline-block; margin-right: 8px; }
.page-progress { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.page-progress-bar { flex: 1; height: 8px; border-radius: 4px; background: #e3e8e4; overflow: hidden; }
.page-progress-fill { height: 100%; background: var(--felt); border-radius: 4px; }
.page-progress-text { font-size: 13px; color: var(--muted); white-space: nowrap; }
.page-lessons { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.page-lesson {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.page-lesson:hover { border-color: var(--felt); background: #f6faf7; }
.page-lesson-num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--felt);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-lesson.done .page-lesson-num { background: var(--plus); }
.page-lesson-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.page-choice {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin: 6px 0 0;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.page-choice:hover { border-color: var(--felt); background: #f6faf7; }
.page-choice-name { font-weight: 700; font-size: 16px; color: var(--felt-dark); }
.page-choice-line { font-size: 14px; color: var(--muted); line-height: 1.4; }
.page-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 15px; }
.page-setting .lang-switch { margin-left: 0; }
.page-sample { margin-left: auto; font-size: 20px; letter-spacing: 3px; }
.page-lang { margin-left: 0; }
html:lang(th) :is(.page-line, .page-note, .page-choice-line, .welcome-text) { line-height: 1.55; }

/* --- First-visit screens -------------------------------------------------- */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 45, 30, 0.72);
}
.welcome-box {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 18px;
  padding: 18px 20px 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}
.welcome-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.welcome-brand { font-weight: 800; color: var(--felt-dark); }
.welcome-title { margin: 18px 0 8px; font-size: 24px; color: var(--felt-dark); }
.welcome-text { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink); min-height: 7.5em; }
.welcome-dots { display: flex; gap: 6px; justify-content: center; margin: 16px 0 14px; }
.welcome-dot { width: 8px; height: 8px; border-radius: 50%; background: #cfd8d2; }
.welcome-dot.on { background: var(--felt); width: 22px; border-radius: 4px; }
.welcome-buttons { display: flex; gap: 10px; justify-content: space-between; }
.welcome-skip, .welcome-next { min-height: 44px; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 16px; }
.welcome-skip { border: none; background: none; color: var(--muted); }
.welcome-next { border: none; background: var(--accent); color: #3a2c00; }
.welcome-choice {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--felt);
  background: #fff;
  color: var(--felt-dark);
  text-align: left;
}
.welcome-choice:first-child { background: var(--felt); color: #fff; }
.welcome-choice strong { font-size: 16px; }
.welcome-choice span { font-size: 14px; opacity: 0.9; }

/* --- Four-colour deck and card size (Me, settings) ------------------------ */
body.four-colour .s-D, body.four-colour .s-D * { color: #1d63c4; }
body.four-colour .s-C, body.four-colour .s-C * { color: #1f8044; }
body.cards-large .pos-bottom .card { min-width: 40px; height: 44px; font-size: 20px; }
body.cards-large .pos-bottom .suit-symbol { width: 40px; height: 40px; font-size: 30px; }
body.cards-large .pos-top .card { min-width: 32px; height: 34px; font-size: 17px; }

/* The sheet button belongs to the phone layout only. */
.sheet-btn { display: none; }

/* --- Phones (up to 620px wide, held upright) ------------------------------ */
@media (max-width: 620px) {
  /* Room at the bottom for the bar of the five places. */
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }

  .topbar { padding: 6px 10px 2px; gap: 2px 10px; align-items: center; }
  .topbar h1 { font-size: 17px; }
  .deal-info { order: 3; width: 100%; font-size: 12px; }
  .mode-note { display: none; }
  .lang-switch button { padding: 2px 10px; font-size: 13px; }

  /* The five places: a bar along the bottom. */
  .places {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin: 0;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: #fff;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  }
  .toolbar .place-btn {
    flex-direction: column;
    gap: 2px;
    min-height: 56px;
    padding: 6px 2px 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    background: #fff;
  }
  .toolbar .place-btn + .place-btn { border-left: none; }
  .place-btn svg { width: 24px; height: 24px; }
  .toolbar .place-btn.active { background: #fff; color: var(--felt); box-shadow: inset 0 3px 0 var(--felt); }

  /* The tools for the table: smaller, the rarely used ones left out. */
  .toolbar { padding: 2px 8px 4px; gap: 4px 6px; }
  .toolbar button { padding: 4px 9px; font-size: 13.5px; }
  .tools { gap: 4px 6px; }
  .goto, #playTools .switch, #wReplayBtn, #wPracticeBtn { display: none; }
  #playTools .w-speed > span { display: none; }
  #watchTools .w-speed { display: none; }
  #watchTools button { padding: 4px 8px; }
  .toolbar select { font-size: 13.5px; padding: 3px 4px; }

  /* The table fills the screen: North across the top, East and West beside
     the trick, your hand along the bottom. */
  .layout, body.watching .layout, body.learning .layout { padding: 0 4px 8px; gap: 8px; }
  .table, body.watching .table, body.learning .table {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "tally  tally  tally"
      "top    top    top"
      "left   centre right"
      "bottom bottom bottom";
    gap: 6px;
    padding: 6px;
    border-radius: 10px;
    min-height: calc(100vh - 170px);
  }
  /* Play a hand: East and West beside North, so the trick and the bidding
     box below have the full width. */
  body:not(.watching):not(.learning) .table, body.learning:has(.practice-box) .table {
    grid-template-areas:
      "tally  tally  tally"
      "left   top    right"
      "centre centre centre"
      "bottom bottom bottom";
  }
  body:not(.watching):not(.learning) :is(.pos-left, .pos-right),
  body.learning:has(.practice-box) :is(.pos-left, .pos-right) { align-self: start; justify-self: auto; }
  /* The bidding box: a little shorter on a phone. */
  .bidbox .ans-btn { padding: 3px 2px; }
  .bidbox-grid { gap: 2px; }

  /* Watch a hand and Learn bidding often show all four hands: East and West
     side by side, the trick and the explanation full width below them. */
  body.watching .table, body.learning .table {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
      "tally  tally"
      "top    top"
      "left   right"
      "centre centre"
      "bottom bottom";
  }
  body.watching .pos-left, body.watching .pos-right, body.learning .pos-left, body.learning .pos-right { max-width: none; }
  body.watching .pos-right, body.learning .pos-right { justify-self: end; }
  .tally { justify-self: stretch; padding: 4px 8px 5px; }
  .tally-big { font-size: 22px; }
  .tally-label, .tally-foot, .tally-skill { font-size: 11.5px; }
  .tally-dots { display: none; }
  .tally-foot { display: inline; margin-right: 6px; }
  .pos-top { justify-self: center; }
  .pos-bottom { justify-self: stretch; }
  .pos-left, .pos-right { align-self: center; max-width: 34vw; }
  .seat { padding: 4px 6px 5px; }
  .seat-head { margin-bottom: 2px; gap: 4px; font-size: 13.5px; }
  .tag { font-size: 10px; padding: 0 5px; }
  /* Hidden hands are just a name and a count. */
  .pos-left .backs, .pos-right .backs, .pos-top .backs { display: none; }
  .pos-left .count, .pos-right .count, .pos-top .count { margin-left: 0; }
  /* Hands in view at the sides (Watch a hand; dummy at the side) are compact. */
  .pos-left .card, .pos-right .card { min-width: 19px; height: 24px; padding: 0 2px; font-size: 13px; }
  .pos-left .suit-symbol, .pos-right .suit-symbol { width: 20px; height: 20px; font-size: 15px; margin-right: 1px; }
  .pos-left .suit-row, .pos-right .suit-row { min-height: 24px; gap: 1px; }
  .pos-top .card { min-width: 26px; height: 30px; font-size: 15px; }
  /* Your hand: big enough to tap. */
  .pos-bottom .card { min-width: 36px; height: 40px; font-size: 18px; }
  .pos-bottom .suit-symbol { width: 32px; height: 32px; font-size: 24px; }
  .pos-bottom .suit-row { gap: 4px; min-height: 40px; }
  .trick-caption:empty { display: none; }
  /* Learn bidding: hidden hands are not shown at all (the auction grid
     names the players), nor the line under the title (the box says it). */
  body.learning .seat:has(.backs) { display: none; }
  body.learning .deal-info { display: none; }
  body.cards-large .pos-bottom .card { min-width: 42px; height: 48px; font-size: 21px; }
  .trick { width: 140px; height: 130px; }
  body.watching .trick { width: 136px; height: 100px; }
  body.watching .tally-foot { display: none; }
  .face { width: 36px; height: 50px; }
  #centreChooser .callout-text { font-size: 14px; line-height: 1.35; }
  #centreChooser .callout { padding: 6px 10px 4px; }
  .learn-box, .learn-box.auction-box, .learn-box.learn-box-tight { max-width: 100%; max-height: none; min-height: 0; }

  /* Hands nobody taps (all four in Watch a hand; North, East and West in
     Learn bidding) are drawn as a printed bridge diagram: a suit and its
     cards on one short line. */
  body.watching .seat .card, body.learning :is(.pos-top, .pos-left, .pos-right) .card {
    min-width: 0;
    height: auto;
    padding: 0 1px;
    border: none;
    background: none;
    box-shadow: none;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
  }
  body.watching .seat .suit-symbol, body.learning :is(.pos-top, .pos-left, .pos-right) .suit-symbol {
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    font-size: 16px;
    margin-right: 4px;
  }
  body.watching .seat .suit-symbol.black, body.learning :is(.pos-top, .pos-left, .pos-right) .suit-symbol.black { color: #fff; }
  body.watching .seat .card.black, body.learning :is(.pos-top, .pos-left, .pos-right) .card.black { color: #fff; }
  body.watching .seat .card.red, body.watching .seat .suit-symbol.red,
  body.learning :is(.pos-top, .pos-left, .pos-right) :is(.card, .suit-symbol).red { color: #ffb3b5; }
  body.four-colour.watching .seat :is(.card, .suit-symbol).s-D,
  body.four-colour.learning :is(.pos-top, .pos-left, .pos-right) :is(.card, .suit-symbol).s-D { color: #9cc7ff; }
  body.four-colour.watching .seat :is(.card, .suit-symbol).s-C,
  body.four-colour.learning :is(.pos-top, .pos-left, .pos-right) :is(.card, .suit-symbol).s-C { color: #a6f0be; }
  body.watching .seat .suit-row, body.learning :is(.pos-top, .pos-left, .pos-right) .suit-row { min-height: 0; gap: 1px; }
  body.watching .seat .hand, body.learning :is(.pos-top, .pos-left, .pos-right) .hand { gap: 0; }

  /* The side panel is a sheet that slides up over the table. */
  .panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 22vh;
    bottom: calc(57px + env(safe-area-inset-bottom, 0px));
    z-index: 50;
    max-height: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(110%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  body.watching .panel, body.learning .panel { max-height: none; }
  /* In the sheet, the lesson lists, their heading and the practice button
     repeat the Learn and Practise pages: the lesson itself comes first. */
  :is(#learnPanel, #watchPanel) > :is(.watch-head, .watch-lead, .lesson-list, .practice-btn) { display: none; }
  body.sheet-open .panel { transform: none; }
  /* The button that opens the sheet: in the top bar, always in view (the
     sheet starts lower down). */
  .topbar .sheet-btn {
    display: inline-block;
    margin-left: auto;
    padding: 3px 12px;
    border: none;
    border-radius: 16px;
    background: var(--felt-dark);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
  }
  .topbar .sheet-btn + .lang-switch { margin-left: 6px; }
  .topbar .sheet-btn[hidden], body.on-page .topbar .sheet-btn { display: none; }

  /* Pages */
  .page { padding: 2px 10px 20px; }
  .page-title { font-size: 21px; }
  .page-lessons { grid-template-columns: 1fr; }
  .welcome-text { font-size: 15.5px; }
}
@media (prefers-reduced-motion: reduce) { .panel { transition: none; } }

/* ==========================================================================
   App stage 3 (PLAN.md section 19.4): How bridge works, and the guided
   first hand.
   ========================================================================== */
.basics-kicker { color: var(--felt); }
.basics-picture { margin: 12px 0 2px; display: flex; justify-content: center; }
.basics-q { margin: 2px 0 10px; font-size: 16px; font-weight: 600; line-height: 1.45; }
.basics-options { display: flex; flex-wrap: wrap; gap: 8px; }
.basics-option {
  min-height: 44px;
  min-width: 64px;
  padding: 8px 16px;
  border: 1px solid var(--felt);
  border-radius: 10px;
  background: #fff;
  color: var(--felt-dark);
  font-weight: 700;
  font-size: 16px;
}
.basics-option:hover:not(:disabled) { background: #eef6f0; }
.basics-option:disabled { cursor: default; opacity: 0.6; }
.basics-option.is-right { opacity: 1; border-color: var(--plus); box-shadow: 0 0 0 2px var(--plus); }
.basics-option.wrong { opacity: 1; border-color: var(--minus); background: #fdeceb; }
.basics-feedback { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; font-size: 15px; line-height: 1.45; }
.basics-feedback.right { background: #e3f3e7; color: #14532d; }
.basics-feedback.wrong { background: #fdeceb; color: #7a1d18; }
.basics-nav { display: flex; justify-content: space-between; gap: 10px; }

/* The table from above */
.basics-table {
  position: relative;
  width: 260px;
  height: 200px;
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-areas: ". n ." "w f e" ". s .";
  gap: 4px;
}
.basics-felt { grid-area: f; border-radius: 10px; background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 100%); }
.basics-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f3f5f3;
  font-size: 12.5px;
  line-height: 1.25;
  padding: 2px 4px;
}
.basics-seat strong { font-size: 14px; }
.basics-seat.ns { background: #e3f3e7; border-color: #9fd3ae; }
.b-n { grid-area: n; } .b-s { grid-area: s; } .b-w { grid-area: w; } .b-e { grid-area: e; }

/* Cards in a row, a trick, the bids */
.basics-row { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.basics-row .face { width: 34px; height: 48px; }
.basics-trick {
  position: relative;
  width: 220px;
  height: 190px;
  border-radius: 12px;
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 100%);
}
.basics-slot { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.basics-slot-name { color: #fff; font-size: 12px; }
.basics-slot.slot-N { top: 6px; left: 50%; transform: translateX(-50%); }
.basics-slot.slot-S { bottom: 6px; left: 50%; transform: translateX(-50%); flex-direction: column-reverse; }
.basics-slot.slot-W { left: 10px; top: 50%; transform: translateY(-50%); }
.basics-slot.slot-E { right: 10px; top: 50%; transform: translateY(-50%); }
.basics-trick .face { width: 38px; height: 54px; }
.basics-bids { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 420px; }
.basics-bid { min-width: 42px; padding: 5px 6px; text-align: center; border: 1px solid var(--border); border-radius: 6px; background: var(--paper); font-weight: 700; }
.basics-more { color: var(--muted); border-style: dashed; }
.basics-sum { display: flex; align-items: baseline; gap: 10px; font-size: 20px; color: var(--muted); }
.basics-big { font-size: 30px; font-weight: 800; color: var(--felt-dark); }
.basics-bands { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 460px; }
.basics-band { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: #f3f5f3; }
.basics-band strong { min-width: 6.5em; color: var(--felt-dark); }
.basics-dup { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.basics-dup-table { display: flex; flex-direction: column; align-items: center; padding: 10px 18px; border-radius: 10px; background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 100%); color: #fff; }
.basics-dup-suits { font-size: 20px; letter-spacing: 3px; }
.basics-dup-note { width: 100%; margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.basics-glossary { margin: 0; width: 100%; display: grid; grid-template-columns: 1fr; gap: 2px 0; }
.basics-glossary dt { margin-top: 8px; font-weight: 700; color: var(--felt-dark); }
.basics-glossary dd { margin: 0; font-size: 14.5px; line-height: 1.45; }
.g-th { font-weight: 600; }
.g-sep { color: var(--muted); }

/* The coach of the guided first hand */
.coach {
  max-width: 980px;
  margin: 0 auto 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff6dd;
  border: 2px solid var(--accent);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.coach-text { margin: 0; flex: 1 1 320px; font-size: 15.5px; line-height: 1.45; font-weight: 600; color: #3a2c00; }
.coach-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.coach-btn { min-height: 40px; padding: 8px 14px; border: none; border-radius: 10px; background: var(--accent); color: #3a2c00; font-weight: 700; }
.coach-btn + .coach-btn { background: #fff; border: 1px solid var(--accent); }
.coach-target { box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(242, 193, 78, 0.8) !important; animation: coach-pulse 1.6s ease-in-out infinite; }
@keyframes coach-pulse { 50% { box-shadow: 0 0 0 3px var(--accent), 0 0 4px rgba(242, 193, 78, 0.3); } }
@media (prefers-reduced-motion: reduce) { .coach-target { animation: none; } }
/* During the guided hand, the game choice and New deal are put away. */
body.guided #playTools .w-speed, body.guided #newBtn, body.guided .goto, body.guided #playTools .switch, body.guided .mode-note { display: none; }

@media (max-width: 620px) {
  .coach { margin: 0 4px 6px; padding: 6px 10px; gap: 6px; }
  .coach-text { font-size: 14px; line-height: 1.35; flex-basis: 100%; }
  .coach-btn { min-height: 36px; padding: 6px 12px; }
  /* During the guided hand on a phone: only what the coach talks about. */
  body.guided .deal-info, body.guided #playTools, body.guided .tally-skill { display: none; }
  .basics-table { width: 240px; height: 180px; }
  .basics-row .face { width: 24px; height: 36px; }
  .basics-row .face .face-rank { font-size: 13px; }
  .basics-row .face .face-suit { font-size: 14px; }
}

/* --- Your account (Me): sign up, the emailed code, sign in (account-view.js) --- */
.acc-form { display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
.acc-form .page-h3, .acc-form .page-line { margin: 0; }
.acc-field { display: flex; flex-direction: column; gap: 4px; }
.acc-label { font-weight: 600; font-size: 15px; }
.acc-input {
  font: inherit;
  font-size: 16px; /* 16px or more: phones do not zoom in on the box */
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #b9c3bc;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.acc-input:focus { outline: 2px solid var(--felt); outline-offset: 1px; border-color: var(--felt); }
.acc-hint { font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.acc-hint.ok { color: var(--plus); font-weight: 600; }
.acc-hint.bad { color: var(--minus); font-weight: 600; }
.acc-check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.45; cursor: pointer; }
.acc-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--felt); }
.acc-show { font-size: 14px; color: var(--muted); }
.acc-error, .acc-info { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; line-height: 1.4; }
.acc-error { background: #fdecea; color: #9b1c15; }
.acc-info { background: #eef6f0; color: var(--felt-dark); }
.acc-submit { align-self: flex-start; min-width: 180px; }
.acc-submit:disabled { opacity: 0.7; cursor: wait; }
.acc-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.acc-more { display: flex; flex-wrap: wrap; gap: 0 18px; }
.acc-link { min-height: 40px; font-size: 15px; }
.acc-check .acc-link { min-height: 0; font-size: inherit; }
.acc-who { margin: 0; }
.acc-email { margin: 0 0 6px; overflow-wrap: anywhere; }
.acc-privacy { max-width: 620px; }
@media (max-width: 620px) {
  .acc-submit { align-self: stretch; }
}
.acc-danger { background: var(--minus); color: #fff; }
.acc-danger:hover { background: #8f1e18; }
.acc-danger-link { color: var(--minus); }

/* --- A rubber game (Practise; app.js renderRubberBox, rubberLines) --- */
.rubber-box { margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fbfdfb; }
.rubber-head { margin: 0 0 2px; font-size: 16px; color: var(--felt-dark); }
.rubber-sheet { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 14px; }
.rubber-sheet th, .rubber-sheet td { padding: 3px 6px; text-align: left; }
.rubber-sheet .num { text-align: right; }
.rubber-sheet .rubber-below td { border-top: 2px solid var(--ink); } /* the line */
.rubber-sheet .total td { font-weight: 700; border-top: 1px solid var(--border); }
.rubber-deals { margin: 4px 0 6px; padding-left: 20px; font-size: 13.5px; line-height: 1.4; }
.over-rubber { margin: 4px 0 0; font-size: 14px; }
.rubber-end { margin-top: 10px; }
.rubber-end.plus { color: var(--plus); }
.rubber-end.minus { color: var(--minus); }
.rubber-sum { margin: 6px 0; }
.rubber-sum-row { display: flex; justify-content: space-between; gap: 12px; margin: 2px 0; font-size: 14px; }
.rubber-sum-total { font-size: 16px; border-top: 1px solid var(--border); padding-top: 3px; }

/* --- The daily competition (daily.js, places.js) --- */
.daily-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; color: var(--felt-dark); min-width: 4.5em; }
.daily-pause { font-weight: 600; }
.daily-cover {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--felt-dark);
  border-radius: inherit;
}
.daily-cover-box { background: #fff; border-radius: 14px; padding: 18px 22px; max-width: 320px; text-align: center; }
.daily-problem { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: #fdecea; color: #9b1c15; font-size: 14px; }
.daily-head { margin: 0; font-size: 18px; color: var(--felt-dark); }
.daily-rules { margin: 4px 0 12px; padding-left: 20px; font-size: 14.5px; line-height: 1.45; }
.daily-rules li { margin: 3px 0; }
.daily-status { font-weight: 600; color: var(--felt-dark); }
.contract-tile { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.contract-tile-chip { background: #fff; color: var(--ink); border-radius: 8px; padding: 1px 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.contract-tile-call { font-size: 26px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.contract-tile-by { font-size: 16px; font-weight: 700; }
@media (max-width: 620px) {
  /* On a phone the contract tile and the tricks share a line, so the table
     still fits the screen. */
  .tally:has(.contract-tile) { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
  .tally:has(.contract-tile) > :not(.contract-tile):not(.tally-head) { grid-column: 1 / -1; }
  .tally .contract-tile { margin-bottom: 0; gap: 6px; }
  .tally .contract-tile-by { font-size: 14px; }
  .tally .contract-tile-call { font-size: 22px; }
}
.daily-score { margin-top: 8px; padding-top: 6px; border-top: 2px solid var(--felt); }
.daily-working { font-style: italic; }
.daily-score-line { margin: 4px 0; color: var(--felt-dark); }
.page-card .page-link + .page-link { margin-left: 8px; }

/* --- Bigger cards and bids to choose from (draw.js pickLarge) --- */
.pick-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 30, 20, 0.55);
}
.pick-box { width: 100%; max-width: 460px; background: #fff; border-radius: 16px; padding: 14px 14px 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); }
.pick-title { margin: 0 0 10px; text-align: center; font-weight: 700; color: var(--felt-dark); }
.pick-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 10px; }
.pick-btn {
  min-width: 84px;
  min-height: 60px;
  padding: 6px 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 26px;
  font-weight: 800;
  cursor: pointer;
}
.pick-btn.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.6); }
.pick-btn:disabled { opacity: 0.28; cursor: default; }
.pick-card { min-width: 0; padding: 4px; border-color: transparent; background: transparent; }
.pick-card .face { width: 68px; height: 96px; }
.pick-card .face-rank { font-size: 30px; }
.pick-card .face-suit { font-size: 30px; }
.pick-card.current .face { box-shadow: 0 0 0 3px var(--accent), 0 2px 4px rgba(0, 0, 0, 0.25); }
.pick-cancel { display: block; margin: 0 auto; min-height: 44px; padding: 8px 26px; font-size: 16px; }

/* --- The leaderboard (leaderboard.js) --- */
.board { list-style: none; margin: 6px 0 4px; padding: 0; }
.board-row { display: grid; grid-template-columns: 2.4em 1fr auto; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.board-me { background: #fff7dc; border-radius: 8px; }
.board-rank { text-align: center; font-weight: 800; font-size: 16px; color: var(--felt-dark); }
.board-who { min-width: 0; }
.board-name { font-weight: 700; margin-right: 6px; overflow-wrap: anywhere; }
.board-parts { display: block; font-size: 12.5px; color: var(--muted); }
.board-score { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.board-gap { text-align: center; color: var(--muted); padding: 2px 0; }
.board-award { margin-right: 4px; font-size: 17px; }
.board-title { margin-left: 6px; font-size: 12.5px; font-weight: 600; color: var(--felt); }
.tag-new { margin-left: 6px; background: #e3ecf8; color: #24456e; }
.board-note { margin-bottom: 12px; }
.daily-deals { display: flex; flex-wrap: wrap; gap: 8px; }
.daily-review-head { margin-top: 14px; }
.daily-review { margin: 6px 0; padding-left: 22px; }
.daily-review li { margin: 6px 0; line-height: 1.4; }
.daily-review li .page-link { margin-left: 8px; min-height: 36px; padding: 6px 12px; font-size: 14px; }

/* --- Your title, Bridge Points and trophies (PLAN.md 19.17 step 4) --- */
.page-card-mine {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  width: 100%;
  min-height: 52px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.page-card-mine:hover { background: #f6faf7; }
.mine-title { font-weight: 800; font-size: 17px; color: var(--felt-dark); }
.mine-line { color: var(--ink); }
.mine-marks { letter-spacing: 1px; }
.mine-go { margin-left: auto; color: var(--felt); font-weight: 700; }
.standing-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 10px; }
.standing-title { font-size: 24px; font-weight: 800; color: var(--felt-dark); }
.standing-bp { font-size: 16px; font-weight: 700; color: #6b5200; }
.standing-needs { margin: -4px 0 10px; padding-left: 22px; line-height: 1.5; }
.standing-rating { font-weight: 700; margin-bottom: 2px; }
.standing-about { margin: 0 0 10px; }
.standing-cabinet-head { margin-top: 14px; }
.standing-cabinet { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0 8px; }
.standing-award { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 10px; background: #fff7dc; text-align: center; }
.standing-award.none { background: #f1f3f1; opacity: 0.55; }
.standing-mark { font-size: 24px; line-height: 1.1; }
.standing-count { font-weight: 800; font-size: 16px; }
.standing-name { font-size: 11px; line-height: 1.2; color: var(--muted); }
.standing-awards { margin: 0 0 6px; padding-left: 4px; list-style: none; line-height: 1.6; }
.standing-how { margin-top: 10px; }
.standing-how summary { cursor: pointer; font-weight: 700; color: var(--felt-dark); min-height: 32px; }
.standing-how ul { margin: 4px 0 0; padding-left: 22px; line-height: 1.55; font-size: 14px; }
.news-line { margin: 0 0 10px; font-size: 16px; line-height: 1.5; }
.news-box .welcome-buttons { margin-top: 14px; }
.daily-test-note { padding: 8px 10px; border-radius: 8px; background: #fff3c4; color: #6b5200; font-weight: 600; }

/* --- The owner's page (PLAN.md 19.17 step 6) --- */
.owner-tabs { margin: 8px 0 10px; }
.owner-flag { border-top: 1px solid var(--border); padding: 12px 0 4px; }
.owner-flag-title { margin: 0; font-weight: 800; color: var(--felt-dark); }
.owner-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 8px; }
.owner-side { background: #f6f8f6; border-radius: 10px; padding: 8px 10px; }
.owner-name { margin: 0; font-weight: 800; }
.owner-score { margin: 6px 0 0; font-weight: 700; }
.owner-deals { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.5; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.owner-danger { border-color: var(--minus); color: var(--minus); }

/* --- Your past games; About (PLAN.md 19.18 step 2) --- */
.daily-past { list-style: none; margin: 4px 0 0; padding: 0; }
.daily-past > li { border-top: 1px solid var(--border); padding: 8px 0; }
.daily-past-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.daily-past .daily-review { margin-top: 6px; }
.about-card a { color: var(--felt); font-weight: 700; }
