/* The handmade finish. Loaded last; it restyles only.
 *
 * Kakure should look printed and stamped, the way an Edo woodblock print or a
 * village ledger looks: flat colour, ink lines, graded bands of colour, seals
 * pressed into paper, lacquer that is deep rather than glassy. The house rules
 * (words too) are in docs/agent/HOUSE-STYLE.md. In short:
 *
 *   - No glossy highlights. A white spot at the top left turns a seal into a
 *     sweet and a button into plastic.
 *   - No glows, light sweeps, lens sparkles or pulsing halos. (The fireflies
 *     stay: Taylor loves them.)
 *   - Seals are inked: square-ish, flat vermilion, a little worn, a little
 *     crooked, no drop shadow.
 *   - Wide-spaced capitals (K A K U R E) stay: Taylor likes them.
 *   - Corners are cut, not pill-shaped: lacquer trays and paper cards have a
 *     small radius (8px at most). Only avatars, dice pips and round icon
 *     buttons are circles.
 */

:root {
  --seal-ink: #b3341f;
  --seal-frame: rgba(255, 238, 220, .55);
  /* Where the ink didn't take: a fine, uneven wear across the seal's face. */
  --seal-wear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cfilter id='w' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.3' numOctaves='3' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -5 4.1'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url%28%23w%29'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------ seals */
/* Every kanji seal is the same object: ink pressed once into paper. */
.way__seal, .lobby .way__seal, .circle-card__seal, .table-tile__seal, .table-card__seal,
.rules-scroll__mark, .seat-news__seal, .recap__seal, .seal-stamp.is-earned, .rank-card__kanji,
.modal--farewell .farewell-seal, .fx-seal, .keep-card__seal, .tour-seal, .tour-goal__seal,
.act-mark__seal, .act-event__seal, .act-rules__mark, .tour-year, .tour-stage--prologue .tour-layer > .tour-vert {
  background: var(--seal-ink);
  box-shadow: inset 0 0 0 2px var(--seal-ink), inset 0 0 0 3.5px var(--seal-frame);
  -webkit-mask: var(--seal-wear) center / 100% 100%;
  mask: var(--seal-wear) center / 100% 100%;
}
.way__seal, .lobby .way__seal, .circle-card__seal, .table-tile__seal, .table-card__seal,
.rules-scroll__mark, .seat-news__seal, .recap__seal, .seal-stamp.is-earned, .rank-card__kanji,
.modal--farewell .farewell-seal, .keep-card__seal, .tour-seal { border-radius: 3px; }
.fx-seal { border-radius: 6px; box-shadow: inset 0 0 0 5px var(--seal-ink), inset 0 0 0 8px var(--seal-frame); }
/* The tutorial's seal is gold ink, the bell indigo; the Act seals keep their season. */
.way--tutorial .way__seal { background: #a8782a; box-shadow: inset 0 0 0 2px #a8782a, inset 0 0 0 3.5px var(--seal-frame); }
.way--tutorial.is-story .way__seal { background: var(--seal-ink); box-shadow: inset 0 0 0 2px var(--seal-ink), inset 0 0 0 3.5px var(--seal-frame); }
.circle-card__seal--bell { background: #2c3c66; box-shadow: inset 0 0 0 2px #2c3c66, inset 0 0 0 3.5px var(--seal-frame); }
.act-mark[data-season="autumn"] .act-mark__seal,
.act-event[data-season="autumn"] .act-event__seal, .act-rules[data-season="autumn"] .act-rules__mark { background: #a24a17; box-shadow: inset 0 0 0 2px #a24a17, inset 0 0 0 3.5px var(--seal-frame); }
.act-mark[data-season="winter"] .act-mark__seal,
.act-event[data-season="winter"] .act-event__seal, .act-rules[data-season="winter"] .act-rules__mark { background: #3f557f; box-shadow: inset 0 0 0 2px #3f557f, inset 0 0 0 3.5px var(--seal-frame); }

/* Count marks on cards, and the gold coins: flat ink and flat gold. */
.rescard__n, :root[data-game="kakure"] .rescard__n, .pcard__vp { background: var(--seal-ink); }
.pcard__coin, .coin-fly { background: #c09a3a; }

/* ------------------------------------------------------------ chips and switches */
/* Player chips are flat dyed cloth in the player's colour: no sheen, no glow. */
@media (max-width: 860px), (orientation: landscape) and (max-height: 500px) {
  #view-game .mobile-player {
    background: var(--pc, #555);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .4);
  }
  #view-game .mobile-player.is-turn { box-shadow: 0 0 0 2px var(--leaf, #d6a84c), 0 2px 4px rgba(0, 0, 0, .4); }
}
/* Settings switches are a wooden latch in a lacquer slot, not a phone toggle. */
.setting__switch { background: #2f261f; }
.setting__switch::after { border-radius: 3px; }
.setting input:checked + .setting__switch { background: #b3341f; }
/* The top bar's buttons are one set of lacquer boxes, bell included. */
.topbar__right :is(.icon-btn, .icon-toggle), .topbar__right #btn-more,
body:has(#view-game:not([hidden])) .topbar__right .icon-toggle { border-radius: 6px; }
