:root {
  color-scheme: dark;
  --ink: #f2eaf5;
  --muted: #a99aad;
  --line: #3b3044;
  --paper: #211b28;
  --canvas: #17131d;
  --green: #ff9b45;
  --green-dark: #c293df;
  --blue: #30263a;
  --pumpkin: #ff9b45;
  --purple: #bd8ddd;
  font-family: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(233, 121, 47, .12), transparent 32rem),
    radial-gradient(ellipse at 94% 14%, rgba(137, 91, 166, .13), transparent 31rem),
    var(--canvas);
  color: var(--ink);
}

button { font: inherit; }

.app-shell {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 27px 0 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 23px;
  border-bottom: 1px solid #342b3b;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.035em;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: #492b60;
}

.brand-mark svg { width: 19px; height: 19px; }

.session-tag, .eyebrow, .progress-heading, .card-type, .card-number, .column-count {
  font-family: "DM Mono", monospace;
  letter-spacing: .045em;
}

.session-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b3a7b7;
  font-size: 13px;
  font-weight: 500;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #e9792f; box-shadow: 0 0 0 3px rgba(233,121,47,.13); }

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  padding: 43px 0 33px;
}

.intro-copy { max-width: 780px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 13px;
  color: #b3a6b9;
  font-size: 13px;
  font-weight: 500;
}

.eyebrow-line { width: 19px; height: 1px; background: #e9792f; }

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 11px;
  font-family: Manrope, sans-serif;
  font-size: clamp(49px, 5vw, 69px);
  font-weight: 700;
  letter-spacing: -.065em;
  line-height: 1.08;
}

h1 span { color: var(--pumpkin); }
.ghost-doodle { display: inline-block; width: 39px; height: 46px; margin-left: 9px; vertical-align: -5px; filter: drop-shadow(0 5px 8px rgba(189, 141, 221, .2)); animation: ghost-float 3s ease-in-out infinite; }
@keyframes ghost-float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }

.intro-text {
  max-width: 700px;
  margin-bottom: 0;
  color: #c0b5c5;
  font-size: 18px;
  line-height: 1.65;
}

.progress-card {
  flex: 0 0 240px;
  padding: 16px 17px 13px;
  border: 1px solid #3b3044;
  border-radius: 12px;
  background: rgba(37, 29, 44, .82);
}

.progress-heading { display: flex; justify-content: space-between; color: #b4a8b8; font-size: 12px; }
.progress-heading span:last-child { color: var(--ink); font-size: 14px; font-weight: 500; }
.progress-track { height: 5px; margin: 12px 0 10px; overflow: hidden; border-radius: 9px; background: #43364c; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e9792f, #9a65b5); transition: width .25s ease; }
.progress-card p { margin: 0; color: #aa9eaf; font-size: 13px; }

.game-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  gap: 18px;
  min-height: 462px;
  padding: 23px;
  border: 1px solid #3b3044;
  border-radius: 16px;
  background: rgba(31, 25, 37, .88);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
}

.column { min-width: 0; }
.column-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.heading-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; }
.heading-icon svg { width: 19px; height: 19px; }
.regulations-icon { color: #ffad68; background: #412d27; }
.scenarios-icon { color: #d0a7e5; background: #382a43; }
.column-heading h2 { margin: 0 0 2px; font-family: Manrope, sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.column-heading p { margin: 0; color: #aa9eae; font-size: 13px; }
.column-count { margin-left: auto; color: #a99cad; font-size: 13px; }

.card-list, .scenario-list { display: flex; flex-direction: column; gap: 9px; }

.regulation-card {
  position: relative;
  display: flex;
  min-height: 76px;
  overflow: hidden;
  border: 1px solid #403545;
  border-radius: 10px;
  background: var(--paper);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, opacity .16s ease;
}

.regulation-card:hover { border-color: #98603e; box-shadow: 0 3px 12px rgba(0, 0, 0, .2); }
.regulation-card.is-selected { border-color: #ff9b45; box-shadow: 0 0 0 2px rgba(255, 155, 69, .18); }
.regulation-card.is-dragging { opacity: .55; transform: scale(.98); }

.drag-handle {
  display: flex;
  flex: 0 0 29px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-right: 1px solid #39303e;
  background: #27212e;
  color: #a89bac;
  cursor: grab;
}

.drag-handle:active { cursor: grabbing; }
.drag-handle:focus-visible, .drop-zone:focus-visible, .secondary-button:focus-visible { outline: 2px solid #9a65b5; outline-offset: 2px; }
.drag-dots { display: grid; grid-template-columns: repeat(2, 3px); gap: 3px; }
.drag-dots i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.card-main { flex: 1; min-width: 0; padding: 10px 12px 8px; }
.card-meta, .scenario-topline { display: flex; align-items: center; justify-content: space-between; }
.card-type { color: #aa9eaf; font-size: 10px; }
.card-number { color: #e9a56d; font-size: 12px; }

.card-text {
  margin: 0;
  padding: 2px 0 4px;
  min-height: 27px;
  color: #e4d9e8;
  font-size: 14px;
  line-height: 1.45;
}

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; }
.pager-pages { display: flex; gap: 5px; }
.pager-button, .pager-dot { display: grid; min-width: 26px; height: 26px; place-items: center; padding: 0 6px; border: 1px solid #493d50; border-radius: 7px; background: transparent; color: #c2b5c7; font-family: "DM Mono", monospace; font-size: 13px; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.pager-button { font-size: 20px; line-height: 1; }
.pager-button:hover:not(:disabled), .pager-dot:hover { border-color: #766084; background: #251e2d; }
.pager-button:disabled { opacity: .35; cursor: default; }
.pager-dot.is-current { border-color: #ff9b45; background: #ff9b45; color: #1d1622; font-weight: 500; }
.pager-button:focus-visible, .pager-dot:focus-visible { outline: 2px solid #9a65b5; outline-offset: 2px; }
.page-indicator { margin: 12px 0 0; color: #a89bab; font-family: "DM Mono", monospace; font-size: 13px; letter-spacing: .045em; text-align: center; }
.page-dialog { text-align: center; }
.page-dialog .dialog-actions { justify-content: center; }
.page-dialog-icon { display: grid; width: 40px; height: 40px; margin: 0 auto 10px; place-items: center; border: 1px solid #4f7a49; border-radius: 50%; background: #24301f; color: #b9e3a8; font-size: 23px; }
.wrong-dialog-icon { border-color: #8a4646; background: #34201f; color: #f0a8a3; }
.wrong-dialog .dialog-text { text-align: left; line-height: 1.55; }
.congrats-icon { display: block; margin: 0 auto 8px; filter: drop-shadow(0 4px 10px rgba(233, 121, 47, .3)); animation: ghost-float 3s ease-in-out infinite; }
.congrats-dialog h2 { font-size: 26px; }
.congrats-dialog .dialog-text { margin-bottom: 6px; }
.congrats-note { margin: 10px 0 16px; color: #c0b5c5; font-size: 16px; line-height: 1.5; }

.column-hint { margin: 12px 0 0 3px; color: #a89bab; font-size: 16px; }
.column-hint span { padding-right: 3px; color: #e9792f; font-size: 21px; }

.board-divider { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.board-divider span { width: 3px; height: 3px; border-radius: 50%; background: #64516e; }

.scenario-card {
  min-height: 91px;
  padding: 10px 12px 8px;
  border: 1px solid #403545;
  border-radius: 10px;
  background: #211b28;
}

.scenario-card .card-text { min-height: 26px; padding-top: 4px; }

.drop-zone {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 27px;
  align-items: center;
  padding: 0;
  border: 1px dashed #5a4a60;
  border-radius: 6px;
  background: #27212e;
  color: #ad9fb1;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.drop-zone.is-over { border-color: #ff9b45; background: #3a2b29; transform: scale(1.01); }
.drop-zone.has-match { border-style: solid; border-color: #4f7a49; background: #24301f; cursor: default; }
.drop-zone.has-match .match-pill { color: #b9e3a8; }
.drop-zone.is-wrong { border-color: #d9534f; background: #3a2226; animation: wrong-shake .35s ease; }
@keyframes wrong-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.drop-placeholder { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 12px; }
.plus-icon { display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid #65566d; border-radius: 50%; font-size: 16px; line-height: 1; }
.match-pill { display: block; overflow: hidden; padding: 5px 27px 5px 8px; color: #d4b4e4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.board-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px 3px 0; }
.board-footer p { margin: 0 auto 0 0; color: #ab9eae; font-size: 13px; }
.secondary-button { padding: 7px 10px; border: 1px solid #493d50; border-radius: 7px; background: transparent; color: #c2b5c7; font-size: 13px; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.secondary-button:hover { border-color: #766084; background: #251e2d; }
.submit-button { padding: 7px 14px; border: 1px solid #ff9b45; border-radius: 7px; background: #ff9b45; color: #1d1622; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s ease, opacity .15s ease; }
.submit-button:hover:not(:disabled) { background: #ffb06b; }
.submit-button:disabled { opacity: .4; cursor: not-allowed; }
.submit-button:focus-visible { outline: 2px solid #9a65b5; outline-offset: 2px; }

.submit-dialog { width: min(360px, calc(100% - 32px)); padding: 22px; border: 1px solid #4a3d52; border-radius: 14px; background: #211b28; color: var(--ink); box-shadow: 0 18px 48px rgba(0, 0, 0, .45); }
.submit-dialog::backdrop { background: rgba(10, 8, 13, .7); }
.submit-dialog h2 { margin-bottom: 4px; font-family: Manrope, sans-serif; font-size: 23px; letter-spacing: -.02em; }
.dialog-text { margin-bottom: 14px; color: #b4a8b8; font-size: 16px; }
.dialog-text strong { color: var(--pumpkin); }
.submit-dialog label { display: block; margin-bottom: 4px; color: #c2b5c7; font-size: 14px; }
.submit-dialog input { display: block; width: 100%; padding: 8px 10px; border: 1px solid #4a3d52; border-radius: 7px; background: #17131d; color: var(--ink); font: inherit; font-size: 17px; }
.submit-dialog input:focus { outline: 2px solid #9a65b5; outline-offset: 1px; }
.submit-dialog input[aria-invalid="true"] { border-color: #d9534f; }
.field-error { min-height: 14px; margin: 3px 0 8px; color: #ff8a85; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.footnote { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 25px 0 0; color: #8f8295; font-size: 12px; text-align: center; }
.pumpkin-doodle { width: 20px; height: 18px; flex: 0 0 auto; filter: drop-shadow(0 2px 4px rgba(233, 121, 47, .2)); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 760px) {
  .app-shell { width: min(100% - 36px, 560px); padding-top: 18px; }
  .intro { align-items: stretch; flex-direction: column; gap: 20px; padding: 31px 0 23px; }
  .progress-card { flex-basis: auto; }
  .game-board { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 17px; }
  .board-divider { display: none; }
  .column-hint { margin-bottom: 2px; }
  .scenario-list { gap: 9px; }
}

@media (max-width: 420px) {
  .app-shell { width: calc(100% - 24px); }
  .session-tag { font-size: 10px; }
  .game-board { padding: 12px; }
  .board-footer { align-items: flex-start; }
  .ghost-doodle { width: 31px; height: 37px; margin-left: 5px; }
}
