:root {
  --primary: #063d70;
  --primary-dark: #042f57;
  --accent: #cc5123;
  --background: #fff8ef;
  --panel: #b8dbf5;
  --success: #146c3e;
  --text: #20232c;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, [tabindex="-1"]:focus-visible { outline: .25rem solid #e5a000; outline-offset: .25rem; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
svg { display: block; width: 100%; height: 100%; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; color: var(--primary); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 1.3rem; color: var(--primary); }
.app-shell { width: min(100%, 84rem); margin: 0 auto; padding: clamp(1rem, 3vw, 2.5rem); }
.page-header { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2rem; margin-bottom: 1.6rem; }
.eyebrow { margin: 0 0 .75rem; color: #a63d16; font-size: .95rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.intro { max-width: 44rem; margin: .9rem 0 0; font-size: 1.2rem; line-height: 1.5; }
.game-summary { min-width: 16rem; padding: 1.2rem 1.3rem; border: .12rem solid var(--primary); border-radius: 1.15rem; background: #fff; }
.progress-text { margin: 0 0 .7rem; font-size: 1.1rem; color: var(--primary); font-weight: 800; }
.progress-track { height: .7rem; overflow: hidden; background: #e1e8ef; border-radius: 1rem; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--primary); border-radius: inherit; transition: width .2s ease; }
.pace-note { margin: .7rem 0 0; color: #465367; font-size: 1rem; }
.steps { display: flex; flex-wrap: wrap; gap: .8rem 2rem; margin: 0 0 1.4rem; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: .6rem; color: var(--primary); font-size: 1.1rem; font-weight: 700; }
.step-number { display: grid; place-items: center; flex: 0 0 2rem; height: 2rem; border: .12rem solid var(--primary); border-radius: 50%; background: #fff; font-size: 1rem; }
.feedback { position: sticky; top: .5rem; z-index: 20; display: flex; align-items: center; gap: .8rem; min-height: 4.5rem; margin-bottom: 1.5rem; padding: .85rem 1.1rem; border: .12rem solid #7192ad; border-radius: 1rem; background: #eef6fc; box-shadow: 0 .2rem .5rem rgb(4 47 87 / 8%); }
.feedback p { margin: 0; font-size: 1.1rem; line-height: 1.4; }
.feedback-mark { display: grid; place-items: center; flex: 0 0 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.2rem; }
.feedback[data-kind="correct"] { background: #edf7ef; border-color: var(--success); }
.feedback[data-kind="correct"] .feedback-mark { background: var(--success); }
.feedback[data-kind="incorrect"] { background: #fff0df; border-color: #a63d16; }
.feedback[data-kind="incorrect"] .feedback-mark { background: #a63d16; }
.game-board { display: grid; grid-template-columns: minmax(16rem, .8fr) minmax(0, 1.8fr); gap: 1.75rem; align-items: start; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; }
.small-label { font-size: 1rem; color: #465367; }
.draw-zone { padding: 1.3rem; border: .14rem solid var(--primary); border-radius: 1.35rem; background: var(--panel); box-shadow: 0 .25rem 0 var(--primary); }
.current-card, .card-placeholder { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; width: 100%; min-height: 20rem; padding: 2rem 1.1rem; border: .15rem solid var(--primary); border-radius: 1.1rem; background: #fff; color: var(--primary); text-align: center; }
.current-card { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 .3rem 0 rgb(6 61 112 / 15%); }
.current-card:hover { border-color: var(--accent); }
.current-card.is-selected { outline: .22rem solid var(--accent); outline-offset: .2rem; }
.current-card.is-dragging { opacity: .25; }
.drag-ghost { opacity: .95; box-shadow: 0 1rem 2rem rgb(4 47 87 / 25%); transform: rotate(3deg); cursor: grabbing; }
.card-corner { position: absolute; top: .9rem; left: 1rem; font-size: 1rem; font-weight: 900; color: #67809a; }
.card-visual { display: block; width: 7rem; height: 7rem; flex: 0 0 7rem; }
.card-visual img { width: 100%; height: 100%; object-fit: contain; }
.card-label { font-size: clamp(1.4rem, 2vw, 1.75rem); line-height: 1.25; font-weight: 800; overflow-wrap: anywhere; }
.card-select-hint { color: #465367; font-size: 1rem; font-weight: 400; }
.card-placeholder { border-style: dashed; background: rgb(255 255 255 / 65%); }
.placeholder-icon { width: 5.5rem; height: 5.5rem; opacity: .6; }
.card-placeholder p, .placeholder-label { max-width: 12rem; margin: 0; font-size: 1.3rem; font-weight: 700; }
.card-placeholder--draw { cursor: pointer; }
.card-placeholder--draw:hover { border-color: var(--accent); background: #fff; }
.card-instruction { min-height: 3.3rem; margin: 1rem 0; font-size: 1.05rem; line-height: 1.45; color: var(--primary-dark); }
.deck-button { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 5.75rem; padding: .85rem; border: .13rem solid var(--primary); border-radius: .9rem; background: var(--primary); color: #fff; text-align: left; cursor: pointer; }
.deck-button:hover:not(:disabled) { background: var(--primary-dark); }
.deck-button:disabled { background: #e8f0f7; color: #42556b; border-color: #7993aa; }
.deck-back { display: grid; place-items: center; flex: 0 0 2.65rem; height: 3.65rem; border: .1rem solid currentColor; border-radius: .4rem; background: repeating-linear-gradient(45deg, transparent, transparent 6px, rgb(255 255 255 / 12%) 6px, rgb(255 255 255 / 12%) 7px); font-size: 1.5rem; font-weight: 800; box-shadow: -.2rem .15rem 0 rgb(255 255 255 / 40%); }
.deck-button strong { display: block; font-size: 1.1rem; line-height: 1.3; }
.deck-button span span { display: block; margin-top: .4rem; font-size: 1rem; }
.collect-zone > .section-heading { min-height: 1.6rem; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.category { min-width: 0; border: .14rem solid var(--primary); border-radius: 1.2rem; background: #fff; box-shadow: 0 .2rem 0 var(--primary); overflow: hidden; }
.category .category-target { min-height: 14rem; border: 0; border-radius: 0 0 1rem 1rem; box-shadow: none; }
.category > .category-top { width: auto; margin: .6rem 1rem 0; flex-wrap: nowrap; }
.category-help { display: flex; align-items: center; gap: .45rem; flex: 1; min-width: 0; min-height: 3rem; padding: .3rem .15rem; border: 0; border-radius: .4rem; background: transparent; color: var(--primary); text-align: left; cursor: pointer; }
.category-help .category-title { flex: 1; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: .2rem; }
.category-help:hover { background: #eef5fc; }
.help-mark { display: grid; place-items: center; flex: 0 0 1.25rem; height: 1.25rem; border: .1rem solid currentColor; border-radius: 50%; font-size: .9rem; font-weight: 700; }
.category.is-complete { border-color: var(--success); box-shadow: 0 .2rem 0 var(--success); background: #edf7ef; }
.category.is-complete .category-target { box-shadow: none; }
.category:has(.is-drop-target) { border-color: var(--accent); }
.category-target { display: flex; flex-direction: column; width: 100%; min-height: 17.6rem; padding: 1rem; border: .14rem solid var(--primary); border-radius: 1.2rem; color: var(--primary); background: #fff; box-shadow: 0 .2rem 0 var(--primary); cursor: pointer; text-align: left; }
.category-target:hover:not(:disabled), .category-target.is-drop-target { border-color: var(--accent); background: #fff6e9; box-shadow: 0 .2rem 0 var(--accent); }
.category-target:disabled { opacity: 1; }
.category-top { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; width: 100%; margin-bottom: 1rem; }
.category-icon { width: 1.8rem; height: 1.8rem; flex-shrink: 0; }
.category-title { flex: 1 1 7rem; font-size: 1.1rem; line-height: 1.2; font-weight: 800; overflow-wrap: anywhere; }
.category-count { flex-shrink: 0; padding: .3rem .5rem; border-radius: .5rem; background: #eef5fc; font-size: 1rem; font-weight: 800; }
.category-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1; gap: .5rem; width: 100%; }
.empty-card, .mini-card { min-height: 5rem; border-radius: .5rem; }
.empty-card { border: .1rem dashed #8ba1b7; background: #f7fafd; }
.mini-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: .4rem .2rem; border: .1rem solid #8ba1b7; background: #fff8ef; color: var(--primary-dark); font-size: .9rem; font-weight: 700; line-height: 1.18; text-align: center; overflow-wrap: anywhere; }
.mini-card__visual { width: 1.7rem; height: 1.7rem; }
.mini-card__visual img { display: block; width: 100%; height: 100%; object-fit: contain; }
.category-caption { display: block; width: 100%; margin-top: .8rem; font-size: 1rem; font-weight: 700; text-align: center; }
.is-complete .category-target { border-color: var(--success); box-shadow: 0 .2rem 0 var(--success); background: #edf7ef; }
.is-complete .category-caption { color: var(--success); }
.category-explanation { margin: .8rem .2rem 0; font-size: 1rem; line-height: 1.45; color: var(--primary-dark); }
.completion { margin-top: 2rem; padding: 2rem; border: .14rem solid var(--success); border-radius: 1.3rem; background: #edf7ef; text-align: center; }
.completion h2 { margin-top: .8rem; font-size: 2rem; }
.completion p { font-size: 1.25rem; }
.completion-check { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: auto; border-radius: 50%; color: #fff; background: var(--success); font-size: 2rem; }
.button { min-height: 3.6rem; padding: .85rem 1.3rem; border: .14rem solid var(--primary); border-radius: 1rem; cursor: pointer; font-size: 1.2rem; font-weight: 800; }
.button--primary { background: var(--primary); color: #fff; }
.category-dialog { width: min(calc(100% - 2rem), 36rem); max-height: calc(100dvh - 2rem); padding: 0; border: .15rem solid var(--primary); border-radius: 1.35rem; color: var(--text); background: #fff; box-shadow: 0 .3rem 0 var(--primary); overflow-y: auto; }
.category-dialog::backdrop { background: rgb(4 47 87 / 72%); }
.category-dialog__content { display: grid; justify-items: center; gap: 1.1rem; padding: clamp(1.25rem, 4vw, 2rem); text-align: center; }
.category-dialog__content h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
.category-dialog__content p { margin: 0; font-size: 1.2rem; line-height: 1.55; }
.category-dialog__icon { width: 4.5rem; height: 4.5rem; padding: .8rem; border-radius: 1rem; background: #edf7ef; color: var(--success); }
.category-dialog__content .category-dialog__success { color: var(--success); font-size: 1.05rem; font-weight: 700; }
.category-dialog__content .button { min-width: 10rem; }
.page-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #bac9d4; color: #465367; text-align: center; font-size: 1rem; }
.page-footer p { margin: 0; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.noscript { padding: 2rem; font-size: 1.2rem; }
@media (max-width: 66rem) {
  .page-header { grid-template-columns: 1fr; gap: 1.2rem; }
  .game-summary { max-width: 28rem; }
  .game-board { grid-template-columns: minmax(15rem, .8fr) minmax(0, 1.5fr); gap: 1.2rem; }
  .category-top { gap: .4rem; }
  .category-icon { display: none; }
  .category-target { padding: .85rem; }
}
@media (max-width: 52rem) {
  .game-board { grid-template-columns: 1fr; }
  .draw-zone { width: 100%; }
  #current-slot { max-width: 21rem; margin: 0 auto; }
  .current-card, .card-placeholder { min-height: 18rem; }
  .deck-button { max-width: 28rem; margin: auto; }
  .card-instruction { min-height: 0; text-align: center; }
  .category-icon { display: block; }
  .category-target { min-height: 18rem; }
}
@media (max-width: 36rem) {
  .app-shell { padding: 1.2rem .85rem; }
  .steps { gap: .65rem; flex-direction: column; }
  .category-grid { grid-template-columns: 1fr; gap: 1.3rem; }
  .category-target { min-height: 17rem; padding: 1rem; }
  .category-title { font-size: 1.25rem; }
  .category-slots { gap: .7rem; }
  .mini-card { font-size: 1rem; }
  .draw-zone { padding: 1rem; }
  .feedback { align-items: start; }
  .feedback-mark { margin-top: .1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
