[hidden] { display: none !important; }

@font-face { font-family: 'Fraunces'; src: url(../fonts/fraunces.woff2) format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url(../fonts/figtree.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #1c1410;
  --bg2: #2a1d15;
  --ink: #f3e7d6;
  --muted: #b9a58e;
  --brass: #d6ae55;
  --copper: #c46f37;
  --silver: #c3c9cf;
  --card: #2b1f17;
  --line: rgba(214, 174, 85, 0.35);
  --accent: #e7b75a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: Figtree, system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
.noscript { padding: 2rem; text-align: center; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 10px 8px;
  background: linear-gradient(#2a1d15, #1c1410);
  border-bottom: 1px solid rgba(214, 174, 85, 0.18);
  min-height: 52px;
}
.who { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
.who.right { justify-content: flex-end; text-align: right; }
.who .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .togo { color: var(--muted); font-size: 12px; white-space: nowrap; }
.who .togo:not(:empty)::after { content: ' to go'; }
.who.on .name { color: var(--accent); }
.who:not(.on) { opacity: 0.7; }
.who.solo .swatch { display: none; }
.who.solo { opacity: 1; }
.swatch { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: inset -2px -2px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.5); }
.swatch.copper { background: radial-gradient(circle at 35% 30%, #f2b27a, #c46f37 55%, #7b3c18); }
.swatch.silver { background: radial-gradient(circle at 35% 30%, #fff, #bfc5cb 55%, #80868c); }
.status { font-family: Fraunces, Georgia, serif; font-size: 15px; text-align: center; white-space: nowrap; }
.menu-btn {
  background: none; border: 1px solid var(--line); border-radius: 10px;
  width: 38px; height: 38px; font-size: 18px; cursor: pointer;
}

.table {
  position: relative; flex: 1; min-height: 0;
  background: radial-gradient(ellipse at 50% 40%, #33241a 0%, #1c1410 70%);
}
#board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }

.banner {
  position: absolute; left: 50%; top: 72%; transform: translate(-50%, -50%);
  background: rgba(28, 20, 16, 0.92); border: 1px solid var(--line);
  padding: 12px 20px; border-radius: 14px; text-align: center;
  font-family: Fraunces, Georgia, serif; font-size: 20px;
  width: max-content; max-width: min(86vw, 420px);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  pointer-events: none;
  animation: pop .25s ease-out;
}
.banner small { display: block; font-family: Figtree, sans-serif; font-size: 14px; color: var(--muted); margin-top: 4px; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -40%) scale(.96); } }

.sheet {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 8, 6, 0.72);
  padding: 16px; overflow-y: auto;
  -webkit-user-select: text; user-select: text;
}
.sheet[hidden] { display: none; }
#title { background: radial-gradient(ellipse at 50% 20%, #3a2819, #120c09 75%); align-items: flex-start; }
.card {
  width: 100%; max-width: 440px; margin: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 20px 14px; box-shadow: 0 20px 50px rgba(0,0,0,.55);
  display: flex; flex-direction: column; gap: 10px;
}
.card.small { max-width: 340px; }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 40px; margin: 0; color: var(--accent); letter-spacing: -0.5px; text-align: center; }
h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 19px; margin: 10px 0 0; }
.lede { color: var(--muted); margin: 0 0 6px; text-align: center; line-height: 1.4; }

.card button {
  display: block; width: 100%; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); text-align: left;
}
.card button:hover, .card button:focus-visible { background: rgba(214, 174, 85, 0.1); outline: none; }
.card > button { text-align: center; }
.card button.primary { background: var(--accent); color: #241509; border: none; font-weight: 700; text-align: center; font-size: 17px; }
.card button.primary:hover, .card button.primary:focus-visible { background: #f1c873; }
.card button.link { background: none; border: none; text-align: center; color: var(--muted); text-decoration: underline; padding: 6px; }

.opponents, .seg { display: grid; gap: 8px; }
.seg { grid-template-columns: 1fr 1fr; }
.opponents button, .seg button { display: flex; flex-direction: column; gap: 2px; }
.opponents button b, .seg button b { font-size: 16px; }
.opponents button span, .seg button span { font-size: 13px; color: var(--muted); }
.opponents button[aria-pressed="true"], .seg button[aria-pressed="true"] { border-color: var(--accent); background: rgba(231, 183, 90, 0.14); box-shadow: inset 0 0 0 1px var(--accent); }
.opponents .rec { color: var(--brass); font-size: 12px; }

.rules { margin: 0; padding-left: 18px; line-height: 1.45; display: grid; gap: 8px; }
.rules b { color: var(--accent); font-weight: 600; }

#overText { color: var(--muted); margin: 0; line-height: 1.4; white-space: pre-line; }

.jd-foot { text-align: center; font-size: 13px; color: var(--muted); padding: 10px 0 2px; }
.jd-foot a { color: var(--muted); text-decoration: none; }
.jd-foot a:hover, .jd-foot a:focus-visible { text-decoration: underline; color: var(--ink); }

@media (max-width: 520px) {
  .status { display: none; }
  .bar { grid-template-columns: 1fr 1fr auto; }
  .who .togo:not(:empty) { background: rgba(255,255,255,0.08); border-radius: 9px; padding: 1px 7px; font-weight: 600; color: var(--ink); }
  .who .togo::after { content: none !important; }
  .status { font-size: 14px; }
  h1 { font-size: 34px; }
}

/* A phone on its side leaves the board too small to aim at. */
.turn-me { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .turn-me {
    position: fixed; inset: 0; z-index: 50;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 24px; text-align: center;
    background: var(--bg); color: var(--ink);
    font-family: Fraunces, Georgia, serif; font-size: 20px;
  }
  .turn-me span { font-size: 40px; }
}
