/* turf's own look: a printed city map. Flat paper and ink, hairlines and a double neatline, the map as the hero.
   Reads tokens.css; restyles what base.css draws generically. */

/* ---------- type ---------- */
h1, h2, .display { line-height: 0.92; }
h1 { font-size: clamp(40px, 5.2vw, 74px); }
h2 { font-size: clamp(30px, 3.6vw, 48px); }
h3, .h3 { font: 700 19px/1.25 var(--font-text); letter-spacing: -0.005em; }
.lede b { color: var(--ink); font-weight: 700; }
.kicker { color: var(--ink); font-weight: 500; }
.kicker-dot { width: 9px; height: 9px; border-radius: 1px; background: var(--ink); }
.big { font: var(--display-weight) 40px/1 var(--font-display); letter-spacing: 0; }
.label { color: var(--muted); }
.fine { font-size: 13px; }

/* ---------- header ---------- */
#top { background: var(--bg); backdrop-filter: none; border-bottom: 1px solid var(--ink); }
.brand { display: flex; align-items: center; color: var(--ink); }
.brand svg { display: block; }
.nav a { border-radius: 0; padding: 8px 10px; color: var(--ink-2); font-weight: 500; }
.nav a:hover, .nav a[aria-current] { background: none; color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }

/* ---------- buttons, chips ---------- */
.btn { border-radius: var(--r-sm); border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font-weight: 700; letter-spacing: 0.005em; }
.btn:hover { background: var(--surface); border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--ink); box-shadow: var(--press); }
.btn.primary:hover { filter: none; background: #B82E15; }
.btn.primary:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn[disabled].primary { background: var(--surface-2); color: var(--muted); box-shadow: none; border-color: var(--line-3); opacity: 1; }
.chip { border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); }
.chip.rank { color: var(--ink); border-color: var(--ink); font-weight: 600; }
.chip.off { color: var(--muted); border-style: dashed; }
.chip.done { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.seg { border-radius: var(--r-sm); border: 1px solid var(--ink); background: var(--surface); padding: 3px; }
.seg button, .chips button { border-radius: 2px; }
.chips button { border: 1px solid var(--line-2); background: var(--surface); }
.seg button[aria-pressed="true"], .chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.input, .prefix { border-radius: var(--r-sm); border-color: var(--line-3); background: var(--surface); }
.input:focus, .prefix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.card { border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); }
.banner { border-radius: var(--r); border: 1px solid var(--ink); background: var(--surface); }
.banner.good { border-color: var(--good); box-shadow: inset 4px 0 0 var(--good); }
.swatch { display: inline-block; flex: none; border-radius: 1.5px; vertical-align: -1px; }
.swatch.hatched { background-image: repeating-linear-gradient(45deg, rgba(236, 230, 216, 0.5) 0 1.5px, transparent 1.5px 4px) !important; }
.coin-art { border-radius: var(--r-sm); }
.coin-art.drawn { display: inline-block; background: none; }
.coin-art.drawn svg { display: block; }
.link-arrow { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* ---------- the map ---------- */
.live-map-wrap { position: relative; }
.live-map svg, .mini-map svg { display: block; width: 100%; height: auto; }
.live-map .blk { transition: fill var(--t) var(--ease); }
.live-map .blk:hover { stroke: var(--ink); stroke-width: 0.6; cursor: pointer; }
/* the one moment: a block that changed hands flashes red, then settles into the taker's ink */
@keyframes take { 0%, 40% { fill: var(--accent); } }
.live-map .blk.taking { animation: take var(--t-take) var(--ease) both; }
.map-tip { position: absolute; left: 0; top: 0; z-index: 3; min-width: 150px; max-width: 200px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.4; pointer-events: none; opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.map-tip.on { opacity: 1; }
.map-tip b { color: #fff; }

/* the home sheet: a double neatline round the map, the title on the sea, the legend underneath */
.sheet-wrap { padding-top: 22px; }
.sheet { position: relative; border: 2px solid var(--ink); padding: 12px; background: var(--bg); container-type: inline-size; }
.sheet::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--ink); pointer-events: none; }
.sheet-map { position: relative; }
.cartouche { position: absolute; left: 4.2%; top: 9.5%; width: 41%; display: grid; justify-items: start; }
.cartouche .kicker { margin-bottom: 12px; }
.cartouche h1 { font-size: clamp(40px, 5.7cqw, 80px); }
.cartouche h1 span { display: block; }
.cartouche .lede { margin-top: 16px; font-size: clamp(15px, 1.36cqw, 18.5px); color: var(--ink-2); max-width: none; }
.cartouche .ctas { margin-top: 22px; }
.legend { display: grid; grid-template-columns: 1.05fr 1.15fr 1fr; border-top: 1px solid var(--ink); margin-top: 12px; }
.legend > div { padding: 18px 20px 6px; display: grid; gap: 10px; align-content: start; }
.legend > div + div { border-left: 1px solid var(--line-2); }
.legend-big { display: flex; gap: 28px; }
.legend-big > div { display: grid; gap: 2px; }
.legend-big .muted { font-size: 13px; }
.key { display: grid; gap: 6px; }
.key a { display: grid; grid-template-columns: 14px 14px 76px 30px 1fr; gap: 8px; align-items: center; font-size: 14px; }
.key a:hover b { text-decoration: underline; }
.key .num { text-align: right; }
.key-bar { height: 6px; background: var(--lot); }
.key-bar span { display: block; height: 100%; background: var(--ink); }
.legend-ca .ca { margin-top: 0; }
.latest { font-size: 13px; }
.latest:empty { display: none; }

/* ---------- the rules ---------- */
.rules { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ink); background: var(--surface); }
.rule { padding: 20px 20px 24px; display: grid; gap: 8px; align-content: start; }
.rule + .rule { border-left: 1px solid var(--line-2); }
.rule-art { margin: -4px -4px 8px; padding: 10px; background: var(--bg); border: 1px solid var(--line); }
.rule-art svg { display: block; width: 100%; height: auto; }
.rule .step-n { color: var(--ink-2); font-size: 12px; letter-spacing: 0.06em; }
.rule p { font-size: 15px; }
.rules.two { grid-template-columns: repeat(2, 1fr); }
.rules.two .rule:nth-child(3) { border-left: 0; }
.rules.two .rule:nth-child(n+3) { border-top: 1px solid var(--line-2); }
.section.tight { padding-top: 28px; }

/* ---------- standings ---------- */
.table { border-top: 1px solid var(--ink); }
.tr { display: grid; grid-template-columns: 44px minmax(180px, 1.3fr) minmax(150px, 1.1fr) 110px 110px minmax(0, 2fr); gap: 14px; align-items: center; padding: 11px 6px; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
a.tr:hover { background: var(--surface); }
.tr.th { padding-top: 10px; padding-bottom: 10px; font: 500 11px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tr .c0 { color: var(--ink-2); }
.tr .c1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who { display: grid; min-width: 0; line-height: 1.25; }
.who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .mono { font-size: 12.5px; }
.tr .c2 { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; }
.tshare { height: 8px; background: var(--lot); }
.tshare span { display: block; height: 100%; }
.tr .c5 { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- takes ---------- */
.feed { border-top: 1px solid var(--ink); }
.feed-row { grid-template-columns: 62px 74px minmax(0, 1fr) 104px 96px; border-bottom: 1px solid var(--line-2); padding: 10px 0; }
.feed-row.own { grid-template-columns: 62px minmax(0, 1fr) 104px 96px; }
.feed-time { font-size: 12.5px; text-align: left; }
.feed-sym { color: var(--ink); font-size: 13px; font-weight: 500; }
.feed-amt { font-size: 13px; text-align: right; color: var(--ink-2); }
.tx { justify-content: flex-end; }
.ref { display: inline-flex; align-items: center; gap: 4px; padding: 0 5px; margin: 0 1px; border: 1px solid var(--line-3); border-radius: 2px; background: var(--surface); font-size: 12.5px; line-height: 1.5; vertical-align: 1px; }
.ref.lost { border-style: dashed; color: var(--muted); }
.feed-row.k-lost .feed-text, .feed-row.k-claim .feed-text { color: var(--ink-2); }
.feed-row.k-won .feed-text { font-weight: 700; }

/* ---------- crew cards ---------- */
.crew-card { display: grid; gap: 12px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); transition: transform var(--t) var(--ease), border-color var(--t) var(--ease); }
a.crew-card:hover { transform: translateY(-2px); border-color: var(--ink); }
.cc-head { display: flex; align-items: center; gap: 12px; }
.cc-id { min-width: 0; flex: 1; }
.coin-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-sym { font-size: 13px; color: var(--muted); }
.mini-map { border: 1px solid var(--line); }
.cc-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cc-nums > div { display: grid; gap: 2px; }
.cc-nums .num { font-size: 15px; }
.cc-last { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-card.preview .cc-last { white-space: normal; }
.chart-line { stroke: var(--ink); stroke-width: 1.6; }
.chart-area { fill: rgba(28, 26, 22, 0.07); }
.more-moves { margin-top: 14px; }
.skeleton .sk { background: var(--surface-2); animation: pulse 1.4s infinite var(--ease); }
.sk-map { height: 120px; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ---------- stats, CA ---------- */
.stat-value { font-size: 22px; }
.coin-stats { gap: 0; border: 1px solid var(--ink); background: var(--surface); }
.coin-stats .stat { border: 0; border-radius: 0; background: none; padding: 14px 16px; }
.coin-stats .stat + .stat { border-left: 1px solid var(--line-2); }
.ca { border: 1px dashed var(--line-3); border-radius: var(--r-sm); background: var(--surface); }
.ca.small { background: transparent; }
.ca-soon { color: var(--ink); font-weight: 600; }

/* ---------- crew page ---------- */
.coin-head { padding-top: 34px; }
.coin-title h1 { font-size: clamp(36px, 4.6vw, 62px); }
.coin-title .sym { font: 500 0.42em var(--font-mono); color: var(--muted); letter-spacing: 0; }
.coin-actions { display: flex; gap: 10px; }
.turf-panel { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.turf-map { padding: 16px; }
.turf-side { display: grid; gap: 18px; }
.coin-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.next-take { display: grid; gap: 10px; padding: 18px 20px; border: 1px solid var(--ink); background: var(--bg); font-size: 15.5px; }
.next-take b { font-weight: 600; }
.split-box { display: grid; gap: 8px; margin-top: 8px; }
.split { height: 30px; margin-top: 0; border-radius: 2px; border: 1px solid var(--ink); }
.split span { overflow: hidden; white-space: nowrap; font-size: 11.5px; background: var(--lot); color: var(--ink); }
.split span:first-child { background: var(--ink); color: var(--bg); }
.split span:nth-child(2) { background: var(--surface-2); border-left: 1px solid var(--ink); }
.split span:nth-child(3) { border-left: 1px solid var(--ink); }
.split-box.wide { max-width: 760px; margin-top: 18px; }
.split-box.wide .split { height: 40px; }
.split-box.wide .split span { font-size: 13px; }

/* ---------- launch ---------- */
.picker { margin-top: 14px; border: 1px solid var(--line-2); }
.picker .blk { cursor: pointer; }
.picker .blk:hover { fill: var(--ink-2); }
.corner-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.corner-list .chip { height: 32px; gap: 8px; font-family: var(--font-text); font-size: 13.5px; color: var(--ink); cursor: pointer; }
.corner-list .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.corner-list .chip[aria-pressed="true"] .muted { color: #CFC7B6; }
.corner-line { font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.step-title .step-n { border-radius: 2px; border-color: var(--ink); color: var(--ink); }
.step-n { color: var(--ink-2); }
.notes .icon { color: var(--ink); }
.flow-steps li.done .flow-mark { background: var(--ink); color: var(--bg); }
.flow-steps li.now .flow-mark { border-color: var(--ink); }
.drop { border-radius: var(--r); border-color: var(--line-3); background: var(--surface); }

/* ---------- how ---------- */
.rulebook { display: grid; grid-template-columns: 150px 1fr; gap: 0; margin-top: 22px; border-top: 1px solid var(--ink); max-width: 920px; }
.rulebook dt, .rulebook dd { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.rulebook dt { font: 500 12px/1.6 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 16px; }
.rulebook dd { color: var(--ink-2); }
.faq details { border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); }
.faq details[open] { border-color: var(--ink); }
.risks { display: grid; gap: 10px; margin-top: 18px; max-width: 760px; }
.risks li { padding-left: 22px; position: relative; color: var(--ink-2); }
.risks li::before { content: ''; position: absolute; left: 0; top: 7px; width: 10px; height: 10px; border: 1.5px solid var(--ink); border-radius: 1px; }

/* ---------- band, empty, 404 ---------- */
.band { justify-items: center; text-align: center; padding-bottom: 20px; }
.band h2 { font-size: clamp(44px, 6vw, 88px); }
.band h2 span { display: block; }
.empty-lots { display: grid; grid-template-columns: repeat(3, 22px); gap: 5px; margin-bottom: 6px; }
.empty-lots span { height: 22px; border-radius: 2px; background: var(--lot); }
.empty-lots span:nth-child(5) { background: none; border: 1.5px dashed var(--line-3); }
.lost h1 { font-size: clamp(48px, 7vw, 96px); }

/* ---------- footer ---------- */
#foot { border-top: 1px solid var(--ink); }
.foot { grid-template-columns: 1.2fr 2fr; }
.foot-word svg { display: block; }
.foot-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.foot-col { display: grid; gap: 8px; align-content: start; }
.foot-col a { color: var(--ink-2); }
.foot-col a:hover { color: var(--ink); text-decoration: underline; }
.foot-base { border-top: 1px solid var(--line-2); }

/* ---------- toasts, modal ---------- */
.toast { border-radius: var(--r-sm); }
.modal-veil { background: rgba(28, 26, 22, 0.55); backdrop-filter: none; }
.modal-panel { border-radius: var(--r); border: 1.5px solid var(--ink); background: var(--surface); box-shadow: 6px 6px 0 rgba(28, 26, 22, 0.25); }
.menu { border-radius: var(--r-sm); border: 1px solid var(--ink); background: var(--surface); }
.menu-item:hover { background: var(--bg); }
.wallet-row { border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg); }
.wallet-row:hover:not([disabled]) { border-color: var(--ink); }
.live-dot { background: var(--good); }

/* ---------- smaller screens ---------- */
@media (max-width: 1080px) {
  .cartouche { position: static; width: auto; padding: 22px 8px 24px; }
  .cartouche h1 { font-size: clamp(40px, 9cqw, 72px); }
  .cartouche .lede { font-size: 17px; max-width: 36em; }
  .sheet-map { display: flex; flex-direction: column; }
  .cartouche { order: -1; }
  .legend { grid-template-columns: 1fr 1fr; }
  .legend-ca { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--line-2); }
  .rules { grid-template-columns: repeat(2, 1fr); }
  .rules .rule:nth-child(3) { border-left: 0; }
  .rules .rule:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .turf-panel, .coin-grid { grid-template-columns: 1fr; }
  .tr { grid-template-columns: 36px minmax(160px, 1.3fr) minmax(130px, 1fr) 100px 100px; }
  .tr .c5 { display: none; }
}
@media (max-width: 860px) {
  .tabbar { border-radius: var(--r); border: 1px solid var(--ink); background: var(--surface); backdrop-filter: none; }
  .tabbar a { border-radius: var(--r-sm); }
  .tabbar a[aria-current] { background: var(--ink); color: var(--bg); }
  .foot { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sheet { padding: 8px; }
  .sheet::before { inset: 3px; }
  .legend { grid-template-columns: 1fr; }
  .legend > div + div { border-left: 0; border-top: 1px solid var(--line-2); }
  .legend > div { padding: 16px 10px 8px; }
  .rules, .rules.two { grid-template-columns: 1fr; }
  .rules .rule + .rule { border-left: 0; border-top: 1px solid var(--line-2); }
  .tr { grid-template-columns: 28px minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
  .tr .c3, .tr .c4 { display: none; }
  .tr .c2 { grid-template-columns: 26px 1fr; }
  .feed-row, .feed-row.own { grid-template-columns: 54px minmax(0, 1fr) 84px; }
  .feed-row .feed-sym { display: none; }
  .feed-row .tx { display: none; }
  .coin-stats { grid-template-columns: 1fr 1fr; }
  .coin-stats .stat { border-left: 0 !important; border-top: 1px solid var(--line-2); }
  .coin-stats .stat:nth-child(even) { border-left: 1px solid var(--line-2) !important; }
  .coin-stats .stat:nth-child(-n+2) { border-top: 0; }
  .coin-actions { flex-wrap: wrap; }
  .rulebook { grid-template-columns: 1fr; }
  .rulebook dt { border-bottom: 0; padding-bottom: 0; }
  .foot-links { grid-template-columns: 1fr 1fr; }
  .band h2 { font-size: clamp(40px, 12vw, 64px); }
}
