/* Layout: the front page's card room carried into a reference library - felt
   and brass for navigation and callouts, a calm dark page for long reading. */
:root {
  --night: #07120e;
  --night-2: #0c1b15;
  --night-3: #11241c;
  --felt: #0f4a35;
  --felt-deep: #0a3123;
  --brass: #d8ab52;
  --brass-soft: #f1d89c;
  --ivory: #f5efe1;
  --ink: #d3dbd5;
  --muted: #93a79c;
  --ruby: #d24a53;
  --line: rgba(216, 171, 82, 0.26);
  --line-soft: rgba(211, 219, 213, 0.12);

  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.7;
}
a { color: var(--brass-soft); text-underline-offset: 3px; }
a:hover { color: var(--ivory); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ivory); line-height: 1.15; text-wrap: balance; font-weight: 500; }
img { max-width: 100%; }

.wrap { width: min(1200px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--ink); max-width: 62ch; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.2rem; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  text-decoration: none; border: 1px solid var(--brass); white-space: nowrap;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brass); color: var(--night); }
.btn-primary:hover { background: var(--brass-soft); color: var(--night); }
.btn-ghost { color: var(--brass-soft); }
.btn-ghost:hover { background: rgba(216, 171, 82, 0.12); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(7, 18, 14, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 1.2rem; padding-block: 0.65rem; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--ivory); text-decoration: none; white-space: nowrap; }
.brand .suit { color: var(--brass); }
.nav { display: flex; gap: 1.1rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.92rem; white-space: nowrap; }
.nav a:hover { color: var(--brass-soft); }
.lang-switch { font: 600 0.78rem var(--mono); letter-spacing: 0.08em; color: var(--brass-soft); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.65rem; text-decoration: none; }
.top .btn { padding: 0.45rem 0.95rem; font-size: 0.88rem; }
@media (max-width: 1000px) { .nav a:not(:first-child) { display: none; } }
@media (max-width: 520px) { .nav { display: none; } .lang-switch { margin-left: auto; } }

.crumbs { font-size: 0.85rem; color: var(--muted); padding-top: 1.4rem; }
.crumbs a { color: var(--muted); }

/* ---------- article layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: clamp(2rem, 5vw, 4rem); padding-block: 1rem 4rem; }
.article { min-width: 0; }
.article-head { display: grid; gap: 0.8rem; padding-block: 1.2rem 1.8rem; border-bottom: 1px solid var(--line); margin-bottom: 1.8rem; }
.article-head h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem); margin: 0; }
.side { display: grid; gap: 1.5rem; align-content: start; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.side h2 { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); margin: 0 0 0.6rem; font-weight: 500; }
.side ol, .side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.side a { display: block; color: var(--ink); text-decoration: none; font-size: 0.92rem; padding: 0.3rem 0.6rem; border-left: 2px solid transparent; }
.side a:hover { color: var(--brass-soft); }
.side [aria-current="page"] a { color: var(--ivory); border-left-color: var(--brass); background: rgba(216, 171, 82, 0.08); }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .side { position: static; max-height: none; order: -1; } .side .section-list { display: none; } }

/* ---------- prose ---------- */
.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin-top: 2.6rem; padding-top: 0.4rem; }
.prose h3 { font-size: 1.35rem; margin-top: 2rem; color: var(--brass-soft); }
.prose p, .prose li { color: var(--ink); }
.prose strong { color: var(--ivory); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.35rem; }
.prose li::marker { color: var(--brass); }
.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.3rem; border-left: 3px solid var(--brass); background: var(--night-2); border-radius: 0 10px 10px 0; }
.prose blockquote p { color: var(--ivory); margin: 0; }
.prose code { font-family: var(--mono); font-size: 0.88em; color: var(--brass-soft); background: var(--night-3); padding: 0.1em 0.35em; border-radius: 4px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.table-scroll { overflow-x: auto; margin-block: 1.4rem; border: 1px solid var(--line-soft); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); font-weight: 500; background: var(--night-2); }
tr:last-child td { border-bottom: 0; }
td { font-variant-numeric: tabular-nums; }

/* ---------- inline cards ---------- */
.mini-cards { display: inline-flex; gap: 3px; vertical-align: -0.15em; }
.mc {
  display: inline-grid; place-items: center; min-width: 1.75em; padding: 0.05em 0.25em;
  border-radius: 4px; background: var(--ivory); color: #16201b;
  font: 700 0.88em var(--body); line-height: 1.35; box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.mc.red { color: #c3313b; }
.hand-name { font-family: var(--mono); color: var(--brass-soft); }

/* ---------- charts ---------- */
.chart { margin: 2rem 0; padding: clamp(1rem, 2.5vw, 1.5rem); background: var(--night-2); border: 1px solid var(--line-soft); border-radius: 14px; }
.chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; margin-bottom: 1rem; }
.chart figcaption strong { font-family: var(--display); font-size: 1.25rem; color: var(--ivory); font-weight: 500; }
.chart figcaption span { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.key { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 2px; background: var(--night-3); border: 1px solid var(--muted); vertical-align: -0.05em; margin-left: 0.4em; }
.key.on { background: var(--brass); border-color: var(--brass); }
.key.alt { background: #7a5c22; border-color: #7a5c22; }

.range-grid { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 2px; max-width: 560px; }
.rc {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 3px;
  font: 500 clamp(0.5rem, 1.35vw, 0.72rem) var(--mono); color: var(--muted);
  background: var(--night-3);
}
.rc.pair { background: #172e25; }
.rc.on { background: var(--brass); color: var(--night); font-weight: 500; }
.legend { font-size: 0.8rem; color: var(--muted); margin: 0.8rem 0 0; }
.range-text { margin: 0.4rem 0 0; font-size: 0.8rem; }
.range-text code { white-space: normal; }

.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 3.2rem 1fr 4.2rem; gap: 0.7rem; align-items: center; }
.bar-row.wide { grid-template-columns: minmax(6rem, 11rem) 1fr 4.6rem; }
.bar-label { font-family: var(--mono); font-size: 0.82rem; color: var(--ink); text-align: right; }
.bar-row.wide .bar-label { text-align: left; font-family: var(--body); font-size: 0.9rem; }
.bar-track { position: relative; height: 18px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brass); border-radius: 0 4px 4px 0; }
.bar-fill.alt { background: #7a5c22; }
.bar-value { font-family: var(--mono); font-size: 0.82rem; color: var(--ivory); font-variant-numeric: tabular-nums; }
.bar-row:hover .bar-fill { filter: brightness(1.15); }
.chart-table { margin-top: 1rem; }
.chart-table summary { cursor: pointer; color: var(--brass-soft); font-size: 0.9rem; }

.vs { display: grid; gap: 10px; }
.vs-row { display: grid; grid-template-columns: 6.5rem 1fr 6.5rem; gap: 0.8rem; align-items: center; }
.vs-hand.right { text-align: right; }
.vs-track { display: flex; height: 24px; border-radius: 4px; overflow: hidden; gap: 2px; }
.vs-a, .vs-b { display: grid; place-items: center; font: 500 0.75rem var(--mono); min-width: 0; overflow: hidden; }
.vs-a { background: var(--brass); color: var(--night); }
.vs-b { background: #3d6b5a; color: var(--ivory); }
.vs-tie { background: var(--night-3); }

.seats-chart svg { width: 100%; max-width: 560px; height: auto; display: block; margin-inline: auto; }
.seats-chart .felt { fill: #11563c; stroke: #3b2516; stroke-width: 10; }
.seats-chart circle { fill: var(--night-2); stroke: var(--brass); stroke-width: 2; }
.seats-chart .blind circle { fill: #2a1f12; }
.seats-chart .late circle { fill: var(--brass); }
.seats-chart .late text { fill: var(--night); }
.seats-chart text { fill: var(--ivory); font: 600 14px var(--mono); text-anchor: middle; }
.seats-chart .dealer { fill: var(--ivory); stroke: none; }
.seats-chart .dealer-t { fill: var(--night); font-weight: 700; }

@media (max-width: 520px) {
  .vs-row { grid-template-columns: 4.6rem 1fr 4.6rem; gap: 0.4rem; }
  .bar-row.wide { grid-template-columns: 6rem 1fr 3.8rem; }
}

/* ---------- toc ---------- */
.toc ol { counter-reset: toc; }
.toc li a::before { counter-increment: toc; content: counter(toc) ". "; color: var(--brass); font-family: var(--mono); font-size: 0.8em; }

/* ---------- calls to action ---------- */
.cta {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem 1.5rem; align-items: center;
  margin-top: 3rem; padding: 1.5rem 1.6rem; border-radius: 16px;
}
.cta h2 { font-size: 1.45rem; margin: 0 0 0.25rem; }
.cta p { margin: 0; font-size: 0.97rem; }
.cta.play { background: linear-gradient(135deg, var(--felt), var(--felt-deep)); border: 1px solid var(--brass); box-shadow: inset 0 0 40px rgba(0,0,0,.3); }
.cta.where { margin-top: 1rem; grid-template-columns: 1fr auto; border: 1px solid var(--line); background: var(--night-2); }
.cta-cards { display: flex; }
.cta-cards .mc { font-size: 1.4rem; padding: 0.3em 0.35em; transform: rotate(-8deg); }
.cta-cards .mc + .mc { margin-left: -0.5em; transform: rotate(7deg); }
@media (max-width: 640px) { .cta, .cta.where { grid-template-columns: 1fr; } .cta-cards { display: none; } }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.pager a { display: grid; gap: 0.15rem; padding: 0.9rem 1.1rem; border: 1px solid var(--line-soft); border-radius: 12px; text-decoration: none; color: var(--ivory); }
.pager a:hover { border-color: var(--brass); }
.pager small { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- category & home ---------- */
.card-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem; }
.card-list a { display: grid; gap: 0.5rem; height: 100%; padding: 1.3rem 1.4rem; border: 1px solid var(--line-soft); border-radius: 14px; text-decoration: none; background: var(--night-2); transition: border-color 0.2s ease, transform 0.2s ease; }
.card-list a:hover { border-color: var(--brass); transform: translateY(-2px); }
.card-list h2 { font-size: 1.35rem; margin: 0; }
.card-list p { margin: 0; color: var(--ink); font-size: 0.95rem; }
.card-list .more { font-family: var(--mono); font-size: 0.78rem; color: var(--brass); align-self: end; }

.home-head { display: grid; gap: 1rem; padding-block: clamp(2rem, 6vw, 4rem) 2rem; }
.home-head h1 { font-size: clamp(2.6rem, 1.8rem + 4vw, 4.8rem); margin: 0; }
.start-here { margin-bottom: 3rem; }
.start-here h2 { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); font-weight: 500; }
.start-here ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0.8rem; counter-reset: start; }
.start-here a { display: grid; gap: 0.3rem; padding: 1.1rem; height: 100%; border-radius: 12px; text-decoration: none; background: linear-gradient(160deg, var(--felt), var(--felt-deep)); border: 1px solid var(--line); }
.start-here a::before { counter-increment: start; content: counter(start); font-family: var(--display); font-size: 1.8rem; color: var(--brass); line-height: 1; }
.start-here strong { color: var(--ivory); }
.start-here span { color: var(--ink); font-size: 0.88rem; line-height: 1.45; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1.2rem; }
.cat-block { padding: 1.4rem 1.5rem; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--night-2); }
.cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-decoration: none; }
.cat-head h2 { margin: 0; font-size: 1.6rem; }
.cat-head span { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.cat-block p { margin: 0.4rem 0 0.8rem; font-size: 0.95rem; color: var(--muted); }
.cat-block ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.2rem; }
.cat-block li::marker { color: var(--brass); }

/* ---------- operator listings ---------- */
.op-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; margin: 1.5rem 0 0.6rem; }
.op-card { display: grid; gap: 0.8rem; align-content: start; padding: 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: 14px; background: var(--night-2); }
.op-card header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.op-card h3 { margin: 0; font-size: 1.35rem; color: var(--ivory); }
.op-card .age { font: 700 0.75rem var(--mono); color: var(--ivory); border: 1.5px solid var(--ruby); border-radius: 999px; padding: 0.1rem 0.45rem; }
.op-card p { margin: 0; font-size: 0.95rem; }
.op-card dl { margin: 0; display: grid; gap: 0.45rem; }
.op-card dt { font: 500 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); }
.op-card dd { margin: 0; font-size: 0.9rem; color: var(--ink); }
.op-card .btn { justify-self: start; }
.op-checked { font-size: 0.82rem; color: var(--muted); margin: 0.4rem 0 1.5rem; }
.notice { display: flex; gap: 0.9rem; align-items: flex-start; padding: 1rem 1.2rem; border-radius: 12px; border: 1px solid #8a3b40; background: rgba(195, 49, 59, 0.1); }
.notice b.age { font: 700 0.95rem var(--mono); line-height: 1; color: var(--ivory); border: 2px solid var(--ruby); border-radius: 50%; min-width: 3rem; height: 3rem; display: grid; place-items: center; flex: none; }
.notice p { margin: 0; }

footer { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; color: var(--muted); font-size: 0.88rem; }
footer p { margin: 0 0 0.5rem; max-width: 80ch; }
footer a { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  html { scroll-behavior: auto; }
}
