/* Designer's 1920 x 1080 game composition. All artwork is supplied PNG art. */
@font-face {
  font-family: DNFBitBitv2;
  src: url('./assets/fonts/DNFBitBitv2.otf') format('opentype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
/* Galmuri 2.40.3 (quiple/galmuri), distributed with LICENSE-Galmuri.txt. */
@font-face {
  font-family: Galmuri14;
  src: url('./assets/fonts/Galmuri14.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
/* Shared type roles. Main controls keep 44px targets; amount steps use compact
   rows. Display numbers also fit their own available width. */
.art-game, body.game-active, body.title-art {
  --art-font: DNFBitBitv2, var(--body-font);
  --type-title: clamp(24px, calc(var(--stage-width) * .025), 40px);
  --type-section: clamp(16px, calc(var(--stage-width) * .015), 24px);
  --type-body: clamp(14px, calc(var(--stage-width) * .01125), 18px);
  --type-caption: clamp(12px, calc(var(--stage-width) * .00875), 16px);
  --type-action: clamp(16px, calc(var(--stage-width) * .014), 24px);
  --type-control: var(--type-body);
  --type-score: clamp(32px, calc(var(--stage-width) * .04), 72px);
  --type-amount: clamp(28px, calc(var(--stage-width) * .034), 64px);
  --type-unit: clamp(16px, calc(var(--stage-width) * .015), 24px);
  --type-direction-compact: clamp(22px, 2.55cqw, 44px);
  --type-icon: 24px;
  --bubble-panel-image: url('./assets/designer/bubble-box.png');
  --bubble-source-slice: 200;
  --bubble-corner: 20px;
  --bubble-tail-overlap: 8px;
  /* Spacing scale: 4 / 8 / 12 / 16 / 24 / 32px. Panel insets never
     shrink with artwork percentages; compact panels retain 12px vertically. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --panel-padding: clamp(16px, 1.5cqw, 24px);
  --control-padding-block: clamp(14px, 1.6cqw, 28px);
  --control-gap: clamp(4px, .6cqw, 12px);
  --control-row: clamp(44px, 4.6cqw, 88px);
  --quick-row: 24px;
  --price-tail-height: clamp(6px, .6cqw, 12px);
  --line-title: 1.2;
  --line-body: 1.5;
  --line-caption: 1.4;
}
.art-game { margin: 0 auto; height: 100svh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; background: #251039; }
.art-game > form { width: 100%; min-height: 100%; margin: 0; display: grid; place-items: center; }
.art-game button, .art-game input { font: inherit; }
.art-game button:focus-visible { outline: 3px solid #334fff; outline-offset: 3px; }
body.question-art { background: #251039; overflow: clip; }
.question-art #main-content { padding: 0; width: 100%; max-width: none; margin: 0; }
.question-art .site-header, .question-art .site-footer { display: none; }
.art-stage {
  --scene-height: 56.25cqw;
  container-type: inline-size;
  position: relative;
  width: min(100vw, calc(100svh * 16 / 9));
  width: min(100vw, calc(100dvh * 16 / 9));
  margin: 0 auto;
  display: flow-root;
  overflow: clip;
  isolation: isolate;
  background: url('./assets/designer/stage-background.png') top center / 100% auto no-repeat;
  font-family: var(--art-font);
  color: #606060;
}
.art-decoration { position: absolute; display: block; pointer-events: none; user-select: none; }
.art-frame { left: 22.82%; top: calc(var(--scene-height) * .015); width: 54.42%; height: calc(var(--scene-height) * .591); z-index: 1; }
.art-judge-left { left: -.2%; top: calc(var(--scene-height) * .201); width: 20%; height: auto; z-index: 2; }
.art-judge-right { left: 83.5%; top: calc(var(--scene-height) * .352); width: 14%; height: auto; z-index: 2; }
.art-wood { left: 0; top: calc(var(--scene-height) * .598); width: 150%; height: calc(100% - var(--scene-height) * .598 + 1%); z-index: 3; }
.art-board-content { position: absolute; left: 27.1%; top: calc(var(--scene-height) * .095); width: 45.8%; height: calc(var(--scene-height) * .432); z-index: 3; display: grid; grid-template-rows: max-content minmax(0, 1fr) max-content; gap: var(--control-gap); }
.art-product {
  position: relative; justify-self: center; width: 82%; height: 100%; min-width: 0; min-height: 0;
  margin: 0; padding: var(--space-2); background: #fff; overflow: clip;
}
.art-product .product-photo { width: 100%; height: 100%; object-fit: contain; }
.art-title {
  margin: 0; min-width: 0;
  text-align: center; font: 400 var(--type-title)/var(--line-title) var(--art-font); letter-spacing: 0;
  word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance;
}
.art-product-name { color: #2346ed; }
.art-question-prompt { white-space: nowrap; }
.art-board-footer { display: grid; gap: var(--space-1); min-width: 0; }
.art-tags {
  min-width: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2);
  color: #99512f; font-size: var(--type-caption); line-height: var(--line-body);
}
.art-tags span { max-width: 100%; overflow-wrap: anywhere; }
.art-round { position: absolute; left: 30%; top: calc(var(--scene-height) * .56); width: 40%; text-align: center; color: #fff; font-size: var(--type-section); line-height: 1.25; z-index: 2; }
.art-score-label { position: absolute; left: 79%; top: calc(var(--scene-height) * .129); width: 18.7%; text-align: center; color: #fff; font-size: var(--type-section); line-height: 1.25; z-index: 4; }
.art-score { position: absolute; left: 79%; top: calc(var(--scene-height) * .176); width: 18.7%; height: calc(var(--scene-height) * .161); z-index: 4; }
.art-hint, .art-score, .art-price-bubble { isolation: isolate; }
/* Each bubble owns its layers: tail behind the panel, content above both. */
.art-bubble-body { position: absolute; z-index: 1; display: block; inset: 0 0 auto; width: 100%; height: 85%; pointer-events: none; }
.art-bubble-tail { position: absolute; z-index: 0; width: 16%; height: 24%; right: 6%; bottom: 0; transform: scaleX(-1); object-fit: contain; object-position: center top; pointer-events: none; }
.art-score .art-bubble-tail { left: 47%; right: auto; width: 18%; height: 28%; bottom: -3%; transform: none; }
.art-score output { position: absolute; z-index: 2; inset: 0 5% 15%; display: grid; place-items: center; color: #344eff; font-size: var(--type-score); line-height: 1; }
.art-hint.retry-feedback {
  position: absolute; left: 10.6%; top: calc(var(--scene-height) * .036); width: 10.4%; height: calc(var(--scene-height) * .16); z-index: 4;
  display: block; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; color: #e60000;
}
.art-hint .art-bubble-tail { transform: none; left: 10%; right: auto; width: 25%; }
.art-hint-word { position: absolute; z-index: 2; inset: 0 0 16%; padding-inline: var(--hint-padding-inline, 8px); display: grid; place-items: center; font-size: var(--type-score); line-height: 1; }
.art-hint.down .art-hint-word { color: #3450ff; }
.art-hint.neutral .art-hint-word { color: #606080; }
.art-audience { z-index: 4; height: auto; }
/* The center bust overlaps its neighbours on the supplied sheet. Clip only those
   neighbouring shoulders, without painting or changing the character artwork. */
.art-audience[src$="audience-center.png"] { clip-path: polygon(0 0,100% 0,100% 54%,90% 63%,100% 80%,100% 100%,0 100%,0 77%,5% 68%,20% 61%,20% 40%); }
.art-person-1 { left: -4%; top: calc(var(--scene-height) * .67); width: 18%; }
.art-person-2 { left: 11%; top: calc(var(--scene-height) * .755); width: 17%; }
.art-person-3 { left: 26%; top: calc(var(--scene-height) * .737); width: 17%; }
.art-person-4 { left: 41.5%; top: calc(var(--scene-height) * .77); width: 18%; }
.art-person-5 { left: 58.5%; top: calc(var(--scene-height) * .76); width: 17%; }
.art-person-6 { left: 72%; top: calc(var(--scene-height) * .737); width: 17%; }
.art-person-7 { left: 87.5%; top: calc(var(--scene-height) * .677); width: 18%; }
/* Desktop controls and lives stay in one flow so validation grows upward.
   Compact stages use the side gutters for status and lives, keeping both
   amount rows clear of the product. */
.art-lower { --controls-inset: 20%; --feedback-inset: 1.5%; --feedback-gap: clamp(16px, 1.5cqw, 24px); position: absolute; inset: auto 0 clamp(6px, calc(var(--scene-height) * .012), 16px); height: auto; min-height: 0; margin: 0; padding: 0 var(--controls-inset); display: flex; flex-direction: column; gap: clamp(6px, .75cqw, 14px); z-index: 5; pointer-events: none; }
.art-lower > * { pointer-events: auto; }
.art-controls { position: relative; width: 100%; z-index: 5; display: grid; gap: clamp(4px, .5cqw, 10px); margin-bottom: var(--price-tail-height); order: 0; }
.art-price-bubble { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(88px, 24%); gap: clamp(12px, 1.5cqw, 24px) clamp(16px, 1.5cqw, 28px); align-items: center; padding: var(--control-padding-block) var(--panel-padding); }
.art-price-bubble > .art-bubble-body { height: 100%; }
.art-price-bubble > .art-bubble-tail { left: 45%; right: auto; top: calc(100% - var(--bubble-tail-overlap)); bottom: auto; width: 10%; height: calc(var(--price-tail-height) + var(--bubble-tail-overlap)); transform: none; }
.art-price-bubble > :is(.art-price-entry, .guess-submit, .art-guess-error, .art-quick) { z-index: 2; }
.art-price-entry { container-type: inline-size; min-width: 0; height: var(--control-row); display: flex; align-items: center; gap: var(--space-2); color: #344eff; }
.art-price-entry input {
  display: block; min-width: 0; width: 100%; height: 100%; padding: 0;
  border: 0; border-radius: 0; outline-offset: 0; background: transparent;
  color: inherit; font: 400 min(var(--type-amount), max(12px, calc(124cqw / var(--amount-chars, 7))))/1 var(--art-font); letter-spacing: -.025em;
  text-align: right; font-variant-numeric: tabular-nums;
}
.art-price-entry input::placeholder { color: #344eff; opacity: .5; }
.art-price-entry input:focus-visible { outline: 0; box-shadow: 0 2px 0 #8a98ff; }
.art-price-entry input[aria-invalid=true] { outline: 2px solid #d42828; }
.art-price-entry .art-currency { flex-shrink: 0; align-self: center; font-size: var(--type-unit); line-height: 1; }
.art-quick { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 44px; align-items: stretch; gap: 2px clamp(4px, .5cqw, 10px); min-width: 0; }
.art-quick button { width: 100%; height: var(--quick-row); min-height: var(--quick-row); padding: 0 8px; background: transparent; box-shadow: none; color: #707ba8; font: 400 var(--type-control)/1.25 var(--art-font); white-space: nowrap; }
.art-quick .plus { color: #344eff; }
.art-quick .minus { color: #b24b64; }
.art-quick .art-clear { grid-column: 6; grid-row: 1 / span 2; height: auto; }
.art-quick button:hover { color: #344eff; }
.art-quick .art-clear { font-size: var(--type-icon); line-height: 1; }
.art-lives { position: relative; width: 25.8333%; display: flex; gap: 1.2cqw; margin: 0 auto; z-index: 6; flex-shrink: 0; order: 2; }
.art-lives img { display: block; width: calc((100% - 2.4cqw) / 3); height: auto; }
.art-lives .spent { opacity: .22; }
.art-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.art-price-bubble .guess-submit { width: 100%; min-height: var(--control-row); margin: 0; padding: var(--space-2); color: #fff; background: #344eff; border-radius: 16px; font: 400 var(--type-action)/1.25 var(--art-font); box-shadow: 0 2px 0 #223bd7; }
.art-price-bubble .guess-submit:hover { background: #4d64ff; }
.art-price-bubble .guess-submit:active { transform: translateY(.15cqw); box-shadow: none; }
.art-guess-error { grid-column: 1 / -1; margin: 0; text-align: center; font: 400 var(--type-caption)/var(--line-caption) var(--art-font); color: #d62929; }
.art-guess-error:empty { display: none; }
.art-attempt { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding-inline: var(--panel-padding); color: #fff; font-size: var(--type-caption); line-height: var(--line-caption); }
.art-attempt > span { white-space: nowrap; }
/* End the hint before the control column, including an explicit gutter. Both
   derive from the same inset so resizing cannot make the two frames overlap. */
.art-feedback { position: absolute; left: var(--feedback-inset); top: calc(var(--scene-height) * .027); width: calc(var(--controls-inset) - var(--feedback-inset) - var(--feedback-gap)); min-height: calc(var(--scene-height) * .15); max-height: calc(var(--scene-height) * .28); z-index: 5; padding: var(--panel-padding); overflow: auto; overflow-wrap: anywhere; overscroll-behavior: contain; color: #626c99; }
.art-feedback:focus-visible { outline: 2px solid #879dff; outline-offset: 2px; }
.art-feedback .retry-feedback { display: block; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #626c99; }
.art-feedback .retry-direction { display: none; }
.art-feedback .retry-feedback strong { font: 400 var(--type-section)/1.25 var(--art-font); color: #344eff; }
.art-feedback .retry-feedback p { margin-top: var(--space-2); font: 400 var(--type-body)/var(--line-body) var(--art-font); }
.art-feedback .retry-feedback small { margin-top: var(--space-2); font: 400 var(--type-caption)/var(--line-caption) var(--art-font); color: #626c99; }
.art-popover { position: absolute; z-index: 9; }
.art-popover[open] { z-index: 20; }
.art-popover summary { cursor: pointer; list-style: none; text-align: center; }
.art-popover summary::-webkit-details-marker { display: none; }
.art-popover summary:focus-visible { outline: 3px solid #879dff; outline-offset: 3px; }
.art-popover-content { position: absolute; padding: var(--panel-padding); color: #626c99; }
.art-menu { left: 1.5%; top: 2.5%; width: 7%; }
.art-menu > summary { display: grid; place-items: center; min-height: 44px; padding: var(--space-2) var(--space-3); font-size: var(--type-body); line-height: var(--line-caption); color: #344eff; }
.art-menu-content { left: 0; top: calc(100% + .5cqw); width: 24cqw; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font: 400 var(--type-body)/var(--line-body) var(--art-font); }
.art-menu-content button { min-height: 44px; padding: 8px; border-radius: .8cqw; background: #edf0ff; color: #344eff; }
.art-menu-content .sound-state { font: inherit; margin-left: 6px; }
.art-menu-content button:hover { background: #dfe5ff; }
.art-menu-content p { grid-column: 1 / -1; text-align: center; font-size: var(--type-caption); line-height: var(--line-body); padding-top: 6px; }
.art-conditions { min-width: 0; font: 400 var(--type-caption)/var(--line-body) var(--art-font); }
.art-conditions .price-policy-note { margin: 4px 0 0; font: inherit; }
.question-art #info-dialog { border-color: #aeb8ed; }
.question-art #info-dialog::backdrop { background: #1d0b35b3; }
:is(.game-active, .title-art) #info-dialog :is(p,dd,dt,a,button,li,summary,label,textarea) { font-size: var(--type-body); line-height: var(--line-body); }
:is(.game-active, .title-art) #info-dialog :is(.dialog-small,.photo-caption,.dialog-badge,.source-table dt,.info-definitions dt) { font-size: var(--type-caption); line-height: var(--line-caption); }
:is(.game-active, .title-art) #info-dialog h2 { font-size: var(--type-title); line-height: var(--line-title); }
:is(.game-active, .title-art) #info-dialog h3 { font-size: var(--type-section); line-height: 1.25; }
:is(.game-active, .title-art) #info-dialog { padding: var(--panel-padding); }
:is(.game-active, .title-art) #info-dialog .dialog-heading { top: calc(0px - var(--panel-padding)); gap: var(--space-4); padding-bottom: var(--space-4); }
:is(.game-active, .title-art) #info-dialog .dialog-content { padding-top: var(--space-4); }
:is(.game-active, .title-art) #info-dialog .icon-button { min-width: 44px; min-height: 44px; font-size: var(--type-icon); }
/* Keep the existing round-reveal content and actions inside the game, too. */
body.game-active:has(.reveal-heading) { background: #251039; overflow: clip; }
.game-active:has(.reveal-heading) .site-header, .game-active:has(.reveal-heading) .site-footer { display: none; }
.game-active:has(.reveal-heading) #main-content { display: grid; place-items: center; width: 100%; min-height: 100svh; min-height: 100dvh; margin: 0; padding: 4dvh 0; background: url('./assets/designer/stage-background.png') center / cover no-repeat; }
.game-active:has(.reveal-heading) .game-shell { width: min(88vw, 1200px); max-height: 92dvh; margin: 0; padding: var(--panel-padding); overflow: auto; overscroll-behavior: contain; }
.game-active:has(.reveal-heading) .reveal-heading h1 { font: 400 var(--type-title)/var(--line-title) var(--art-font); letter-spacing: 0; }
.game-active:has(.reveal-heading) .reveal-navigation { position: sticky; bottom: -1px; z-index: 2; padding: 12px 0 0; background: #fcfdff; }
.game-active:has(.reveal-heading) .next-button { font: 400 var(--type-action)/1.25 var(--art-font); border-radius: 999px; }
.game-active:has(.reveal-heading) :is(.round-counter > span,.game-score > span,.game-score small,.figure-index,.figure-bottom,.figure-bottom > span,.figure-bottom small,.condition-tags span,.eyebrow,.answer-condition,.guess-result small,.source-link,.knowledge-source,.knowledge-source > a,.knowledge-source > button,.reveal-label,.error-badge,.compare-cell > span,.compare-cell small) { font-size: var(--type-caption); line-height: var(--line-caption); }
.game-active:has(.reveal-heading) :is(.specification,.scope-note,.answer-korean,.knowledge-text,.attempt-result-label,.result-guess > span) { font-size: var(--type-body); line-height: var(--line-body); }
.game-active:has(.reveal-heading) :is(.revealed-product h2,.knowledge-copy h2,.earned-score,.round-counter strong,.game-score strong) { font-size: var(--type-section); line-height: 1.25; }
.game-active:has(.reveal-heading) .answer-price { font-size: var(--type-score); }
.game-active:has(.reveal-heading) #info-dialog::backdrop { background: #1d0b35b3; }
/* The same source-pixel corner is mapped to the same 20px square everywhere.
   Only edge strips and the filled center stretch. A 1px transparent layout
   border avoids zero-border rendering differences; content padding is retained.
   The PNG supplies the fill; a second background would show through its
   transparent outer edge as a white rim. */
.art-bubble-body,
.art-feedback,
.art-popover-content,
.art-menu > summary,
.game-active:has(.reveal-heading) .game-shell,
:is(.game-active, .title-art) #info-dialog {
  border: 1px solid transparent;
  border-image-source: var(--bubble-panel-image);
  border-image-slice: var(--bubble-source-slice) fill;
  border-image-width: var(--bubble-corner);
  border-image-outset: 0;
  border-image-repeat: stretch;
  border-radius: var(--bubble-corner);
  background: transparent;
  box-shadow: none;
}
.art-bubble-body { min-width: calc(var(--bubble-corner) * 2); min-height: calc(var(--bubble-corner) * 2); }
/* Animated bubbles reuse one painted 9-slice texture across their whole scale. */
.art-bubble-texture { position: absolute; z-index: 0; left: -1px; top: -1px; width: calc(100% + 2px); height: calc(100% + 2px); pointer-events: none; }
.art-hint > .art-bubble-body[data-flattened=true] { border-image: none; transform: translateZ(0); backface-visibility: hidden; }
.art-hint { transform: translateZ(0); transform-origin: center; }
