/* TECHNOFEUDAL: layout and the card on top of Web Awesome (theme, native element styles, utilities). Hand-written,
   no build. Look: deep cyanotype, light cards with crests, a sturdy serif for lords and titles, a condensed
   grotesk for everything else, gold for rent and the next move, red for attacks. Grid paper only where cards lie
   on a grid (a structure). */

@font-face { font-family: "Vollkorn"; src: url("vendor/fonts/vollkorn-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap; }
@font-face { font-family: "Vollkorn"; src: url("vendor/fonts/vollkorn-latin-800-normal.woff2") format("woff2");
  font-weight: 800; font-display: swap; }
@font-face { font-family: "Plex Condensed"; src: url("vendor/fonts/ibm-plex-sans-condensed-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Condensed"; src: url("vendor/fonts/ibm-plex-sans-condensed-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Condensed"; src: url("vendor/fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap; }

:root {
  --tf-paper: #13253d;      /* the page: deep cyanotype */
  --tf-paper-deep: #0d1a2c; /* wells: the sea, logs */
  --tf-panel: #1b304d;      /* raised: panels, a lord's structure */
  --tf-chalk: #edf1f6;
  --tf-wash: #a5b8cd;       /* secondary text */
  --tf-rule: rgb(237 241 246 / 0.11);
  --tf-gold: #e3b341;       /* rent, overlords, the next move */
  --tf-wax: #ef7f73;        /* attacks, danger */
  --tf-cell: 10.5rem;       /* one card's width on the table grid */
  --tf-ratio: 1.5;          /* its height over its width */
  --tf-text: "Plex Condensed", system-ui, sans-serif;
  --tf-display: "Vollkorn", Georgia, serif;  /* lining figures where numbers matter */

  --wa-font-family-body: var(--tf-text);
  --wa-font-family-heading: var(--tf-text);
  --wa-font-family-longform: var(--tf-text);
  --wa-color-surface-default: var(--tf-paper);
  --wa-color-surface-raised: var(--tf-panel);
  --wa-color-surface-lowered: var(--tf-paper-deep);
  --wa-color-surface-border: rgb(238 243 248 / 0.28);
  --wa-color-text-normal: var(--tf-chalk);
  --wa-color-text-quiet: var(--tf-wash);
  --wa-color-text-link: var(--tf-gold);
  --wa-color-brand-fill-loud: var(--tf-gold);
  --wa-color-brand-on-loud: var(--tf-paper-deep);
  --wa-color-brand-fill-normal: rgb(230 189 87 / 0.18);
  --wa-color-brand-on-normal: var(--tf-gold);
  --wa-color-brand-fill-quiet: rgb(230 189 87 / 0.08);
  --wa-color-brand-on-quiet: var(--tf-gold);
  --wa-color-brand-border-loud: var(--tf-gold);
  --wa-color-brand-border-normal: rgb(230 189 87 / 0.6);
  --wa-color-brand-border-quiet: rgb(230 189 87 / 0.3);
  --wa-color-danger-fill-loud: var(--tf-wax);
  --wa-color-danger-on-loud: var(--tf-paper-deep);
  --wa-border-radius-scale: 0.5;
}

html, body { min-height: 100%; margin: 0; }
html { background-color: var(--tf-paper); }
.grid-paper {
  background-image:
    linear-gradient(var(--tf-rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--tf-rule) 1px, transparent 1px);
  background-size: calc(var(--tf-cell) / 5) calc(var(--tf-cell) / 5);
}
body {
  background: transparent;
  color: var(--tf-chalk);
  font-family: var(--tf-text);
  font-size: 1.0625rem;
  line-height: 1.5;
}
a:not(.wa-button) { color: var(--tf-gold); text-decoration-style: solid; text-decoration-thickness: 1px;
  text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--tf-gold); outline-offset: 2px; }
.skip-link:focus { position: fixed; top: .5rem; left: .5rem; z-index: 1000; padding: .25rem .75rem;
  background: var(--tf-paper-deep); color: var(--tf-chalk); }

.wrap { max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
.narrow { max-width: 40rem; }
.muted { color: var(--tf-wash); }
.lead { font-size: 1.25rem; max-width: 38rem; }
.money { color: var(--tf-gold); font-weight: 600; white-space: nowrap; }

/* header */
.site-header { display: flex; align-items: baseline; gap: 1.5rem; padding-block: .9rem; flex-wrap: wrap; margin-bottom: 1.5rem;
  background: linear-gradient(var(--tf-rule), var(--tf-rule)) center bottom / calc(100% - 2rem) 1px no-repeat; }
a.wordmark { font-family: var(--tf-display); font-weight: 800; font-size: 1.55rem; color: var(--tf-chalk);
  text-decoration: none; line-height: 1; letter-spacing: -.005em; }
a.wordmark:hover { color: var(--tf-gold); }
.logo { width: 1.45em; height: auto; margin-right: .4em; vertical-align: -.12em; }
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-left: auto; align-items: baseline; }
.site-nav a { color: var(--tf-wash); text-decoration: none; padding-bottom: .2rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--tf-chalk); }
.site-nav a[aria-current="page"] { color: var(--tf-chalk); border-bottom-color: var(--tf-gold); }
.site-footer { margin-top: 4rem; padding-block: 2rem; border-top: 1px solid var(--tf-rule); }

/* type: the serif names things (pages, realms, lords, cards); the grotesk runs the interface */
h1, h2, h3 { font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-family: var(--tf-display); font-weight: 800; font-size: 2.3rem; letter-spacing: -.005em; }
h2 { font-family: var(--tf-display); font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
.panel h2, .prize h2, .happenings h2, .map-side h2, .hand-area h2, .open-area h2 { font-family: var(--tf-text); font-size: 1.05rem; }
.lordly { font-family: var(--tf-display); font-weight: 600; }

/* home */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3rem; align-items: center; padding-block: 3rem 2rem; }
.hero h1 { font-family: var(--tf-display); font-weight: 800; font-size: clamp(3rem, 9vw, 6rem); line-height: 1;
  margin-bottom: .25em; color: var(--tf-chalk); }
.hero-cards { --tf-cell: 10.5rem; display: grid; grid-template-columns: repeat(2, var(--tf-cell)); grid-template-rows: repeat(2, calc(var(--tf-cell) * var(--tf-ratio)));
  gap: 1.1rem; }  /* room for the arrows between cards */
.hero-cards > :nth-child(1) { grid-column: 1; grid-row: 2; }
.hero-cards > :nth-child(2) { grid-column: 1; grid-row: 1; }
.hero-cards > :nth-child(3) { grid-column: 2; grid-row: 2; }
.steps { padding-left: 1.25rem; }
.steps li { margin-bottom: .5rem; max-width: 40rem; }
.showcase { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.showcase figcaption { max-width: 22rem; font-size: .9rem; color: var(--tf-wash); }
/* how a season plays: four steps in order, numbered by the list itself */
.how { padding-block: 1rem 2.5rem; }
.how-steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem 2rem; padding: 0; margin: 0; }
.how-steps li { counter-increment: step; margin: 0; }
.how-steps h3 { display: flex; align-items: baseline; gap: .55rem; margin-bottom: .35rem; }
.how-steps h3::before { content: counter(step); font-family: var(--tf-display); font-weight: 800; font-size: 1.9rem;
  font-variant-numeric: lining-nums; line-height: 1; color: var(--tf-gold); }
.how-steps p { margin: 0; color: var(--tf-wash); }
.reference { padding-top: 2rem; border-top: 1px solid var(--tf-rule); margin-top: 2.5rem; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem; }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } .hero-cards { --tf-cell: 9.5rem; } }

/* ------------------------------------------------------------------ the card
   A portrait card on the dark table, as card games print them: a title bar (gold an overlord, a vassal's first
   alignment, red an exploit, violet an edict) with the rent stored on the card, a cartoon (technofeudal/art) with the
   card's motto printed under it in plain type, then alignments, the ability and the numbers. --tf-cell is its width, --tf-ratio its height over its width.
   Arrows sit outside the edges: .arrow-N/E/S/W (outgoing); .arrow-in points into the card from the side it hangs
   by. Text stays upright whatever the card's heading on the table. */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.card { --card-paper: #f1ede3; --card-ink: #16121c; --card-quiet: #59606b; --card-band: #232733; --card-on-band: #f6f1e4;
  position: relative; box-sizing: border-box; width: var(--tf-cell); height: calc(var(--tf-cell) * var(--tf-ratio));
  padding: .3rem .32rem .35rem; background: var(--card-paper); color: var(--card-ink);
  border-radius: 9px; box-shadow: inset 0 0 0 1px rgb(22 18 28 / 0.35), inset 0 0 0 3px var(--card-paper),
  inset 0 0 0 4px rgb(22 18 28 / 0.18), 0 2px 0 rgb(0 0 0 / 0.45);
  font-size: .72rem; line-height: 1.25; display: flex; flex-direction: column; gap: .22rem; overflow: visible; }
.card--overlord { --card-band: linear-gradient(#ffd75e, #e3a92a); --card-on-band: #16121c; --card-paper: #f6eed8;
  box-shadow: inset 0 0 0 2px #c99a2b, inset 0 0 0 4px #f6eed8, inset 0 0 0 5px rgb(201 154 43 / 0.6), 0 2px 0 rgb(0 0 0 / 0.45); }
.card--exploit { --card-band: #c8322b; }
.card--edict { --card-band: #3a2f6b; }
.card--al-public { --card-band: #2d5ca8; } .card--al-open { --card-band: #2f7f52; }
.card--al-proprietary { --card-band: #6c4799; } .card--al-ruthless { --card-band: #b3352b; }
.card--al-mainstream { --card-band: #5c6570; } .card--al-fringe { --card-band: #a6531a; }
.card--al-shadow { --card-band: #25262b; } .card--al-zealot { --card-band: #8e2a4f; } .card--al-viral { --card-band: #a3386d; }
.card--al-private { --card-band: #d9a83a; --card-on-band: #16121c; }
.card--al-utopian { --card-band: #e4f3fb; --card-on-band: #16121c; }
.card-title { flex: none; display: flex; align-items: center; gap: .3rem; min-height: 1.45rem; padding: .08rem .35rem;
  border-radius: 5px 5px 2px 2px; background: var(--card-band); color: var(--card-on-band); }
.card-name { flex: 1; min-width: 0; font-family: var(--tf-display); font-weight: 600; font-size: .8rem; line-height: 1.05;
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.card-money { flex: none; min-width: 1.35rem; padding: .02rem .35rem; border-radius: 999px; background: #ffd75e;
  color: #16121c; box-shadow: inset 0 0 0 1.5px #16121c; font-weight: 600; text-align: center; font-size: .72rem;
  font-variant-numeric: tabular-nums; }
.card-art { position: relative; flex: none; aspect-ratio: 200 / 164; overflow: hidden; border-radius: 2px;
  background: #16121c; box-shadow: 0 0 0 2px #16121c; }
.card-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the motto (technofeudal/art satire.json), printed under the cartoon on its ink frame, plain and high-contrast */
.card-art { border-radius: 2px 2px 0 0; }
.card-motto { flex: none; margin: -.22rem 0 0; padding: .12rem .3rem .14rem; border-radius: 0 0 2px 2px;
  background: #16121c; color: #fff4dc; box-shadow: 0 0 0 2px #16121c; font-family: var(--tf-text); font-weight: 600;
  font-size: .6rem; letter-spacing: .03em; line-height: 1.15; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-big .card-motto { font-size: .9rem; padding: .2rem .5rem .25rem; }
.card-head { display: flex; gap: .4rem; align-items: flex-start; }
.crest { flex: none; width: 1.7rem; height: auto; }
.crest-rim { fill: none; stroke: var(--card-ink); stroke-width: 1.4; }
.crest-roundel { stroke: var(--card-ink); stroke-width: .8; }
.crest-ring { fill: none; stroke: rgb(243 242 236 / 0.7); stroke-width: 1.2; }
.card-text { flex: 1 1 auto; min-height: 0; margin: 0 .15rem; overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.1em), transparent); }
.card-flavour { margin: 0 .15rem; color: var(--card-quiet); font-style: italic; }
.card > .card-flavour:not(.card-text) { display: none; }  /* small cards: the ability only; the card page shows both */
.card .aligns { margin: 0 .15rem; }
.card-stats { display: flex; gap: .7rem; margin: auto .15rem 0; padding-top: .2rem;
  border-top: 1px solid rgb(22 18 28 / 0.15); }  /* at the foot, however short the text */
.card-stats div { display: flex; flex-direction: column-reverse; }
.card-stats dt { color: var(--card-quiet); font-size: .56rem; line-height: 1.1; }
.card-stats dd { margin: 0; font-weight: 600; font-size: .95rem; line-height: 1; font-variant-numeric: tabular-nums; }

/* alignments are tinctures (technofeudal/heraldry.py): the same colour on the chip and in the crest */
.aligns { display: flex; flex-wrap: wrap; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.aligns li { margin: 0; }
a.al { text-decoration: none; }
.al { display: inline-block; padding: 0 .3rem; border-radius: 3px; font-size: .62rem; line-height: 1.45;
  background: var(--al, #7d8791); color: #fff; }
.al.al-public { --al: #2d5ca8; } .al.al-private { --al: #d9a83a; color: #1d2330; }
.al.al-open { --al: #2f7f52; } .al.al-proprietary { --al: #6c4799; }
.al.al-utopian { --al: #f3f2ec; color: #1d2330; box-shadow: inset 0 0 0 1px #9aa3ad; } .al.al-ruthless { --al: #c23b30; }
.al.al-mainstream { --al: #7d8791; } .al.al-fringe { --al: #c46a24; }
.al.al-shadow { --al: #25262b; } .al.al-zealot { --al: #8e2a4f; } .al.al-viral { --al: #c94f8a; }

.arrow { position: absolute; width: 0; height: 0; border: .45rem solid transparent; }
.arrow-N { top: -.95rem; left: calc(50% - .45rem); border-bottom-color: var(--tf-chalk); }
.arrow-S { bottom: -.95rem; left: calc(50% - .45rem); border-top-color: var(--tf-chalk); }
.arrow-E { right: -.95rem; top: calc(50% - .45rem); border-left-color: var(--tf-chalk); }
.arrow-W { left: -.95rem; top: calc(50% - .45rem); border-right-color: var(--tf-chalk); }
.arrow.is-blocked { opacity: .35; }
.arrow-in { border-width: .3rem; }
.arrow-in.from-S { bottom: 0; left: calc(50% - .3rem); border-bottom-color: var(--card-quiet); }
.arrow-in.from-N { top: 0; left: calc(50% - .3rem); border-top-color: var(--card-quiet); }
.arrow-in.from-E { right: 0; top: calc(50% - .3rem); border-right-color: var(--card-quiet); }
.arrow-in.from-W { left: 0; top: calc(50% - .3rem); border-left-color: var(--card-quiet); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tf-cell), 1fr)); gap: 1.6rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* card gallery and card page */
.filters { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: baseline; margin-bottom: 1rem; }
.filters a { text-decoration: none; }
.filters a[aria-current="page"] { text-decoration: underline; text-underline-offset: .25em; }
.filters a.al { padding: 0 .3rem; }
.card-link { color: inherit; text-decoration: none; display: block; justify-self: center; }
.card-link:hover .card, .card-link:focus-visible .card { outline: 2px solid var(--tf-gold); outline-offset: 2px; }
.card-page { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3rem; padding-top: 2rem; }
.card-big { --tf-cell: 18rem; }
.card-big .card { font-size: .95rem; padding: .5rem .55rem .55rem; gap: .4rem; }
.card-big .card-name { font-size: 1.3rem; }
.card-big .card-title { min-height: 2.2rem; padding: .15rem .55rem; }
.card-big .card-money { font-size: 1rem; }
.card-big .crest { width: 2.6rem; }
.card-big .al { font-size: .75rem; }
.card-big .card-text { flex: none; mask-image: none; }
.card-big .card > .card-flavour:not(.card-text) { display: block; flex: 1 1 auto; }
.card-big .card-stats dd { font-size: 1.3rem; }
.card-big .card-stats dt { font-size: .72rem; }
.relations dt { color: var(--tf-wash); margin-top: .75rem; }
.relations dd { margin: 0; }
@media (max-width: 720px) { .card-page { grid-template-columns: 1fr; } }

/* forms */
.form label { display: flex; flex-direction: column; gap: .25rem; max-width: 24rem; }
.form .hint, .form .error { font-size: .85rem; }
.error { color: var(--tf-wax); }
.inline-form { display: inline-flex; gap: .5rem; align-items: baseline; margin: 0; }
.link-button { color: var(--tf-wash); padding: 0; min-height: 0; height: auto; font: inherit; }
.link-button:hover { color: var(--tf-chalk); }

/* lobby */
.table-list { padding-left: 1.1rem; }
.table-list li { margin-bottom: .3rem; }
.form fieldset { border: 1px solid var(--tf-rule); padding: .75rem 1rem; max-width: 40rem; }
.form label.check { flex-direction: row; align-items: baseline; gap: .5rem; max-width: none; }
.log { list-style: none; padding: 0; max-height: 24rem; overflow: auto; font-size: .9rem; color: var(--tf-wash); }

/* ------------------------------------------------------------------ the table page */
.board-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1.25rem; margin-bottom: 1.5rem; }
.board-head h1 { margin: 0; }
.status { margin: 0; font-size: 1.15rem; }
.status.is-mine { color: var(--tf-gold); font-weight: 600; }
.status.is-over { color: var(--tf-gold); }
.board-head .muted { margin: 0; }
.board-error { margin-bottom: 1rem; }
.board-grid { display: grid; grid-template-columns: minmax(0, 1fr) 23rem; gap: 2rem; align-items: start; }
.realms { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.realm { background: var(--tf-panel); border-radius: 8px; padding: .9rem 1.15rem 1rem; }
.realm.is-me { box-shadow: inset 0 0 0 1px rgb(227 179 65 / 0.45); }
.realm.is-waiting { box-shadow: inset 4px 0 0 var(--tf-gold); }
.realm.is-out { opacity: .55; }
.realm-head h2 { font-size: 1.05rem; margin: 0; }
.realm-head .lordly { font-size: 1.4rem; color: var(--tf-gold); }
.realm-head .who { font-family: var(--tf-text); color: var(--tf-wash); font-weight: 400; }
.realm-facts { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 .6rem; font-size: .9rem; color: var(--tf-chalk); }
.realm-facts > span { padding: .05rem .5rem; border-radius: 4px; background: rgb(237 241 246 / 0.07); }
/* the table: cards lie on grid paper, so the grid says where the next card can go */
.structure { display: grid; grid-auto-columns: var(--tf-cell); grid-auto-rows: calc(var(--tf-cell) * var(--tf-ratio)); gap: 1.2rem;
  padding: 1.2rem; overflow-x: auto; justify-content: start; border-radius: 6px; background-color: var(--tf-paper-deep);
  background-image: linear-gradient(var(--tf-rule) 1px, transparent 1px), linear-gradient(90deg, var(--tf-rule) 1px, transparent 1px);
  background-size: calc((var(--tf-cell) + 1.2rem) / 4) calc((var(--tf-cell) + 1.2rem) / 4); background-position: .6rem .6rem; }
.cell { position: relative; }
.card-row { display: flex; flex-wrap: wrap; gap: 1.2rem; padding: .25rem .25rem 1rem; }
.open-area h2, .hand-area h2, .panel h2 { font-size: 1.05rem; }
.side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: .75rem; }
.panel { background: var(--tf-panel); border-radius: 8px; padding: .85rem 1.1rem; }
.panel.contest { box-shadow: inset 0 0 0 2px var(--tf-wax); }
.panel.move { box-shadow: inset 4px 0 0 var(--tf-gold); }
.panel details, .panel details[open] { padding: 0; background: none; border: 0; border-radius: 0; }
.panel details summary { padding: .15rem 0; margin-inline: 0; }
.panel summary { cursor: pointer; font-weight: 600; }
.panel form { margin: .4rem 0; }
.panel .form label { max-width: none; }
.panel select, .panel input:not([type=checkbox], [type=radio]) { width: 100%; }
.panel input.amount { width: 6rem; }
.panel fieldset { border: 0; padding: 0; margin: 0; }
.panel fieldset.kinds { display: flex; flex-direction: column; gap: .1rem; }
.panel legend { color: var(--tf-wash); font-size: .9rem; }
.parts { list-style: none; padding: 0; margin: .25rem 0; font-size: .9rem; }
.parts li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dotted var(--tf-rule); }
.need { font-size: 1.05rem; }
.odds { min-height: 2rem; }
.log { list-style: none; padding: 0; margin: 0; max-height: 22rem; overflow: auto; font-size: .88rem; color: var(--tf-wash); }
.log li { margin: 0; padding: .2rem 0; border-bottom: 1px solid var(--tf-rule); }
.notes { padding-left: 1rem; font-size: .9rem; }
.resign summary { color: var(--tf-wash); cursor: pointer; }
code.hash { word-break: break-all; font-size: .75rem; }
.gc-1 { grid-column: 1; } .gr-1 { grid-row: 1; }
.gc-2 { grid-column: 2; } .gr-2 { grid-row: 2; }
.gc-3 { grid-column: 3; } .gr-3 { grid-row: 3; }
.gc-4 { grid-column: 4; } .gr-4 { grid-row: 4; }
.gc-5 { grid-column: 5; } .gr-5 { grid-row: 5; }
.gc-6 { grid-column: 6; } .gr-6 { grid-row: 6; }
.gc-7 { grid-column: 7; } .gr-7 { grid-row: 7; }
.gc-8 { grid-column: 8; } .gr-8 { grid-row: 8; }
.gc-9 { grid-column: 9; } .gr-9 { grid-row: 9; }
.gc-10 { grid-column: 10; } .gr-10 { grid-row: 10; }
.gc-11 { grid-column: 11; } .gr-11 { grid-row: 11; }
.gc-12 { grid-column: 12; } .gr-12 { grid-row: 12; }
.gc-13 { grid-column: 13; } .gr-13 { grid-row: 13; }
.gc-14 { grid-column: 14; } .gr-14 { grid-row: 14; }
.gc-15 { grid-column: 15; } .gr-15 { grid-row: 15; }
@media (max-width: 960px) { .board-grid { grid-template-columns: 1fr; } .side { position: static; order: -1; } }
@media (max-width: 960px) { .realm-grid .side { order: 0; } }  /* a realm: your structure first, the world after */
.research summary h2 { display: inline; margin: 0; font-size: inherit; }

/* realms */
.leaders { padding-left: 1.4rem; }
.leaders li { margin-bottom: .2rem; }
.feed { display: flex; flex-direction: column; gap: .75rem; }
.panel.attack.is-incoming { border-color: var(--tf-wax); }
.panel.attack p { margin: .2rem 0; }
.cell.is-resting .card { opacity: .7; }
.exploit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.commons-card p { margin: .2rem 0 0; font-size: .8rem; text-align: center; }
.log time { color: var(--tf-gold); margin-right: .3rem; }

/* patron themes: the same blueprint, other inks */
html[data-theme="copper"] { --tf-paper: #143331; --tf-paper-deep: #0d2422; --tf-panel: #1c423f; --tf-gold: #d4945a; --tf-wash: #a9d1c8; }
html[data-theme="oxblood"] { --tf-paper: #331316; --tf-paper-deep: #240c0f; --tf-panel: #45191d; --tf-gold: #e2b85c; --tf-wash: #e0b6b0; }
html[data-theme] { --wa-color-surface-default: var(--tf-paper); --wa-color-surface-raised: var(--tf-panel);
  --wa-color-surface-lowered: var(--tf-paper-deep); }
.patron-mark { color: var(--tf-gold); font-size: .8em; margin-left: .2em; }
.ai-mark { color: var(--tf-wash); border: 1px solid var(--tf-wash); border-radius: 2px; font-size: .7em;
  padding: 0 .25em; margin-left: .3em; vertical-align: .1em; }

/* the season's prize pool: play money reads as a specimen note (dashed, stamped), real Bitcoin as solid gold */
.prize { padding: .85rem 1.1rem; margin-bottom: 1rem; background: var(--tf-panel); border-radius: 8px; }
.prize-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.prize h2 { margin: 0; font-size: 1rem; }
.prize-pot { font-family: var(--tf-display); font-weight: 800; font-variant-numeric: lining-nums; font-size: 2.2rem; line-height: 1.1; margin: 0 0 .25rem; }
.prize--play { border: 2px dashed var(--tf-wash); }
.prize--play .prize-pot { color: var(--tf-wash); }
.prize--btc { border: 2px solid var(--tf-gold); }
.prize--btc .prize-pot { color: var(--tf-gold); }
.prize-stamp { margin: 0; padding: .1rem .5rem; transform: rotate(-6deg);
  color: var(--tf-wax); border: 3px double var(--tf-wax); font-weight: 700; letter-spacing: .04em; }
.prize-shares { padding-left: 1.4rem; margin: .4rem 0; }
.prize-shares li { margin-bottom: .15rem; }
.prize-shares .is-me { font-weight: 700; }
.home-prize { max-width: 40rem; }
.ratings { width: 100%; border-collapse: collapse; }
.ratings th, .ratings td { text-align: left; padding: .3rem .5rem; border-bottom: 1px solid var(--tf-rule); }

/* the realm map: a surveyor's plat on the blueprint. Hex outlines in chalk, terrain as hatching, seats as gold
   seals, commons vassals as small chalk diamonds. */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 1.5rem; align-items: start; }
@media (max-width: 52rem) { .map-layout { grid-template-columns: minmax(0, 1fr); } }
.map-pane { border-radius: 8px; overflow: hidden; background: var(--tf-paper-deep); }
.map-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  padding: .5rem .75rem; border-bottom: 1px solid var(--tf-rule); font-size: .9rem; }
.map-controls a { text-decoration: none; padding: .15rem .55rem; border-radius: 4px; background: rgb(237 241 246 / 0.07); color: var(--tf-chalk); }
.map-controls a.is-on { background: var(--tf-gold); color: var(--tf-paper-deep); }
.map-controls .where { margin: 0; }
.pan { display: grid; grid-template-columns: repeat(4, 2rem); gap: .25rem; }
.pan a { text-align: center; padding: .15rem 0; }
.atlas { display: block; width: 100%; height: auto; max-height: 78vh; }
.atlas text { font-family: var(--tf-text); }
.atlas a { text-decoration: none; }
.hex { stroke: rgb(238 243 248 / 0.16); stroke-width: .6; fill: rgb(169 200 230 / 0.10); }
.zoom-2 .hex { stroke-width: .3; }
.hex.t-dark { fill: url(#p-dark); }
.hex.t-farm { fill: url(#p-farm); }
.hex.t-ruin { fill: url(#p-ruin); }
.hex.t-spectrum { fill: url(#p-spectrum); }
.legend .hex { stroke: var(--tf-wash); }
.pat { stroke: rgb(169 200 230 / 0.32); stroke-width: .8; fill: none; }
.pat-fill { fill: rgb(230 189 87 / 0.28); }
.pat-bg { fill: rgb(169 200 230 / 0.10); stroke: none; }
.site { fill: var(--tf-chalk); stroke: var(--tf-paper-deep); stroke-width: .8; }
.site-link:hover .site, .site-link:focus .site { fill: var(--tf-wax); }
.seat-mark { stroke-width: 1.4; fill: var(--tf-paper); }
.seat-mark.rel-me { fill: var(--tf-gold); stroke: var(--tf-chalk); }
.seat-mark.rel-ally { stroke: var(--tf-gold); }
.seat-mark.rel-rival { stroke: var(--tf-wax); }
.seat-mark.rel-npc { stroke: var(--tf-wash); stroke-dasharray: 2 1.5; }
.atlas .seat-initial { font-family: var(--tf-display); font-weight: 800; font-size: 15px; text-anchor: middle; fill: var(--tf-chalk); }
.rel-me .seat-initial { fill: var(--tf-paper-deep); }
.seat-label { font-size: 8.5px; text-anchor: middle; fill: var(--tf-wash); }
.zoom-2 .seat-label { font-size: 6px; }
.overview .seat-label { font-size: 13px; fill: var(--tf-chalk); }
.seat:hover .seat-label, .seat:focus .seat-label { fill: var(--tf-gold); }
.grid-ring { fill: none; stroke: rgb(238 243 248 / 0.1); }
.grid-spoke { stroke: rgb(238 243 248 / 0.08); }
.core { fill: none; stroke: var(--tf-gold); stroke-width: 1.5; }
.map-side h2 { font-size: 1rem; margin: 0 0 .4rem; }
.neighbours { padding-left: 1.3rem; margin: 0 0 1.25rem; }
.neighbours li { margin-bottom: .35rem; }
.neighbours .muted { display: block; font-size: .82rem; }
.legend { list-style: none; padding: 0; margin: 0 0 1rem; font-size: .88rem; }
.legend li { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.legend svg { width: 1.2rem; height: 1.2rem; flex: none; }
.pattern-defs { position: absolute; }
.hex.is-fog { fill: rgb(169 200 230 / 0.035); stroke: rgb(238 243 248 / 0.07); }
.legend .hex.is-fog { stroke: var(--tf-wash); }
.probe { fill: rgb(230 189 87 / 0.05); stroke: var(--tf-gold); stroke-width: 1; stroke-dasharray: 4 3; }
.probe.is-flying { stroke-dasharray: 1 4; }
.probe-form { flex-basis: 100%; }
.probe-form button { font-size: .85rem; }
.probes { list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: .9rem; }
.probes li { margin-bottom: .3rem; }
.site-far .site { fill: none; stroke: var(--tf-wash); stroke-width: 1; }
.commons-card.is-far .card { opacity: .6; }
.earth-sea { fill: var(--tf-paper-deep); }
.earth-land { fill: rgb(169 200 230 / 0.13); stroke: rgb(169 200 230 / 0.55); stroke-width: .5; }
.overview .seat-label { font-size: 6.5px; }
.overview .seat-mark { stroke-width: .8; }
.region-label text { font-size: 9px; fill: var(--tf-gold); text-anchor: middle; letter-spacing: .02em; }
.region-label .region-event { font-size: 6.5px; fill: var(--tf-wax); }
.hex.t-sea { fill: transparent; stroke: rgb(238 243 248 / 0.035); }
.hex.t-ice { fill: rgb(238 243 248 / 0.16); }
.held { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.held.rel-me { stroke: var(--tf-gold); fill: rgb(230 189 87 / 0.12); }
.held.rel-ally { stroke: rgb(230 189 87 / 0.6); fill: rgb(230 189 87 / 0.06); }
.held.rel-rival { stroke: rgb(240 138 126 / 0.7); fill: rgb(240 138 126 / 0.07); }
.held.rel-npc { stroke: rgb(169 200 230 / 0.45); stroke-dasharray: 3 2; }
.fief-mark { stroke-width: 1; fill: var(--tf-paper); stroke: var(--tf-wash); }
.fief-mark.rel-me { fill: var(--tf-gold); stroke: var(--tf-chalk); }
.fief-mark.rel-ally { stroke: var(--tf-gold); }
.fief-mark.rel-rival { stroke: var(--tf-wax); }
.landmark-mark { fill: none; stroke: var(--tf-gold); stroke-width: 1.1; }
.overview .landmark-mark { stroke-width: .7; fill: rgb(230 189 87 / 0.35); }
.landmark-label { font-size: 8px; text-anchor: middle; fill: var(--tf-gold); }

/* the chronicle on the map: what happened in the last day, where it happened */
/* dashed rings, apart from the solid seat and holding marks; bold and solid while fresh */
.ev-mark { fill: none; stroke: var(--tf-chalk); stroke-width: 1.4; stroke-dasharray: 3 2; opacity: .6;
  vector-effect: non-scaling-stroke; }
.ev.is-fresh .ev-mark { stroke-width: 2.6; stroke-dasharray: none; opacity: 1; }
.ev-arrival .ev-mark { stroke: var(--tf-wash); }
.ev-alliance .ev-mark, .ev-season .ev-mark { stroke: var(--tf-gold); }
.chronicle { list-style: none; padding: 0; max-width: 60rem; }
.chronicle li { padding: .3rem 0; border-bottom: 1px solid var(--tf-rule); display: flex; flex-wrap: wrap; gap: .25rem .6rem; }
.chronicle time { color: var(--tf-wash); min-width: 7.5rem; }
.ev-kind { color: var(--tf-gold); }
.away { margin-bottom: 1rem; }

/* colonies: a triangle on the hex, outlined while on its way */
.colony-mark { stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.colony-mark.rel-me { fill: var(--tf-gold); stroke: var(--tf-paper-deep); }
.colony-mark.rel-ally { fill: var(--tf-chalk); stroke: var(--tf-gold); }
.colony-mark.rel-rival, .colony-mark.rel-npc { fill: var(--tf-wax); stroke: var(--tf-paper-deep); }
.colony.is-flying .colony-mark { fill: none; stroke: currentColor; stroke-dasharray: 3 2; color: var(--tf-chalk); }
.hex.is-here { stroke: var(--tf-gold); stroke-width: 2; vector-effect: non-scaling-stroke; }
.hex-link:focus-visible .hex { stroke: var(--tf-chalk); stroke-width: 2; }
.here { margin-top: .4rem; }
.here p { margin: .2rem 0; }
.here .amount { width: 5rem; }
.happenings { margin-bottom: 1rem; }
.happenings h2 { font-size: 1rem; margin: 0 0 .3rem; }

/* what to do now (realm/guide.py): the realm page leads with the next move */
.next-moves ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.next-moves li { margin: 0; }
.next-moves p { margin: .15rem 0 .45rem; color: var(--tf-wash); font-size: .95rem; }
.target-card { margin: .5rem 0 .25rem; }
.turn-hint { margin: 0 0 .5rem; color: var(--tf-wash); font-size: .95rem; }

/* the overlord picker: the cards themselves are the choices */
.pick { border: 0; padding: 0; margin: 0; }
.pick legend { margin-bottom: 1rem; max-width: 40rem; }
.pick-grid { --tf-cell: 11rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--tf-cell) + 1.8rem), 1fr));
  gap: 1.5rem .5rem; justify-items: center; }
.form label.pick-card { display: block; position: relative; max-width: none; cursor: pointer; }
.pick-card input { position: absolute; opacity: 0; pointer-events: none; }
.pick-card:hover .card { outline: 2px solid rgb(227 179 65 / 0.6); outline-offset: 3px; }
.pick-card:has(input:checked) .card { outline: 3px solid var(--tf-gold); outline-offset: 3px; }
.pick-card:has(input:focus-visible) .card { outline: 3px dashed var(--tf-chalk); outline-offset: 3px; }

/* guests (accounts/guests.py) */
.guest-mark { font-size: .75em; color: var(--tf-wash); border: 1px solid currentColor; border-radius: 3px; padding: 0 .3em; }
.guest-code .code { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.guest-code code { font-size: 1.15rem; padding: .3rem .6rem; border-radius: 4px; background: var(--tf-paper-deep); color: var(--tf-gold); }
.sign-out { margin-top: 2rem; }
.hero-note { margin-top: .75rem; font-size: .95rem; }
.alt-entry { margin-top: 1.5rem; }
.guest-note { margin-bottom: 1rem; padding: .6rem 1rem; border-radius: 8px; background: rgb(227 179 65 / 0.12);
  box-shadow: inset 4px 0 0 var(--tf-gold); }
.guest-note p { margin: 0; }
.guest-note code { color: var(--tf-gold); font-size: 1.05em; }
.art-note { color: var(--tf-wash); max-width: 40rem; }

/* attacks in flight (realm/atlas.py): an arc from the attacker's seat, marching toward the target, a head where the
   attack is now. The one motion on the map: it is where something is about to happen. */
.flight-path { fill: none; stroke: var(--tf-wax); stroke-width: 1.6; stroke-dasharray: 6 5; stroke-linecap: round;
  vector-effect: non-scaling-stroke; opacity: .85; animation: tf-march 1.1s linear infinite; }
.flight-head { fill: var(--tf-wax); stroke: var(--tf-paper-deep); stroke-width: 1; vector-effect: non-scaling-stroke; }
.flight.rel-me .flight-path, .flight.rel-ally .flight-path { stroke: var(--tf-gold); }
.flight.rel-me .flight-head, .flight.rel-ally .flight-head { fill: var(--tf-gold); }
.flight.rel-npc .flight-path { stroke: var(--tf-wash); opacity: .6; }
.flight.rel-npc .flight-head { fill: var(--tf-wash); }
@keyframes tf-march { to { stroke-dashoffset: -22; } }

/* cards as objects: they lean toward the pointer (technofeudal.js sets --rx, --ry, --mx, --my), overlords catch the
   light, and a card that arrives in a live board turns over into place */
.card { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .2s ease-out,
  box-shadow .2s ease-out; }
.card.is-lifted { z-index: 3; box-shadow: 0 14px 28px rgb(0 0 0 / 0.5); }
.card--overlord .card-art::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 25%, rgb(255 236 179 / 0.32) 42%, rgb(150 225 255 / 0.22) 52%,
  rgb(255 170 230 / 0.18) 60%, transparent 75%) no-repeat;
  background-size: 260% 260%; background-position: var(--mx, 20%) var(--my, 20%); mix-blend-mode: color-dodge; }
.card.is-new { animation: tf-arrive .6s ease-out; }
@keyframes tf-arrive { from { transform: perspective(900px) rotateY(-90deg); opacity: .2; } to { transform: perspective(900px) rotateY(0); opacity: 1; } }

/* arms (technofeudal/heraldry.py): an alliance's banner or a lone lord's seal, beside its name; the leaders read
   as a roll of arms */
.crest--arms { width: 1.1em; vertical-align: -.2em; margin-right: .35em; --card-ink: var(--tf-paper-deep); }
.crest--arms .crest-rim { stroke: rgb(237 241 246 / 0.5); }
h1 .crest--arms, h2 .crest--arms { width: .9em; }
.roll { list-style-position: outside; }
.map-arms .crest-rim { stroke: var(--tf-paper-deep); stroke-width: 2.5; }
@media (max-width: 420px) { .gallery, .pick-grid { --tf-cell: 9.6rem; --tf-ratio: 1.62; } }  /* two cards a row on a phone, a
   little taller so the ability still reads */
.lobby .quick { margin: 0 0 1.5rem; max-width: 40rem; }
.lobby .quick p { margin: .2rem 0 .6rem; }
