:root {
  --night: #171126;
  --deep: #100b1c;
  --cream: #f7f1e5;
  --gold: #dcc092;
  --gold-soft: #f0d6a5;
  --muted: #baacc7;
  --line: #4e3c5e;
  --serif: "Gowun Batang", Georgia, serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shell: min(1380px, calc(100% - 80px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; scroll-padding-top: 24px; }
body {
  margin: 0;
  color: var(--cream);
  background: radial-gradient(ellipse at 80% 10%, #2a1b36 0, transparent 50%), var(--night);
  font: 15px/1.65 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .board-scroll:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; background: var(--gold); color: var(--deep); padding: 12px; transform: translateY(-150%); opacity: 0; pointer-events: none; }
.skip-link:focus { transform: none; opacity: 1; pointer-events: auto; }
.preview-bar { background: #362741; color: #eddfed; text-align: center; font-size: 11px; padding: 6px 16px; }
.preview-bar span { padding-left: 12px; color: #c9b9d2; }
.site-header { background: #100b1ce6; border-bottom: 1px solid #392b46; }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 750 18px/1 "Manrope", var(--sans); letter-spacing: .2em; }
.brand svg { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.1; }
.header-row nav { display: flex; align-items: center; font-size: 12px; }
.header-row nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.home-link { color: var(--gold); }
.intro { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 40px; padding: 28px 0 32px; }
.breadcrumbs { display: flex; gap: 10px; font-size: 11px; color: #b8a6c4; margin-bottom: 16px; }
.eyebrow { font: 650 10px/1.7 "Manrope", var(--sans); letter-spacing: 1.7px; color: var(--gold); }
.intro h1 { font: 400 43px/1.45 var(--serif); letter-spacing: -.035em; margin-top: 8px; }
.intro-copy { padding-bottom: 4px; color: #d0c2db; }
.intro-copy > p { font-size: 14px; line-height: 1.9; }
.tool-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 11px; color: #bba7cc; }
.tool-facts span::before { content: "✦"; color: var(--gold); margin-right: 7px; font-size: 8px; }
.spread-picker { margin-bottom: 24px; }
.spread-picker-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.spread-picker-heading h2 { font: 400 25px/1.5 var(--serif); margin-top: 5px; }
.spread-picker-heading > p { color: #bda7ca; font-size: 12px; line-height: 1.8; }
.spread-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.spread-choice { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; min-width: 0; min-height: 134px; padding: 14px 16px; text-align: left; border: 1px solid #574161; border-radius: 9px; background: #191222; color: #eadfed; }
.spread-choice svg { grid-column: 1 / -1; width: 100%; height: 70px; overflow: visible; }
.spread-choice rect { fill: #382447; stroke: #b19878; stroke-width: 1.2; }
.spread-choice-name { font-size: 13px; font-weight: 650; white-space: nowrap; }
.spread-choice-count { color: #bca5ca; font: 500 11px/1.5 var(--sans); white-space: nowrap; }
.spread-check { position: absolute; top: 9px; right: 9px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #261730; background: var(--gold-soft); opacity: 0; font: 700 12px/1 var(--sans); }
.spread-choice:hover { border-color: #ae8cba; background: #24182f; }
.spread-choice[aria-pressed="true"] { border-color: var(--gold-soft); background: #35243e; box-shadow: inset 0 0 0 1px var(--gold-soft); }
.spread-choice[aria-pressed="true"] rect { fill: #5e3d67; stroke: #ebd19c; }
.spread-choice[aria-pressed="true"] .spread-choice-name, .spread-choice[aria-pressed="true"] .spread-choice-count { color: var(--gold-soft); }
.spread-choice[aria-pressed="true"] .spread-check { opacity: 1; }
.spread-choice:focus-visible { outline: 3px solid #f0d7a4; outline-offset: 4px; }
.workbench { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings, .board { min-width: 0; border: 1px solid #584461; border-radius: 12px; background: #120e1dd9; }
.settings { padding: 24px; }
.panel-label h3 { font: 400 23px/1.5 var(--serif); margin-top: 7px; }
.mode-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.mode-buttons button { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 46px; border: 1px solid #4b3b58; border-radius: 5px; background: #271c34; color: #d6c9e0; padding: 10px 5px; font-size: 12px; font-weight: 600; }
.mode-buttons button span { color: #af8fc3; }
.mode-buttons button[aria-pressed="true"] { color: #241830; border-color: var(--gold); background: var(--gold-soft); }
.mode-buttons button[aria-pressed="true"] span { color: #675039; }
.settings-fields { margin-top: 24px; }
.field { display: grid; gap: 7px; margin-top: 16px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: #d8c9e4; }
.field select, .field textarea, .field input[type="number"] { width: 100%; min-width: 0; max-width: 100%; border: 1px solid #51415e; border-radius: 5px; padding: 10px 12px; background: #201629; color: #f4eaf6; font-size: 13px; min-height: 44px; }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.7; }
.field select:disabled { opacity: .6; }
.field-help { font-size: 10px; color: #b9a5c7; line-height: 1.7; margin-top: 7px; }
.reverse-control { display: flex; align-items: center; gap: 7px; min-height: 44px; margin-top: 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.reverse-control input { width: 17px; height: 17px; margin: 0; accent-color: var(--gold); }
.private-note { margin-top: 8px; color: #baa6c6; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 650; }
.button-gold { background: var(--gold-soft); color: #241830; border-color: var(--gold-soft); }
.button-outline { border-color: #625074; background: #21162c80; color: #ddcbe8; }
.primary-action { width: 100%; margin-top: 24px; min-height: 49px; font-size: 13px; }
.setting-note { font-size: 10px; line-height: 1.75; color: #b29abe; margin-top: 12px; text-align: center; }
.note-disclosure { border-top: 1px solid #493652; margin-top: 20px; padding-top: 10px; }
.note-disclosure summary { cursor: pointer; font-size: 11px; color: #c1a5d1; min-height: 44px; padding-top: 10px; }
.note-disclosure summary small { font-size: 10px; color: #b39ac1; margin-left: 5px; }
.note-disclosure .question-field { margin-top: 7px; }
.board { display: flex; flex-direction: column; padding: 26px 28px; min-height: 735px; }
.board-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #43314f; padding-bottom: 18px; }
.board-heading h3 { font: 400 26px/1.4 var(--serif); margin-top: 4px; }
.board-heading #board-state { font-size: 11px; color: #bca5cb; margin-top: 7px; }
#board-title:focus { outline: none; }
.board-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; }
.board-actions .button { font-size: 11px; padding: 9px 11px; }
.text-button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; background: none; color: #c6aad4; border: 0; font-size: 11px; padding: 6px; }
.layout-note { color: #b69dc8; font-size: 11px; line-height: 1.8; margin-top: 14px; }
.layout-note:empty, .draw-status:empty { display: none; }
.board-empty { text-align: center; padding: 42px 0 36px; flex: 1; }
.empty-mark { display: grid; place-items: center; width: 140px; height: 140px; margin: 12px auto 26px; border: 1px solid #6c506e; border-radius: 50%; color: var(--gold-soft); font: 400 51px/1 var(--serif); background: radial-gradient(ellipse, #382345, #1b1327); }
.empty-title { font: 400 22px/1.6 var(--serif); color: #e5d5ec; margin-bottom: 10px; }
.board-empty > p:last-child { color: #b8a2c8; font-size: 12px; line-height: 1.8; }
.board-empty strong { color: var(--gold); font-weight: 550; }
.board-scroll { min-width: 0; max-width: 100%; max-height: min(720px, 78dvh); overflow: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #9c7aaa #21162c; border-radius: 8px; }
.board-scroll:has(.results:empty) { display: none; }
.results { position: relative; display: block; width: 100%; min-height: 400px; margin: 22px 0 20px; isolation: isolate; scroll-margin-top: 24px; background: radial-gradient(circle, #bc9ccd1a .7px, transparent .9px) 0 0 / 22px 22px; }
.results:empty { display: none; }
.result-card { position: absolute; min-width: 0; padding: 0; text-align: center; border-radius: 6px; }
.result-position { position: absolute; top: 6px; left: 6px; z-index: 2; pointer-events: none; }
.position-number { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 2px 5px; color: var(--gold-soft); background: #170d24e8; border: 1px solid #9b7d5b; border-radius: 4px; font: 600 9px "Manrope", var(--sans); }
.position-label { display: none; }
.card-face { border: 0; background: transparent; display: block; width: 100%; max-width: none; padding: 0; margin: 0; box-shadow: 0 8px 20px #0005; border-radius: 5px; user-select: none; -webkit-user-select: none; }
.card-image { display: block; width: 100%; aspect-ratio: 15/26; object-fit: cover; border-radius: 5px; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.card-image.is-reversed { transform: rotate(180deg); }
.card-meta { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.card-meta h3, .card-name { color: #f3e7ee; font: 400 16px/1.5 var(--serif); overflow-wrap: anywhere; }
.card-en { display: none; }
.direction-tag { display: inline-flex; align-items: center; justify-content: center; padding: 2px 7px; border: 1px solid #5e466a; border-radius: 4px; font-size: 9px; color: #d3badf; background: #2b1e38; }
.direction-tag.is-reversed { color: #efd4ad; border-color: #806148; background: #352638; }
.card-actions { display: flex; flex-wrap: nowrap; justify-content: center; gap: 4px; width: 100%; max-width: 100%; margin-top: 7px; }
.card-actions button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 7px 5px; border: 1px solid #665173; border-radius: 4px; background: #21172be8; color: #d8c1e4; font-size: 10px; line-height: 1.3; }
.card-actions .direction-tag { flex: 1; max-width: 78px; font-size: 9px; white-space: nowrap; }
.card-actions .direction-tag.is-reversed { color: #efd4ad; border-color: #806148; background: #352638; }
.card-actions button:hover:not(:disabled) { border-color: #b593c5; background: #342343; }
.draw-status { font-size: 12px; line-height: 1.8; color: #c6b0d5; min-height: 24px; margin-top: 14px; margin-bottom: 15px; }
.draw-status.is-error { color: #ffd2b3; }
.board-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 18px; border-top: 1px solid #43314f; padding-top: 17px; margin-top: auto; }
.board-footer p { font-size: 11px; color: #d1badb; line-height: 1.8; }
.board-footer p span { font-size: 10px; color: #b39bc3; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.record-actions .button { font-size: 11px; }
.copy-fallback { width: 100%; margin-top: 12px; padding: 12px; border: 1px solid #655370; border-radius: 5px; background: #201629; color: var(--cream); font: 12px/1.7 var(--sans); resize: vertical; }
#copy-fallback-label { font-size: 12px; color: var(--gold); margin-top: 16px; }
.site-footer { display: flex; align-items: start; justify-content: space-between; gap: 24px; border-top: 1px solid #432e52; padding: 23px 0 28px; margin-top: 32px; font-size: 10px; color: #ad96bd; }
.site-footer > span { flex-shrink: 0; letter-spacing: 1.5px; font-family: "Manrope", var(--sans); }
.site-footer p { max-width: 610px; line-height: 1.8; }
.site-footer a { white-space: nowrap; color: #d0b183; min-height: 32px; }
dialog { border: 1px solid #705780; border-radius: 12px; padding: 0; background: #171020; color: var(--cream); box-shadow: 0 35px 100px #050308a0; max-height: calc(100dvh - 48px); width: min(1040px, calc(100% - 48px)); overflow: auto; }
dialog::backdrop { background: #080511da; backdrop-filter: blur(6px); }
.picker-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 28px 12px; background: #171020fa; border-bottom: 1px solid #493352; }
.picker-header h2 { font: 400 25px/1.6 var(--serif); margin-top: 8px; }
.picker-header #pick-count { font-size: 12px; color: var(--gold); margin-top: 9px; }
.close-button { flex-shrink: 0; min-width: 44px; min-height: 44px; width: 44px; height: 44px; background: none; border: 1px solid #694e76; border-radius: 50%; color: #d8c4e5; font: 400 25px/1 var(--sans); }
.picker-hint { font-size: 12px; color: #bda6cd; padding: 15px 28px 18px; }
.pick-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; padding: 0 28px 26px; }
.pick-card { position: relative; aspect-ratio: 15/26; width: 100%; border: 2px solid #82664e; border-radius: 5px; padding: 5px; background: linear-gradient(135deg, #34203f, #25152f); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.pick-card::before { content: ""; position: absolute; inset: 5px; border: 1px solid #7a4f77; border-radius: 2px; pointer-events: none; }
.pick-card .pick-star { font-size: 22px; }
.pick-card .pick-number { position: absolute; bottom: 9px; font: 500 8px "Manrope", var(--sans); color: #c4a0c2; }
.pick-card .pick-order { position: absolute; top: 6px; right: 6px; border-radius: 50%; width: 23px; height: 23px; background: var(--gold); color: #24122f; display: grid; place-items: center; font-size: 12px; }
.pick-card .pick-order:empty { display: none; }
.pick-card.is-selected, .pick-card[aria-pressed="true"] { border-color: var(--gold-soft); box-shadow: 0 0 0 2px #ddbe8355; transform: translateY(-3px); }
.picker-footer { display: flex; justify-content: space-between; gap: 16px; position: sticky; bottom: 0; z-index: 2; background: #171020f8; border-top: 1px solid #4b3559; padding: 16px 28px; }
.image-dialog { width: min(550px, calc(100% - 32px)); padding: 22px 28px; }
.zoom-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.zoom-header h2 { font: 400 25px/1.5 var(--serif); margin-top: 6px; }
.zoom-header .direction-tag { margin: 0; }
#zoom-image { width: auto; height: auto; max-height: calc(100dvh - 220px); max-width: 100%; margin: auto; object-fit: contain; border-radius: 5px; }
#zoom-image.is-reversed { transform: rotate(180deg); }
.zoom-tip { text-align: center; color: #bca6c9; font-size: 11px; margin-top: 16px; }
.noscript { padding: 24px; color: #f0ccaf; }
@media (max-width: 1100px) {
  :root { --shell: calc(100% - 48px); }
  .workbench { grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
  .settings { padding: 22px 18px; }
  .board { padding: 24px 20px; }
  .intro { gap: 24px; }
  .intro h1 { font-size: 38px; }
  .board-heading { align-items: flex-start; flex-wrap: wrap; gap: 14px; }
  .board-actions { justify-content: flex-start; }
  .empty-title { font-size: 20px; }
  .pick-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .spread-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spread-choice { min-height: 122px; }
}
@media (max-width: 800px) {
  .intro { grid-template-columns: 1fr; gap: 14px; padding-bottom: 25px; }
  .intro-copy br { display: none; }
  .tool-facts { margin-top: 11px; }
  .workbench { grid-template-columns: 1fr; }
  .settings { padding: 22px 24px; }
  .panel-label { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .panel-label h3 { margin-top: 0; font-size: 21px; }
  .mode-buttons { gap: 10px; margin-top: 17px; }
  .mode-buttons button { font-size: 13px; }
  .settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-top: 18px; }
  .field { margin-top: 0; }
  .settings-fields > .field-help { display: none; }
  .settings-fields .reverse-control { grid-column: 1 / -1; margin-top: 0; }
  .private-note br { display: none; }
  .primary-action { margin-top: 18px; }
  .setting-note { margin-top: 9px; }
  .note-disclosure { margin-top: 16px; }
  .board { min-height: 650px; }
  .board-heading { flex-wrap: nowrap; }
  .board-actions { justify-content: flex-end; }
  .site-footer { flex-wrap: wrap; gap: 12px; }
  .site-footer p { order: 3; width: 100%; max-width: 100%; }
  .site-footer a { margin-left: auto; }
  .pick-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
}
@media (max-width: 480px) {
  :root { --shell: calc(100% - 28px); }
  .preview-bar { font-size: 10px; padding: 6px 8px; }
  .preview-bar span { padding-left: 7px; font-size: 9px; }
  .header-row { min-height: 66px; gap: 12px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand svg { width: 25px; height: 25px; }
  .header-row nav { font-size: 11px; }
  .intro { padding: 22px 0 24px; gap: 13px; }
  .breadcrumbs { margin-bottom: 13px; }
  .intro h1 { font-size: 32px; }
  .intro-copy > p { font-size: 13px; line-height: 1.8; }
  .intro-copy br { display: block; }
  .tool-facts { font-size: 9px; gap: 6px 12px; }
  .tool-facts span::before { margin-right: 5px; }
  .spread-picker { margin-bottom: 18px; }
  .spread-picker-heading { display: block; margin-bottom: 13px; }
  .spread-picker-heading h2 { font-size: 23px; }
  .spread-picker-heading > p { font-size: 11px; margin-top: 5px; }
  .spread-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .spread-choice { min-height: 112px; padding: 12px; gap: 5px; }
  .spread-choice svg { height: 57px; }
  .spread-choice-name { font-size: 12px; }
  .spread-choice-count { font-size: 10px; }
  .settings { padding: 20px 16px; border-radius: 9px; }
  .panel-label h3 { font-size: 20px; }
  .panel-label .eyebrow { font-size: 9px; letter-spacing: 1px; }
  .settings-fields { gap: 13px 12px; }
  .mode-buttons button { font-size: 12px; }
  .field > span { font-size: 11px; }
  .field select, .field textarea, .field input[type="number"] { font-size: 12px; padding: 10px 8px; }
  .reverse-control { font-size: 12px; }
  .board { padding: 20px 14px; min-height: 560px; border-radius: 9px; }
  .board-heading { flex-wrap: wrap; gap: 12px; padding-bottom: 14px; }
  .board-heading h3 { font-size: 25px; }
  .board-heading .eyebrow { font-size: 9px; letter-spacing: 1px; }
  .board-heading #board-state { font-size: 10px; }
  .board-actions { width: 100%; justify-content: space-between; gap: 10px; }
  .board-actions .button { font-size: 11px; }
  .text-button { font-size: 10px; padding: 6px 0; }
  .layout-note { font-size: 10px; margin-top: 12px; }
  .board-empty { padding: 29px 0 26px; }
  .empty-mark { width: 108px; height: 108px; font-size: 40px; }
  .empty-title { font-size: 18px; }
  .board-empty > p:last-child { font-size: 11px; }
  .results { margin-top: 18px; }
  .draw-status { font-size: 11px; }
  .board-footer { align-items: stretch; gap: 13px; }
  .board-footer > p { width: 100%; }
  .record-actions { display: flex; justify-content: flex-end; width: 100%; }
  .record-actions .button { min-width: 0; padding: 10px 14px; font-size: 11px; }
  .site-footer { font-size: 9px; padding-bottom: 25px; margin-top: 25px; }
  .site-footer > span { letter-spacing: .5px; }
  .site-footer a { font-size: 9px; }
  dialog { width: calc(100% - 20px); max-height: calc(100dvh - 24px); border-radius: 9px; }
  .picker-header { padding: 20px 16px 8px; gap: 12px; }
  .picker-header h2 { font-size: 21px; }
  .picker-header #pick-count { font-size: 12px; }
  .picker-hint { padding: 14px 16px 16px; font-size: 11px; }
  .pick-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; padding: 0 16px 20px; }
  .pick-card .pick-star { font-size: 20px; }
  .pick-card .pick-number { font-size: 7px; bottom: 7px; }
  .pick-card .pick-order { width: 20px; height: 20px; font-size: 10px; top: 4px; right: 4px; }
  .picker-footer { gap: 10px; padding: 14px 16px; }
  .picker-footer .button { flex: 1; min-width: 0; padding: 10px 7px; font-size: 11px; }
  .image-dialog { padding: 20px 18px; }
  .zoom-header h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
