/* Self-hosted variable fonts (Google Fonts builds, latin subset). No third-party requests. */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('/assets/fonts/fredoka-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url('/assets/fonts/nunito-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Party Moose Games — studio site. Palette lifted from the logo. */
:root {
  --sky: #EAF7FC;
  --paper: #FFFFFF;
  --ink: #1A1410;
  --body: #3A2C24;
  --muted: #6E5A4E;
  --cyan: #35C0EC;
  --cyan-deep: #1A8FB8;
  --yellow: #FFE23A;
  --cream: #FFF0B3;
  --moose: #4B3328;
  --line: #1A1410;
  --focus: #1A8FB8;
  --card-shadow: 6px 6px 0 var(--ink);
  --radius: 18px;
  --radius-sm: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky: #1C1512;
    --paper: #2A1F1A;
    --ink: #0E0A08;
    --body: #F1E8DF;
    --muted: #C4B3A6;
    --cyan: #5BCDF0;
    --cyan-deep: #8EDDF7;
    --cream: #FFE9A3;
    --line: #0E0A08;
    --focus: #8EDDF7;
  }
}
:root[data-theme="dark"] {
  --sky: #1C1512;
  --paper: #2A1F1A;
  --ink: #0E0A08;
  --body: #F1E8DF;
  --muted: #C4B3A6;
  --cyan: #5BCDF0;
  --cyan-deep: #8EDDF7;
  --cream: #FFE9A3;
  --line: #0E0A08;
  --focus: #8EDDF7;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--body);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}
h1, h2, h3 {
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 600;
  color: var(--body);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: 0.005em;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-top: 2.5rem; }
h3 { font-size: 1.25rem; margin-top: 1.75rem; }
p, ul, ol { margin: 0 0 1em; max-width: 68ch; }
li { margin-bottom: 0.35em; }
a { color: var(--cyan-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--body); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.95em; background: var(--paper); padding: 0.1em 0.35em; border-radius: 4px; }
small, .small { font-size: 0.9rem; color: var(--muted); }

.wrap { width: min(100% - 32px, 920px); margin-inline: auto; }

/* Header */
.site-head { padding: 20px 0 8px; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--body); font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.25rem; }
.brand img { width: 44px; height: 44px; }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-weight: 700; }
.site-nav a { text-decoration: none; padding: 6px 2px; }
.site-nav a[aria-current="page"] { border-bottom: 3px solid var(--yellow); }

/* Hero */
.hero { padding: 24px 0 8px; }
.hero img { display: block; width: min(100%, 640px); height: auto; margin: 0 0 20px -2%; }
.hero p { font-size: clamp(1.1rem, 2.4vw, 1.35rem); max-width: 34ch; }

/* Sticker cards */
.cards { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 22px; max-width: none; }
.card {
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
}
.card .art { width: 112px; height: 112px; border: 3px solid var(--line); border-radius: var(--radius-sm); object-fit: cover; background: var(--cream); }
.card .art.wide { width: 224px; height: 105px; }
.card .art.key { width: 150px; height: 118px; }
.card h3 { margin-top: 0; }
.card p { margin-bottom: 0.6em; }
.card .tag { display: inline-block; font-weight: 800; font-size: 0.85rem; padding: 2px 10px; border: 2px solid var(--line); border-radius: 999px; background: var(--yellow); color: #1A1410; margin-bottom: 8px; }
.card .tag.quiet { background: var(--cream); }
.card .tag.live { background: var(--cyan); }
.btn {
  display: inline-block; font-weight: 800; text-decoration: none;
  background: var(--cyan); color: #1A1410;
  border: 3px solid var(--line); border-radius: 999px;
  padding: 8px 18px; box-shadow: 3px 3px 0 var(--ink);
}
.btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); color: #1A1410; }
.btn.secondary { background: var(--paper); color: var(--body); }
@media (max-width: 520px) {
  .card { grid-template-columns: 1fr; }
  .card .art { width: 96px; height: 96px; }
  .card .art.wide { width: 192px; height: 90px; }
  .card .art.key { width: 150px; height: 118px; }
}

/* Contact block */
.contact { margin-top: 40px; padding: 20px; border: 3px solid var(--line); border-radius: var(--radius); background: var(--cream); color: #1A1410; }
.contact h2 { margin-top: 0; color: #1A1410; }
.contact p { margin-bottom: 0.4em; }
.contact a { color: #1A1410; }

/* Document pages */
.doc { padding: 12px 0 24px; }
.doc .meta { color: var(--muted); margin-bottom: 1.5rem; }
.doc table { border-collapse: collapse; margin: 0 0 1.5em; width: 100%; max-width: 760px; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, var(--body) 25%, transparent); }
.doc th { font-weight: 800; }

/* Footer */
.site-foot { margin-top: 56px; padding: 24px 0 40px; border-top: 3px solid var(--line); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 0.95rem; }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }

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

/* Stack the data table on narrow screens */
@media (max-width: 600px) {
  .doc thead { display: none; }
  .doc tr { display: block; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--body) 25%, transparent); }
  .doc td { display: block; border: 0; padding: 2px 0; }
  .doc td:first-child { font-weight: 800; }
}

/* BattlePucks stats */
.crumb { margin: 0 0 4px; font-weight: 700; }
.stats .note { color: var(--muted); font-size: 0.95rem; }
.stats-controls {
  position: sticky; top: 0; z-index: 2;
  display: grid; grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(110px, 1fr)); gap: 10px 14px;
  background: var(--paper); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow);
  padding: 14px 16px; margin: 8px 0 18px;
}
.stats-controls label { display: grid; gap: 4px; font-weight: 800; font-size: 0.9rem; }
.stats-controls input[type="search"], .stats-controls select {
  font: inherit; font-weight: 600; font-size: 1rem; color: var(--body); background: var(--sky);
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; min-height: 40px; width: 100%;
}
.level-control output { font-family: "Fredoka", sans-serif; font-size: 1.15rem; background: var(--yellow); color: #1A1410; border: 2px solid var(--line); border-radius: 999px; padding: 0 10px; margin-left: 4px; }
.level-control input[type="range"] { width: 100%; min-height: 40px; accent-color: var(--cyan-deep); }
.num { font-weight: 800; }
.num.scales { background: var(--cream); color: #1A1410; border-radius: 4px; padding: 0 4px; }
.puck-list { list-style: none; padding: 0; margin: 0; max-width: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 22px; align-items: start; }
.puck {
  background: var(--paper); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow);
  padding: 18px; margin: 0; scroll-margin-top: 150px; min-width: 0;
}
.puck:target { outline: 4px solid var(--yellow); outline-offset: 2px; }
.puck-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.puck-head h3 { margin: 0 0 4px; }
.puck-head h3 a { color: var(--body); text-decoration: none; }
.puck-head h3 a:hover { text-decoration: underline; }
.puck .art {
  flex: none; width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--line);
  background: radial-gradient(circle at 50% 38%, #FFFFFF 0 30%, var(--arena) 100%); overflow: hidden; display: block; position: relative;
}
/* The renders share one camera, so every character stands at the same spot (feet centred at
   36.5% across, 81% down) at the same scale; centre the crop on the body, not on the image,
   or pucks with a weapon to one side sit off centre. tiers.js draws the same crop. */
.puck .art img, .tier-puck .art img { position: absolute; width: 175%; height: 175%; max-width: none; left: -13.9%; top: -35.75%; }
.puck .art.icon { background: var(--cream); }
.puck .art.icon::after {
  content: ""; position: absolute; inset: 18%; background: var(--tint);
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.minion { margin-top: 14px; padding: 12px; border: 2px dashed color-mix(in srgb, var(--body) 40%, transparent); border-radius: var(--radius-sm); }
.minion-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.minion h4 { margin: 0; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.1rem; }
.minion h4 .pill { vertical-align: 2px; margin-left: 4px; }
.minion-note { margin: 2px 0 0; font-size: 0.9rem; color: var(--muted); }
.puck .minion-art { width: 64px; height: 64px; --arena: var(--sky); }
.minion .puck-stats { margin-bottom: 0; }
.numbers { margin: 10px 0 0; font-size: 0.95rem; }
.numbers div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid color-mix(in srgb, var(--body) 15%, transparent); }
.numbers dd { margin: 0; white-space: nowrap; }
.pill { display: inline-block; font-weight: 800; font-size: 0.8rem; padding: 1px 9px; border: 2px solid var(--line); border-radius: 999px; background: var(--cyan); color: #1A1410; margin-right: 6px; }
.pill.quiet { background: var(--cream); }
.puck-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px; }
.puck-stats div { background: var(--sky); border-radius: var(--radius-sm); padding: 6px 8px; text-align: center; }
.puck-stats dt { font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.puck-stats dd { margin: 0; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.2rem; }
.ability p { margin: 0 0 0.5em; }
.keywords { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }
.keywords div { margin-bottom: 4px; }
.keywords dt { display: inline; font-weight: 800; color: var(--body); }
.keywords dt::after { content: ": "; }
.keywords dd { display: inline; margin: 0; }
.puck details { margin-top: 12px; }
.puck summary { cursor: pointer; font-weight: 800; color: var(--cyan-deep); min-height: 32px; }
.table-scroll { overflow-x: auto; }
.doc .level-table, .doc .cost-table { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.doc .level-table th, .doc .level-table td { padding: 4px 8px; text-align: right; white-space: nowrap; }
.doc .level-table th:first-child { text-align: left; }
.doc tr.current { background: var(--cream); color: #1A1410; }
.doc .cost-table { max-width: 520px; }
@media (max-width: 760px) {
  .stats-controls { grid-template-columns: 1fr 1fr; position: static; }
  .stats-controls .level-control { grid-column: 1 / -1; }
  .puck { scroll-margin-top: 16px; }
}
@media (max-width: 600px) {
  /* The level and cost tables stay tables; only the legal pages stack. */
  .doc .level-table thead, .doc .cost-table thead { display: table-header-group; }
  .doc .level-table tr, .doc .cost-table tr { display: table-row; padding: 0; border: 0; }
  .doc .level-table td, .doc .level-table th, .doc .cost-table td, .doc .cost-table th { display: table-cell; border-bottom: 1px solid color-mix(in srgb, var(--body) 25%, transparent); padding: 4px 8px; }
  .doc .level-table td:first-child, .doc .cost-table td:first-child { font-weight: 400; }
  .puck-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Tier list maker (/battle-pucks/tiers). */
[hidden] { display: none !important; }
.tier-title { display: grid; gap: 4px; font-weight: 800; font-size: 0.9rem; max-width: 420px; margin-bottom: 16px; }
.tier-title input, .tier-link input {
  font: inherit; font-weight: 600; font-size: 1rem; color: var(--body); background: var(--paper);
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; min-height: 40px; width: 100%;
}
.tier-board { border: 3px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow); background: var(--paper); }
.tier-row { display: grid; grid-template-columns: 72px 1fr; min-height: 104px; }
.tier-row + .tier-row { border-top: 3px solid var(--line); }
.tier-label {
  font: 600 2rem "Fredoka", sans-serif; color: #1A1410; background: var(--tier);
  border: 0; border-right: 3px solid var(--line); cursor: pointer;
}
.tier-items { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 8px; min-height: 100px; cursor: pointer; }
.tier-items.drop { background: color-mix(in srgb, var(--cyan) 18%, transparent); }
.tier-items.pool { border: 3px dashed color-mix(in srgb, var(--body) 40%, transparent); border-radius: var(--radius); margin-bottom: 12px; }
.tier-puck {
  width: 80px; padding: 4px 2px 2px; border: 2px solid transparent; border-radius: var(--radius-sm);
  background: none; color: var(--body); font: inherit; cursor: grab; display: grid; justify-items: center; gap: 2px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.tier-puck .art {
  width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--line); overflow: hidden; position: relative; display: block;
  background: radial-gradient(circle at 50% 38%, #FFFFFF 0 30%, var(--arena) 100%);
}
.tier-puck .name { font-weight: 800; font-size: 0.75rem; line-height: 1.15; text-align: center; }
.tier-puck:hover .art { transform: translateY(-2px); }
.tier-puck.selected { border-color: var(--line); background: var(--yellow); color: #1A1410; }
.tier-puck.dragging { opacity: 0.35; }
.tier-ghost { position: fixed; left: 0; top: 0; z-index: 10; pointer-events: none; cursor: grabbing; background: var(--paper); border-color: var(--line); box-shadow: var(--card-shadow); }
.tier-selected {
  position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  background: var(--yellow); color: #1A1410; border: 3px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 12px; margin: 0 0 10px; max-width: none;
}
.tier-selected a { color: #1A1410; }
.tier-selected-links { display: flex; gap: 14px; font-weight: 800; }
.link-button { font: inherit; font-weight: 800; color: #1A1410; background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.tier-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.tier-actions .btn { font: inherit; font-weight: 800; cursor: pointer; }
.tier-link { display: grid; gap: 4px; font-weight: 800; font-size: 0.9rem; max-width: none; }
.tiers .note { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 520px) {
  .tier-row { grid-template-columns: 52px 1fr; min-height: 88px; }
  .tier-label { font-size: 1.6rem; }
  .tier-items { padding: 6px; gap: 2px; min-height: 84px; }
  .tier-puck { width: 76px; }
  .tier-puck .name { font-size: 0.72rem; }
  .tier-puck .art { width: 56px; height: 56px; }
}
