@font-face {
  font-family: Manrope;
  src: url(assets/manrope-latin.woff2) format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url(assets/manrope-cyrillic.woff2) format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0400-052F, U+2116;
}
@font-face {
  font-family: CardTitle;
  src: url(assets/card-serif.ttf) format("truetype");
  font-feature-settings: "lnum" 1;
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: CardBody;
  src: url(assets/card-italic.ttf) format("truetype");
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: CardRules;
  src: url(assets/card-rules.ttf) format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: CardRules;
  src: url(assets/card-rules-italic.ttf) format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
.rich-field {
  margin-bottom: 18px;
}
.rich-field > .field {
  margin-bottom: 7px;
}
.text-tools,
.symbol-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.symbol-button {
  width: 32px;
  height: 34px;
  border-radius: 4px;
  background: #f3eff5;
  color: #18131f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #635173;
  font:
    20px Georgia,
    serif;
  padding: 5px;
  flex-shrink: 0;
}
.symbol-button img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}
.symbol-button:hover {
  background: #d4bce8;
  border-color: #cbb4e5;
}
.more-symbols {
  font-size: 10px;
  margin-top: 9px;
}
.more-symbols summary {
  color: #c7afe8;
  cursor: pointer;
  padding: 5px 0;
}
.more-symbols .symbol-options {
  margin: 10px 0;
}
.more-symbols > .button {
  margin-top: 5px;
}
.unicode-insert {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}
.unicode-insert input {
  width: 100%;
  font-size: 12px;
}
.markup-help {
  font-size: 9px;
  line-height: 1.8;
  margin: -2px 0 18px;
  color: #9d8cab;
}
.deck-mark-settings {
  border-top: 1px solid #41364d;
  margin-top: 24px;
  padding-top: 20px;
}
.deck-mark-settings h3 {
  font-size: 11px;
  font-weight: 500;
}
.aspect span img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.aspect span {
  width: 30px;
}
.aspect {
  min-height: 53px;
}
@media (min-width: 1031px) {
  .preview-panel,
  .export-panel {
    position: sticky;
    top: 20px;
  }
}
@media (max-width: 700px) {
  .symbol-button {
    width: 36px;
    height: 40px;
  }
  .unicode-insert input {
    font-size: 16px;
  }
}
.deck-mark-settings {
  padding: 15px 0 19px;
  margin: 0 0 19px;
  border-top: 0;
  border-bottom: 1px solid #41364d;
}
.deck-mark-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 13px;
}
.deck-mark-choice {
  background: #261c30;
  border: 1px solid #4c395d;
  border-radius: 5px;
  min-height: 64px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 3px;
}
.deck-mark-choice img {
  width: 29px;
  height: 29px;
  object-fit: contain;
}
.deck-mark-choice > span {
  font-size: 8px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  color: #c1b4cc;
}
.deck-mark-choice.selected {
  border-color: #debfef;
  box-shadow: inset 0 0 0 1px #debfef;
  background: #412954;
}
.deck-mark-choice:hover {
  background: #3b294a;
}
.deck-mark-choice > b {
  font-size: 20px;
  height: 29px;
}
.card-number-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin-top: 9px;
}
.card-number-fields .field {
  margin: 5px 0;
}
.card-number-fields > b {
  padding-bottom: 16px;
  font-size: 20px;
  color: #c7afe8;
}
.number-feedback {
  font-size: 10px;
  color: #a99bb2;
  margin-top: 6px;
}
.number-feedback strong {
  color: #f3e6ff;
  font-size: 15px;
  letter-spacing: 1px;
  margin-left: 5px;
}
.number-error {
  font-size: 10px;
  color: #edabb7;
  margin-top: 8px;
}
.upload-deck {
  font-size: 10px;
}
.card-hit-areas {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  overflow: hidden;
}
.card-edit-region {
  position: absolute;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0;
}
.card-edit-region:hover,
.card-edit-region:focus-visible {
  border-color: #e8c7ff;
  background: #c7afe81a;
  outline: 1px solid #22152f;
  outline-offset: 1px;
}
.card-hit-areas:empty {
  pointer-events: none;
}
@media (min-width: 1031px) {
  .workspace > .preview-panel,
  .workspace > .export-panel {
    position: sticky;
    top: 20px;
  }
}
.field:has(input:focus) {
  scroll-margin-top: 25px;
}
:root {
  color-scheme: dark;
  --bg: #100e15;
  --panel: #19151f;
  --line: #37303f;
  --ink: #f1ecf5;
  --muted: #a89caf;
  --accent: #c7afe8;
  --gold: #d6bf87;
  --serif: CardTitle, Georgia, serif;
  --sans: Manrope, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    13px/1.65 Manrope,
    Arial,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
}
button svg,
a svg {
  flex-shrink: 0;
}
button {
  border: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  background: #120f18;
  border: 1px solid #41364d;
  border-radius: 5px;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #c7afe81a;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
  min-height: 28px;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.05;
}
h1 {
  font-size: 45px;
  letter-spacing: -1px;
}
h2 {
  font-size: 34px;
}
h3 {
  font-size: 14px;
}
p {
  color: var(--muted);
}
.topbar {
  height: 87px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: #15111a;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  letter-spacing: 2px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}
.brand-icon {
  display: grid;
  place-items: center;
  border: 1px solid #6d5689;
  width: 43px;
  height: 47px;
  color: var(--accent);
  border-radius: 9px;
}
.brand-sub {
  display: block;
  font-size: 8px;
  letter-spacing: 2.2px;
  font-weight: 500;
  color: var(--muted);
}
.topbar nav {
  display: flex;
  align-self: stretch;
  gap: 8px;
  margin-left: 24px;
}
.topbar nav a {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 17px;
  color: #a79cab;
  border-bottom: 2px solid transparent;
}
.topbar nav a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.topbar nav b {
  font-size: 10px;
  margin-left: 5px;
  background: #302639;
  border-radius: 4px;
  padding: 2px 5px;
}
.save-status {
  margin-left: auto;
  font-size: 10px;
  color: #a89cad;
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.save-status svg {
  color: #9cbd9c;
}
.button {
  min-height: 44px;
  padding: 11px 17px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 5px;
  font-weight: 650;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.button:active {
  transform: translateY(1px);
}
.primary {
  color: #241a30;
  background: var(--accent);
  border: 1px solid var(--accent);
}
.primary:hover {
  background: #dfcaf8;
  border-color: #dfcaf8;
}
.ghost {
  background: transparent;
  border: 1px solid #493b57;
}
.ghost:hover {
  background: #302538;
  border-color: #846c9e;
}
.small {
  font-size: 11px;
  padding: 8px 12px;
  min-height: 36px;
}
.wide {
  width: 100%;
  margin-top: 9px;
}
.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid #51405e;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  background: transparent;
}
.icon-button:hover {
  background: #33263c;
}
.text-button {
  background: none;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
}
.danger {
  color: #dca9b1;
}
.eyebrow,
.panel-caption {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--gold);
}
.editor-intro {
  max-width: 1560px;
  margin: auto;
  padding: 35px 34px 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.editor-intro h1 {
  font-size: 39px;
  margin: 7px 0;
}
.editor-intro p {
  font-size: 12px;
}
.workspace {
  max-width: 1560px;
  margin: 0 auto 40px;
  padding: 0 34px;
  display: grid;
  grid-template-columns: 300px minmax(300px, 1fr) 268px;
  align-items: start;
  gap: 20px;
}
.editor-panel,
.export-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
}
.panel-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  padding: 0 9px;
}
.panel-tabs button {
  background: none;
  color: var(--muted);
  padding: 15px 0 13px;
  font-size: 10px;
  border-bottom: 2px solid transparent;
}
.panel-tabs button.selected {
  color: var(--accent);
  border-color: var(--accent);
}
.panel-content {
  padding: 21px;
}
.panel-caption {
  margin-bottom: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 14px 0;
  font-size: 11px;
}
.field > span {
  color: #d0c5da;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-row .field {
  margin: 0 0 12px;
}
.range > span {
  display: flex;
  justify-content: space-between;
}
.range b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}
.muted {
  color: var(--muted);
  font-size: 11px;
}
.upload-box {
  padding: 30px 14px;
  border: 1px dashed #6e537f;
  border-radius: 6px;
  background: #21192b;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.upload-box:hover {
  background: #30203c;
}
.upload-box svg {
  color: var(--accent);
}
.upload-box span {
  color: var(--muted);
  font-size: 10px;
}
.upload-box + p {
  margin: 15px 0 23px;
}
.aspect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px 0;
}
.aspect {
  border: 1px solid #46364e;
  background: #1b1523;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 9px;
  font-size: 10px;
}
.aspect span {
  font-size: 24px;
  width: 26px;
  line-height: 1;
}
.aspect.selected {
  background: #342343;
  border-color: var(--accent);
}
.color-field {
  display: grid;
  grid-template-columns: 1fr 45px;
  align-items: center;
  margin-top: 25px;
}
.color-field input {
  height: 35px;
  padding: 3px;
}
.color-field code {
  color: var(--muted);
  font-size: 10px;
}
.preview-panel {
  min-height: 680px;
  position: relative;
  border-radius: 8px;
  padding: 18px 24px 23px;
  background:
    radial-gradient(ellipse at 50% 40%, #3c2c484d, transparent 70%),
    linear-gradient(90deg, #20192730 1px, transparent 1px),
    linear-gradient(#20192730 1px, transparent 1px);
  background-size:
    auto,
    24px 24px,
    24px 24px;
  border: 1px solid #28202f;
  text-align: center;
}
.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
  color: #a594b3;
  letter-spacing: 0.9px;
}
.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  font-weight: 650;
}
.pill i {
  width: 5px;
  height: 5px;
  background: #b8cb9d;
  border-radius: 50%;
}
.card-stage {
  position: relative;
  width: min(100%, 326px);
  margin: 42px auto 25px;
  aspect-ratio: 750/1040;
  filter: drop-shadow(0 20px 24px #0008);
}
.card-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 9px;
}
.stage-measure {
  position: absolute;
  color: #8f7c9d;
  font-size: 8px;
  letter-spacing: 2px;
  filter: none;
}
.measure-top {
  top: -24px;
  left: 0;
  width: 100%;
}
.measure-side {
  right: -24px;
  top: 45%;
  writing-mode: vertical-rl;
}
.side-switch {
  display: inline-flex;
  border: 1px solid #45364f;
  padding: 4px;
  border-radius: 30px;
  gap: 2px;
}
.side-switch button {
  border-radius: 25px;
  background: none;
  padding: 8px 15px;
  font-size: 10px;
  color: #aa9cb4;
}
.side-switch button.selected {
  background: #3e2e4c;
  color: #f3e9ff;
}
.preview-foot {
  font-size: 9px;
  color: #9a8ca5;
  display: flex;
  justify-content: center;
  gap: 5px;
  align-items: center;
  margin-top: 19px;
}
.overflow-warning {
  font-size: 11px;
  color: #f2c2a3;
  background: #3e251e;
  padding: 10px;
  border-radius: 5px;
  margin-top: 12px;
}
.overflow-warning[hidden] {
  display: none;
}
.export-panel {
  padding: 23px 20px;
}
.export-panel h2 {
  font-size: 32px;
  margin-bottom: 15px;
  color: #eee6f5;
}
.export-panel .muted {
  line-height: 1.8;
}
.print-spec {
  margin: 22px 0;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.print-spec div {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin: 7px 0;
}
.print-spec span {
  color: var(--muted);
}
.print-spec strong {
  font-weight: 500;
}
.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  margin: 12px 0;
}
.export-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.export-links button {
  flex: 1;
  font-size: 10px;
  background: #241c2e;
  border: 1px solid #3d3049;
  border-radius: 4px;
  min-height: 35px;
}
.export-links button:hover {
  background: #3b2948;
}
.print-hint {
  font-size: 9px;
  color: #a99ab3;
  line-height: 1.9;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 17px;
}
.print-hint b {
  font-weight: 600;
  color: #d1c2dd;
}
.workspace-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.app-footer {
  max-width: 1492px;
  border-top: 1px solid var(--line);
  margin: 25px auto 0;
  padding: 22px 0 30px;
  display: flex;
  justify-content: space-between;
  color: #8f829a;
  font-size: 9px;
  gap: 20px;
}
.app-footer > span:first-child {
  letter-spacing: 1.2px;
}
.app-footer b {
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 15px;
}
.content-page {
  max-width: 1470px;
  padding: 45px 34px;
  margin: auto;
  min-height: 80vh;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 35px;
  gap: 20px;
}
.page-heading h1 {
  margin: 12px 0;
  font-size: 48px;
}
.page-heading p {
  font-size: 12px;
  max-width: 600px;
}
.page-heading em {
  font: italic 30px var(--serif);
  color: var(--accent);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.project-open {
  width: 100%;
  padding: 25px 30px;
  background: #201728;
}
.project-open canvas {
  max-width: 100%;
  width: 180px;
  display: block;
  margin: auto;
}
.project-card > div {
  padding: 19px;
}
.project-card p {
  font-size: 10px;
  margin: 5px 0 10px;
}
.library-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 42px;
}
.library-hero h1 {
  font-size: 62px;
  margin: 15px 0 20px;
}
.library-hero h1 i {
  font-family: CardBody, Georgia, serif;
  font-weight: 400;
  color: var(--accent);
}
.archive-mark {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 25px;
  padding-right: 65px;
  color: #9977ba;
}
.archive-mark span {
  font-size: 9px;
  letter-spacing: 1.5px;
}
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  border-top: 1px solid var(--line);
  padding: 20px 0;
  margin-bottom: 15px;
}
.library-toolbar input {
  max-width: 280px;
  font-size: 11px;
}
.category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.category-tabs button {
  padding: 10px 14px;
  background: none;
  border: 1px solid transparent;
  border-radius: 25px;
  color: var(--muted);
  font-size: 11px;
  min-height: 40px;
}
.category-tabs button.selected {
  background: #30223c;
  color: var(--accent);
  border-color: #5c466f;
}
.pack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.pack-tile {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition:
    border-color 0.2s,
    transform 0.2s;
  min-width: 0;
}
.pack-tile:hover {
  border-color: #9571b2;
  transform: translateY(-3px);
}
.pack-cover {
  height: 255px;
  position: relative;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse, #40314d, #1e1727);
  padding: 24px;
  overflow: hidden;
  min-height: 0;
}
.pack-cover img {
  position: absolute;
  inset: 24px;
  width: calc(100% - 48px);
  height: calc(100% - 48px);
  object-fit: contain;
  filter: drop-shadow(0 8px 14px #0006);
}
.pack-cover.boards img,
.pack-cover.mats img {
  width: calc(100% - 48px);
  height: calc(100% - 48px);
}
.pack-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #100c18d9;
  border: 1px solid #6c5479;
  padding: 3px 7px;
  font-size: 7px;
  letter-spacing: 1.2px;
}
.pack-note-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 100%;
}
.pack-info {
  padding: 17px 16px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.pack-info h3 {
  font-size: 16px;
  font-family: var(--serif);
  font-weight: 600;
}
.pack-info p {
  font-size: 9px;
  margin-top: 5px;
}
.pack-meta {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #2f2637;
  margin: 0 16px;
  padding: 11px 0;
  color: var(--muted);
  font-size: 9px;
}
.library-note {
  font-size: 10px;
  border-top: 1px solid var(--line);
  margin-top: 35px;
  padding-top: 20px;
  max-width: 900px;
}
.info-note {
  padding: 15px 19px;
  background: #2b2330;
  border: 1px solid #5d4868;
  border-left: 3px solid var(--gold);
  border-radius: 5px;
  font-size: 12px;
  color: #d5c7df;
  margin: 15px 0 25px;
}
.count-label {
  color: var(--muted);
  font-size: 11px;
}
.resource-files {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 38px;
}
.resource-file {
  border: 1px solid #483750;
  border-radius: 5px;
  background: #1f1727;
  padding: 13px 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.resource-file svg {
  color: var(--accent);
}
.resource-file b {
  font-size: 11px;
  font-weight: 500;
}
.resource-file small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}
.resource-file:hover {
  background: #33233e;
}
.section-label {
  font: 600 26px var(--serif);
  margin: 32px 0 20px;
}
.section-label span {
  font:
    11px Manrope,
    sans-serif;
  color: var(--muted);
  margin-left: 10px;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
}
.asset-tile {
  text-align: left;
  background: none;
  min-width: 0;
  padding: 0;
}
.asset-tile > div {
  height: 290px;
  padding: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #1b1422;
  border-radius: 6px;
  transition: border-color 0.15s;
}
.asset-tile:hover > div {
  border-color: var(--accent);
}
.asset-tile img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}
.asset-tile h3 {
  font-size: 11px;
  margin: 10px 0 4px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.asset-tile p {
  font-size: 9px;
}
.asset-grid.sheets {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.sheets .asset-tile > div {
  height: 330px;
}
.sheets .asset-tile img {
  max-height: 300px;
}
.rules {
  padding: 20px;
  border: 1px solid var(--line);
  margin-top: 35px;
  border-radius: 6px;
}
.rules summary {
  cursor: pointer;
}
.rules pre {
  white-space: pre-wrap;
  font:
    12px/1.8 Manrope,
    sans-serif;
  color: #c1b4cc;
}
.asset-dialog {
  max-width: 1000px;
  width: calc(100% - 32px);
  max-height: 92dvh;
  background: #1a1422;
  color: var(--ink);
  border: 1px solid #79608a;
  border-radius: 10px;
  padding: 30px;
  overflow: auto;
}
.asset-dialog[open] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
}
.asset-dialog::backdrop {
  background: #08050de0;
  backdrop-filter: blur(5px);
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
}
.asset-large {
  text-align: center;
}
.asset-large img {
  max-width: 100%;
  max-height: 76dvh;
  object-fit: contain;
}
.asset-detail h2 {
  font-size: 38px;
  margin: 12px 0;
}
.asset-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: start;
  margin-top: 28px;
}
.empty-state {
  padding: 35px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  background: #e0d1ef;
  color: #20142b;
  z-index: 50;
  padding: 14px 22px;
  border-radius: 7px;
  box-shadow: 0 12px 50px #0008;
  max-width: calc(100% - 32px);
  width: max-content;
  font-size: 12px;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.error {
  background: #f4cccb;
  color: #441a23;
}
@media (min-width: 1650px) {
  .card-stage {
    width: 350px;
  }
  .preview-panel {
    min-height: 728px;
  }
}
@media (max-width: 1250px) {
  .topbar {
    padding: 0 22px;
    gap: 18px;
  }
  .topbar nav {
    margin: 0;
  }
  .topbar nav a {
    padding: 0 10px;
  }
  .save-status {
    font-size: 0;
  }
  .workspace {
    grid-template-columns: 275px minmax(260px, 1fr) 235px;
    gap: 13px;
    padding: 0 22px;
  }
  .panel-content {
    padding: 17px;
  }
  .preview-panel {
    padding: 18px 22px;
    min-height: 640px;
  }
  .export-panel {
    padding: 20px 15px;
  }
  .editor-intro {
    padding-left: 22px;
    padding-right: 22px;
  }
  .app-footer {
    margin-left: 22px;
    margin-right: 22px;
  }
  .pack-grid {
    gap: 16px;
  }
  .asset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1030px) {
  .workspace {
    grid-template-columns: 280px minmax(260px, 1fr);
  }
  .export-panel {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 25px;
  }
  .export-panel > .panel-caption,
  .export-panel > h2,
  .export-panel > .muted,
  .export-panel > .print-spec {
    grid-column: 1;
  }
  .export-panel > h2 {
    font-size: 36px;
  }
  .export-panel > .field {
    grid-column: 2;
    grid-row: 1/3;
    margin-top: 0;
  }
  .export-panel > .check-field {
    grid-column: 2;
    grid-row: 3;
  }
  .export-panel > [data-export="pdf"] {
    grid-column: 2;
    grid-row: 4;
  }
  .export-panel > [data-export="a4"] {
    grid-column: 2;
    grid-row: 5;
  }
  .export-panel > .export-links {
    grid-column: 2;
    grid-row: 6;
  }
  .export-panel > .print-hint {
    grid-column: 1;
    margin: 0;
    border: 0;
  }
  .export-panel > .workspace-actions {
    grid-column: 2;
    grid-row: 7;
  }
  .preview-panel {
    min-height: 720px;
  }
  .card-stage {
    width: 340px;
    max-width: 100%;
  }
  .topbar .brand {
    font-size: 12px;
    letter-spacing: 1.5px;
  }
  .brand-sub {
    font-size: 6px;
  }
  .topbar nav a {
    font-size: 11px;
  }
  .pack-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .archive-mark {
    padding-right: 0;
  }
  .asset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .asset-grid.sheets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .topbar {
    height: auto;
    min-height: 112px;
    padding: 16px 16px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .topbar .brand {
    font-size: 13px;
  }
  .brand-sub {
    font-size: 7px;
  }
  .brand-icon {
    height: 39px;
    width: 36px;
  }
  .topbar nav {
    grid-column: 1/-1;
    grid-row: 2;
    width: 100%;
    justify-content: space-around;
  }
  .topbar nav a {
    padding: 11px 6px;
    font-size: 11px;
  }
  .topbar nav svg {
    width: 16px;
  }
  .save-status {
    display: none;
  }
  .topbar > .import-project {
    grid-column: 2;
    grid-row: 1;
  }
  .editor-intro {
    padding: 25px 16px 22px;
  }
  .editor-intro h1 {
    font-size: 33px;
  }
  .editor-intro .eyebrow {
    font-size: 7px;
    letter-spacing: 1.1px;
  }
  .editor-intro p {
    font-size: 10px;
    max-width: 200px;
  }
  .editor-intro > .button {
    font-size: 10px;
    padding: 10px;
  }
  .workspace {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .workspace > aside,
  .preview-panel {
    width: 100%;
  }
  .preview-panel {
    order: -1;
    min-height: 0;
    padding: 17px 25px 22px;
  }
  .card-stage {
    width: min(76%, 280px);
    margin-top: 37px;
    margin-bottom: 23px;
  }
  .stage-measure {
    font-size: 7px;
  }
  .panel-tabs button {
    font-size: 12px;
    min-height: 49px;
  }
  .panel-content {
    padding: 22px;
  }
  .field {
    font-size: 12px;
  }
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
  .field-row {
    gap: 15px;
  }
  .export-panel {
    display: block;
    padding: 25px;
  }
  .export-panel h2 br {
    display: none;
  }
  .export-panel h2 {
    font-size: 34px;
  }
  .export-panel > .field {
    margin-top: 17px;
  }
  .print-hint {
    padding-top: 20px !important;
  }
  .export-panel .workspace-actions {
    margin-top: 18px;
  }
  .button {
    min-height: 44px;
  }
  .app-footer {
    margin: 30px 16px 0;
    flex-direction: column;
    gap: 9px;
    font-size: 8px;
  }
  .app-footer b {
    display: block;
    margin: 6px 0 0;
  }
  .content-page {
    padding: 28px 16px;
  }
  .library-hero {
    padding: 10px 0 28px;
    gap: 15px;
  }
  .library-hero h1 {
    font-size: 46px;
  }
  .library-hero p {
    font-size: 11px;
  }
  .archive-mark {
    display: none;
  }
  .library-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  .category-tabs {
    gap: 3px;
  }
  .category-tabs button {
    padding: 8px 12px;
    font-size: 10px;
  }
  .library-toolbar input {
    max-width: none;
    font-size: 16px;
  }
  .pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }
  .pack-cover {
    height: 200px;
    padding: 24px 17px 15px;
  }
  .pack-info {
    padding: 13px 11px 9px;
  }
  .pack-info h3 {
    font-size: 16px;
  }
  .pack-info svg {
    display: none;
  }
  .pack-info p {
    font-size: 8px;
  }
  .pack-meta {
    font-size: 8px;
    margin: 0 11px;
  }
  .page-heading {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }
  .page-heading h1 {
    font-size: 39px;
  }
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }
  .asset-tile > div {
    height: 250px;
    padding: 9px;
  }
  .asset-tile img {
    max-height: 230px;
  }
  .asset-grid.sheets {
    grid-template-columns: 1fr;
  }
  .sheets .asset-tile > div {
    height: 350px;
  }
  .sheets .asset-tile img {
    max-height: 330px;
  }
  .asset-dialog {
    padding: 28px 18px;
    width: calc(100% - 20px);
  }
  .asset-dialog[open] {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .asset-large img {
    max-height: 55dvh;
  }
  .asset-detail h2 {
    font-size: 30px;
  }
  .asset-actions {
    align-items: stretch;
    margin-top: 18px;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .project-open {
    padding: 17px;
  }
  .project-card > div {
    padding: 13px;
  }
  .project-card h3 {
    font-size: 12px;
  }
  .project-card p {
    font-size: 9px;
  }
  .resource-files {
    margin-bottom: 25px;
  }
  .resource-file {
    width: 100%;
  }
  .library-note {
    font-size: 9px;
  }
}
@media (max-width: 370px) {
  .topbar nav a {
    font-size: 10px;
    gap: 5px;
  }
  .topbar nav a svg {
    display: none;
  }
  .editor-intro h1 {
    font-size: 29px;
  }
  .editor-intro > .button {
    padding: 8px;
  }
  .pack-cover {
    height: 168px;
  }
  .asset-tile > div {
    height: 210px;
  }
  .asset-tile img {
    max-height: 190px;
  }
  .side-switch button {
    padding: 8px 11px;
  }
  .preview-top {
    font-size: 8px;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  min-width: 0;
}
.header-actions select {
  width: 112px;
  padding: 9px 10px;
  font-size: 12px;
}
.brand-name {
  letter-spacing: 0.7px;
}
.brand-sub {
  letter-spacing: 0.5px;
  font-size: 10px;
  margin-top: 4px;
}
.topbar {
  gap: 18px;
}
.topbar nav {
  margin-left: 0;
}
.pack-info h3 {
  font-size: 21px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.pack-info p {
  font-size: 12px;
  line-height: 1.6;
}
.pack-info {
  align-items: flex-start;
  min-height: 105px;
}
.pack-meta {
  gap: 10px;
  font-size: 11px;
  flex-wrap: wrap;
}
.document-cover {
  display: grid;
  place-items: center;
  width: 90px;
  color: var(--accent);
}
.document-cover svg {
  width: 90px;
  height: 90px;
}
.pack-category {
  font-size: 9px;
}
.library-section {
  margin: 32px 0;
}
.section-label {
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 0.4px;
  margin: 0 0 20px;
}
.section-label span {
  color: var(--muted);
  margin-left: 8px;
}
.back-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.asset-tile {
  overflow: hidden;
}
.asset-tile h3 {
  font-size: 18px;
  line-height: 1.3;
  margin-top: 14px;
}
.asset-tile p {
  font-size: 12px;
}
.file-original-name {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.rule-tile {
  display: flex;
  flex-direction: column;
  gap: 25px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.rule-tile:hover {
  border-color: var(--accent);
  background: #251c30;
}
.rule-book {
  color: var(--accent);
  width: 54px;
}
.rule-book svg {
  width: 54px;
  height: 54px;
}
.rule-tile h3 {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.2;
  margin: 12px 0;
}
.rule-tile p {
  font-size: 12px;
}
.rule-read {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  color: var(--accent);
  font-size: 13px;
}
.pack-rules {
  margin: 30px 0 45px;
}
.rules-heading {
  padding: 30px 0 38px;
  border-bottom: 1px solid var(--line);
}
.rules-heading h1 {
  margin: 16px 0;
  max-width: 950px;
}
.source-language {
  font-size: 13px;
}
.reader-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.reader-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 800px);
  gap: 50px;
  align-items: start;
  margin-top: 40px;
}
.rules-toc {
  position: sticky;
  top: 24px;
  max-height: 80vh;
  overflow: auto;
  padding-right: 16px;
}
.rules-toc h2 {
  font-family: var(--sans);
  font-size: 14px;
  margin-bottom: 18px;
}
.rules-toc button {
  display: block;
  background: none;
  border: 0;
  border-left: 1px solid var(--line);
  text-align: left;
  padding: 9px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  width: 100%;
}
.rules-toc button:hover {
  color: var(--ink);
  border-color: var(--accent);
}
.rules-article {
  max-width: 800px;
  min-width: 0;
  font-size: 16px;
  line-height: 1.85;
}
.rules-article h2 {
  font-size: 30px;
  margin: 35px 0 18px;
  scroll-margin-top: 24px;
}
.rules-article h2:first-child {
  margin-top: 0;
}
.rules-article p {
  margin: 0 0 19px;
  color: #d4cbd9;
}
.rules-article ul {
  padding-left: 24px;
  margin: 0 0 24px;
}
.rules-article li {
  padding-left: 6px;
  margin: 10px 0;
  color: #d4cbd9;
}
.page-reader {
  max-width: 1000px;
  margin: 30px auto;
}
.reader-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 13px;
}
.rule-page-image {
  display: block;
  border: 1px solid var(--line);
  background: white;
}
.rule-page-image img {
  display: block;
  width: 100%;
  height: auto;
}
.pdf-reader {
  margin-top: 24px;
}
.pdf-reader p {
  margin-bottom: 18px;
}
.pdf-reader object {
  width: 100%;
  height: 80vh;
  min-height: 500px;
  border: 1px solid var(--line);
}
.app-footer {
  gap: 20px;
  flex-wrap: wrap;
}
.support-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}
@media (max-width: 1250px) {
  .header-actions .save-status {
    display: none;
  }
  .topbar nav a {
    padding: 0 10px;
  }
  .rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 850px) {
  .brand-name {
    font-size: 13px;
  }
  .header-actions {
    gap: 8px;
  }
  .header-actions .import-project span {
    display: none;
  }
  .header-actions .import-project {
    padding: 10px;
  }
  .reader-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 25px;
  }
  .back-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .topbar {
    gap: 12px 8px;
    padding: 14px 12px 0;
  }
  .topbar nav {
    grid-row: 2;
    margin: 0;
    gap: 0;
  }
  .brand-sub {
    display: block;
    font-size: 8px;
    letter-spacing: 0;
  }
  .topbar .brand {
    font-size: 12px;
    letter-spacing: 0;
    gap: 8px;
  }
  .header-actions {
    grid-row: 1;
    grid-column: 2;
  }
  .header-actions select {
    width: 96px;
    font-size: 11px;
    padding: 8px;
  }
  .header-actions .import-project {
    display: none;
  }
  .pack-info {
    min-height: 108px;
    padding: 14px 12px;
  }
  .pack-info h3 {
    font-size: 19px;
  }
  .pack-info p {
    font-size: 11px;
  }
  .pack-meta {
    margin: 0 12px;
    font-size: 10px;
  }
  .pack-cover img,
  .pack-cover.boards img,
  .pack-cover.mats img {
    inset: 20px;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
  }
  .back-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rule-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .rule-tile {
    flex-direction: row;
    align-items: flex-start;
    padding: 22px;
    gap: 20px;
  }
  .rule-book {
    flex-shrink: 0;
    width: 38px;
  }
  .rule-book svg {
    width: 38px;
    height: 38px;
  }
  .rule-tile h3 {
    font-size: 23px;
  }
  .rule-tile .eyebrow {
    font-size: 8px;
  }
  .reader-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 24px;
  }
  .rules-toc {
    position: static;
    max-height: 230px;
    width: 100%;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .rules-article {
    font-size: 15px;
    line-height: 1.8;
  }
  .rules-article h2 {
    font-size: 27px;
  }
  .rules-heading h1 {
    font-size: 36px;
    overflow-wrap: anywhere;
  }
  .reader-actions {
    flex-direction: column;
  }
  .reader-pagination {
    flex-wrap: wrap;
  }
  .reader-pagination span {
    order: -1;
    width: 100%;
    text-align: center;
  }
  .reader-pagination button {
    flex: 1;
    font-size: 11px;
    padding: 10px;
  }
  .app-footer {
    font-size: 10px;
  }
}
@media (max-width: 370px) {
  .topbar .brand {
    font-size: 11px;
  }
  .brand-icon {
    width: 29px;
    height: 35px;
  }
  .brand-sub {
    font-size: 7px;
  }
  .header-actions select {
    width: 89px;
  }
  .pack-grid {
    grid-template-columns: 1fr;
  }
  .pack-cover {
    height: 275px;
  }
  .pack-info {
    min-height: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
