*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Outfit,Segoe UI,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media (min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.block{display:block}.inline{display:inline}.flex{display:flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.hidden{display:none}.shrink{flex-shrink:1}.grow{flex-grow:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.border{border-width:1px}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}/* Bridge Bros Online — phone-first table styles (BBO-inspired, not a copy) */

:root {
  --felt: #1a3d2e;
  --felt-deep: #0f241a;
  --felt-light: #245c45;
  --felt-mist: #2f6b52;
  --wood: #2c2118;
  --wood-edge: #4a3728;
  --ivory: #f3efe6;
  --ivory-muted: #cfc6b6;
  --ink: #1c1814;
  --gold: #c4a35a;
  --gold-soft: #e0c98a;
  --brand-gold: #d9b45a;
  --vul: #c45c4a;
  --club: #1a1a1a;
  --diamond: #c45c4a;
  --heart: #c45c4a;
  --spade: #1a1a1a;
  --panel: rgba(15, 36, 26, 0.92);
  --line: rgba(243, 239, 230, 0.12);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-brand: 'Cinzel', 'Times New Roman', serif;
  --font-sans: 'Outfit', 'Segoe UI', sans-serif;
  --bid-h: 0px;
  --dock-h: 120px;
  --nav-h: 48px;
  /* Strip target ~1.75× prior compact size; phone dials toward that within one row */
  --status-h: 72px;
  --strip-scale: 1.75;
  --pass: #2f9e5b;
  --dbl: #c04545;
  --rdbl: #3a6fd8;
  /*
   * Hand cards (BBO): JS sets --hand-peek from felt width so 13 strips nearly
   * span the table. Fallbacks below are used until the first layout pass.
   * Trick cards in the center use the full --card-* faces below.
   *
   * Card size (Settings → Display): ratios drive rank/suit fill of each peek.
   * Default = Large (Fred). Standard / BBO override via body[data-card-size].
   */
  /* Large defaults — between Standard and BBO fill */
  --card-face-rank-ratio: 0.84;
  --card-face-suit-ratio: 0.78;
  --card-face-h-ratio: 1.62;
  --card-face-inset-ratio: 0.12;
  --card-face-inset-min: 2.5;
  --card-face-inset-max: 4;
  --card-face-inset-floor: 2;
  --card-face-glyph-pad: 3;
  --card-face-weight: 750;
  --card-face-rank-lh: 0.86;
  --card-face-suit-lh: 0.88;
  --card-face-pad-top: 0.04rem;
  --card-face-suit-scale: 1.18;
  --hand-peek: clamp(24px, 7.2vw, 34px);
  --hand-card-w: var(--hand-peek);
  /* Compact N/S height: rank + suit + small margin (JS overrides from felt) */
  --hand-card-h: calc(var(--hand-peek) * var(--card-face-h-ratio));
  --hand-rank: calc(var(--hand-peek) * var(--card-face-rank-ratio));
  --hand-suit: calc(var(--hand-peek) * var(--card-face-suit-ratio));
  --hand-inset: clamp(
    calc(var(--card-face-inset-min) * 1px),
    1.6vw,
    calc(var(--card-face-inset-max) * 1px)
  );
  /* Full faces for played trick cards only */
  --card-w: clamp(54px, 14vw, 76px);
  --card-h: clamp(104px, 27.5vw, 140px);
  --card-rank: clamp(1.85rem, 8.4vw, 2.35rem);
  --card-suit: clamp(1.7rem, 8vw, 2.2rem);
  /*
   * Fixed trick face from the HAND peek face (not the oversized --card-* token).
   * ~1.2× visible hand face — fits the N–S gap at 375/390 with North dummy
   * (tightest case) with a small clear gap. Same for W/E dummy; never space-fit.
   */
  --trick-fixed-w: calc(var(--hand-peek) * 1.2);
  --trick-fixed-h: calc(var(--hand-card-h) * 1.2);
  --trick-fixed-gap: 0.12rem;
}

/* Standard: prior compact faces */
body[data-card-size="standard"] {
  --card-face-rank-ratio: 0.72;
  --card-face-suit-ratio: 0.64;
  --card-face-h-ratio: 1.48;
  --card-face-inset-ratio: 0.22;
  --card-face-inset-min: 5.5;
  --card-face-inset-max: 7;
  --card-face-inset-floor: 3.5;
  --card-face-glyph-pad: 4;
  --card-face-weight: 700;
  --card-face-rank-lh: 0.88;
  --card-face-suit-lh: 0.9;
  --card-face-pad-top: 0.06rem;
  --card-face-suit-scale: 1;
  --card-w: clamp(50px, 13.3vw, 72px);
  --card-h: clamp(98px, 26vw, 132px);
  --card-rank: clamp(1.6rem, 7.6vw, 2rem);
  --card-suit: clamp(1.4rem, 7vw, 1.9rem);
}

/* Large: between Standard and BBO fill */
body[data-card-size="large"] {
  --card-face-rank-ratio: 0.84;
  --card-face-suit-ratio: 0.78;
  --card-face-h-ratio: 1.62;
  --card-face-inset-ratio: 0.12;
  --card-face-inset-min: 2.5;
  --card-face-inset-max: 4;
  --card-face-inset-floor: 2;
  --card-face-glyph-pad: 3;
  --card-face-weight: 750;
  --card-face-rank-lh: 0.86;
  --card-face-suit-lh: 0.88;
  --card-face-pad-top: 0.04rem;
  --card-face-suit-scale: 1.18;
  --card-w: clamp(54px, 14vw, 76px);
  --card-h: clamp(104px, 27.5vw, 140px);
  --card-rank: clamp(1.85rem, 8.4vw, 2.35rem);
  --card-suit: clamp(1.7rem, 8vw, 2.2rem);
}

/* Explicit BBO (same as :root defaults; keeps data-attr path consistent) */
body[data-card-size="bbo"] {
  --card-face-rank-ratio: 0.96;
  --card-face-suit-ratio: 0.98;
  --card-face-h-ratio: 1.82;
  --card-face-inset-ratio: 0.04;
  --card-face-inset-min: 0.8;
  --card-face-inset-max: 1.8;
  --card-face-inset-floor: 0.8;
  --card-face-glyph-pad: 1.5;
  --card-face-weight: 800;
  --card-face-rank-lh: 0.8;
  --card-face-suit-lh: 0.82;
  --card-face-pad-top: 0.01rem;
  --card-face-suit-scale: 1.35;
  --card-w: clamp(56px, 14.5vw, 78px);
  --card-h: clamp(110px, 29vw, 148px);
  --card-rank: clamp(2.1rem, 9.5vw, 2.65rem);
  --card-suit: clamp(1.95rem, 9vw, 2.5rem);
}

body.four-color {
  --club: #1f7a4c;
  --diamond: #2f6fed;
  --heart: #c45c4a;
  --spade: #1a1a1a;
}

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

html {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  /* Never trap the document — short desktop windows must be able to scroll */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--ivory);
  background: var(--felt-deep);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-y: visible;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }

button, input {
  font: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--ink);
  font-weight: 600;
}
.btn--primary:hover { filter-color: #fff6; }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ivory);
}
.btn--ghost:hover { background: rgba(255,255,255,0.06); }
.btn--lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn--ghost[href] { display: inline-flex; }

/* —— Nav —— */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: var(--nav-h);
  padding: 0 0.75rem;
  background: rgba(12, 28, 20, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}
.app-nav__brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 58%;
  line-height: 1;
  text-decoration: none;
  color: var(--ivory);
}
.app-nav__brand-name {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 18px;
  color: #f3efe6;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.app-nav__brand-sub {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 8px;
  line-height: 1;
  color: #d9b45a;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding-left: 0.05em;
  white-space: nowrap;
}
.app-nav__links {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.app-nav__links > a {
  color: var(--ivory-muted);
  flex: 0 0 auto;
  white-space: nowrap;
}
.app-nav__links > a:hover { color: var(--ivory); }
.app-nav__more {
  position: relative;
  flex: 0 0 auto;
}
.app-nav__more-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  margin: 0;
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(196, 163, 90, 0.35);
  background: rgba(196, 163, 90, 0.12);
  color: var(--ivory, #f4efe4);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.app-nav__more-btn[aria-expanded="true"] {
  border-color: rgba(196, 163, 90, 0.7);
  background: rgba(196, 163, 90, 0.22);
}
.app-nav__more-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 50;
  min-width: 9.5rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(196, 163, 90, 0.35));
  background: #16281f;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.app-nav__more-menu[hidden] { display: none !important; }
.app-nav__more-menu a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: var(--ivory, #f4efe4);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}
.app-nav__more-menu a:hover,
.app-nav__more-menu a:focus {
  background: rgba(196, 163, 90, 0.16);
  color: var(--ivory, #f4efe4);
}
.app-nav__more-rule {
  border: 0;
  border-top: 1px solid rgba(196, 163, 90, 0.28);
  margin: 0.25rem 0.35rem;
}
@media (max-width: 430px) {
  .app-nav {
    padding: 0 0.55rem;
  }
  .app-nav__brand-name {
    font-size: 18px;
  }
  .app-nav__links {
    gap: 0.55rem;
    font-size: 0.88rem;
  }
}
@media (max-width: 390px) {
  .app-nav__links {
    gap: 0.5rem;
    font-size: 0.86rem;
  }
  .app-nav__brand {
    max-width: 52%;
  }
}
/* Table page already has the board-strip ☰ (History / Admin / Sign out). */
.page-table .app-nav__more {
  display: none;
}

/* —— Splash —— */
.page-splash {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(196, 163, 90, 0.18), transparent 60%),
    radial-gradient(ellipse 100% 80% at 80% 100%, rgba(36, 92, 69, 0.55), transparent 50%),
    linear-gradient(165deg, #0c1c14 0%, #1a3d2e 45%, #12291f 100%);
}
.splash {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
  overflow: hidden;
}
.splash__atmosphere {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, rgba(15, 36, 26, 0.55)),
    repeating-linear-gradient(
      -12deg,
      transparent 0 14px,
      rgba(255,255,255,0.015) 14px 15px
    );
  animation: mist 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes mist {
  from { opacity: 0.7; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-8px); }
}
.splash__content {
  position: relative;
  text-align: center;
  max-width: 28rem;
  animation: rise 700ms ease-out both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.splash__eyebrow {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
  margin: 0 0 1rem;
}
.splash__brand {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(2.4rem, 11vw, 3.6rem);
  line-height: 0.95;
  margin: 0;
  color: var(--ivory);
  text-shadow: 0 8px 30px rgba(0,0,0,0.35);
}
.splash__brand-sub {
  display: block;
  margin: 0.55rem 0 1rem;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(0.7rem, 2.8vw, 0.85rem);
  letter-spacing: 0.36em;
  color: #d9b45a;
  text-transform: uppercase;
}
.splash__tagline {
  margin: 0 0 2rem;
  color: var(--ivory-muted);
  font-size: 1.05rem;
  line-height: 1.45;
}
.splash__cta .btn {
  animation: pulse-cta 2.4s ease-in-out infinite;
}
@keyframes pulse-cta {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,163,90,0.35); }
  50% { box-shadow: 0 0 0 10px rgba(196,163,90,0); }
}

/* —— Login —— */
.page-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 0%, rgba(196,163,90,0.12), transparent 40%),
    linear-gradient(180deg, #12291f, #0c1c14);
}
.login__panel {
  width: min(100%, 22rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.75rem 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  animation: rise 500ms ease-out both;
}
.login__brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 0.85rem;
  line-height: 1;
  text-decoration: none;
  color: var(--ivory);
}
.login__brand-name {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.45rem;
  color: #f3efe6;
}
.login__brand-sub {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 0.55rem;
  letter-spacing: 0.32em;
  color: #d9b45a;
  text-transform: uppercase;
  padding-left: 0.05em;
}
.login__title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}
.login__hint--forgot {
  margin-top: 1rem;
  text-align: center;
}
.login__ok {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: rgba(61, 107, 79, 0.18);
  color: #cfe8d4;
  font-size: 0.95rem;
  line-height: 1.45;
}
.login__hint {
  margin: 0 0 1.25rem;
  color: var(--ivory-muted);
  font-size: 0.92rem;
}
.login__error {
  background: rgba(196, 92, 74, 0.18);
  border: 1px solid rgba(196, 92, 74, 0.45);
  color: #f0c2ba;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  font-size: 0.88rem;
  color: var(--ivory-muted);
}
.field input {
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--ivory);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}
.field input:focus {
  outline: 2px solid rgba(196,163,90,0.45);
}

/* —— Table app (BBO-inspired seated table + center phase) —— */
.page-table {
  min-height: 100dvh;
  background: var(--felt-deep);
  /* Do NOT use overflow:hidden here — it blocks page scroll in Edge/desktop. */
  overflow-x: hidden;
  overflow-y: visible;
}

.table-app {
  display: flex;
  flex-direction: column;
  /* Grow with content; document (html) scrolls when chrome exceeds the viewport */
  height: auto;
  min-height: calc(100dvh - var(--nav-h));
  max-height: none;
  overflow: visible;
}

.board-strip {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: calc(0.28rem * var(--strip-scale));
  min-height: var(--status-h);
  padding: calc(0.28rem * var(--strip-scale)) calc(0.34rem * var(--strip-scale));
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  overflow: visible;
}

/* IMP score window (left of board badge) — running session totals */
.score-box {
  flex-shrink: 0;
  min-width: calc(2.85rem * var(--strip-scale));
  padding: calc(0.14rem * var(--strip-scale)) calc(0.3rem * var(--strip-scale)) calc(0.18rem * var(--strip-scale));
  border-radius: calc(3px * var(--strip-scale));
  background: #f3efe6;
  border: 1px solid rgba(0, 0, 0, 0.45);
  color: #1a1a1a;
  font-size: calc(0.58rem * var(--strip-scale));
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.score-box__title {
  text-align: center;
  font-weight: 700;
  font-size: calc(0.55rem * var(--strip-scale));
  letter-spacing: 0.02em;
  margin-bottom: calc(0.04rem * var(--strip-scale));
}
.score-box__row {
  display: flex;
  justify-content: space-between;
  gap: calc(0.35rem * var(--strip-scale));
  font-weight: 600;
}

/* BBO-style board badge: number + 4 compass vul bars */
.board-badge {
  --badge-bar: calc(0.5rem * var(--strip-scale));
  --badge-vul: #c0392b;
  --badge-safe: #ece8e0;
  --badge-line: #6a655c;
  position: relative;
  width: calc(2.5rem * var(--strip-scale));
  height: calc(2.5rem * var(--strip-scale));
  flex-shrink: 0;
  border-radius: calc(4px * var(--strip-scale));
  background: #1c1c1c;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.board-badge__num {
  position: absolute;
  inset: var(--badge-bar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  background: #d8d4cc;
  color: #111;
  font-size: calc(1.02rem * var(--strip-scale));
  font-weight: 800;
  line-height: 1;
  border-radius: 1px;
  z-index: 2;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.18);
}
.board-badge__bd {
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}
.board-badge__num:has(.board-badge__hid:not([hidden])) .board-badge__bd {
  font-size: calc(0.88rem * var(--strip-scale));
}
.board-badge__hid {
  font-size: calc(0.48rem * var(--strip-scale));
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #333;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-badge__hid[hidden] { display: none !important; }
.board-badge__bar {
  position: absolute;
  display: grid;
  place-items: center;
  background: var(--badge-safe);
  border: 1px solid var(--badge-line);
  color: #1a1a1a;
  z-index: 1;
  box-sizing: border-box;
}
.board-badge__bar--N {
  top: 0;
  left: var(--badge-bar);
  right: var(--badge-bar);
  height: var(--badge-bar);
  border-radius: 2px 2px 0 0;
}
.board-badge__bar--S {
  bottom: 0;
  left: var(--badge-bar);
  right: var(--badge-bar);
  height: var(--badge-bar);
  border-radius: 0 0 2px 2px;
}
.board-badge__bar--W {
  left: 0;
  top: var(--badge-bar);
  bottom: var(--badge-bar);
  width: var(--badge-bar);
  border-radius: 2px 0 0 2px;
}
.board-badge__bar--E {
  right: 0;
  top: var(--badge-bar);
  bottom: var(--badge-bar);
  width: var(--badge-bar);
  border-radius: 0 2px 2px 0;
}
.board-badge__bar.is-vul {
  background: var(--badge-vul);
  border-color: #8f2a20;
  color: #fff;
}
.board-badge__d {
  display: none;
  font-size: calc(0.42rem * var(--strip-scale));
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.board-badge__bar.is-dealer .board-badge__d { display: block; }
.board-badge__bar--W .board-badge__d,
.board-badge__bar--E .board-badge__d {
  font-size: calc(0.38rem * var(--strip-scale));
}

.board-strip__turn {
  flex: 1;
  min-width: 0;
  margin: 0 0.15rem;
  color: var(--gold-soft);
  font-weight: 600;
  font-size: calc(0.68rem * var(--strip-scale));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.board-strip__turn[hidden] { display: none !important; }

/* BBO-style compact contract + last-trick / trick counters */
.contract-cluster {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: calc(0.18rem * var(--strip-scale));
  min-width: 0;
}
.contract-box {
  appearance: none;
  flex: 0 0 auto;
  min-width: calc(3.6rem * var(--strip-scale));
  max-width: calc(6.2rem * var(--strip-scale));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: calc(3px * var(--strip-scale));
  background: #d8d4cc;
  color: #111;
  cursor: pointer;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.contract-box:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.contract-box[aria-expanded="true"] {
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.7);
}
.contract-box__bid {
  display: block;
  padding: calc(0.22rem * var(--strip-scale)) calc(0.3rem * var(--strip-scale));
  font-size: calc(0.72rem * var(--strip-scale));
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  background: #e8e4dc;
}
.contract-box__tricks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(0, 0, 0, 0.2);
  width: 100%;
}
.contract-box__trick {
  display: grid;
  place-items: center;
  min-height: calc(1.15rem * var(--strip-scale));
  padding: calc(0.05rem * var(--strip-scale)) calc(0.2rem * var(--strip-scale));
  background: #1a6b6b;
  color: #fff;
  font-size: calc(0.78rem * var(--strip-scale));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Last-trick peek — felt bottom-right (not top strip, not trick-center South slot).
 * Top-strip NS/EW counts lived here before and duplicated the contract box. */
.last-trick-chip {
  appearance: none;
  display: grid;
  place-items: center;
  min-width: 2.1rem;
  min-height: 1.35rem;
  padding: 0.12rem 0.35rem;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 5px;
  background: rgba(232, 228, 220, 0.9);
  color: #111;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  z-index: 6;
}
.last-trick-chip--on-felt {
  position: absolute;
  right: 0.35rem;
  left: auto;
  /* SE gutter above South hand — high enough to clear fan + name chip */
  bottom: clamp(7.2rem, calc(var(--hand-card-h, 3.6rem) + 3.2rem), 11rem);
  transform: none;
  z-index: 12;
}
/* East dummy owns the right side — park LAST on the SW gutter instead */
.felt[data-phase="play"].play-dummy-E .last-trick-chip--on-felt {
  right: auto;
  left: 0.35rem;
}
/* West dummy owns the left side — keep LAST on the SE gutter */
.felt[data-phase="play"].play-dummy-W .last-trick-chip--on-felt {
  right: 0.35rem;
  left: auto;
}
.last-trick-chip[hidden] { display: none !important; }
.last-trick-chip:disabled {
  opacity: 0.45;
  cursor: default;
}
.last-trick-chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.last-trick-chip.is-active {
  box-shadow: 0 0 0 2px rgba(196, 163, 90, 0.85);
  background: #fff8e6;
}
.last-trick-chip__tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.board-strip__actions {
  display: flex;
  align-items: center;
  gap: calc(0.22rem * var(--strip-scale));
  margin-left: auto;
  flex-shrink: 0;
  overflow: visible;
}
.strip-btn {
  appearance: none;
  border: 0;
  border-radius: calc(4px * var(--strip-scale));
  min-height: calc(2rem * var(--strip-scale));
  padding: calc(0.28rem * var(--strip-scale)) calc(0.48rem * var(--strip-scale));
  background: #1e4f8c;
  color: #fff;
  font-size: calc(0.72rem * var(--strip-scale));
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
}
.strip-btn:disabled {
  opacity: 0.42;
  cursor: default;
}
.strip-btn[hidden] { display: none !important; }
.strip-btn--claim,
.strip-btn--other {
  background: #1e4f8c;
}
.strip-btn__full { display: none; }
.strip-btn__short { display: inline; }

.menu-anchor {
  position: relative;
  flex-shrink: 0;
  z-index: 62;
}
.menu-btn {
  position: relative;
  flex-shrink: 0;
  width: calc(2rem * var(--strip-scale));
  height: calc(2rem * var(--strip-scale));
  border-radius: calc(4px * var(--strip-scale));
  border: 0;
  background: #1e4f8c;
  color: #fff;
  font-size: calc(1.05rem * var(--strip-scale));
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 63;
}
.menu-btn[aria-expanded="true"] {
  background: #2a6ab8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
/* Play review sheet is below .menu-btn (z-index 63). Hide the strip ☰ while
 * review is open so it cannot float over North's cards; ✕ closes review. */
body.has-play-review .menu-anchor {
  display: none !important;
}
.menu-btn__dot,
.tools-menu__item-dot {
  position: absolute;
  top: 0.18rem;
  right: 0.18rem;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #e8b84a;
  box-shadow: 0 0 0 1.5px #1e4f8c;
  pointer-events: none;
}
.tools-menu__item-dot {
  top: 0.55rem;
  right: 0.65rem;
  box-shadow: 0 0 0 1.5px rgba(22, 40, 31, 0.95);
}
.menu-btn__dot[hidden],
.tools-menu__item-dot[hidden] { display: none !important; }
.tools-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 61;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: default;
}
.tools-menu-backdrop[hidden] { display: none !important; }

/* Shared sheet chrome (auction + Other tables) */
.sheet-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.2rem 0.45rem;
  flex-shrink: 0;
}
.sheet-head__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}
.sheet-close {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.sheet-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* Auction history popover from contract box */
.auction-popover {
  position: fixed;
  inset: 0;
  /* Above play-review sheet (58) so Auction from review stays usable */
  z-index: 70;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--nav-h) + var(--status-h) + 0.35rem) 0.6rem 1rem;
  pointer-events: none;
}
.auction-popover[hidden] { display: none !important; }
.auction-popover:not([hidden]) { pointer-events: auto; }
.auction-popover__backdrop {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 0;
}
.auction-popover__panel {
  position: relative;
  z-index: 1;
  width: min(22rem, 100%);
  max-height: min(70vh, 32rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f3efe6;
  color: var(--ink);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  padding: 0.45rem 0.5rem 0.55rem;
  pointer-events: auto;
  overscroll-behavior: contain;
}
.auction-popover__panel .sheet-head {
  color: #3a3428;
  margin-bottom: 0.25rem;
}
.auction-popover__panel .sheet-close {
  background: rgba(0, 0, 0, 0.08);
  color: #3a3428;
}
.auction-popover__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.auction-popover__hint {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: #6a5a40;
  text-align: center;
}
.auction-popover__meaning {
  margin-top: 0.4rem;
  padding: 0.4rem 0.45rem;
  background: #fff;
  border: 1px solid rgba(58, 52, 40, 0.14);
  border-radius: 8px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #3a3428;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.auction-popover__meaning[hidden] { display: none !important; }
.auction-grid--popover {
  font-size: 0.82rem;
}
.auction-grid--popover .auction-grid__cell {
  min-height: 1.35rem;
  font-size: 0.78rem;
}

/* Other-tables — body-level full-screen ivory sheet (covers sticky .app-nav) */
body.has-field-sheet {
  overflow: hidden;
}
.field-popover {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 70; /* above .app-nav (40) and play-review (58) */
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  background: #f7f4ec;
  pointer-events: none;
}
.field-popover[hidden] { display: none !important; }
.field-popover:not([hidden]) { pointer-events: auto; }
.field-popover__backdrop {
  display: none;
}
.field-popover__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: #f7f4ec;
  color: #1c1914;
  border-radius: 0;
  pointer-events: auto;
  box-sizing: border-box;
}
@media (max-width: 420px) {
  .auction-popover__panel {
    max-height: min(55vh, 24rem);
  }
}
.field-popover .field-review {
  margin: 0;
  min-height: min-content;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #1c1914;
  padding: 0 0.85rem calc(1rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.field-popover .field-list-pane,
.field-popover .field-auction-pane {
  overflow: visible;
  min-height: 0;
  flex: 0 0 auto;
  gap: 0.55rem;
}
.field-popover .field-review__head.sheet-head,
.field-popover .field-auction-pane__head.sheet-head {
  position: sticky;
  top: 0;
  z-index: 3;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin: 0 -0.85rem;
  /* iOS notch / Dynamic Island — keep ✕ Close fully below the status bar */
  padding:
    calc(0.65rem + env(safe-area-inset-top, 0px))
    0.85rem
    0.55rem;
  background: #f7f4ec;
  border-bottom: 1px solid rgba(58, 52, 40, 0.14);
  color: #3a3428;
}
.field-popover .field-review__head.sheet-head {
  grid-template-columns: 1fr auto;
}
.field-popover .field-auction-pane__head.sheet-head {
  grid-template-columns: auto 1fr auto;
}
.field-popover .field-review__spread {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
  color: #5a5348;
  font-size: 0.82rem;
  line-height: 1.4;
}
.field-popover .field-review__title {
  color: #1c1914;
  font-size: 1.05rem;
  font-weight: 700;
}
.field-review__hid {
  margin-left: 0.35rem;
  font-size: 0.85em;
  font-weight: 650;
  color: #6a655c;
  letter-spacing: -0.02em;
}
.field-review__hid[hidden] { display: none !important; }
.field-popover .field-review__hid {
  color: #5a5348;
}
.sheet-back-label,
.sheet-close-label {
  appearance: none;
  border: 1px solid rgba(58, 52, 40, 0.22);
  margin: 0;
  padding: 0.55rem 0.85rem;
  min-height: 44px;
  min-width: 44px;
  border-radius: 10px;
  background: #fff;
  color: #1c1914;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  box-sizing: border-box;
}
.sheet-back-label:focus-visible,
.sheet-close-label:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.field-sheet-close-bottom {
  display: flex;
  width: 100%;
  max-width: 22rem;
  margin: 0.35rem auto 0.25rem;
  min-height: 44px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  box-sizing: border-box;
}
.field-popover .sheet-close,
.field-popover .sheet-back {
  background: #fff;
  color: #1c1914;
  border: 1px solid rgba(58, 52, 40, 0.22);
}
.field-popover .field-review__you {
  margin: 0;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  background: rgba(217, 180, 90, 0.18);
  border: 1px solid rgba(196, 163, 90, 0.45);
  color: #1c1914;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 600;
}
.field-popover .field-review__makeable {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #3a3428;
}
/* Force red/black suits on the ivory sheet (beats four-color + emoji fonts). */
.field-popover .suit-H,
.field-popover .suit-D,
.field-popover .field-review__makeable .suit-H,
.field-popover .field-review__makeable .suit-D,
.field-popover .field-review__you .suit-H,
.field-popover .field-review__you .suit-D,
.field-popover .field-table .suit-H,
.field-popover .field-table .suit-D {
  color: #a12828 !important;
  -webkit-text-fill-color: #a12828;
  font-weight: 700;
}
.field-popover .suit-S,
.field-popover .suit-C,
.field-popover .field-review__makeable .suit-S,
.field-popover .field-review__makeable .suit-C,
.field-popover .field-review__you .suit-S,
.field-popover .field-review__you .suit-C,
.field-popover .field-table .suit-S,
.field-popover .field-table .suit-C {
  color: #1a1a1a !important;
  -webkit-text-fill-color: #1a1a1a;
  font-weight: 700;
}
.field-popover .field-review__scroll {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  border: 1px solid rgba(58, 52, 40, 0.14);
  border-radius: 10px;
  background: #fff;
}
.field-popover .field-review__note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #6a5a40;
}
.field-popover .field-table {
  font-size: 0.8rem;
  table-layout: fixed;
}
.field-popover .field-table th,
.field-popover .field-table td {
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid rgba(58, 52, 40, 0.1);
  color: #1c1914;
  vertical-align: top;
  word-break: break-word;
}
.field-popover .field-table th {
  color: #5a5348;
  background: #f0ebe0;
  position: static;
}
.field-popover .field-table .field-col-num {
  width: 1.6rem;
  text-align: center;
  white-space: nowrap;
  padding-left: 0.3rem;
  padding-right: 0.2rem;
}
.field-popover .field-table .field-col-style {
  width: 4.4rem;
  max-width: 4.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-popover .field-table .field-col-result {
  width: auto;
  white-space: nowrap;
}
.field-popover .field-table .field-col-ns,
.field-popover .field-table .field-col-imps {
  width: 3.4rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.field-popover .field-table .field-col-imps.is-plus { color: #1f6b3a; }
.field-popover .field-table .field-col-imps.is-minus { color: #a12828; }
.field-popover .field-table .field-sort {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.15rem 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  min-width: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}
.field-popover .field-table .field-sort.is-active {
  color: #1c1914;
}
.field-popover .field-table tr.is-you td {
  background: rgba(217, 180, 90, 0.22);
  color: #1c1914;
  font-weight: 650;
}
.field-popover .field-table tr.is-tappable:active td,
.field-popover .field-table tr.is-tappable:focus-visible td {
  background: rgba(196, 163, 90, 0.16);
}
.field-popover .field-table tr.is-you.is-tappable:active td,
.field-popover .field-table tr.is-you.is-tappable:focus-visible td {
  background: rgba(217, 180, 90, 0.34);
}
.field-popover .field-auction-pane__meta {
  color: #5a5348;
}
.field-popover .field-auction-pane__scroll {
  overflow: visible;
  min-height: 0;
}
.field-popover .field-auction-pane__missing {
  background: rgba(58, 52, 40, 0.05);
  border-color: rgba(58, 52, 40, 0.22);
  color: #5a5348;
}
.field-popover .field-auction-pane .auction-grid--popover {
  background: #fff;
  border: 1px solid rgba(58, 52, 40, 0.14);
  color: #1c1914;
}
.field-popover .field-auction-pane__meaning {
  background: #fff;
  border-color: rgba(196, 163, 90, 0.4);
  color: #1c1914;
}
.field-popover .field-auction-pane__summary > div {
  background: #fff;
  border: 1px solid rgba(58, 52, 40, 0.1);
}
.field-popover .field-auction-pane__summary dt {
  color: #5a5348;
}
.field-popover .field-auction-pane__summary dd {
  color: #1c1914;
}

/*
 * Phone 390px: land near ~1.55× prior strip (true 2× overflows with Other).
 * iPad/desktop keep --strip-scale 1.75 (~2× look with room for "Other tables").
 */
@media (max-width: 420px) {
  :root {
    /*
     * Largest stable one-row scale with Other + fixed-width contract (~1.35× prior).
     * True 2× overflows 390px once Other is added; iPad uses ~1.85×.
     */
    --strip-scale: 1.35;
    --status-h: 56px;
  }
  .board-strip {
    gap: 0.16rem;
    padding: 0.16rem 0.2rem;
  }
  .score-box {
    /* Fixed so "NS −12.5" cannot push actions off the 390px row */
    width: 3.55rem;
    min-width: 3.55rem;
    max-width: 3.55rem;
    padding: 0.12rem 0.18rem 0.14rem;
    overflow: hidden;
  }
  .contract-box {
    /* Fixed width: compact "2♥ N" / "3NTX E" never truncates or shoves the menu */
    width: 4.35rem;
    min-width: 4.35rem;
    max-width: 4.35rem;
  }
  .contract-box__bid {
    font-size: 0.88rem;
    padding: 0.18rem 0.16rem;
  }
  .contract-box__trick {
    min-height: 1.3rem;
    font-size: 0.92rem;
  }
  .last-trick-chip {
    width: 3.55rem;
    min-width: 3.55rem;
    max-width: 3.55rem;
    min-height: 2.55rem;
  }
  .last-trick-chip__tag {
    font-size: 0.72rem;
    padding: 0.12rem 0.1rem;
  }
  .strip-btn {
    padding: 0.28rem 0.26rem;
    min-height: 2.3rem;
    font-size: 0.82rem;
  }
  .menu-btn {
    width: 2.3rem;
    height: 2.3rem;
    font-size: 1.12rem;
  }
}

@media (min-width: 768px) {
  :root {
    --strip-scale: 1.85;
    --status-h: 78px;
  }
  .strip-btn__full { display: inline; }
  .strip-btn__short { display: none; }
  .contract-box {
    max-width: 9rem;
  }
  .last-trick-chip {
    min-width: 4.4rem;
    min-height: 3.1rem;
  }
  .last-trick-chip__tag {
    font-size: 0.78rem;
  }
}

.tools-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 64;
  display: block;
  padding: 0;
  background: transparent;
  /* Keep hamburger visible above the panel while open */
}
.tools-menu[hidden] { display: none !important; }
.tools-menu__profile {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}
.tools-menu__profile-user {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ivory-muted);
}
.tools-menu__profile-user strong {
  color: var(--gold-soft);
  font-weight: 650;
}
.tools-menu__profile-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--ivory-muted);
  opacity: 0.9;
}
.tools-menu__profile-status {
  margin: 0;
  font-size: 0.78rem;
  color: var(--gold-soft);
}
.tools-menu__profile-status.is-error {
  color: #f0a0a0;
}
.tools-menu__rule {
  border: 0;
  border-top: 1px solid rgba(196, 163, 90, 0.28);
  margin: 0.55rem 0 0.7rem;
}
.field--nickname {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}
.field--nickname span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-soft);
}
.field--nickname input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid rgba(196, 163, 90, 0.4);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ivory, #f4efe4);
  padding: 0.5rem 0.65rem;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.field--nickname input:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
}
.nickname-modal__lede {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--ivory-muted);
}
.nickname-modal__status {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--gold-soft);
}
.nickname-modal__status.is-error {
  color: #f0a0a0;
}
.history__who {
  margin: 0.15rem 0 0.55rem;
  font-size: 0.9rem;
  color: var(--ivory-muted);
}
.history__who strong {
  color: var(--gold-soft);
}
.flags__by {
  color: var(--gold-soft);
  font-weight: 650;
  font-size: 0.85rem;
}
.tools-menu__inner {
  width: min(92vw, 18rem);
  background: #16281f;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.9rem 0.9rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.tools-menu__inner--slim {
  width: min(92vw, 14rem);
  padding: 0.55rem;
  gap: 0.4rem;
}
.tools-menu__settings-btn {
  appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(196, 163, 90, 0.45);
  background: rgba(196, 163, 90, 0.16);
  color: var(--ivory, #f4efe4);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}
.about-sheet {
  position: fixed;
  inset: 0;
  z-index: 72;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.about-sheet[hidden] { display: none !important; }
.about-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.about-sheet__panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 22rem);
  background: #16281f;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.95rem 1rem;
  box-shadow: var(--shadow);
  color: var(--ivory, #f4efe4);
}
.about-sheet__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.about-sheet__app {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-soft, #e8d5a3);
}
.about-sheet__meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ivory-muted, #c8c0b0);
  word-break: break-all;
}
.about-sheet__update {
  margin-top: 0.65rem;
  min-height: 48px;
  width: 100%;
}
.about-sheet__update[hidden] { display: none !important; }
a.tools-menu__settings-btn:hover,
a.tools-menu__settings-btn:focus {
  color: var(--ivory, #f4efe4);
  text-decoration: none;
}
.tools-menu__settings-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.tools-menu__actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.tools-menu__actions .btn { width: 100%; justify-content: center; }
.tools-menu__status {
  margin: 0;
  min-height: 1rem;
  font-size: 0.8rem;
  color: var(--gold-soft);
}
.tools-menu__close { margin-top: 0.2rem; }
.tools-menu__settings-btn--quiet {
  border-color: rgba(196, 163, 90, 0.28);
  background: rgba(0, 0, 0, 0.18);
  font-weight: 650;
  min-height: 44px;
  font-size: 0.98rem;
}
.settings-choice__options--wrap {
  flex-wrap: wrap;
}
.auction-review-pause {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.75rem;
  margin: 0.55rem 0.35rem 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(196, 163, 90, 0.14);
  border: 1px solid rgba(196, 163, 90, 0.4);
}
.auction-review-pause[hidden] { display: none !important; }
.auction-review-pause__label {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ivory, #f4efe4);
  letter-spacing: 0.01em;
}
.auction-review-pause__start {
  min-height: 44px;
  padding-inline: 1rem;
  font-weight: 700;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--ivory-muted);
  cursor: pointer;
}

/* Settings — body-level ivory sheet covering sticky .app-nav (like Other Tables) */
body.has-settings-sheet {
  overflow: hidden;
}
.settings-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 72;
  display: flex;
  flex-direction: column;
  background: #f7f4ec;
  pointer-events: auto;
}
.settings-sheet[hidden] { display: none !important; }
.settings-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7f4ec;
  color: #1c1914;
  box-sizing: border-box;
}
.settings-sheet__head.sheet-head {
  position: sticky;
  top: 0;
  z-index: 3;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin: 0;
  padding:
    calc(0.65rem + env(safe-area-inset-top, 0px))
    0.85rem
    0.55rem;
  background: #f7f4ec;
  border-bottom: 1px solid rgba(58, 52, 40, 0.14);
  color: #1c1914;
}
.settings-sheet__head .sheet-head__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  color: #1c1914;
}
.settings-sheet__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.75rem 0.85rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.settings-section {
  margin: 0 0 1rem;
  padding: 0.85rem 0.85rem 0.95rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(58, 52, 40, 0.12);
  box-shadow: 0 1px 2px rgba(28, 25, 20, 0.04);
}
.settings-section__title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6a6154;
}
.settings-section__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.settings-section__actions .btn {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 650;
}
.settings-sheet__profile-user {
  margin: 0;
  font-size: 0.9rem;
  color: #5a5348;
}
.settings-sheet__profile-user strong {
  color: #1c1914;
  font-weight: 700;
}
.settings-sheet__hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #6a6154;
}
.settings-sheet__rule {
  border: 0;
  border-top: 1px solid rgba(58, 52, 40, 0.14);
  margin: 1rem 0 0.85rem;
}
.settings-sheet__subhead {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1c1914;
}
.settings-password {
  display: grid;
  gap: 0.65rem;
}
.settings-password .field span {
  color: #3a3428;
}
.settings-password .field input {
  background: #f7f4ec;
  color: #1c1914;
  border: 1px solid rgba(58, 52, 40, 0.22);
  min-height: 44px;
  font-size: 1rem;
}
.settings-sheet__status {
  margin: 0;
  min-height: 1rem;
  font-size: 0.82rem;
  color: #3d6b4f;
}
.settings-sheet__status.is-error {
  color: #a33a3a;
}
.settings-sheet .field--nickname span {
  color: #3a3428;
}
.settings-sheet .field--nickname input {
  background: #f7f4ec;
  color: #1c1914;
  border: 1px solid rgba(58, 52, 40, 0.22);
  min-height: 48px;
  font-size: 1.05rem;
}
.settings-sheet .toggle--settings {
  min-height: 48px;
  padding: 0.35rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1c1914;
  gap: 0.65rem;
}
.settings-sheet .toggle--settings input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #1a3d2e;
}
.settings-sheet .toggle--nested {
  padding-left: 1.35rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.settings-sheet .toggle--nested.is-disabled {
  opacity: 0.45;
}
.settings-sheet__hint--nested {
  padding-left: 1.35rem;
}
.settings-choice {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.settings-choice__label {
  font-size: 1rem;
  font-weight: 600;
  color: #1c1914;
}
.settings-choice__options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}
.settings-choice__opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.4rem 0.35rem;
  border-radius: 10px;
  border: 1.5px solid rgba(58, 52, 40, 0.22);
  background: #f7f4ec;
  color: #1c1914;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  text-align: center;
  user-select: none;
}
.settings-choice__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.settings-choice__opt:has(input:checked),
.settings-choice__opt.is-selected {
  border-color: #1a3d2e;
  background: #e7f0ea;
  color: #0f241a;
  box-shadow: inset 0 0 0 1px #1a3d2e;
}
.settings-choice__opt:has(input:focus-visible) {
  outline: 2px solid #1a3d2e;
  outline-offset: 2px;
}
.settings-sheet__close-bottom {
  display: flex;
  width: 100%;
  max-width: 22rem;
  margin: 0.35rem auto 0.15rem;
  min-height: 48px;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 700;
  box-sizing: border-box;
  justify-content: center;
}

/* Home-screen update nudge — unobtrusive, above the dock */
.update-pill {
  position: fixed;
  left: 50%;
  bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 80;
  margin: 0;
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(196, 163, 90, 0.65);
  border-radius: 999px;
  background: rgba(15, 36, 26, 0.94);
  color: #f3efe6;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  max-width: calc(100vw - 1.5rem);
  white-space: nowrap;
}
.update-pill[hidden] { display: none !important; }
.update-pill:focus-visible {
  outline: 2px solid #e0c98a;
  outline-offset: 2px;
}
body.has-settings-sheet .update-pill,
body.has-history-sheet .update-pill {
  display: none !important;
}

/* Square card table — width = height, sized to the phone width (~390×390).
 * Holds N/E/W/S seats + trick center. Auction/bid pad live in .below-table. */
.felt {
  position: relative; /* anchors .eoh-result + .deal-status overlays */
  flex: 0 0 auto; /* never shrink when EOH results/buttons appear below */
  /* Square table; --below-reserve leaves room for auction/bid on short-wide */
  --below-reserve: 0px;
  --felt-max-h: calc(100dvh - var(--nav-h) - var(--status-h) - var(--below-reserve) - 0.8rem);
  width: min(calc(100% - 0.6rem), var(--felt-max-h));
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  max-height: var(--felt-max-h);
  min-height: 0;
  margin: 0.3rem auto;
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
  grid-template-rows: auto minmax(0, 1fr) auto;
  /* N/S span full width (BBO) so labels + 10 peeks aren't crushed by E/W columns */
  grid-template-areas:
    "N N N"
    "W C E"
    "S S S";
  gap: 0.25rem 0.25rem;
  padding: 0.35rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 45%, var(--felt-mist), var(--felt) 55%, var(--felt-deep)),
    var(--felt);
  border: 3px solid var(--wood-edge);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.35), var(--shadow);
  box-sizing: border-box;
}

/* Immediate end-of-hand result — absolute overlay on the felt (not a grid item).
   Must never participate in the N/W/C/E/S grid or side hands get vertically crushed.
   Three short lines so the pill fits the ~70px W↔E gap at 390px. */
.eoh-result {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 18; /* above W/E peeks, below popovers */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  width: max-content;
  /* Stay inside the centre corridor between W/E columns (see EW_CENTRE_MIN_PX). */
  max-width: min(4.55rem, 22vw);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  text-align: center;
  pointer-events: none;
  box-sizing: border-box;
  color: #fff;
}
.eoh-result[hidden] { display: none !important; }
.eoh-result.is-made {
  background: #1f7a3d;
}
.eoh-result.is-down {
  background: #b02a2a;
}
.eoh-result__contract,
.eoh-result__outcome,
.eoh-result__tricks {
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  color: #fff;
}
.eoh-result__contract {
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}
.eoh-result__contract .suit-H,
.eoh-result__contract .suit-D { color: #ffc9c9; }
.eoh-result__contract .suit-S,
.eoh-result__contract .suit-C { color: #ffffff; }
.eoh-result__outcome {
  font-size: 0.82rem;
}
.eoh-result__tricks {
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  opacity: 0.95;
}
@media (min-width: 480px) {
  .eoh-result {
    max-width: 7.5rem;
    padding: 8px 14px;
    gap: 0.16rem;
  }
  .eoh-result__contract { font-size: 0.95rem; }
  .eoh-result__outcome { font-size: 0.88rem; }
  .eoh-result__tricks { font-size: 0.78rem; }
}
.felt[data-phase="bidding"] {
  /* Same compass layout while bidding — auction is below the table */
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "N N N"
    "W C E"
    "S S S";
}
.felt__seat--N { grid-area: N; justify-self: stretch; max-width: 100%; }
.felt__seat--W { grid-area: W; align-self: stretch; justify-self: stretch; }
.felt__seat--E { grid-area: E; align-self: stretch; justify-self: stretch; }
.felt__seat--S { grid-area: S; justify-self: stretch; }

.seat-box {
  position: relative;
  border-radius: 10px;
  padding: 0.15rem 0.2rem;
  background: rgba(0,0,0,0.18);
  border: 2px solid transparent;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.seat-box.is-turn {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(196,163,90,0.45), 0 0 14px rgba(196,163,90,0.25);
  background: rgba(196,163,90,0.12);
}

/* Friendly turn nudge — speech-bubble toast near the seat (gold, soft pulse). */
.turn-nudge {
  position: absolute;
  z-index: 30;
  max-width: min(14.5rem, 78vw);
  padding: 0.38rem 0.7rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(42, 36, 22, 0.96), rgba(28, 24, 16, 0.96));
  border: 1.5px solid var(--gold);
  box-shadow:
    0 0 0 1px rgba(196, 163, 90, 0.28),
    0 6px 18px rgba(0, 0, 0, 0.35);
  color: var(--gold-soft);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  animation: turn-nudge-pulse 2s ease-in-out infinite;
}
.turn-nudge::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 7px solid transparent;
}
/* Anchored to .seat-box__chip — keep clear of the center trick cross. */
.seat-box__chip {
  position: relative;
}
.turn-nudge--S {
  /* Pin to top of South chip, hang down — stays in felt, clear of header/trick. */
  left: auto;
  right: 0.1rem;
  top: 0.08rem;
  bottom: auto;
  transform: none;
  max-width: min(7.8rem, 40vw);
  font-size: 0.7rem;
  padding: 0.2rem 0.42rem;
  line-height: 1.2;
}
.turn-nudge--S::after {
  display: none;
}
.turn-nudge--N {
  /* Pin to top of North chip, hang down — never into IMPs/scoreboard. */
  left: auto;
  right: 0.1rem;
  top: 0.08rem;
  bottom: auto;
  transform: none;
  max-width: min(7.8rem, 40vw);
  font-size: 0.7rem;
  padding: 0.2rem 0.42rem;
  line-height: 1.2;
}
.turn-nudge--N::after {
  display: none;
}
.turn-nudge--W {
  /* To the right of the West chip, still outside the trick cross. */
  left: calc(100% + 0.2rem);
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  max-width: min(7.5rem, 40vw);
}
.turn-nudge--W::after {
  right: 100%;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--gold);
  border-left-width: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
}
.turn-nudge--E {
  left: auto;
  right: calc(100% + 0.2rem);
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  max-width: min(7.5rem, 40vw);
}
.turn-nudge--E::after {
  left: 100%;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--gold);
  border-right-width: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
}
/* Play: keep nudge + trick inside the felt (no scoreboard bleed). */
.felt[data-phase="play"] {
  overflow: hidden;
}
.felt[data-phase="play"] .turn-nudge {
  z-index: 14;
  background: linear-gradient(180deg, rgba(42, 36, 22, 0.92), rgba(28, 24, 16, 0.9));
}
.felt[data-phase="play"] .seat-box__chip {
  overflow: visible;
}
@keyframes turn-nudge-pulse {
  0%, 100% {
    opacity: 0.92;
    filter: brightness(1);
    box-shadow:
      0 0 0 1px rgba(196, 163, 90, 0.28),
      0 6px 18px rgba(0, 0, 0, 0.35);
  }
  50% {
    opacity: 1;
    filter: brightness(1.08);
    box-shadow:
      0 0 0 1px rgba(224, 201, 138, 0.45),
      0 6px 20px rgba(196, 163, 90, 0.28),
      0 0 14px rgba(196, 163, 90, 0.22);
  }
}
@media (prefers-reduced-motion: reduce) {
  .turn-nudge { animation: none; }
}
.seat-box.is-vul .seat-box__dir {
  background: var(--vul);
}
.seat-box__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.seat-box__chip--static { cursor: default; }
.seat-box__dir {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 4px;
  background: #1f7a4c;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.seat-box__name {
  color: var(--ivory-muted);
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/*
 * Seat bid sequences — auction only (hidden once auction completes).
 * Upright pills; N/S under the name bar; W/E vertical column on the table
 * side of the name chip. Sized ~2× the old phone pills; scale with felt via
 * vmin so desktop/iPad stay proportional. Never cover name bars or the trick.
 */
.felt {
  /* Phone portrait (~390): ~2× prior 0.7rem / tight padding. Larger viewports
   * grow with the smaller viewport axis (proxy for felt size). */
  --bid-pill-fs: clamp(1.35rem, 0.95rem + 1.55vmin, 1.75rem);
  --bid-pill-pad-y: clamp(0.16rem, 0.1rem + 0.35vmin, 0.28rem);
  --bid-pill-pad-x: clamp(0.5rem, 0.32rem + 0.75vmin, 0.78rem);
  --bid-pill-min: clamp(1.9rem, 1.25rem + 2vmin, 2.55rem);
  --bid-pill-gap: clamp(0.16rem, 0.1rem + 0.35vmin, 0.28rem);
  --bid-pill-pass-min: clamp(1.7rem, 1.15rem + 1.7vmin, 2.2rem);
  --bid-ew-inset: clamp(2.35rem, 1.7rem + 1.8vmin, 3.1rem);
  --bid-ew-col-max: clamp(4.4rem, 3.2rem + 3.2vmin, 5.6rem);
}
.seat-box__bid {
  z-index: 8;
  display: flex;
  align-items: center;
  align-content: center;
  gap: var(--bid-pill-gap);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.seat-box__bid[hidden] { display: none !important; }
.seat-box__bid-call {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--bid-pill-min);
  padding: var(--bid-pill-pad-y) var(--bid-pill-pad-x);
  border-radius: 999px;
  border: 1px solid rgba(28, 25, 20, 0.22);
  background: #f7f4ec;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  color: #1c1914;
  font-size: var(--bid-pill-fs);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-sizing: border-box;
}
.seat-box__bid-call .suit-C { color: var(--club); }
.seat-box__bid-call .suit-D { color: var(--diamond); }
.seat-box__bid-call .suit-H { color: var(--heart); }
.seat-box__bid-call .suit-S { color: var(--spade); }
.seat-box__bid-call.is-pass {
  background: #e8eee9;
  color: #2a4034;
  font-weight: 750;
  min-width: var(--bid-pill-pass-min);
  padding-left: var(--bid-pill-pad-x);
  padding-right: var(--bid-pill-pad-x);
}
.seat-box__bid-call.is-dbl,
.seat-box__bid-call.is-rdbl {
  background: #f8e0dc;
  color: #c02828;
  font-weight: 900;
  border-color: rgba(192, 40, 40, 0.35);
}
/* N/S: own line under the name bar, centered on the table */
.felt__seat--N .seat-box__bid,
.felt__seat--S .seat-box__bid {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  max-height: calc(var(--bid-pill-fs) * 2.6);
  overflow-x: auto;
  overflow-y: hidden;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  writing-mode: horizontal-tb;
  transform: none;
  /* Sit in the seat strip flow — never over the name chip or trick cards */
  z-index: 7;
}
/*
 * E/W: upright (no rotate) vertical stack on the table side of the name chip,
 * vertically centered on the bar. Long auctions wrap to a 2nd column (never
 * clip the first calls at the top; never cover the name chip).
 */
.felt__seat--W .seat-box__bid,
.felt__seat--E .seat-box__bid {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: horizontal-tb;
  width: max-content;
  max-width: var(--bid-ew-col-max); /* up to two larger pill columns */
  height: min(14rem, 68%);
  max-height: min(14rem, 68%);
  overflow: visible;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  align-content: flex-start;
  gap: var(--bid-pill-gap);
  z-index: 7;
}
.felt__seat--W .seat-box__bid {
  left: var(--bid-ew-inset); /* table side of West chip — clear of the label */
  right: auto;
}
.felt__seat--E .seat-box__bid {
  right: var(--bid-ew-inset);
  left: auto;
}
.felt__seat--W .seat-box__bid .seat-box__bid-call,
.felt__seat--E .seat-box__bid .seat-box__bid-call {
  /* Same readable size as N/S — do not shrink side pills back down */
  min-width: var(--bid-pill-pass-min);
  padding: var(--bid-pill-pad-y) var(--bid-pill-pad-x);
  font-size: var(--bid-pill-fs);
}
/* Keep the upright column visible even when side columns are overflow:hidden */
.felt__seat--W:has(.seat-box__bid:not([hidden])),
.felt__seat--E:has(.seat-box__bid:not([hidden])) {
  overflow: visible;
}
/* Name chip stays above bid pills so enlarged bubbles never cover the label */
.felt__seat--N .seat-box__chip,
.felt__seat--S .seat-box__chip,
.felt__seat--W .seat-box__chip,
.felt__seat--E .seat-box__chip {
  position: relative;
  z-index: 9;
}
/* Trick / played cards stay above seat bid chrome (bids are hidden in play) */
.felt .phase--play,
.felt .trick-area {
  position: relative;
  z-index: 10;
}

/*
 * BBO seat strips: name bar attached to the hand; cards sit on the felt
 * inside the strip (N bar above hand, S bar below hand, E/W vertical).
 */
.felt__seat--N {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.08rem;
  width: 100%;
  max-width: 100%;
  z-index: 6;
  padding: 0.1rem 0.15rem 0.15rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(196, 163, 90, 0.28);
  border-radius: 8px;
  overflow: visible;
  box-sizing: border-box;
}
.felt__seat--N .seat-box__chip {
  width: 100%;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.12rem 0.35rem;
  background: rgba(196, 163, 90, 0.18);
  border-radius: 4px;
  box-sizing: border-box;
  overflow: visible;
  flex-shrink: 0;
}
.felt__seat--S {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.08rem;
  width: 100%;
  max-width: 100%;
  z-index: 6;
  padding: 0.15rem 0.15rem 0.1rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(196, 163, 90, 0.28);
  border-radius: 8px;
  justify-self: stretch;
  overflow: visible;
  box-sizing: border-box;
}
.felt__seat--S .seat-box__chip {
  width: 100%;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.12rem 0.35rem;
  background: rgba(196, 163, 90, 0.18);
  border-radius: 4px;
  box-sizing: border-box;
  overflow: visible;
  flex-shrink: 0;
}
.felt.has-north-hand .felt__seat--N {
  justify-self: stretch;
  max-width: 100%;
  z-index: 6;
}
.felt.has-north-hand[data-phase="play"] {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

/* West / East: vertical name strip + upright BBO suit-rows inside the strip */
.felt__seat--W,
.felt__seat--E {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.1rem;
  padding: 0.12rem;
  overflow: hidden;
  z-index: 2;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(196, 163, 90, 0.28);
  border-radius: 8px;
}
.felt__seat--E {
  flex-direction: row-reverse;
  justify-content: flex-start;
}
.felt__seat--W .seat-box__chip {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  flex-shrink: 0;
  padding: 0.2rem 0.1rem;
  background: rgba(196, 163, 90, 0.18);
  border-radius: 4px;
}
.felt__seat--E .seat-box__chip {
  writing-mode: vertical-rl;
  flex-shrink: 0;
  padding: 0.2rem 0.1rem;
  background: rgba(196, 163, 90, 0.18);
  border-radius: 4px;
}
.felt__seat--W .seat-box__name,
.felt__seat--E .seat-box__name {
  max-width: none;
  overflow: visible;
}
/* Chip-only seats (no hand) stay quiet */
.felt__seat--W:not(.has-hand),
.felt__seat--E:not(.has-hand),
.felt__seat--N:not(.has-hand) {
  background: transparent;
  border-color: transparent;
  padding: 0.05rem;
}
.felt__seat--S:not(.has-hand) .card-fan {
  display: none;
}

/* When N/W/E hands are visible (teaching auction / end-of-hand), both sides widen */
.felt.has-hands {
  grid-template-columns: var(--ew-side) minmax(0, 1fr) var(--ew-side);
  overflow: hidden;
}
.felt.has-hands .felt__seat--W,
.felt.has-hands .felt__seat--E {
  align-self: stretch;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  /* Vertically centre the hand stack inside the side column */
  align-items: center;
}
.felt.has-hands .hand-suit-rows {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  justify-content: center;
}
.felt.has-hands {
  /* Slightly wider side columns so 7–8 card suits densify instead of wrapping */
  --ew-hand-w: clamp(7.6rem, 32vw, 10rem);
  --ew-side: calc(var(--ew-hand-w) + 1.15rem);
}

/*
 * Live card play (BBO-style): only viewer + dummy take space.
 * - North dummy: narrow side chips, full center for the trick.
 * - East/West dummy: compact vertical suit columns in a side zone ≤30% of the
 *   felt (use % of the grid, never vw — vw crushed the center on desktop).
 */
.felt[data-phase="play"].play-dummy-E {
  grid-template-columns: 2.35rem minmax(0, 1fr) minmax(6.4rem, 28%);
  --ew-card-w: var(--hand-card-w);
  --ew-card-h: var(--hand-card-h);
  --ew-rank: var(--hand-rank);
  --ew-suit: var(--hand-suit);
}
.felt[data-phase="play"].play-dummy-W {
  grid-template-columns: minmax(6.4rem, 28%) minmax(0, 1fr) 2.35rem;
  --ew-card-w: var(--hand-card-w);
  --ew-card-h: var(--hand-card-h);
  --ew-rank: var(--hand-rank);
  --ew-suit: var(--hand-suit);
}
/* Larger card-size → slightly roomier dummy column; still ≤30% of felt */
body[data-card-size="large"] .felt[data-phase="play"].play-dummy-E {
  grid-template-columns: 2.35rem minmax(0, 1fr) minmax(6.8rem, 30%);
}
body[data-card-size="large"] .felt[data-phase="play"].play-dummy-W {
  grid-template-columns: minmax(6.8rem, 30%) minmax(0, 1fr) 2.35rem;
}
body[data-card-size="bbo"] .felt[data-phase="play"].play-dummy-E {
  grid-template-columns: 2.35rem minmax(0, 1fr) minmax(7rem, 30%);
}
body[data-card-size="bbo"] .felt[data-phase="play"].play-dummy-W {
  grid-template-columns: minmax(7rem, 30%) minmax(0, 1fr) 2.35rem;
}
/* Default (Large / no attr) uses the Large dummy column widths above. */
body:not([data-card-size]) .felt[data-phase="play"].play-dummy-E {
  grid-template-columns: 2.35rem minmax(0, 1fr) minmax(6.8rem, 30%);
}
body:not([data-card-size]) .felt[data-phase="play"].play-dummy-W {
  grid-template-columns: minmax(6.8rem, 30%) minmax(0, 1fr) 2.35rem;
}
.felt[data-phase="play"].play-dummy-E .felt__seat--E,
.felt[data-phase="play"].play-dummy-W .felt__seat--W {
  align-self: stretch;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.felt[data-phase="play"].play-dummy-E .hand-suit-rows,
.felt[data-phase="play"].play-dummy-W .hand-suit-rows {
  /* Stay inside the side column — never spill over the trick */
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.felt[data-phase="play"].play-dummy-E .felt__seat--W,
.felt[data-phase="play"].play-dummy-W .felt__seat--E {
  /* Chip-only opponent — no empty hand column */
  justify-content: center;
}
.felt[data-phase="play"]:not(.has-hands) .felt__seat--W:not(.has-hand),
.felt[data-phase="play"]:not(.has-hands) .felt__seat--E:not(.has-hand) {
  /* Chip label only — no empty “column” panel */
  padding: 0.05rem;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.felt[data-phase="play"] .phase--play {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
}

.suit-sym { font-weight: 600; }
.suit-ranks { letter-spacing: 0.01em; }

.suit-C, .suit-C .suit-sym, .suit-C .playing-card__rank, .suit-C .playing-card__suit,
.suit-C .bid-strain-btn__sym { color: var(--club); }
.suit-D, .suit-D .suit-sym, .suit-D .playing-card__rank, .suit-D .playing-card__suit,
.suit-D .bid-strain-btn__sym { color: var(--diamond); }
.suit-H, .suit-H .suit-sym, .suit-H .playing-card__rank, .suit-H .playing-card__suit,
.suit-H .bid-strain-btn__sym { color: var(--heart); }
.suit-S, .suit-S .suit-sym, .suit-S .playing-card__rank, .suit-S .playing-card__suit,
.suit-S .bid-strain-btn__sym { color: var(--spade); }
.suit-NT { color: var(--ink); }

/* Phase panel: trick center on the square felt (auction lives in .below-table) */
.phase-panel {
  grid-area: C;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.4rem;
  overflow: hidden; /* bidding: keep empty; play overrides to visible below */
  position: relative;
  z-index: 4;
}
.felt[data-phase="bidding"] .phase-panel {
  /* Empty green center during the auction */
  pointer-events: none;
}
.felt.has-hands[data-phase="play"] .play-summary {
  padding: 0.55rem 0.7rem;
}

/* Below the square table: auction/bid pad, or end-of-hand results (never on felt) */
.below-table {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  padding: 0.25rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
  box-sizing: border-box;
  min-width: 0;
}
.below-table[hidden] {
  display: none !important;
}
.below-table .phase--bidding {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 0 0 auto;
  min-height: 0;
  position: relative;
}
.below-table .auction-row {
  /* Fixed to header + exactly 3 call rows — grid scrolls; never under the bid pad */
  --auction-head-h: 1.05rem;
  --auction-row-h: 1.45rem;
  --auction-grid-pad: 0.64rem; /* top+bottom padding inside .auction-grid */
  --auction-grid-h: calc(var(--auction-grid-pad) + var(--auction-head-h) + 3 * var(--auction-row-h));
  height: var(--auction-grid-h);
  max-height: var(--auction-grid-h);
  flex: 0 0 auto;
  overflow: hidden;
  align-items: stretch;
}
.below-table .auction-window {
  min-height: 0;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.below-table .auction-grid {
  font-size: 0.78rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  /* Header stays put; only the body scrolls — nothing paints over W/N/E/S */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.28rem 0.32rem 0.36rem;
  box-sizing: border-box;
}
.below-table .auction-grid__head {
  position: static;
  flex: 0 0 auto;
  z-index: 2;
  background: rgba(243, 239, 230, 0.98);
  height: var(--auction-head-h, 1.05rem);
  min-height: var(--auction-head-h, 1.05rem);
  max-height: var(--auction-head-h, 1.05rem);
  margin-bottom: 0;
  padding-bottom: 0;
  align-items: center;
  box-sizing: border-box;
}
.below-table .auction-grid__body {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(3 * var(--auction-row-h, 1.45rem));
  max-height: calc(3 * var(--auction-row-h, 1.45rem));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.below-table .auction-grid__row {
  height: var(--auction-row-h, 1.45rem);
  min-height: var(--auction-row-h, 1.45rem);
  max-height: var(--auction-row-h, 1.45rem);
  box-sizing: border-box;
}
.below-table .auction-grid__cell {
  /* One line: level + suit (grid would stack the text node + suit span) */
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.02rem;
  min-height: 0;
  height: 100%;
  width: 100%;
  font-size: 0.74rem;
  line-height: 1;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}
.below-table .auction-grid__cell .suit-C,
.below-table .auction-grid__cell .suit-D,
.below-table .auction-grid__cell .suit-H,
.below-table .auction-grid__cell .suit-S,
.below-table .auction-grid__cell .suit-NT {
  display: inline;
  line-height: 1;
}
.below-table .bid-box {
  --tap: 40px;
  padding: 0.32rem 0.3rem 0.36rem;
  /* Always paint above any overflowing auction chrome */
  position: relative;
  z-index: 2;
}
.felt.has-hands ~ .below-table .auction-row {
  --auction-row-h: 1.42rem;
  --auction-head-h: 1.05rem;
  --auction-grid-pad: 0.72rem;
}
.felt.has-hands ~ .below-table .bid-box {
  --tap: 36px;
  padding: 0.26rem 0.24rem 0.3rem;
}
.felt.has-hands ~ .below-table .bid-special { font-size: 0.92rem; }
.felt.has-hands ~ .below-table .bid-level-btn { font-size: 1rem; }
.felt.has-hands ~ .below-table .bid-strain-btn { font-size: 1.05rem; }
.felt.has-hands ~ .below-table .btn-hint {
  width: 1.7rem;
  height: 1.7rem;
}

/* Declarer Coach — under the felt, does not shrink the table */
.declarer-coach {
  flex: 0 0 auto;
  width: 100%;
  max-width: 22rem;
  margin: 0.35rem auto 0.15rem;
  box-sizing: border-box;
  border: 1px solid rgba(30, 79, 140, 0.22);
  border-radius: 0.55rem;
  background: linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
  color: #16324f;
  overflow: hidden;
}
.declarer-coach[hidden] { display: none !important; }
.declarer-coach__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}
.declarer-coach__head--review {
  margin-bottom: 0.25rem;
}
.declarer-coach__flag {
  appearance: none;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid rgba(196, 163, 90, 0.45);
  background: rgba(196, 163, 90, 0.14);
  color: var(--gold-soft, #e8d5a3);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.declarer-coach__flag:active {
  transform: scale(0.96);
}
.declarer-coach__warn {
  margin: 0 0 0.35rem;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
  background: rgba(196, 163, 90, 0.12);
  border: 1px solid rgba(196, 163, 90, 0.28);
  color: var(--gold-soft, #e8d5a3);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
}
.declarer-coach__warn[hidden] { display: none !important; }
.flagged-tricks__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.flagged-tricks__filter {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255,255,255,0.18));
  color: var(--ivory-muted, #c8c0b0);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}
.flagged-tricks__filter.is-active {
  background: rgba(196, 163, 90, 0.2);
  border-color: rgba(196, 163, 90, 0.55);
  color: var(--ivory, #f4efe4);
}
.flagged-tricks__hid {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gold-soft, #e8d5a3);
}
.flagged-tricks__status {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
}
.flagged-tricks__status--open {
  background: rgba(196, 163, 90, 0.22);
  color: var(--gold-soft, #e8d5a3);
}
.flagged-tricks__status--reviewed {
  background: rgba(80, 140, 100, 0.25);
  color: #b7e0c4;
}
.flagged-tricks__plan {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  color: var(--ivory, #f4efe4);
}
.flagged-tricks__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.btn--small {
  min-height: 2rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
}
.declarer-coach__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.4rem;
  padding: 0.45rem 0.7rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.declarer-coach__chevron {
  font-size: 0.85rem;
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.declarer-coach.is-collapsed .declarer-coach__chevron {
  transform: rotate(-90deg);
}
.declarer-coach__body {
  padding: 0 0.7rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.declarer-coach.is-collapsed .declarer-coach__body {
  display: none;
}
.declarer-coach__line {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #1c3a57;
}
.declarer-coach__line[hidden] { display: none !important; }
.declarer-coach__line--options {
  white-space: pre-line;
  font-variant-numeric: tabular-nums;
  color: #1c3a57;
}
.declarer-coach__line--options.is-calculating {
  font-style: italic;
  opacity: 0.85;
}
.declarer-coach__line--plan {
  font-weight: 650;
  color: #0f2b45;
}
.declarer-coach__line--reason {
  color: #3a536b;
  font-style: italic;
}
.declarer-coach--review {
  max-width: 100%;
  margin: 0.35rem 0 0.55rem;
  border-radius: 0.45rem;
}
.declarer-coach__body--review {
  padding: 0.55rem 0.7rem 0.65rem;
}
@media (max-width: 400px) {
  .declarer-coach {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .declarer-coach__line { font-size: 0.76rem; }
}

.below-play {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
  /* Lives under the square felt — page (.table-app) scrolls; felt never shrinks. */
  flex: 0 0 auto;
}
.below-play[hidden] { display: none !important; }
.below-play .play-summary {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.below-play .play-summary__row {
  grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr);
  white-space: normal;
}
.below-play .play-summary__value {
  overflow-wrap: anywhere;
  word-break: normal;
}
.below-play .play-review-open {
  display: block;
  width: 100%;
  max-width: 22rem;
  margin: 0.55rem auto 0;
  box-sizing: border-box;
}
.below-play .play-review-open[hidden] { display: none !important; }
.below-play__actions {
  /* One row: Deal (primary, slightly wider) · Review · Other tables.
     Flex so a lone first-board Deal still fills the row. */
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.4rem;
  width: 100%;
  max-width: 22rem;
  margin: 0.55rem auto 0;
  /* Clear the iPhone home indicator. */
  padding-bottom: max(0.55rem, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  align-items: stretch;
}
.below-play__actions[hidden] { display: none !important; }
.below-play__btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.3rem;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  touch-action: manipulation;
}
/* Primary Deal — same row, slightly wider / stronger type. */
.below-play__btn--deal {
  flex: 1.25 1 0;
  min-height: 44px;
  padding: 0.55rem 0.35rem;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.below-play__btn--deal[hidden],
.below-play__btn[hidden] { display: none !important; }
.below-play__btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn--secondary {
  background: #1e4f8c;
  color: #fff;
  border: 0;
}
.btn--secondary:hover { filter: brightness(1.06); }
.btn--secondary:disabled {
  opacity: 0.45;
  cursor: default;
}
@media (max-width: 400px) {
  .below-play__actions {
    gap: 0.3rem;
    max-width: 100%;
  }
  .below-play__btn {
    min-height: 44px;
    padding: 0.5rem 0.22rem;
    font-size: 0.82rem;
  }
  .below-play__btn--deal {
    min-height: 44px;
    padding: 0.5rem 0.28rem;
    font-size: 0.9rem;
  }
}
.below-play .play-status {
  text-align: left;
  padding: 0 0.15rem;
}
/* Bidding: same BBO hand stubs; side columns wide enough for long suits */
.felt[data-phase="bidding"] {
  --ew-card-w: var(--hand-card-w);
  --ew-card-h: var(--hand-card-h);
  --ew-rank: var(--hand-rank);
  --ew-suit: var(--hand-suit);
  /* Room for ~5–6 peeks before densify/wrap; N/S still span full felt */
  --ew-hand-w: clamp(7.2rem, 30vw, 9.2rem);
  --ew-side: calc(var(--ew-hand-w) + 1.05rem);
  --ew-row-gap: 0;
  --ew-row-stack: 1;
}
.felt[data-phase="bidding"].has-hands {
  grid-template-columns: var(--ew-side) minmax(0, 1fr) var(--ew-side);
  overflow: hidden; /* keep stubs inside the square; page scrolls instead */
}
.felt[data-phase="bidding"].has-hands .felt__seat--W,
.felt[data-phase="bidding"].has-hands .felt__seat--E {
  align-self: stretch;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}
/* Shorter phones (e.g. 375×667): slightly smaller faces; page may scroll */
@media (max-height: 720px) {
  :root {
    --hand-peek: clamp(22px, 6.6vw, 30px);
    --hand-card-w: var(--hand-peek);
    --hand-card-h: calc(var(--hand-peek) * 1.48);
    --hand-rank: calc(var(--hand-peek) * 0.72);
    --hand-suit: calc(var(--hand-peek) * 0.64);
    --hand-inset: clamp(5.5px, 1.6vw, 7px);
  }
  .below-table .bid-box {
    --tap: 34px;
    padding: 0.22rem 0.2rem 0.24rem;
  }
  .below-table .auction-row {
    --auction-row-h: 1.35rem;
    --auction-head-h: 1rem;
    --auction-grid-pad: 0.64rem;
  }
  .below-table .auction-grid {
    font-size: 0.7rem;
    padding: 0.24rem 0.28rem;
  }
}

/*
 * Very short any-width (phone landscape ~844×390): shrink felt so auction/bid
 * can sit below without relying solely on scroll. Portrait phones (≥844 tall)
 * and iPad mini 768×1024 are unaffected.
 */
@media (max-height: 520px) {
  /* Mild reserve only — page scroll reaches auction/bid; avoid a postage-stamp felt
   * when tablet status-h (78px @ ≥768px) stacks with a large reserve on ~844×390. */
  .felt {
    --below-reserve: 3.5rem;
  }
  :root {
    --hand-peek: clamp(18px, 5.5vw, 26px);
    --hand-card-w: var(--hand-peek);
    --hand-card-h: calc(var(--hand-peek) * 1.42);
    --hand-rank: calc(var(--hand-peek) * 0.7);
    --hand-suit: calc(var(--hand-peek) * 0.62);
  }
  .below-table .bid-box {
    --tap: 32px;
    padding: 0.18rem 0.16rem 0.2rem;
  }
}

.phase { min-width: 0; }
.phase[hidden] { display: none !important; }

.phase--bidding {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  min-height: 0;
  flex: 0 0 auto;
  justify-content: flex-start;
}

/* Outside-tap dismiss for notes — iOS needs a real control with cursor:pointer */
.meaning-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.meaning-backdrop[hidden] { display: none !important; }

/* BBO-style: auction ~55–60% upper-left, notes to the right, bid box below.
 * Main table grid is fixed to header + 3 rows (see .below-table .auction-row). */
.auction-row {
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(0, 1fr);
  gap: 0.35rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
}
.auction-window {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  align-self: stretch;
}
.auction-grid {
  background: rgba(243, 239, 230, 0.96);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.4rem 0.45rem 0.45rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  font-size: 0.92rem;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.bid-notes {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
  z-index: 41;
}
.auction-grid__head,
.auction-grid__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.12rem;
  text-align: center;
}
.auction-grid__head {
  font-size: 0.68rem;
  font-weight: 700;
  color: #5a5348;
  margin-bottom: 0.1rem;
}
.auction-grid__cell {
  min-height: 1.4rem;
  /* inline-flex keeps "4" + suit glyph on one line (grid stacks them) */
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.02rem;
  font-size: 0.8rem;
  line-height: 1.1;
  white-space: nowrap;
  border-radius: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.05rem;
  cursor: default;
  box-sizing: border-box;
}
.call-inline {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
  line-height: 1;
}
.call-inline__level {
  display: inline;
  line-height: 1;
}
.auction-grid__cell.has-call {
  background: rgba(0,0,0,0.04);
  cursor: pointer;
}
.auction-grid__cell.is-latest {
  background: #e8d4a8;
  font-weight: 600;
}
.auction-grid__cell.is-selected {
  outline: 2px solid #9a7a2e;
  outline-offset: -1px;
}
.auction-grid__cell.is-off-system {
  background: rgba(160, 88, 48, 0.16);
  position: relative;
}
.auction-grid__cell.is-off-system::after {
  content: '';
  position: absolute;
  top: 0.12rem;
  right: 0.14rem;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: #a85830;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.55);
}
.auction-grid__cell.is-turn {
  color: #9a7a2e;
  animation: blink 1.1s ease-in-out infinite;
}
@keyframes blink {
  50% { opacity: 0.35; }
}
/* Bid notes sit in the right column (not a floating overlay over the bid pad) */
.meaning-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  background: #f3efe6;
  border: 1px solid rgba(154, 122, 46, 0.35);
  border-radius: 8px;
  padding: 0.4rem 0.5rem 0.45rem;
  font-size: 0.68rem;
  line-height: 1.3;
  color: #3a3428;
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.meaning-panel[hidden] { display: none !important; }
@media (min-width: 421px) {
  .meaning-panel {
    font-size: 0.72rem;
  }
}
.meaning-panel__call {
  margin: 0 0 0.2rem;
  font-weight: 700;
  font-size: 0.8rem;
}
.meaning-panel__text { margin: 0; }
.meaning-panel__verdict {
  margin: 0.35rem 0 0;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(58, 52, 40, 0.12);
  font-size: 0.64rem;
  line-height: 1.3;
  color: #5a4a28;
}
.meaning-panel__verdict[data-verdict="correct"] { color: #2f6b3a; }
.meaning-panel__verdict[data-verdict="reasonable"] { color: #6b5a2e; }
.meaning-panel__verdict[data-verdict="deviation"] { color: #8a3e28; }
.meaning-panel__verdict[hidden] { display: none !important; }
.meaning-panel__candidates {
  margin: 0.25rem 0 0;
  padding-left: 1rem;
  font-size: 0.62rem;
  line-height: 1.3;
  color: #4a4338;
}
.meaning-panel__candidates[hidden] { display: none !important; }
.meaning-panel__candidates .candidate-row__call {
  color: #6b5a2e;
  min-width: 2rem;
}
.meaning-panel__candidates .candidate-row__meta {
  color: #5a5348;
  font-size: 0.6rem;
}

.bid-box {
  --tap: 44px;
  background: #e8d4a8;
  border-radius: 12px;
  padding: 0.45rem 0.4rem 0.5rem;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  position: relative;
  z-index: 1; /* below meaning backdrop while open */
  flex: 0 0 auto;
  width: 100%;
}
.bid-box__specials {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 0.32rem;
  margin-bottom: 0.32rem;
}
.bid-special {
  border: 0;
  border-radius: 9px;
  min-height: var(--tap);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.bid-special:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  filter: grayscale(0.35);
}
.bid-special--pass { background: var(--pass); }
.bid-special--dbl { background: var(--dbl); }
.bid-special--rdbl { background: var(--rdbl); }

.bid-box__levels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.26rem;
}
.bid-level-btn {
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  min-height: var(--tap);
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
}
.bid-level-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}
.bid-level-btn.is-selected {
  outline: 2px solid #9a7a2e;
  background: #fff8e8;
}

.bid-box__strains {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.26rem;
  margin-top: 0.32rem;
}
.bid-strain-btn {
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  border-radius: 8px;
  min-height: var(--tap);
  min-width: 0;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0.15rem;
}
.bid-strain-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}
.bid-strain-btn__nt {
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
}

.bid-box__hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  min-height: 2rem;
}
.btn-bid-undo {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: #3d3428;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1;
  min-height: 2.2rem;
  min-width: 4.25rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.btn-bid-undo:disabled {
  opacity: 0.38;
  cursor: default;
}
.btn-bid-undo--play {
  margin: 0.65rem auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-color: rgba(0, 0, 0, 0.22);
}
.btn-bid-undo--play[hidden] { display: none !important; }
.btn-hint {
  width: 1.7rem;
  height: 1.7rem;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.55);
  color: #5a5348;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  opacity: 0.85;
  margin-left: auto;
}
.bid-special,
.bid-level-btn,
.bid-strain-btn {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.btn-hint:hover,
.btn-hint:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.85);
}
.btn-hint:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn-hint.has-used {
  border-color: rgba(154, 122, 46, 0.7);
  background: rgba(255, 236, 190, 0.9);
  color: #6a5218;
  opacity: 1;
}
.btn-hint[hidden] { display: none !important; }
.btn-hint__icon {
  display: block;
  transform: translateY(-0.5px);
}

.hint-panel {
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  background: rgba(8, 22, 16, 0.94);
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: 10px;
  padding: 0.45rem 0.55rem 0.5rem;
  color: var(--ivory);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hint-panel[hidden] { display: none !important; }
.hint-panel__title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: var(--gold-soft);
  font-weight: 600;
}
.hint-panel__list {
  margin: 0 0 0.4rem;
  padding-left: 1.1rem;
  font-size: 0.7rem;
}
.hint-panel__hide {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  min-height: 1.75rem;
}

.candidate-row {
  margin: 0.2rem 0;
}
.candidate-row__call {
  display: inline-block;
  min-width: 2.4rem;
  margin-right: 0.35rem;
  color: var(--gold-soft);
}
.candidate-row__meta {
  font-size: 0.72rem;
  color: var(--ivory-muted, #c5d0c8);
}
.candidate-row--top .candidate-row__call {
  color: #f0d78c;
}

/* End-of-hand result panel (field tables live in the Other popover) */
.play-summary__card {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  text-align: left;
}
.play-summary__row {
  display: grid;
  grid-template-columns: 7.2rem 1fr;
  gap: 0.35rem 0.55rem;
  align-items: baseline;
  font-size: 0.95rem;
  line-height: 1.35;
}
.play-summary__label {
  color: #5a5348;
  font-weight: 650;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.play-summary__value {
  color: #1c1914;
  font-weight: 650;
  font-size: 0.98rem;
}
.play-summary__value.is-plus { color: #1f6b3a; }
.play-summary__value.is-minus { color: #a12828; }
.play-summary__value .suit-H,
.play-summary__value .suit-D { /* keep suit colors readable on white */
  font-weight: 700;
}
@media (max-width: 420px) {
  .play-summary__row {
    grid-template-columns: 6.4rem 1fr;
    font-size: 0.92rem;
  }
  .play-summary__label { font-size: 0.74rem; }
  .play-summary__value { font-size: 0.95rem; }
}
.field-review {
  margin-top: 0;
  background: rgba(8, 22, 16, 0.96);
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: 10px;
  padding: 0.55rem 0.6rem 0.6rem;
  color: var(--ivory);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
}
.field-review[hidden] { display: none !important; }
.field-review__title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--gold-soft);
}
.field-review__spread {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ivory);
}
.field-review__makeable {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #c8d6c0;
}
.field-review__you {
  margin: 0;
  font-size: 0.78rem;
  color: var(--gold-soft);
}
.field-review__scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}
.field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  table-layout: fixed;
}
.field-table th,
.field-table td {
  padding: 0.28rem 0.35rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.field-table th {
  color: var(--ivory-muted, #c5d0c8);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: rgba(12, 28, 20, 0.98);
}
.field-table .field-col-num { width: 1.5rem; text-align: center; white-space: nowrap; }
.field-table .field-col-style {
  width: 4.2rem;
  max-width: 4.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-table .field-col-result { white-space: nowrap; }
.field-table .field-col-ns,
.field-table .field-col-imps {
  width: 3.2rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.field-table .field-col-imps.is-plus { color: #7dcea0; }
.field-table .field-col-imps.is-minus { color: #f5b7b1; }
.field-table .field-sort {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-align: right;
}
.field-table tr.is-you td {
  background: rgba(196, 163, 90, 0.12);
  color: var(--gold-soft);
}
.field-table tr.is-tappable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.field-table tr.is-tappable:active td,
.field-table tr.is-tappable:focus-visible td {
  background: rgba(255, 255, 255, 0.08);
}
.field-table tr.is-you.is-tappable:active td,
.field-table tr.is-you.is-tappable:focus-visible td {
  background: rgba(196, 163, 90, 0.22);
}
.field-review__note {
  margin: 0;
  font-size: 0.68rem;
  color: var(--ivory-muted, #c5d0c8);
  line-height: 1.3;
}

/* Other-tables → per-table BBO auction detail */
.field-list-pane[hidden],
.field-auction-pane[hidden] { display: none !important; }
.field-list-pane,
.field-auction-pane {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.field-auction-pane__head.sheet-head {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.35rem;
}
.sheet-back {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ivory);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.field-auction-pane__meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ivory-muted, #c5d0c8);
  line-height: 1.3;
  flex-shrink: 0;
}
.field-auction-pane__scroll {
  flex: 1 1 auto;
  min-height: 8rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.field-auction-pane__missing {
  margin: 0.4rem 0;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  font-size: 0.8rem;
  color: var(--ivory-muted, #c5d0c8);
  text-align: center;
}
.field-auction-pane__missing[hidden] { display: none !important; }
.field-auction-pane .auction-grid--popover {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 0.25rem 0.2rem 0.35rem;
}
.field-auction-pane__meaning {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(196, 163, 90, 0.28);
}
.field-auction-pane__meaning[hidden] { display: none !important; }
.field-auction-pane__summary {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.55rem;
  font-size: 0.72rem;
}
.field-auction-pane__summary > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}
.field-auction-pane__summary dt {
  margin: 0;
  color: var(--ivory-muted, #c5d0c8);
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.field-auction-pane__summary dd {
  margin: 0;
  color: var(--ivory);
  font-weight: 600;
}

/* End-of-hand score card — lives in .below-play, full width under the table */
.play-summary {
  background: #f7f4ec;
  color: #1c1914;
  border: 1px solid rgba(196, 163, 90, 0.55);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.play-summary[hidden] { display: none !important; }
.play-summary__note {
  margin: 0;
  font-size: 0.9rem;
  color: #6a5a40;
  font-style: italic;
}
.felt[data-phase="play"] .phase-panel {
  /* Trick is sized to fit the center cell — keep it inside, clear of N/S hands. */
  overflow: hidden;
}
.trick-area {
  /* Fixed N/E/S/W cross from --trick-fixed-* (≈1.25× hand peek face).
   * Sized to fit between N/S hands at 375/390 — never shrink at runtime. */
  --trick-card-w: var(--trick-fixed-w, var(--hand-peek));
  --trick-card-h: var(--trick-fixed-h, var(--hand-card-h));
  --trick-gap: var(--trick-fixed-gap, 0.14rem);
  position: relative;
  display: grid;
  grid-template-columns: var(--trick-card-w) var(--trick-card-w) var(--trick-card-w);
  grid-template-rows: var(--trick-card-h) var(--trick-card-h) var(--trick-card-h) auto;
  gap: var(--trick-gap);
  width: max-content;
  max-width: 100%;
  height: max-content;
  max-height: 100%;
  margin: 0 auto;
  flex-shrink: 0;
  box-sizing: border-box;
  z-index: 4;
  place-items: center;
  align-self: center;
  justify-self: center;
  overflow: visible;
}
/* Same fixed size for North dummy and W/E side-column dummy — never re-scale. */
.felt[data-phase="play"].play-dummy-E .trick-area,
.felt[data-phase="play"].play-dummy-W .trick-area {
  --trick-card-w: var(--trick-fixed-w, var(--card-w));
  --trick-card-h: var(--trick-fixed-h, var(--card-h));
  --trick-gap: var(--trick-fixed-gap, 0.22rem);
}
.trick-area[hidden] { display: none !important; }
.trick-area.is-peeking-last,
.trick-area.is-lingering {
  z-index: 3;
}
.trick-slot {
  position: relative;
  width: var(--trick-card-w, 3.1rem);
  height: var(--trick-card-h, 4.4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none;
}
.trick-slot.is-winner .playing-card {
  box-shadow: 0 0 0 2px rgba(232, 196, 90, 0.95), 0 2px 10px rgba(0, 0, 0, 0.45);
}
.trick-slot--N { grid-column: 2; grid-row: 1; }
.trick-slot--W { grid-column: 1; grid-row: 2; }
.trick-slot--E { grid-column: 3; grid-row: 2; }
.trick-slot--S { grid-column: 2; grid-row: 3; }
/* Winner text under the cross — never covers a card (gold ring marks the winner). */
.trick-winner {
  grid-column: 1 / -1;
  grid-row: 4;
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  z-index: 2;
  pointer-events: none;
  margin-top: 0.1rem;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  background: rgba(8, 18, 12, 0.82);
  border: 1px solid rgba(232, 196, 90, 0.7);
  color: #f4e6c0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  justify-self: center;
}
.trick-winner[hidden] { display: none !important; }

/* Play-review overlay: full middle between hands; live-size trick cards */
.trick-replay-overlay {
  position: absolute;
  inset: 4% 6%;
  z-index: 8;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(6, 18, 12, 0.62);
  border: 1px solid rgba(196, 163, 90, 0.4);
  border-radius: 12px;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.35);
  overflow: visible;
}
.trick-replay-overlay[hidden] { display: none !important; }
.trick-replay-overlay__cross {
  position: relative;
  /* Match live .trick-area footprint so cards are not crammed/clipped */
  width: min(12.5rem, 72%);
  height: min(14.5rem, 86%);
  --trick-card-w: calc(var(--card-w) * 0.78);
  --trick-card-h: calc(var(--card-h) * 0.78);
  overflow: visible;
}
.trick-replay-overlay .trick-slot--W { left: 4%; }
.trick-replay-overlay .trick-slot--E { right: 4%; }
.trick-replay-overlay .trick-slot--N { top: 0; }
.trick-replay-overlay .trick-slot--S { bottom: 0; }
.trick-replay-overlay .trick-slot {
  overflow: visible;
}
.trick-replay-overlay .trick-slot .playing-card {
  width: var(--trick-card-w);
  height: var(--trick-card-h);
  flex: 0 0 auto;
  margin: 0 !important;
  overflow: visible;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.trick-replay-overlay .playing-card__rank {
  font-size: var(--card-rank);
  font-weight: 800;
  line-height: 0.95;
}
.trick-replay-overlay .playing-card__rank--ten {
  font-size: var(--card-rank);
  letter-spacing: -0.28em;
  transform: scaleX(0.68);
  transform-origin: left center;
  display: inline-block;
  padding-right: 0.32em;
}
.trick-replay-overlay .playing-card__suit {
  font-size: var(--card-suit);
  line-height: 1;
}
/* Dim hands under the review overlay so trick cards stay clear */
.felt.is-reviewing-trick .hand,
.felt.is-reviewing-trick .hand .playing-card {
  opacity: 0.2;
  filter: grayscale(0.45);
}
.felt.is-reviewing-trick .playing-card.is-played-away {
  opacity: 0.12;
  filter: grayscale(0.5);
}
.felt.is-reviewing-trick .trick-replay-overlay .playing-card {
  opacity: 1;
  filter: none;
}
.trick-slot .playing-card {
  width: var(--trick-card-w, 3.1rem);
  height: var(--trick-card-h, 4.4rem);
  flex: 0 0 auto;
  margin: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.trick-slot .playing-card__rank {
  font-size: var(--card-rank);
  font-weight: 800;
  line-height: 0.95;
}
.trick-slot .playing-card__suit {
  font-size: var(--card-suit);
  line-height: 1;
}
.play-status {
  margin: 0.15rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(243, 239, 230, 0.78);
  min-height: 1.1em;
}
.play-status[hidden] { display: none !important; }
.play-status.is-reject { color: #f0b4a8; }
/* Turn cue: gold ring around the hand — not per-card outlines or bigger glyphs */
/* Turn highlight on the full seat — never shrink the fan into a narrow dock */
.felt__seat--S:has(.playing-card.is-playable),
.felt__seat--N:has(.playing-card.is-playable),
.hand-suit-rows:has(.playing-card.is-playable) {
  outline: 2px solid rgba(196, 163, 90, 0.9);
  outline-offset: 3px;
  border-radius: 10px;
}
.card-fan:has(.playing-card.is-playable) {
  /* Fan itself stays full-width; seat owns the gold ring */
  outline: none;
}
.playing-card.is-playable {
  cursor: pointer;
  outline: none;
  /* Identical face metrics to inactive cards */
}
.playing-card.is-playable .playing-card__rank {
  font-size: var(--hand-rank);
  font-weight: var(--card-face-weight, 700);
}
.playing-card.is-playable .playing-card__rank--ten {
  font-size: calc(var(--hand-rank) * 0.9);
  font-weight: var(--card-face-weight, 700);
}
.playing-card.is-playable .playing-card__suit {
  font-size: var(--hand-suit);
  font-weight: var(--card-face-weight, 700);
}
.playing-card.is-playable:hover,
.playing-card.is-playable:focus-visible {
  /* Soft lift only — do not scale or bold glyphs */
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}
.playing-card.is-illegal {
  /* No opacity dim — legal cards already get a gold outline; faces stay crisp. */
  opacity: 1;
  filter: none;
  pointer-events: none;
}
/* Role tags live in the name text (JS) — no ::after that truncates or stacks. */
.phase--play {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  flex: 1;
}
/* Play review sheet — full-screen on phone */
.play-review-sheet {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: flex;
  align-items: stretch;
  justify-content: center;
  pointer-events: none;
}
.play-review-sheet[hidden] { display: none !important; }
.play-review-sheet__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.play-review-sheet__panel {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: 100%;
  max-width: 28rem;
  height: 100%;
  max-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #13241c;
  color: var(--ivory);
  padding: calc(0.45rem + env(safe-area-inset-top, 0px)) 0.55rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overflow: hidden;
}
.play-review-sheet__head {
  flex: 0 0 auto;
  margin-bottom: 0.2rem;
  color: var(--ivory);
}
.play-review-sheet__panel .sheet-close {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ivory);
}
.play-review-sheet__table-block {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.play-review-sheet__below {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 42%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(196, 163, 90, 0.22);
}
.play-review-sheet__summary {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.3;
  color: rgba(243, 239, 230, 0.72);
}
.play-review-sheet__nav-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.play-review-sheet__auction-btn {
  flex: 0 0 auto;
  min-width: 4.6rem;
  font-weight: 650;
}
.play-review-felt {
  flex: 1 1 auto;
  min-height: 12rem;
  display: grid;
  /* N top, mid (W | trick | E), S bottom */
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  padding: 0.45rem 0.4rem;
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(46, 110, 68, 0.55), transparent 70%),
    linear-gradient(165deg, #1a4a32 0%, #0f2e1f 100%);
  border: 1px solid rgba(196, 163, 90, 0.28);
  overflow: hidden;
  /* Same hand peeks as game — JS syncs from the live felt */
  --review-peek: clamp(22px, 6.8vw, 30px);
  --review-card-h: calc(var(--review-peek) * 1.95);
  --review-rank: calc(var(--review-peek) * 0.7);
  --review-suit: calc(var(--review-peek) * 0.62);
  --ew-row-gap: 3px;
  --hand-peek: var(--review-peek);
  --hand-card-w: var(--review-peek);
  --hand-card-h: var(--review-card-h);
  --hand-rank: var(--review-rank);
  --hand-suit: var(--review-suit);
  --ew-card-w: var(--review-peek);
  --ew-card-h: var(--review-card-h);
  --ew-rank: var(--review-rank);
  --ew-suit: var(--review-suit);
}
.play-review-felt__N,
.play-review-felt__S {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.1rem;
  min-width: 0;
}
.play-review-felt__mid {
  min-height: 0;
  display: grid;
  /* Fixed side columns at the edges; centre holds the trick cross */
  grid-template-columns:
    var(--review-ew-side, 8.5rem)
    minmax(0, 1fr)
    var(--review-ew-side, 8.5rem);
  gap: 0.85rem;
  align-items: center;
  justify-items: stretch;
  overflow: hidden;
}
.play-review-felt__W,
.play-review-felt__E {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden; /* never spill past the felt */
  align-self: center;
  box-sizing: border-box;
}
.play-review-felt__W { justify-content: flex-start; }
.play-review-felt__E { justify-content: flex-end; }
.play-review-felt__seat {
  flex: 0 0 auto;
  align-self: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(243, 239, 230, 0.7);
  letter-spacing: 0.04em;
  z-index: 2;
}
.play-review-hand {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  max-width: 100%;
  overflow: hidden;
}
.play-review-hand--NS {
  justify-content: center;
  width: 100%;
}
.play-review-hand--EW {
  flex: 0 1 auto;
  flex-direction: column;
  gap: var(--ew-row-gap, 3px);
  justify-content: center;
  width: auto;
  max-width: 100%;
  min-width: 0;
  max-height: 100%;
  overflow: hidden;
  --ew-row-stack: 1;
  --ew-row-gap: 3px;
}
/* Live-table suit rows inside the review felt (E/W). */
.play-review-hand--EW.hand-suit-rows {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.play-review-hand--EW .suit-row,
.play-review-hand__row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  height: var(--ew-card-h, var(--review-card-h));
  min-height: var(--ew-card-h, var(--review-card-h));
  max-height: var(--ew-card-h, var(--review-card-h));
  max-width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}
.play-review-hand--EW .suit-row + .suit-row,
.play-review-hand--EW .play-review-hand__row + .play-review-hand__row {
  margin-top: 0; /* gap from parent flex */
}
/* Full live faces — rank + suit readable (same .playing-card as the table). */
.play-review-hand .playing-card {
  flex: 0 0 var(--hand-peek, var(--review-peek));
  width: var(--hand-peek, var(--review-peek));
  height: var(--hand-card-h, var(--review-card-h));
  min-height: var(--hand-card-h, var(--review-card-h));
  max-height: var(--hand-card-h, var(--review-card-h));
  margin-left: 0;
  padding: 0.06rem 0 0 var(--hand-inset, 5px);
  overflow: hidden;
  box-sizing: border-box;
}
.play-review-hand .playing-card + .playing-card {
  margin-left: 0;
}
.play-review-hand .playing-card__rank {
  font-size: var(--hand-rank, var(--review-rank));
  line-height: 0.88;
}
.play-review-hand .playing-card__rank--ten {
  font-size: calc(var(--hand-rank, var(--review-rank)) * 0.9);
  letter-spacing: -0.08em;
  transform: scaleX(0.88);
  transform-origin: left center;
  display: inline-block;
  padding-left: 0;
  padding-right: 0.04em;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
}
.play-review-hand .playing-card__suit {
  font-size: var(--hand-suit, var(--review-suit));
  line-height: 0.9;
}
/* Legacy alias kept for any leftover play-review-card nodes */
.play-review-card {
  flex: 0 0 var(--review-peek);
  width: var(--review-peek);
  height: var(--review-card-h);
}
.play-review-trick {
  align-self: center;
  justify-self: center;
  width: min(100%, 13.5rem);
  height: min(100%, 13.5rem);
  aspect-ratio: 1;
  max-height: min(46vw, 14rem);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-areas:
    ". N ."
    "W . E"
    ". S .";
  gap: 0.35rem;
  z-index: 1;
}
/* Seat cross: exclusive cells — N/E/S/W never share space */
.play-review-trick__slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}
.play-review-trick__slot--N { grid-area: N; }
.play-review-trick__slot--S { grid-area: S; }
.play-review-trick__slot--W { grid-area: W; }
.play-review-trick__slot--E { grid-area: E; }
/* Same face language as in-game trick cards; sized to fit the seat cell */
.play-review-trick__slot .play-review-trick-card,
.play-review-trick__slot .playing-card {
  flex: 0 0 auto;
  width: min(100%, var(--trick-card-w, var(--card-w)));
  height: min(100%, var(--trick-card-h, var(--card-h)));
  aspect-ratio: 5 / 7;
  max-width: 3.6rem;
  max-height: 5.1rem;
  margin: 0 !important;
  padding: 0.12rem 0 0 0.08rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.play-review-trick__slot .playing-card__rank {
  font-size: clamp(1.15rem, 5.2vw, var(--card-rank));
  font-weight: 800;
  line-height: 0.95;
}
.play-review-trick__slot .playing-card__rank--ten {
  font-size: clamp(1.05rem, 4.8vw, calc(var(--card-rank) * 0.92));
  letter-spacing: -0.06em;
  transform: scaleX(0.94);
  max-width: none;
  overflow: visible;
}
.play-review-trick__slot .playing-card__suit {
  font-size: clamp(1.05rem, 4.8vw, var(--card-suit));
  line-height: 1;
}
.play-review-sheet__nav {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
}
.play-review-sheet__label {
  min-width: 7.5rem;
  text-align: center;
  font-weight: 650;
  font-size: 0.88rem;
}
.play-review-sheet__notes {
  flex: 0 1 auto;
  margin: 0;
  padding: 0.15rem 0.75rem 0.15rem 1.15rem;
  max-height: none;
  overflow: visible;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(243, 239, 230, 0.88);
}
.play-review-sheet__notes li { margin: 0.12rem 0; }
.play-review-sheet__notes li.is-active { color: var(--gold-soft); }
@media (min-width: 720px) {
  .play-review-sheet {
    align-items: center;
    padding: 1.25rem;
  }
  .play-review-sheet__panel {
    height: auto;
    max-height: min(92vh, 44rem);
    border-radius: 14px;
    border: 1px solid rgba(196, 163, 90, 0.35);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}

/* Legacy south-dock removed — viewer hand is on the felt */
.south-dock { display: none !important; }

/* N/S fans: BBO fixed-peek trimmed stubs, centered, shrink as cards leave */
.card-fan {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: var(--hand-card-h);
  width: max-content;
  max-width: 100%;
  padding: 0;
  margin: 0 auto;
  position: relative;
  overflow: visible;
}
.card-fan .playing-card {
  flex: 0 0 var(--hand-card-w);
  width: var(--hand-card-w);
  height: var(--hand-card-h);
  overflow: hidden;
  /* Center rank/suit in the visible peek (fixes narrow J sitting left). */
  align-items: center;
  padding: var(--card-face-pad-top, 0.06rem) 0 0;
  opacity: 1;
  filter: none;
}
.card-fan .playing-card__rank {
  font-size: var(--hand-rank);
  font-weight: var(--card-face-weight, 700);
  line-height: var(--card-face-rank-lh, 0.88);
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
/* Full card width; slight scaleX so "10" stays fully visible */
.card-fan .playing-card__rank--ten {
  font-size: calc(var(--hand-rank) * 0.9);
  font-weight: var(--card-face-weight, 700);
  letter-spacing: -0.1em;
  line-height: var(--card-face-rank-lh, 0.88);
  transform: scaleX(0.88);
  transform-origin: center center;
  display: inline-block;
  padding-left: 0;
  padding-right: 0;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
  text-align: center;
}
.card-fan .playing-card--ten {
  padding-left: 0;
  align-items: center;
}
.card-fan .playing-card__suit {
  font-size: var(--hand-suit);
  font-weight: var(--card-face-weight, 700);
  line-height: var(--card-face-suit-lh, 0.9);
  margin-left: 0;
  display: inline-block;
  transform: scale(var(--card-face-suit-scale, 1));
  transform-origin: center top;
  text-align: center;
}
.card-fan .playing-card.is-playable:hover,
.card-fan .playing-card.is-playable:focus-visible {
  /* Match global playable hover — lift only, same face metrics */
  transform: translateY(-2px);
}
.card-fan .playing-card.is-playable .playing-card__rank {
  font-size: var(--hand-rank);
  font-weight: var(--card-face-weight, 700);
}
.card-fan .playing-card.is-playable .playing-card__rank--ten {
  font-size: calc(var(--hand-rank) * 0.9);
}
.card-fan .playing-card.is-playable .playing-card__suit {
  font-size: var(--hand-suit);
  font-weight: var(--card-face-weight, 700);
}

.felt {
  /* E/W suit rows share the same BBO hand stubs */
  --ew-card-w: var(--hand-card-w);
  --ew-card-h: var(--hand-card-h);
  --ew-rank: var(--hand-rank);
  --ew-suit: var(--hand-suit);
  --ew-row-gap: 0.08rem;
  --ew-row-stack: 1;
  --ew-hand-w: clamp(6.5rem, 34vw, 9.5rem);
  --ew-side: calc(var(--ew-hand-w) + 1.4rem);
}

.card-fan--north,
.card-fan--south {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  height: var(--hand-card-h);
  align-items: flex-start;
  overflow: visible;
}
.card-fan--north[hidden],
.card-fan--north.is-hidden,
.card-fan--south[hidden],
.card-fan--south.is-hidden { display: none !important; }
.felt__seat--N .card-fan--north,
.felt__seat--S .card-fan--south {
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  /* Same fixed overlap / crisp faces for North dummy and South */
  opacity: 1;
  filter: none;
}

/*
 * BBO East/West: upright cards, one horizontal overlapping row per suit,
 * rows stacked vertically. West left-aligned; East right-aligned.
 */
.hand-suit-rows {
  display: flex;
  flex-direction: column;
  /* Fixed gap from JS (--ew-row-gap); rows never overlap */
  gap: var(--ew-row-gap, 3px);
  justify-content: center;
  /* Fill leftover seat width after the chip — never wider than the column */
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden; /* long suits stay in-column; never cover another row */
  padding: 0;
  margin: 0;
  --ew-row-gap: 3px;
}
.hand-suit-rows[hidden],
.hand-suit-rows.is-hidden { display: none !important; }
.hand-suit-rows--W { align-items: flex-start; }
.hand-suit-rows--E { align-items: flex-end; }
.hand-suit-rows .suit-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: var(--ew-card-h);
  min-height: var(--ew-card-h);
  max-height: var(--ew-card-h);
  /* Content width from JS; column align-items pins W left / E right */
  width: max-content;
  max-width: 100%;
  position: relative;
  overflow: hidden; /* horizontal peeks must fit the column — one row per suit */
  flex-shrink: 0;
}
.hand-suit-rows .suit-row + .suit-row {
  /* Gap comes from parent flex gap — no negative overlap margins */
  margin-top: 0;
}
.hand-suit-rows .suit-row--void {
  align-items: center;
  justify-content: flex-start;
  height: calc(var(--ew-card-h) * 0.45); /* compact dash — not a full empty card row */
  color: rgba(243, 239, 230, 0.55);
  font-size: calc(var(--ew-rank) * 0.75);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding-left: 0.15rem;
}
.hand-suit-rows--E .suit-row--void {
  justify-content: flex-end;
  padding-left: 0;
  padding-right: 0.15rem;
}
.hand-suit-rows .suit-row__void {
  line-height: 1;
  opacity: 0.75;
}
.hand-suit-rows--W .suit-row { justify-content: flex-start; }
.hand-suit-rows--E .suit-row { justify-content: flex-end; }
.hand-suit-rows .playing-card {
  flex: 0 0 var(--ew-card-w);
  width: var(--ew-card-w);
  height: var(--ew-card-h);
  margin-left: 0;
  border-radius: 0.3rem;
  padding: var(--card-face-pad-top, 0.06rem) 0 0;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.22);
  /* Stub: crop to rank+suit corner */
  overflow: hidden;
  gap: 0;
  align-items: center;
  /* Upright — same orientation/face as North/South; no rotate */
  transform: none;
}
.hand-suit-rows .playing-card + .playing-card {
  /* Fallback peek; JS clamps to column width */
  margin-left: calc(var(--ew-card-w) * -0.62);
}
.hand-suit-rows--E .playing-card + .playing-card {
  margin-left: calc(var(--ew-card-w) * -0.62);
}
.hand-suit-rows .playing-card__rank {
  font-size: var(--ew-rank);
  line-height: var(--card-face-rank-lh, 0.88);
  font-weight: var(--card-face-weight, 700);
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
.hand-suit-rows .playing-card__rank--ten,
.hand-suit-rows .playing-card--ten .playing-card__rank--ten {
  /* Full "10" glyphs; JS scaleX fits them in the peek — never clip then scale */
  font-size: calc(var(--ew-rank) * 0.9);
  font-weight: var(--card-face-weight, 700);
  letter-spacing: -0.08em;
  line-height: var(--card-face-rank-lh, 0.88);
  transform: scaleX(0.88);
  transform-origin: center center;
  display: inline-block;
  padding-left: 0;
  padding-right: 0;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
  text-align: center;
}
.hand-suit-rows .playing-card--ten {
  padding-left: 0;
  align-items: center;
}
.hand-suit-rows .playing-card__suit {
  font-size: var(--ew-suit);
  margin-left: 0;
  line-height: var(--card-face-suit-lh, 0.9);
  font-weight: var(--card-face-weight, 700);
  margin-top: 0;
  display: inline-block;
  transform: scale(var(--card-face-suit-scale, 1));
  transform-origin: center top;
  text-align: center;
}
.hand-suit-rows .playing-card.is-playable {
  outline-width: 1.5px;
}
.playing-card {
  /* Default = hand stub; trick slots override to full --card-* */
  flex: 0 0 var(--hand-card-w);
  width: var(--hand-card-w);
  height: var(--hand-card-h);
  margin-left: 0;
  background: #fffef9;
  border: 1px solid rgba(0,0,0,0.28);
  border-radius: 0.3rem;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  /* Center rank/suit in the peek strip (narrow J/Q were left-biased). */
  align-items: center;
  justify-content: flex-start;
  padding: var(--card-face-pad-top, 0.06rem) 0 0;
  gap: 0;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #1a1a1a; /* never inherit ivory from the felt */
  opacity: 1;
  filter: none;
}
/* Playable cards are <button> — reset UA chrome so faces stay crisp white */
button.playing-card {
  appearance: none;
  -webkit-appearance: none;
  background: #fffef9;
  color: #1a1a1a;
  font: inherit;
  margin: 0;
  cursor: pointer;
  opacity: 1;
  filter: none;
}
button.playing-card.is-illegal {
  opacity: 1;
}
/* Fixed BBO peek fallback; JS sets exact margin from --hand-peek */
.playing-card + .playing-card {
  margin-left: calc(var(--hand-peek) - var(--hand-card-w));
}
.playing-card__rank {
  font-weight: var(--card-face-weight, 700);
  font-size: var(--hand-rank);
  line-height: var(--card-face-rank-lh, 0.88);
  font-variant-numeric: tabular-nums;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
/* No per-glyph optical nudge — J/Q were over-corrected after #114. */
.playing-card__rank--ten {
  /* Same height band as A/K/Q; slight scaleX so both digits read as "10" */
  font-size: calc(var(--hand-rank) * 0.9);
  font-weight: var(--card-face-weight, 700);
  letter-spacing: -0.1em;
  display: inline-block;
  line-height: var(--card-face-rank-lh, 0.88);
  transform: scaleX(0.88);
  transform-origin: center center;
  padding-left: 0;
  padding-right: 0;
  max-width: none;
  font-variant-numeric: lining-nums;
  white-space: nowrap;
  text-align: center;
}
.playing-card--ten {
  /* Equal width; glyphs centered in the peek */
  flex-basis: var(--hand-card-w);
  width: var(--hand-card-w);
  padding-left: 0;
  align-items: center;
}
.playing-card--ten .playing-card__rank--ten {
  overflow: visible;
}
.playing-card__suit {
  font-size: var(--hand-suit);
  font-weight: var(--card-face-weight, 700);
  line-height: var(--card-face-suit-lh, 0.9);
  margin-top: 0;
  display: inline-block;
  transform: scale(var(--card-face-suit-scale, 1));
  transform-origin: center top;
  text-align: center;
}
/* Trick cards: fixed full face — bold rank + suit like BBO center cards */
.trick-slot .playing-card {
  flex: 0 0 var(--trick-card-w, var(--card-w));
  width: var(--trick-card-w, var(--card-w));
  height: var(--trick-card-h, var(--card-h));
  overflow: hidden;
  align-items: center;
  justify-content: flex-start;
  padding: 0.08em 0.05em 0.06em;
  gap: 0;
  /* Don't inherit hand-stub suit scale — trick faces size from --trick-card-* */
  --card-face-suit-scale: 1;
}
.trick-slot .playing-card__rank {
  /* ~42% of card height — large & bold on the fixed face */
  font-size: min(var(--card-rank), calc(var(--trick-card-h, var(--card-h)) * 0.42));
  font-weight: 800;
  line-height: 0.9;
  text-align: center;
  width: 100%;
}
.trick-slot .playing-card__rank--ten {
  font-size: min(
    calc(var(--card-rank) * 0.92),
    calc(var(--trick-card-h, var(--card-h)) * 0.38)
  );
  transform: scaleX(0.9);
  transform-origin: center center;
  letter-spacing: -0.08em;
}
.trick-slot .playing-card__suit {
  /* ~36% of card height so rank + suit both fit with a little margin */
  font-size: min(var(--card-suit), calc(var(--trick-card-h, var(--card-h)) * 0.36));
  font-weight: 800;
  line-height: 0.92;
  text-align: center;
  width: 100%;
  transform: none;
  margin-top: 0.01em;
}

/* —— Wider layouts —— */
@media (min-width: 768px) {
  :root {
    --card-w: clamp(60px, 9vw, 80px);
    --card-h: clamp(110px, 16.5vw, 148px);
    --card-rank: clamp(1.65rem, 2.6vw, 2.1rem);
    --card-suit: clamp(1.45rem, 2.3vw, 1.9rem);
  }

  .table-app {
    height: auto;
    max-height: none;
    min-height: calc(100dvh - var(--nav-h));
    padding-bottom: 1rem;
  }

  .felt {
    margin: 0.75rem auto;
    /* Cap by --felt-max-h so auction/bid stay reachable on short desktops */
    width: min(720px, 92vw, 70vh, var(--felt-max-h));
    aspect-ratio: 1 / 1;
    max-height: var(--felt-max-h);
    flex: none;
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
    /* Tablet/desktop: wider side columns for stubs */
    --ew-hand-w: clamp(9rem, 22vw, 13rem);
    --ew-side: calc(var(--ew-hand-w) + 1.75rem);
  }

  .bid-box { --tap: 48px; }
  .seat-box__name { max-width: none; }
  .meaning-panel { font-size: 0.78rem; }
  .below-table {
    width: min(720px, 92vw);
    margin: 0 auto;
  }
  .below-table .auction-row {
    max-height: min(14rem, 28vh);
    grid-template-columns: minmax(0, 56%) minmax(0, 1fr);
  }
  /* Bidding / dual-hand peeks only — never override live E/W dummy columns */
  .felt.has-hands:not(.play-dummy-E):not(.play-dummy-W),
  .felt[data-phase="bidding"] {
    grid-template-columns: var(--ew-side) minmax(0, 1fr) var(--ew-side);
  }

  /* Re-assert play dummy caps after tablet felt sizing (≤30% of felt, not vw) */
  .felt[data-phase="play"].play-dummy-E {
    grid-template-columns: 2.75rem minmax(0, 1fr) minmax(7rem, 28%);
  }
  .felt[data-phase="play"].play-dummy-W {
    grid-template-columns: minmax(7rem, 28%) minmax(0, 1fr) 2.75rem;
  }
  body[data-card-size="large"] .felt[data-phase="play"].play-dummy-E,
  body:not([data-card-size]) .felt[data-phase="play"].play-dummy-E {
    grid-template-columns: 2.75rem minmax(0, 1fr) minmax(7.2rem, 30%);
  }
  body[data-card-size="large"] .felt[data-phase="play"].play-dummy-W,
  body:not([data-card-size]) .felt[data-phase="play"].play-dummy-W {
    grid-template-columns: minmax(7.2rem, 30%) minmax(0, 1fr) 2.75rem;
  }
  body[data-card-size="bbo"] .felt[data-phase="play"].play-dummy-E {
    grid-template-columns: 2.75rem minmax(0, 1fr) minmax(7.4rem, 30%);
  }
  body[data-card-size="bbo"] .felt[data-phase="play"].play-dummy-W {
    grid-template-columns: minmax(7.4rem, 30%) minmax(0, 1fr) 2.75rem;
  }
}

@media (min-width: 1100px) {
  :root {
    --card-w: clamp(68px, 6.5vw, 88px);
    --card-h: clamp(124px, 12vw, 160px);
  }
  .felt {
    width: min(780px, 90vw, 74vh, var(--felt-max-h));
  }
  .below-table { width: min(780px, 90vw); }
}

/*
 * Short + wide desktop/laptop (e.g. Edge ~1018×826, 1280×720, 1366×768):
 * put auction/bid beside the felt so the table + bidding fit without scrolling.
 * Thresholds keep phone portrait (≤430) and iPad mini (768×1024) on the stacked
 * layout they already use. Placed AFTER tablet/desktop felt sizing so width/flex win.
 */
@media (min-width: 960px) and (max-height: 900px) {
  .table-app {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    column-gap: 0.55rem;
  }
  .board-strip {
    flex: 0 0 100%;
    order: 1;
  }
  .felt {
    order: 2;
    /* Keep the square — do not flex-grow wider than tall */
    flex: 0 1 auto;
    /* Fill height beside the bidding column; leave a tiny margin */
    --below-reserve: 0.6rem;
    --felt-max-h: calc(100dvh - var(--nav-h) - var(--status-h) - var(--below-reserve));
    width: min(100%, var(--felt-max-h));
    max-width: calc(100% - 22.5rem);
    max-height: var(--felt-max-h);
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0.35rem 0 0.35rem 0.45rem;
  }
  .below-table {
    order: 3;
    flex: 0 0 21.5rem;
    width: 21.5rem;
    max-width: calc(100vw - 2rem);
    align-self: stretch;
    max-height: calc(100dvh - var(--nav-h) - var(--status-h) - 0.5rem);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.35rem 0.55rem calc(0.4rem + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }
  .declarer-coach {
    order: 4;
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
  }
  /* Slightly denser bidding chrome so the side column fits 720–826 tall */
  .below-table .auction-row {
    --auction-row-h: 1.32rem;
    --auction-head-h: 1rem;
    --auction-grid-pad: 0.56rem;
  }
  .below-table .bid-box {
    --tap: 36px;
    padding: 0.24rem 0.22rem 0.28rem;
  }
  :root {
    --hand-peek: clamp(22px, 3.4vw, 30px);
  }
}

/* Taller desktops still get a felt cap so auction + bid stay on-screen
 * without a side column (1920×1080 stacks with room for the bid pad). */
@media (min-width: 960px) and (min-height: 901px) and (max-height: 1200px) {
  .felt {
    /* Room for auction row + bid pad + Deal/Review/Other on stacked desktop */
    --below-reserve: 18.5rem;
  }
}

/* —— Modal —— */
.modal {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  background: #16281f;
  color: var(--ivory);
  width: min(92vw, 36rem);
}
.modal::backdrop { background: rgba(0,0,0,0.55); }
.modal__inner { margin: 0; padding: 1rem 1rem 1.1rem; }
.modal__inner h2 {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}
.modal textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.3);
  color: var(--ivory);
  padding: 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  resize: vertical;
}
.modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

/* —— History (full-screen ivory sheet, covers / replaces sticky app-nav) —— */
body.page-history.has-history-sheet {
  overflow: hidden;
  background: #f7f4ec;
}
.history-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 72;
  display: flex;
  flex-direction: column;
  background: #f7f4ec;
}
.history-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7f4ec;
  color: #1c1914;
  box-sizing: border-box;
}
.history-sheet__head.sheet-head {
  position: sticky;
  top: 0;
  z-index: 3;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin: 0;
  padding:
    calc(0.65rem + env(safe-area-inset-top, 0px))
    0.85rem
    0.55rem;
  background: #f7f4ec;
  border-bottom: 1px solid rgba(58, 52, 40, 0.14);
  color: #1c1914;
}
.history-sheet__head .sheet-head__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  color: #1c1914;
}
.history-sheet__head .sheet-close-label {
  text-decoration: none;
}
.history-sheet__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0;
  box-sizing: border-box;
}
.history {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.85rem 0.85rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  color: #1c1914;
}
.history__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.history__intro {
  flex: 1 1 10rem;
  min-width: 0;
}
.history__subtitle {
  font-family: var(--font-display);
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  color: #1c1914;
}
.history__goto {
  display: grid;
  grid-template-columns: auto minmax(0, 7rem) auto;
  grid-template-areas:
    "label input btn"
    "hint hint hint";
  gap: 0.35rem 0.45rem;
  align-items: center;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(58, 52, 40, 0.12);
}
.history__goto-label {
  grid-area: label;
  font-weight: 700;
  color: #1c1914;
  white-space: nowrap;
}
.history__goto-input {
  grid-area: input;
  min-height: 44px;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(58, 52, 40, 0.22);
  font-size: 1.05rem;
  font-weight: 650;
  color: #1c1914;
  background: #fff;
}
.history__goto-btn {
  grid-area: btn;
  min-height: 44px;
  min-width: 3.5rem;
  padding-inline: 0.9rem;
}
.history__goto-hint {
  grid-area: hint;
  margin: 0;
  font-size: 0.78rem;
  color: #6a6154;
}
.history__list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.history__item a {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(58, 52, 40, 0.12);
  color: #1c1914;
  box-shadow: 0 1px 2px rgba(28, 25, 20, 0.04);
  text-decoration: none;
}
.history__id {
  flex: 0 0 auto;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #1c1914;
  min-width: 2.6rem;
}
.history__line {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.35rem;
  min-width: 0;
  font-size: 0.92rem;
  color: #3f3a32;
  line-height: 1.35;
}
.history__bd { font-weight: 650; color: #1c1914; }
.history__when { color: #6a6154; }
.history__contract { font-weight: 700; color: #7a5a18; }
.history__sep { color: #9a9184; font-weight: 500; }
.history__board { font-weight: 650; color: #1c1914; }
.history__meta { font-size: 0.85rem; color: #6a6154; }
.vul-text.is-vul { color: var(--vul); font-weight: 600; }
.history__empty, .history__error { color: #6a6154; }
.history__who {
  margin: 0;
  font-size: 0.9rem;
  color: #5a5348;
}
.history__who strong {
  color: #1c1914;
  font-weight: 700;
}
.history__header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}
.history__header-actions .btn {
  min-height: 44px;
}
.history-sheet__close-bottom {
  display: flex;
  width: 100%;
  max-width: 22rem;
  margin: 0.85rem auto 0.25rem;
  min-height: 48px;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 700;
  box-sizing: border-box;
  justify-content: center;
  text-decoration: none;
}

/* Flag a misplay */
.playing-card.is-flaggable {
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 0 0 1.5px rgba(232, 196, 90, 0.55);
}
.playing-card.is-flaggable:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.play-review-sheet__flag-row {
  display: flex;
  justify-content: center;
  padding: 0.35rem 0.75rem 0.15rem;
}
.flag-misplay-btn {
  min-height: 2.6rem;
  min-width: 9.5rem;
  padding: 0.55rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  touch-action: manipulation;
}
.flag-misplay-modal__inner {
  width: min(94vw, 22rem);
}
.flag-misplay-modal__card {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}
.flag-misplay-modal__note-label {
  display: block;
  font-size: 0.85rem;
  color: var(--ivory-muted);
  margin-bottom: 0.3rem;
}
.flag-misplay-modal__note {
  font-family: var(--font-body, Outfit, sans-serif) !important;
  font-size: 1rem !important;
  min-height: 4.5rem;
}
.flag-misplay-modal__status {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  color: var(--gold-soft);
}
.flag-misplay-modal__status.is-error { color: #f0b4a8; }
.flag-misplay-modal__status[hidden] { display: none !important; }

.flags__list .flags__item {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.flags__row {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "board play"
    "contract when";
  gap: 0.15rem 0.85rem;
}
.flags__row .history__board { grid-area: board; }
.flags__play { grid-area: play; text-align: right; }
.flags__row .history__contract { grid-area: contract; text-align: left; }
.flags__row .history__when { grid-area: when; }
.flags__dd {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: var(--gold-soft);
  line-height: 1.35;
}
.flags__note {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--ivory-muted);
  font-style: italic;
}
.flags__open {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: var(--gold);
  text-decoration: underline;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Convention card builder */
.page-card {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(196,163,90,0.12), transparent 50%),
    linear-gradient(165deg, #0c1c14 0%, #163528 45%, #0f241a 100%);
  min-height: 100dvh;
  color: var(--ivory);
}
.card-app {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
}
.card-app__brand {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0.2rem 0 0.35rem;
  color: #f3efe6;
}
.card-app__lede {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--gold-soft);
}
.card-panel,
.card-options,
.card-explain,
.card-summary {
  background: rgba(8, 22, 16, 0.88);
  border: 1px solid rgba(196, 163, 90, 0.28);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
}
.card-panel__row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}
.card-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  font-size: 0.8rem;
  color: var(--ivory-muted, #c5d0c8);
}
.card-field input,
.card-field select,
.card-option select {
  min-height: 2.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: var(--ivory);
  padding: 0.4rem 0.55rem;
  font-size: 0.95rem;
}
.card-base {
  border: 0;
  margin: 0.75rem 0 0.35rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.card-base legend {
  font-size: 0.8rem;
  color: var(--ivory-muted, #c5d0c8);
  margin-bottom: 0.35rem;
  padding: 0;
  width: 100%;
}
.card-radio {
  font-size: 0.9rem;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.card-toggle { margin-top: 0.5rem; }
.card-options__cat {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.card-option {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.card-option--deviation {
  background: rgba(196, 163, 90, 0.08);
  margin: 0 -0.35rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  border-radius: 6px;
}
.card-option--disabled {
  opacity: 0.45;
  pointer-events: none;
}
.card-option__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.card-option__label-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}
.card-option__label {
  background: none;
  border: 0;
  color: var(--ivory);
  font-size: 0.92rem;
  text-align: left;
  padding: 0;
  cursor: pointer;
  text-decoration: underline dotted rgba(196,163,90,0.5);
}
.card-option__deviation {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1408;
  background: var(--gold-soft, #c4a35a);
  border-radius: 3px;
  padding: 0.12rem 0.28rem;
  line-height: 1.2;
}
.card-explain__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--gold-soft);
}
.card-explain__text {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  line-height: 1.4;
}
.card-explain__ex-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
}
.card-explain__hand,
.card-explain__auction,
.card-explain__note {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--ivory-muted, #c5d0c8);
}
.card-summary h2 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--gold-soft);
}
.card-summary__pre {
  margin: 0 0 0.5rem;
  white-space: pre-wrap;
  font-family: Outfit, system-ui, sans-serif;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ivory);
}
.card-actions {
  position: sticky;
  bottom: 0;
  padding: 0.65rem 0 0.25rem;
  background: linear-gradient(transparent, rgba(12,28,20,0.95) 30%);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.card-actions__status {
  width: 100%;
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--gold-soft);
}
@media print {
  .app-nav, .card-actions, .card-options, .card-panel, .card-explain, .card-app__lede {
    display: none !important;
  }
  .card-summary {
    border: 1px solid #333;
    background: #fff;
    color: #111;
  }
  .card-summary__pre { color: #111; }
  .card-app__brand { color: #111; }
}

/* Deal wait overlay — centered pill on the felt while shuffle sound plays */
.deal-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 28; /* above .eoh-result (18) and felt peeks; below popovers */
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(12, 40, 28, 0.82);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  color: #f4f7f5;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  box-sizing: border-box;
}
.deal-status[hidden] { display: none !important; }
.deal-status__spinner {
  width: 0.95rem;
  height: 1.25rem;
  border-radius: 0.18rem;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.05)),
    repeating-linear-gradient(
      90deg,
      transparent 0 2px,
      rgba(255, 255, 255, 0.18) 2px 3px
    );
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  animation: deal-card-spin 1.05s ease-in-out infinite;
  transform-origin: center center;
  flex: 0 0 auto;
}
.deal-status__label {
  line-height: 1;
}
@keyframes deal-card-spin {
  0%   { transform: rotate(-8deg) translateY(0); opacity: 0.9; }
  40%  { transform: rotate(10deg) translateY(-1px); opacity: 1; }
  70%  { transform: rotate(-4deg) translateY(1px); opacity: 0.95; }
  100% { transform: rotate(-8deg) translateY(0); opacity: 0.9; }
}

/* End-of-hand field/IMP compute — placeholder BELOW the table (not over the felt).
 * Felt stays visible (hands + Made/Down). Chrome taps blocked via body.has-imps-busy. */
body.has-imps-busy .app-nav,
body.has-imps-busy .board-strip,
body.has-imps-busy .tools-menu,
body.has-imps-busy .below-play__actions {
  pointer-events: none !important;
}
body.has-imps-busy .felt .hand,
body.has-imps-busy .felt .seat-box__chip,
body.has-imps-busy .felt .trick-slot {
  pointer-events: none; /* view-only while waiting */
}
.imps-busy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  margin: 0.15rem auto 0.35rem;
  min-height: 3.4rem;
  box-sizing: border-box;
  pointer-events: auto;
}
.imps-busy[hidden] { display: none !important; }
.imps-busy__panel {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.72rem 1.05rem 0.78rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(12, 40, 28, 0.88);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  color: #f4f7f5;
  box-sizing: border-box;
}
.imps-busy.is-computing .imps-busy__panel {
  flex-direction: row;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  gap: 0.45rem;
}
.imps-busy__label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}
.imps-busy.is-error .imps-busy__label {
  white-space: normal;
}
.imps-busy__spinner[hidden] { display: none !important; }
.imps-busy__retry {
  min-width: 6.5rem;
  pointer-events: auto !important;
}
.imps-busy__retry[hidden] { display: none !important; }

/* —— Admin console (M3) —— */
body.page-admin.has-admin-sheet {
  overflow: hidden;
  background: #f7f4ec;
}
.admin-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 72;
  display: flex;
  flex-direction: column;
  background: #f7f4ec;
}
.admin-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7f4ec;
  color: #1c1914;
  box-sizing: border-box;
}
.admin-sheet__head.sheet-head {
  position: sticky;
  top: 0;
  z-index: 3;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin: 0;
  padding:
    calc(0.65rem + env(safe-area-inset-top, 0px))
    0.85rem
    0.55rem;
  background: #f7f4ec;
  border-bottom: 1px solid rgba(58, 52, 40, 0.14);
  color: #1c1914;
}
.admin-sheet__head .sheet-head__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1c1914;
}
.admin-sheet__body {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 0.85rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  max-width: 40rem;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.admin-section {
  margin: 0 0 1.5rem;
}
.admin-section__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1c1914;
}
.admin-section__hint {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: #5c564c;
  line-height: 1.4;
}
.admin-invite-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.admin-invite-form .field span,
.admin-filters .field span {
  color: #3a3428;
}
.admin-invite-form input,
.admin-filters select {
  background: #fff;
  color: #1c1914;
  border: 1px solid rgba(58, 52, 40, 0.22);
}
.field__optional {
  font-weight: 400;
  color: #7a7368;
  font-size: 0.85em;
}
.admin-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0.5rem 0 0.75rem;
}
.field--inline {
  flex: 1 1 8rem;
  min-width: 7rem;
}
.admin-status {
  margin: 0.5rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(61, 107, 79, 0.12);
  color: #1f3d2c;
  font-size: 0.9rem;
}
.admin-status--error {
  background: rgba(196, 92, 74, 0.14);
  color: #7a2e24;
}
.admin-user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.admin-user {
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(58, 52, 40, 0.14);
  border-radius: 10px;
  background: #fffef9;
}
.admin-user--empty {
  color: #5c564c;
  font-size: 0.92rem;
  border-style: dashed;
  background: transparent;
}
.admin-user__title {
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 0.2rem;
}
.admin-user__uname {
  color: #6b6458;
  font-size: 0.9em;
}
.admin-user__meta {
  font-size: 0.82rem;
  color: #5c564c;
  line-height: 1.35;
  margin: 0 0 0.55rem;
  word-break: break-word;
}
.admin-user__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.admin-user__actions .btn--small {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  color: #1c1914;
  border-color: rgba(58, 52, 40, 0.28);
  background: #f3efe4;
}
