/* Beyond Board: a private game library at night. Dark walnut, brass, ivory and felt.
   Shared by the TV screens and the tablets. The 3D front screen comes in Phase 6. */
:root {
  --wood-0: #120d0a;
  --wood-1: #1c1410;
  --wood-2: #2a1e17;
  --wood-3: #3a2a20;
  --felt: #1d3a30;
  --felt-2: #24493c;
  --brass: #c9a227;
  --brass-2: #e3c25a;
  --ivory: #efe6d2;
  --ivory-2: #cfc3a8;
  --muted: #9c8e75;
  --danger: #d0694f;
  --good: #7fb37a;
  --line: rgba(201, 162, 39, .28);
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: #120d0a; }
body {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(227, 194, 90, .12), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, .6), transparent 60%),
    linear-gradient(180deg, var(--wood-1), var(--wood-0));
  background-attachment: fixed;
  color: var(--ivory);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }
/* Cormorant's old-style figures drop below the line; codes and scores need level ones. */
body, .serif, .code-input { font-variant-numeric: lining-nums; }
h1 { font-size: 2.6rem; margin: 0; color: var(--brass-2); }
h2 { font-size: 1.7rem; margin: 0 0 .4em; color: var(--ivory); }
h3 { font-size: 1.25rem; margin: 0 0 .4em; color: var(--brass-2); }
p { line-height: 1.45; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
a { color: var(--brass-2); }

.panel {
  background: linear-gradient(180deg, rgba(58, 42, 32, .92), rgba(42, 30, 23, .92));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .04);
  padding: 18px;
}

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 10px; padding: 12px 18px; min-height: 46px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--wood-3), var(--wood-2));
  color: var(--ivory);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button.primary, .btn.primary {
  background: linear-gradient(180deg, var(--brass-2), var(--brass));
  color: #1c1410; border-color: #f0d98a;
}
button.ghost { background: transparent; }
button.danger { color: var(--danger); }
button.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }

input, select, textarea {
  font: inherit; color: var(--ivory);
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; min-height: 46px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
label { display: block; font-size: .85rem; color: var(--ivory-2); margin: 12px 0 6px; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-size: 1.6rem; text-align: center; font-family: var(--serif); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }

.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--brass-2);
}
.tag.good { color: var(--good); border-color: rgba(127, 179, 122, .4); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(201, 162, 39, .12); }
.list li:last-child { border-bottom: 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: rgba(18, 13, 10, .95); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 18px; box-shadow: var(--shadow); z-index: 50; max-width: calc(100% - 32px);
}
.conn { position: fixed; top: 10px; right: 12px; font-size: .8rem; color: var(--muted); z-index: 40; }
.conn.bad { color: var(--danger); }

/* ---- the board (drawn by board.js) ---- */
.board svg { width: 100%; height: auto; display: block; }
.board .cell { fill: var(--felt); stroke: rgba(201, 162, 39, .35); stroke-width: .02; }
.board .cell.alt { fill: var(--felt-2); }
.board .frame { fill: #3b2a1e; stroke: var(--brass); stroke-width: .05; }
.board .target { fill: none; stroke: var(--brass-2); stroke-width: .06; stroke-dasharray: .14 .09; }
.board .legal { fill: rgba(227, 194, 90, .22); stroke: var(--brass-2); stroke-width: .05; cursor: pointer; }
.board .legal:hover { fill: rgba(227, 194, 90, .38); }
.board .marker { stroke: #120d0a; stroke-width: .05; }
.board .marker.turn { stroke: var(--ivory); stroke-width: .07; }
.board .initial { font: 700 .34px var(--sans); fill: #120d0a; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.board .last { fill: none; stroke: rgba(239, 230, 210, .35); stroke-width: .03; }

/* ---------- games made with the rules engine (play.js), on TVs and tablets ---------- */
.pgroup { margin-bottom: 14px; }
.pgroup h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-family: inherit; }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.place {
  background: linear-gradient(180deg, var(--felt-2), var(--felt)); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-height: 92px;
}
.place .pname { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--ivory); line-height: 1.1; }
.place .ptext { font-size: .85rem; color: var(--ivory-2); flex: 1; }
.place .slots { display: flex; gap: 6px; }
.place .slot { width: 14px; height: 14px; border-radius: 50%; border: 1px dashed var(--muted); display: inline-block; }
.place.open { border-color: var(--brass-2); box-shadow: 0 0 0 2px rgba(227, 194, 90, .35); cursor: pointer; }
.place.open:hover, .place.open:focus { background: linear-gradient(180deg, #2c5a4a, var(--felt-2)); outline: none; }
.place.last { box-shadow: 0 0 0 2px rgba(239, 230, 210, .5); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.card {
  background: var(--ivory); color: #241a12; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.card .cname { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; line-height: 1.15; }
.card .cost, .card .ctext, .card .gives { font-size: .85rem; }
.card .gives { font-weight: 600; color: #4a3608; }
.card .tags .tag { color: #6b5212; border-color: rgba(107, 82, 18, .35); font-size: .72rem; }
.amt { white-space: nowrap; }
.amt b { color: var(--brass); font-weight: 400; }
.card .amt b { color: #8a6a10; }
/* The phases of a round (like Skeeple's): where the round is, and what this phase asks. */
.phasestrip { margin: 6px 0 10px; }
.phsegs { display: flex; gap: 4px; margin-bottom: 6px; }
.phseg { flex: 1; min-width: 0; text-align: center; padding: 6px; border-radius: 8px; font-size: .82rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(239, 230, 210, .07); color: var(--ivory-2); }
.phseg.past { background: rgba(239, 230, 210, .13); color: var(--muted); }
.phseg.now { flex: 2.2; background: var(--brass); color: #241a12; }
.phwhere { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.phnote { margin: 4px 0 0; font-size: .95rem; line-height: 1.5; white-space: pre-wrap; color: var(--ivory); }
.phhooks { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.phhook { font-size: .78rem; line-height: 1.35; padding: 3px 9px; border-radius: 999px; border: 1px dashed rgba(157, 134, 216, .7); background: rgba(110, 90, 168, .22); color: var(--ivory); }
.phhook b { color: #c9b8f0; font-weight: 800; margin-right: 2px; }
/* Table modules, like Skeeple's: timers, an auction, upkeep, trading and the score sheet. */
.clocks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 10px; font-size: .9rem; font-variant-numeric: lining-nums tabular-nums; }
.clocks .clkl { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.clocks .clk { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ivory-2); }
.clocks .clk.game { color: var(--brass-2); font-weight: 700; }
.clocks .clk.on { background: rgba(227, 194, 90, .16); color: var(--ivory); font-weight: 700; }
.auction, .scoresheet, .upkeep, .trade { border: 1px solid var(--brass); border-radius: 12px; padding: 10px 12px; margin: 6px 0 12px;
  background: linear-gradient(180deg, rgba(210, 162, 76, .2), rgba(210, 162, 76, .07)); }
.auction p, .scoresheet p { margin: 4px 0; }
.auction .auhead { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.auction .auhead b, .scoresheet > b, .trade > b, .upkeep > b { font-family: var(--serif); font-size: 1.2rem; color: var(--brass-2); }
.auction.mine { box-shadow: 0 0 0 2px var(--brass-2), 0 0 24px rgba(227, 194, 90, .25); }
.auction.done { padding: 8px 12px; border-color: var(--line); background: rgba(239, 230, 210, .05); }
.auction .austat { font-size: 1rem; }
.bidform, .scoresheet form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; background: rgba(0, 0, 0, .22); border-radius: 10px; padding: 10px; }
.bidrows { display: flex; flex-direction: column; gap: 6px; }
.bidrow { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.bidrow input { width: 90px; text-align: center; font-size: 1.1rem; }
.upkeep { border-color: var(--line); background: rgba(239, 230, 210, .05); font-size: .95rem; }
.upkeep ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.upkeep .uk { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; font-weight: 700; white-space: nowrap; }
.upkeep .uk.pay { color: #f0a58f; }
.upkeep .uk.gain { color: #a8d8a2; }
.upkeep .uk .small { font-weight: 400; color: var(--ivory-2); }
.trade { border-color: var(--line); background: rgba(239, 230, 210, .05); }
.trade .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.trade input[type=number] { width: 80px; }
.trade select { flex: 1; min-width: 120px; }
.roll .die { display: inline-block; background: var(--ivory); color: #241a12; border-radius: 6px; padding: 2px 8px; font-weight: 700; margin-right: 4px; }
table.res { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
table.res th { text-align: center; color: var(--brass-2); font-weight: 600; padding: 6px; font-size: .9rem; }
table.res td { text-align: center; padding: 8px 6px; border-top: 1px solid var(--line); }
table.res td:first-child, table.res th:first-child { text-align: left; white-space: nowrap; }
table.res tr.now td { background: rgba(227, 194, 90, .1); }
table.res tr.me td:first-child { font-weight: 700; }
table.res td.score { font-family: var(--serif); font-size: 1.3em; color: var(--brass-2); text-align: left; }
.moves { display: flex; flex-direction: column; gap: 8px; }
.moves .move { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; }
.myres { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.myres .mr { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.myres .mr .big { font-family: var(--serif); font-size: 1.8rem; color: var(--brass-2); line-height: 1; font-variant-numeric: lining-nums; }
.myres .mr.secret { border-style: dashed; }
table.res th .ico { color: var(--brass); font-weight: 400; font-size: 1.1em; }
/* A board picture with places drawn on it. */
/* On a phone the board scrolls sideways rather than shrinking past the point where places can be tapped. */
.boardscroll { overflow-x: auto; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.boardscroll > .boardpic { min-width: 640px; margin-bottom: 0; }
.boardpic { position: relative; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #120d0a; margin-bottom: 14px; }
.boardpic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.boardpic .area {
  position: absolute; border: 2px solid rgba(239, 230, 210, .35); border-radius: 8px; display: flex; flex-direction: column;
  justify-content: space-between; padding: 3px 5px; background: rgba(18, 13, 10, .18);
}
.boardpic .area .alabel { font-size: .72rem; background: rgba(18, 13, 10, .72); color: var(--ivory); border-radius: 4px; padding: 1px 5px; align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boardpic .area .slots { display: flex; gap: 3px; flex-wrap: wrap; }
/* Framed boxes (the game's "show the boxes" setting): a thin brass frame with lit corners over a
   soft shade, the name on a little plaque, so a space reads as part of the board. */
.boardpic.boxes-show .area {
  border: 1px solid rgba(227, 194, 90, .55); border-radius: 10px;
  background-color: transparent; background-image: linear-gradient(180deg, rgba(18, 13, 10, .06), rgba(18, 13, 10, .34));
  box-shadow: inset 0 0 0 1px rgba(18, 13, 10, .5), inset 0 0 14px rgba(227, 194, 90, .12), 0 2px 10px rgba(0, 0, 0, .35);
  transition: box-shadow .25s, border-color .25s, background-color .25s;
}
.boardpic.boxes-show .area::before {
  content: ''; position: absolute; inset: 3px; border-radius: 7px; pointer-events: none;
  --k: rgba(243, 214, 122, .95);
  background:
    linear-gradient(var(--k), var(--k)) top left / 12px 2px no-repeat, linear-gradient(var(--k), var(--k)) top left / 2px 12px no-repeat,
    linear-gradient(var(--k), var(--k)) top right / 12px 2px no-repeat, linear-gradient(var(--k), var(--k)) top right / 2px 12px no-repeat,
    linear-gradient(var(--k), var(--k)) bottom left / 12px 2px no-repeat, linear-gradient(var(--k), var(--k)) bottom left / 2px 12px no-repeat,
    linear-gradient(var(--k), var(--k)) bottom right / 12px 2px no-repeat, linear-gradient(var(--k), var(--k)) bottom right / 2px 12px no-repeat;
}
.boardpic.boxes-show .area .alabel {
  font: 600 clamp(.74rem, 1.05vw, 1rem)/1.25 var(--serif, Georgia, serif); letter-spacing: .02em; color: #f6ecd2; margin: 2px 0 0 3px;
  background: linear-gradient(180deg, rgba(42, 31, 22, .92), rgba(20, 14, 10, .92));
  border: 1px solid rgba(227, 194, 90, .55); border-radius: 5px; padding: 1px 7px; box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.boardpic.boxes-show .area.open { border-color: var(--brass-2); animation: areaLit 1.8s ease-in-out infinite; cursor: pointer; }
.boardpic.boxes-show .area.open::before { --k: #fff3c4; }
.boardpic.boxes-show .area.built::before { --k: var(--pc, var(--brass-2)); }
@keyframes areaLit {
  0%, 100% { box-shadow: 0 0 0 2px rgba(227, 194, 90, .55), 0 0 14px rgba(243, 198, 90, .45), inset 0 0 0 999px rgba(227, 194, 90, .10); }
  50% { box-shadow: 0 0 0 3px rgba(243, 214, 122, .85), 0 0 26px rgba(243, 198, 90, .7), inset 0 0 0 999px rgba(227, 194, 90, .18); }
}
@media (prefers-reduced-motion: reduce) { .boardpic.boxes-show .area.open { animation: none; box-shadow: 0 0 0 3px rgba(227, 194, 90, .7), inset 0 0 0 999px rgba(227, 194, 90, .14); } }
/* Hidden boxes: the board picture speaks for itself; a space only shows when it can be chosen
   (and the pieces on it always show). */
.boardpic.boxes-hide .area:not(.built) { border-color: transparent; background: transparent; }
.boardpic.boxes-hide .area:not(.open) .alabel, .boardpic.boxes-hide .area:not(.open) .syms { opacity: 0; }
.boardpic.boxes-hide .area:not(.open) .ibtn { opacity: .55; transform: scale(.8); }
.boardpic.boxes-hide .area:hover .alabel, .boardpic.boxes-hide .area:focus-within .alabel { opacity: 1; }
.boardpic .area.open { border-color: var(--brass-2); box-shadow: 0 0 0 3px rgba(227, 194, 90, .45), inset 0 0 0 999px rgba(227, 194, 90, .12); cursor: pointer; }
.boardpic.boxes-show .area.last { border-color: var(--ivory); }
.boardpic .area.last { border-color: var(--ivory); }
/* A board's name, when a game has more than one board. */
.bhead { margin: 14px 0 6px; font-family: var(--serif, Georgia, serif); color: var(--brass-2); font-size: 1rem; }
.bhead:first-child { margin-top: 0; }
.boardpic .area.built { border-color: var(--pc, var(--brass)); background-color: rgba(18, 13, 10, .55); background-size: cover; background-position: center; }
.boardpic .area.built .alabel { white-space: normal; font-size: .62rem; line-height: 1.15; }
/* Player boards (mats): one per player, on tablets and the TV players view. */
.mat { border: 1px solid var(--line); border-top: 4px solid var(--pc, var(--brass)); border-radius: 12px; padding: 10px 12px; background: rgba(0, 0, 0, .18); }
.mathead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.matgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.matgrid .mr { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; font-size: .85rem; }
.matgrid .mr .big { font-family: var(--serif); font-size: 1.6rem; color: var(--brass-2); line-height: 1; font-variant-numeric: lining-nums; }
.matgrid .mr.secret { border-style: dashed; }
.pboard .spot { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: rgba(18, 13, 10, .55); border-radius: 8px; color: var(--ivory); overflow: hidden; }
.pboard .spot b { font-family: var(--serif); font-size: clamp(1rem, 3.2vw, 2rem); color: var(--brass-2); line-height: 1; font-variant-numeric: lining-nums; }
.pboard .spot span { font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 3px; }
.mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card .cimg { width: calc(100% + 24px); margin: -10px -12px 4px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px 10px 0 0; display: block; }
/* A card with a picture is drawn as a tile: the art framed in brass on a dark, lantern-lit card. */
.card.tile { background: linear-gradient(180deg, #2a2119, #17110c); color: var(--ivory); border: 1px solid rgba(201, 162, 39, .5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 230, 170, .12); overflow: hidden; }
.card.tile .cimg { box-shadow: 0 1px 0 rgba(201, 162, 39, .55), 0 6px 14px rgba(0, 0, 0, .35); }
.card.tile .cname { color: var(--brass-2); }
.card.tile .cost, .card.tile .gives { color: #e9dcc0; }
.card.tile .amt b { color: var(--brass-2); }
.card.tile .tags .tag { background: rgba(201, 162, 39, .18); color: var(--brass-2); border-color: rgba(201, 162, 39, .45); }

/* Sign in with Google: white, as Google asks, with a plain "G" mark. */
button.google { background: #fff; color: #1f1f1f; border-color: #dadce0; display: inline-flex; align-items: center; justify-content: center; gap: .6em; }
button.google .g { font-weight: 700; color: #4285f4; font-family: Arial, sans-serif; }

/* A building put up during the game: edged in its owner's colour. */
.place.built { border-left: 4px solid var(--pc, var(--line)); }
.place .powner { display: flex; align-items: center; gap: 6px; color: var(--muted, #b9a); }

/* ---------- the end of a game: bars, the swing chart and the honours (public/play.js) ---------- */
.fbars { display: flex; gap: 10px; align-items: flex-end; padding-top: 58px; overflow-x: auto; }
.fbar { flex: 1 1 0; min-width: 60px; display: flex; flex-direction: column; align-items: center; }
.fcol { position: relative; width: 100%; max-width: 70px; height: 220px; border-bottom: 3px solid rgba(239, 230, 210, .25);
  background: repeating-linear-gradient(to top, transparent 0 54px, rgba(239, 230, 210, .07) 54px 55px); }
.frise { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); border-radius: 11px 11px 3px 3px;
  background-image: linear-gradient(90deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,.08) 26%, rgba(255,255,255,0) 50%, rgba(0,0,0,.14) 72%, rgba(0,0,0,.34) 100%);
  box-shadow: inset 0 -8px 12px rgba(0,0,0,.2), 0 6px 14px rgba(0,0,0,.3);
  animation: frise var(--ms) cubic-bezier(.45,.05,.55,.95) both; transform-origin: 50% 100%; }
/* every bar climbs at the same speed: its time is in proportion to its height */
@keyframes frise { from { height: 0; } to { height: var(--h); } }
.fbar.champ .frise { outline: 2px solid var(--brass-2); outline-offset: 1px; }
.fnum { position: absolute; left: -10px; right: -10px; bottom: 100%; margin-bottom: 6px; text-align: center; font-weight: 800; font-size: 1.15rem;
  font-variant-numeric: tabular-nums; animation: fpop .5s ease-out both; }
.ftrophy { position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 30px; text-align: center; font-size: 1.9rem;
  animation: fdrop .7s cubic-bezier(.2,1.5,.4,1) both; animation-delay: calc(var(--rise, 5000ms) + 300ms); }
.fbars .ftrophy { animation-delay: 5300ms; }
.fmedals { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
.fmedal { width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 50%; font-size: 1.15rem; line-height: 1;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #c9a227 60%, #8a6a12); border: 2px solid #f3dc8c; color: #1c1410;
  box-shadow: 0 3px 6px rgba(0,0,0,.4); animation: fmedal .8s cubic-bezier(.2,.9,.3,1) both; }
.fmedal.on { transform: scale(1.18); box-shadow: 0 0 10px rgba(255,236,170,.95), 0 3px 6px rgba(0,0,0,.4); }
.fname { margin-top: 8px; font-weight: 600; font-size: .9rem; text-align: center; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fplace { margin-top: 5px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; padding: 2px 9px; border-radius: 999px;
  background: rgba(239, 230, 210, .1); animation: fdrop .45s ease-out both; }
.fplace.p1 { background: linear-gradient(180deg, #fbe3a0, #c9a227); color: #1c1410; }
.fplace.p2 { background: linear-gradient(180deg, #fff, #c9d0d8); color: #1c1410; }
.fplace.p3 { background: linear-gradient(180deg, #f3c49a, #c27d45); color: #1c1410; }
.fshown { display: flex; align-items: center; gap: 12px; min-height: 56px; margin-top: 12px; padding: 8px 10px; border-radius: 12px; background: rgba(239, 230, 210, .06); }
.fshown .ficon { font-size: 2rem; }
.fswing { width: 100%; height: auto; display: block; }
.fswing text { font-size: 9px; fill: rgba(239, 230, 210, .55); }
.fswing .grid { stroke: rgba(239, 230, 210, .13); stroke-width: 1; }
.fswing .line { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 900; animation: fline 1.4s cubic-bezier(.2,.8,.3,1) both; }
.fswing circle { stroke: #1c1410; stroke-width: 1.2; animation: fpop .3s ease-out both; }
.fkey { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: .85rem; }
.fkey span { display: inline-flex; align-items: center; gap: 6px; }
.fhonours { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fhonours li { display: flex; align-items: center; gap: 12px; animation: fdrop .45s ease-out both; }
.fhonours .ficon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 1.2rem;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #c9a227 60%, #8a6a12); border: 2px solid #f3dc8c; }
.fhonours .dot { width: 9px; height: 9px; margin-right: 5px; vertical-align: baseline; }
@keyframes fline { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
@keyframes fpop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes fdrop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes fmedal { from { opacity: 0; transform: translateY(-60px) scale(1.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .frise, .fnum, .ftrophy, .fmedal, .fplace, .fswing .line, .fswing circle, .fhonours li { animation-duration: 1ms !important; animation-delay: 0ms !important; }
}

/* A game's rules and guides (public/guides.js), on tablets and in the studio. */
.guide { max-width: 680px; }
.guide .gmin { margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
.guide .gbar { display: flex; gap: 4px; margin-bottom: 12px; }
.guide .gbar button { flex: 1; height: 6px; min-height: 0; padding: 0; border: none; border-radius: 3px; background: rgba(239, 230, 210, .16); box-shadow: none; cursor: pointer; }
.guide .gbar button.on { background: var(--brass); }
.guide .gcount { margin: 0 0 4px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.guide .gtitle { font-size: 1.45rem; margin: 0 0 8px; color: var(--brass-2); }
.guide .gtext { margin: 0 0 4px; font-size: 1rem; line-height: 1.65; }
.guide .gpic { display: block; width: 100%; max-height: 46vh; object-fit: cover; border-radius: 10px; margin: 0 0 10px; background: rgba(0, 0, 0, .25); cursor: zoom-in; }
.guide .gnav { margin-top: 16px; flex-wrap: nowrap; }
.guide .gnav .grow2 { flex: 2; }
.guide .gsearch { width: 100%; margin-bottom: 10px; }
.guide .gtoc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.guide .gsec { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, .18); scroll-margin-top: 8px; }
.guide .gsec + .gsec { margin-top: 10px; }
.guide .gsec .gpic { max-height: 30vh; }
.guide mark { background: rgba(227, 194, 90, .35); color: inherit; border-radius: 3px; padding: 0 2px; }
.gzoom { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; padding: 10px; cursor: zoom-out; }
.gzoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

/* The rulebook PDF viewer (public/rulebook.js) and the AI rules finder (public/guides.js). */
.rbook { display: flex; flex-direction: column; gap: 8px; }
.rbook .rbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rbook .rbar .rstatus { flex: 1; min-width: 0; font-size: .85rem; color: var(--muted); }
.rbook .rbar button, .rbook .rbar .btn { min-width: 40px; }
.rbook .rscroll { height: 70vh; overflow: auto; -webkit-overflow-scrolling: touch; background: #2a221c; border-radius: 10px; padding: 8px; }
.rbook .rcol { margin: 0 auto; }
.rbook .rpage { background: #fff; margin: 0 auto 8px; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); overflow: hidden; }
.rbook .rpage canvas { width: 100%; height: 100%; display: block; }
.rbook.full { position: fixed; inset: 0; z-index: 95; background: var(--wood-1); padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
.rbook.full .rscroll { flex: 1; height: auto; }
.rfail { text-align: center; padding: 20px 0; }
.finder { display: flex; flex-direction: column; gap: 10px; }
.finder .fq { width: 100%; resize: vertical; font: inherit; }
.finder .fans { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, .18); line-height: 1.55; }
.finder .fans + .fans { margin-top: 10px; }
.finder .fans p { margin: 0; }
.finder .fans .fqtext { font-weight: 700; color: var(--brass-2); margin-bottom: 6px; }
.finder .fans.pending { opacity: .75; }
.finder .ferr p:last-child { color: var(--danger); }
.aibox { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.aibox h3 { margin: 0; }

/* Resource tokens: the game's own picture when it has one, else its icon. */
/* A piece's token on the board: the picture standing on a disc of its owner's colour. */
.ptok { position: relative; display: inline-block; width: 1.9em; height: 1.9em; border-radius: 50%; background: radial-gradient(circle at 50% 60%, var(--pc) 55%, rgba(0, 0, 0, .55) 100%);
  box-shadow: 0 0 0 2px rgba(18, 13, 10, .85), 0 2px 6px rgba(0, 0, 0, .6); }
.ptok img { position: absolute; left: 50%; bottom: 8%; width: 115%; height: 115%; transform: translateX(-50%); object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.tok { width: 1.15em; height: 1.15em; object-fit: contain; vertical-align: -.2em; display: inline-block; }
/* A token is part of what it sits on: dragging the resource strip from a token drags the strip,
   not the picture (a browser otherwise starts dragging the image and the strip never moves). */
.tok { pointer-events: none; -webkit-user-drag: none; user-select: none; }
.tokc { color: var(--brass); font-weight: 400; }
table.res th .tok { width: 1.5em; height: 1.5em; }
.mr .tok, .rchip .tok { width: 1.25em; height: 1.25em; }
/* A space's symbols: what you pay, get, take or draw, small enough to sit on the board. */
.syms { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.sym { display: inline-flex; align-items: center; gap: 1px; font: 700 .68rem/1 system-ui, sans-serif; color: var(--ivory); background: rgba(18, 13, 10, .78); border-radius: 4px; padding: 2px 3px; white-space: nowrap; }
.sym .tok { width: 1.05em; height: 1.05em; vertical-align: 0; }
.sym .tokc { color: inherit; }
.sym.gain { color: #bfe6a5; }
.sym.pay { color: #f2a99a; }
.sym.others { font-weight: 500; }
.sym i { font-style: normal; font-size: .85em; opacity: .9; }
.symcard { display: inline-flex; align-items: center; justify-content: center; width: .95em; height: 1.25em; border-radius: 2px; border: 1px solid currentColor; font-size: .62rem; background: rgba(201, 162, 39, .25); color: var(--brass-2); }
.boardpic .area .syms { align-self: flex-start; }
.place .syms { margin: 4px 0; }
/* The ⓘ on a space, in its top right corner. */
.ibtn {
  position: absolute; top: 2px; right: 2px; z-index: 2; width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%;
  font: italic 700 .8rem/1 Georgia, serif; color: var(--wood-1, #1a120d); background: var(--ivory); border: 1px solid rgba(0, 0, 0, .4); box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.boardpic .area .alabel { margin-right: 22px; }
.place { position: relative; }
.place .pname { padding-right: 26px; }

/* "On choose" animations: a layer over the whole page, its pieces put over the chosen spot each frame. */
.chosenfx { position: fixed; inset: 0; pointer-events: none; z-index: 60; --fxc: #f3c65a; --fxs: 2s; }
.chosenfx .fxspot, .chosenfx .fxclip { position: fixed; }
.chosenfx.inpic { position: absolute; z-index: 5; }
.chosenfx.inpic .fxspot, .chosenfx.inpic .fxclip { position: absolute; }
.chosenfx .fxclip { animation: fxclip var(--fxs) ease-in-out both;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.chosenfx .fxclip video, .chosenfx .fxclip img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes fxclip { 0% { opacity: 0; transform: scale(.96); } 12% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }
.chosenfx .fx-glow, .chosenfx .fx-none { border-radius: 14px; }
.chosenfx .fx-glow { animation: fxglow var(--fxs) ease-out both; }
@keyframes fxglow { 0% { box-shadow: 0 0 0 0 var(--fxc), inset 0 0 0 0 var(--fxc); opacity: 0; }
  20% { box-shadow: 0 0 34px 10px var(--fxc), inset 0 0 26px 4px var(--fxc); opacity: 1; }
  100% { box-shadow: 0 0 60px 24px transparent, inset 0 0 10px 0 transparent; opacity: 0; } }
.chosenfx.lite .fx-glow { animation-timing-function: linear; }
.chosenfx .fx-sparkle i { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 30%, var(--fxc) 60%, transparent 70%); animation: fxspark 1.3s ease-out both; }
.chosenfx .fx-sparkle { container-type: size; }
@keyframes fxspark { 0% { transform: translate(0, 0) scale(.4); opacity: 0; } 15% { opacity: 1; }
  100% { transform: translate(calc(var(--dx) * 1cqw), calc(var(--dy) * 1cqh)) scale(1.3); opacity: 0; } }
.chosenfx .fx-ripple b { position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  border: 3px solid var(--fxc); animation: fxripple 1.6s ease-out both; }
.chosenfx .fx-ripple b:nth-child(2) { animation-delay: .25s; } .chosenfx .fx-ripple b:nth-child(3) { animation-delay: .5s; }
@keyframes fxripple { 0% { scale: .2; opacity: .9; } 100% { scale: 4; opacity: 0; border-width: 1px; } }
.chosenfx .fx-flare .core { position: absolute; inset: -20%; border-radius: 50%; background: radial-gradient(circle, #fff8 0, var(--fxc) 18%, transparent 60%);
  animation: fxcore 1.6s ease-out both; }
.chosenfx .fx-flare .rays { position: absolute; left: 50%; top: 50%; width: 220%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--fxc) 70%, transparent) 0 4deg, transparent 4deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 62%); mask-image: radial-gradient(circle, #000 0, transparent 62%);
  animation: fxrays 1.8s ease-out both; }
@keyframes fxcore { 0% { scale: .3; opacity: 0; } 25% { scale: 1.1; opacity: 1; } 100% { scale: 1.4; opacity: 0; } }
@keyframes fxrays { 0% { rotate: 0deg; scale: .4; opacity: 0; } 25% { opacity: 1; } 100% { rotate: 50deg; scale: 1.1; opacity: 0; } }

/* Back: Skeeple's raised pill, on every screen away from the title. */
.backlink { flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: .95rem; font-weight: 600;
  color: var(--ivory); padding: 8px 16px; border-radius: 999px; min-height: 40px;
  background: linear-gradient(180deg, rgba(243, 234, 218, .16), rgba(243, 234, 218, .04)); border: 1px solid rgba(243, 234, 218, .28);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.backlink:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }

/* Face-up cards and tiles over the game's background picture (the studio's Background module). */
.market.hasbg { padding: 12px 14px 14px; border-radius: 14px; border: 1px solid var(--line); background-position: center; background-color: #120d0a; box-shadow: inset 0 0 40px rgba(0, 0, 0, .45); }
.market.hasbg > h3 { text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.market.hasbg .card { box-shadow: 0 6px 16px rgba(0, 0, 0, .55); }
