:root {
  --night: #14213D;
  --deep: #0D1730;
  --brass: #E0B04A;
  --paper: #FBFAF7;
  --ink: #1D1D1F;
  --red: #D7372F;
  --muted: #B9C2D6;
  --line: rgba(224, 176, 74, 0.28);
  --head: "Oswald", "Arial Narrow", Arial, sans-serif;
  --text: "PT Serif", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.65;
}
a { color: var(--brass); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-head { background: var(--deep); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.logo { font-family: var(--head); font-weight: 600; font-size: 1.35rem; color: var(--paper); text-decoration: none; letter-spacing: 0.02em; }
.logo span { color: var(--red); }
.nav { display: flex; gap: 6px 18px; flex-wrap: wrap; font-family: var(--head); font-size: 1.02rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--paper); }
.nav a[aria-current="page"] { color: var(--paper); border-bottom-color: var(--brass); }

/* Type */
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); margin-bottom: 12px; }
h3 { font-size: 1.45rem; margin-bottom: 6px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 36em; }
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }

/* Playing cards */
.pcard {
  width: 78px; height: 110px;
  background: var(--paper); color: var(--ink);
  border-radius: 8px; border: 1px solid #d8d3c7;
  position: relative; flex: none;
  font-family: var(--head); font-weight: 600;
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}
.pcard.red { color: var(--red); }
.pcard .c { position: absolute; top: 5px; left: 7px; line-height: 1; text-align: center; font-size: 1.15rem; }
.pcard .c i { display: block; font-style: normal; font-size: 1rem; }
.pcard .p { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.1rem; padding-top: 10px; }
.pcard.big { width: 120px; height: 168px; border-radius: 12px; }
.pcard.big .c { font-size: 1.6rem; top: 8px; left: 10px; }
.pcard.big .p { font-size: 3.4rem; }

.btn {
  display: inline-block; font: inherit; font-family: var(--head); font-size: 1.05rem;
  background: var(--red); color: var(--paper); border: none; border-radius: 6px;
  padding: 11px 22px; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 2px var(--line); }

/* Stage (trick area) */
.stage { background: var(--deep); border: 1px solid var(--line); border-radius: 14px; padding: 26px 20px; margin-top: 26px; }
.stage .status { font-family: var(--head); font-size: 1.35rem; margin: 0 0 4px; }
.stage .hint { color: var(--muted); margin: 0 0 18px; font-size: 0.98rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 8px 0 22px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero */
.hero { padding: 60px 0 50px; }
.hero h1 { max-width: 12em; }
.hero h1 em { font-style: normal; color: var(--brass); }

/* Section links */
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; margin-top: 20px; }
.paths a { text-decoration: none; color: var(--paper); display: block; padding-top: 14px; border-top: 3px solid var(--brass); }
.paths a:hover h3 { color: var(--brass); }
.paths .suit { font-size: 1.6rem; line-height: 1; }
.paths .suit.red { color: var(--red); }
.paths p { color: var(--muted); margin: 6px 0 0; }

/* 21 cards */
.piles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 420px; margin: 0 auto 10px; }
.pile { appearance: none; background: none; border: 2px dashed transparent; border-radius: 10px; padding: 8px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: inherit; font: inherit; }
.pile:hover { border-color: var(--line); }
.pile .pcard + .pcard { margin-top: -84px; }
.pile small { margin-top: 8px; color: var(--muted); font-family: var(--head); }

/* Number cards */
.ncards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ncard { appearance: none; text-align: left; font: inherit; cursor: pointer; background: var(--paper); color: var(--ink); border: 3px solid transparent; border-radius: 10px; padding: 10px 10px 12px; }
.ncard[aria-pressed="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,55,47,0.25); }
.ncard b { font-family: var(--head); display: block; margin-bottom: 4px; }
.ncard span { font-size: 0.78rem; line-height: 1.5; word-spacing: 3px; color: #444; }
.answer { font-family: var(--head); font-size: 2.4rem; color: var(--brass); margin: 6px 0 0; min-height: 1.2em; }

/* Lessons */
.lesson { border-top: 1px solid var(--line); padding: 18px 0; }
.lesson summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.lesson summary::-webkit-details-marker { display: none; }
.lesson summary h3 { margin: 0; }
.level { font-family: var(--head); font-size: 0.95rem; color: var(--brass); white-space: nowrap; }
.lesson .body { max-width: 40em; padding-top: 10px; }
.lesson ol { padding-left: 1.3em; }
.lesson li { margin-bottom: 6px; }
.tip { border-left: 3px solid var(--brass); padding: 4px 0 4px 14px; color: var(--muted); }
.rules { columns: 2 280px; column-gap: 40px; padding-left: 1.1em; }
.rules li { margin-bottom: 10px; break-inside: avoid; }

/* Shows */
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-top: 18px; }
.formats p { color: var(--muted); margin: 6px 0 0; }
.formats .meta { font-family: var(--head); color: var(--brass); margin-top: 8px; }
.contact { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 26px; max-width: 560px; }
.contact h2 { color: var(--ink); }
.contact a { color: var(--red); }
.contact p { margin: 6px 0; }

footer { padding: 34px 0 44px; color: var(--muted); font-size: 0.92rem; border-top: 1px solid var(--line); }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .pcard { width: 52px; height: 74px; border-radius: 6px; }
  .pcard .c { font-size: 0.95rem; left: 5px; }
  .pcard .c i { font-size: 0.85rem; }
  .pcard .p { font-size: 1.4rem; }
  .pile .pcard + .pcard { margin-top: -56px; }
  .row { gap: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .reveal-in { animation: flipin 0.5s ease-out both; }
  @keyframes flipin { from { transform: rotateY(90deg); } to { transform: none; } }
}

/* Фокус дня */
.daily { background: var(--deep); border-left: 4px solid var(--brass); border-radius: 0 14px 14px 0; padding: 24px 26px; max-width: 46em; }
.daily-meta { font-family: var(--head); color: var(--brass); margin: 0 0 6px; }
.daily ol { padding-left: 1.3em; max-width: 40em; }
.daily li { margin-bottom: 6px; }

/* Фокусники */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 34px 40px; }
.person { border-top: 3px solid var(--brass); padding-top: 14px; }
.person .years { font-family: var(--head); color: var(--brass); margin: 0 0 4px; }
.person p:last-child { color: var(--muted); margin: 8px 0 0; }

/* О картах */
.prose p { max-width: 40em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px 32px; margin-top: 14px; }
.facts b { font-family: var(--head); font-weight: 600; font-size: 1.3rem; display: block; }
.facts p { color: var(--muted); margin: 6px 0 0; }
