.game_breadcrumb { font-size:13px; color:var(--muted); display:flex; gap:12px; align-items:center; padding-top:16px; }
.level_dots { display:grid; grid-template-columns:repeat(12,1fr); gap:4px; margin:12px 0 28px; }
.level_dot { height:5px; border-radius:4px; background:var(--line); }
.level_dot.is_complete { background:var(--green); }
.level_dot.is_active { background:var(--ink); height:7px; margin-top:-1px; }
.requirements { margin:20px 0; padding-left:20px; color:var(--muted); font-size:13px; display:grid; gap:8px; }
.hint_box { margin-top:12px; padding:16px; border-radius:12px; background:var(--yellow); font-size:13px; }
.hint_box ol { padding-left:16px; margin:0; display:grid; gap:12px; }
.concept_box { border-top:1px solid var(--line); margin-top:24px; padding-top:20px; font-size:13px; }
.concept_box summary { font-weight:700; cursor:pointer; padding:4px 0; }
.concept_box p { color:var(--muted); margin-top:12px; line-height:1.8; }
.scene_panel { border:1px solid var(--line); border-radius:20px; padding:8px; background:var(--surface); overflow:hidden; }
.scene_heading { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 16px; font-size:12px; }
.scene_heading strong { font-size:13px; }
.scene_legend { display:flex; gap:12px; color:var(--muted); font-size:11px; align-items:center; }
.scene_legend span::before { content:''; display:inline-block; width:9px; height:9px; border:2px dashed var(--green); margin-right:5px; border-radius:3px; vertical-align:middle; }
.scene_legend span:last-child::before { border-style:solid; }
.game_scene { position:relative; border-radius:14px; background:var(--theme); overflow:auto; padding:20px; min-height:280px; }
.html_preview { width:100%; min-height:280px; border:0; border-radius:14px; background:var(--paper); display:block; }
.cafe_scene {
  position:relative;
  display:grid;
  place-items:center;
  overflow:hidden;
  border-radius:14px;
  background:radial-gradient(ellipse at 50% 30%, #e9ddf7, #d9c8ee);
}
.cafe_diorama { position:relative; width:min(100%,480px); container-type:inline-size; }
.cafe_image {
  width:100%;
  filter:saturate(.72) brightness(.96);
  mask-image:linear-gradient(to right, transparent, black 13%, black 87%, transparent);
  transition:filter 450ms ease;
}
.cafe_signboard {
  position:absolute;
  left:32%;
  top:55%;
  display:grid;
  place-items:center;
  width:40%;
  height:11%;
  padding:0 3%;
  transform:rotate(10deg);
  transform-origin:top left;
  color:var(--green_dark);
  background:#f9edca;
  border:2px solid #aa8153;
  border-radius:5px;
  box-shadow:inset 0 0 0 1px #fdf6e6, 1px 3px 1px rgb(81 53 28 / .25);
}
.cafe_signboard::before,.cafe_signboard::after {
  content:'';
  position:absolute;
  top:42%;
  width:3px;
  height:3px;
  border-radius:50%;
  background:#9f7a47;
}
.cafe_signboard::before { left:3%; }
.cafe_signboard::after { right:3%; }
.cafe_sign {
  display:block;
  max-width:100%;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:clamp(10px,4cqi,20px);
  font-weight:850;
  line-height:1.25;
  letter-spacing:-.055em;
}
.cafe_sign:empty { width:72%; border-bottom:2px dashed #a0835f; }
.cafe_status {
  position:absolute;
  left:12px;
  top:12px;
  display:flex;
  align-items:center;
  gap:7px;
  padding:4px 10px;
  border-radius:30px;
  background:var(--surface);
  color:var(--ink);
  font-size:12px;
  font-weight:700;
  box-shadow:0 2px 6px rgb(55 38 75 / .12);
}
.cafe_status::before { content:''; width:7px; height:7px; border-radius:50%; background:#987142; }
.cafe_scene[data-state="open"] .cafe_image { filter:saturate(1.12) brightness(1.04); }
.cafe_scene[data-state="open"] .cafe_status { background:var(--green_dark); color:var(--surface); }
.cafe_scene[data-state="open"] .cafe_status::before { background:#c8edae; }
.cafe_scene[data-state="open"] .cafe_signboard {
  background:var(--green_dark);
  color:var(--surface);
  box-shadow:inset 0 0 0 1px #d2c38e, 1px 3px 2px rgb(81 53 28 / .3);
  animation:hang_sign 570ms ease-out;
}
@keyframes hang_sign {
  0% { transform:translateY(-36%) rotate(4deg); }
  55% { transform:rotate(14deg); }
  80% { transform:rotate(8deg); }
  100% { transform:rotate(10deg); }
}
.cafe_preview > summary { padding:10px 12px 4px; cursor:pointer; color:var(--muted); font-size:12px; }
.cafe_preview[open] > summary { padding-bottom:10px; }
.assembly_status, .order_status {
  margin:0;
  color:var(--green_dark);
  font-size:13px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.assembly_status { display:flex; align-items:center; gap:12px; padding:8px 16px; background:var(--peach); border-radius:10px; }
.assembly_status progress { width:min(26%,96px); }
.html_goal { margin:0 0 10px; padding:8px 10px 10px; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.html_goal figcaption { margin-bottom:4px; color:var(--green_dark); font-size:13px; font-weight:700; }
.html_goal_frame { display:block; width:100%; height:76px; max-height:clamp(96px,26svh,220px); border:0; border-radius:10px; background:var(--paper); }
.stage_arena .html_goal ~ .html_preview { height:clamp(220px,36svh,440px); }
.assembly_bar { display:flex; align-items:center; gap:8px; }
.assembly_bar .assembly_status { flex:1; min-width:0; }
.tag_toggle { display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:4px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--green_dark); font-size:13px; font-weight:650; white-space:nowrap; cursor:pointer; }
.tag_toggle input { width:16px; height:16px; accent-color:var(--green_dark); }
.tag_toggle:has(input:focus-visible) { outline:2px solid var(--green); outline-offset:2px; }
.order_status { width:fit-content; padding:4px 10px; background:var(--surface); border-radius:8px; }
:is(.assembly_status,.order_status).is_complete { color:var(--surface); background:var(--green_dark); }
.assembly_status.is_complete progress { accent-color:var(--mint); }
.assembly_status.is_complete progress::-webkit-progress-value { background:var(--mint); }
.selector_scene.is_packed .is_selected::before {
  content:'';
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  border-radius:inherit;
  background:linear-gradient(to right,transparent 71%,var(--green_dark) 71% 77%,transparent 77%),
    linear-gradient(to bottom,transparent 25%,var(--green_dark) 25% 31%,transparent 31%);
}
@media (prefers-reduced-motion:no-preference) {
  .selector_scene [tabindex] { transition:transform 150ms var(--ease); }
  .selector_scene .is_selected { transform:translateY(-3px); }
  .selector_scene.is_packed .is_selected::before { animation:wrap_order 240ms var(--ease); }
  @keyframes wrap_order { from { opacity:0; } to { opacity:1; } }
}
.selector_scene { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:24px; min-height:240px; padding:16px; }
.selector_scene > :not([data-item]),.selector_scene :is(.tray,.plate,.shelf,.box,.basket,.order,.counter,.gift_box,.small_box) { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:20px; padding:20px 16px; background:rgb(255 255 255 / .5); border-radius:18px; border-bottom:5px solid rgb(36 59 53 / .1); min-width:100px; min-height:110px; }
[data-item] { position:relative; background-image:url('../../public/assets/game-sprites.webp'); background-size:200% 200%; background-repeat:no-repeat; display:block; width:64px; height:64px; flex:0 0 64px; border-radius:10px; }
[data-item='cake'] { background-position:0 0; }
[data-item='cookie'] { background-position:100% 0; }
[data-item='coffee'] { background-position:0 100%; }
[data-item='macaron'] { background-position:100% 100%; }
.selector_scene .is_target { outline:2px dashed var(--green); outline-offset:6px; }
.selector_scene .is_selected { box-shadow:0 0 0 4px var(--green); }
.selector_scene [tabindex] { position:relative; cursor:help; }
.selector_scene [tabindex]:focus-visible:not(.is_target) { outline:none; }
.selector_scene [tabindex]:focus-visible::after { content:''; position:absolute; inset:2px; border:3px double var(--ink); border-radius:inherit; pointer-events:none; }
.source_view { margin:0 0 8px; padding:8px 10px 6px; border-radius:14px; background:var(--editor); color:var(--code); }
.source_view summary { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin-bottom:4px; font-size:12px; cursor:pointer; list-style:none; }
.source_view summary::-webkit-details-marker { display:none; }
.source_view summary::before { content:'▾'; color:var(--code_muted); }
.source_view:not([open]) summary { margin-bottom:0; }
.source_view:not([open]) summary::before { content:'▸'; }
.source_view summary:focus-visible { outline:2px solid var(--code_muted); outline-offset:2px; border-radius:4px; }
.source_view summary strong { font:700 12px var(--mono); }
.source_view summary span { color:var(--code_muted); font-size:11px; }
.source_view pre { position:relative; max-height:clamp(96px,22svh,210px); margin:0; overflow:auto; font:12px/1.7 var(--mono); }
.source_view pre:focus-visible { outline:2px solid var(--code_muted); outline-offset:2px; border-radius:6px; }
.source_line { display:block; padding:0 6px; border-radius:4px; white-space:pre; cursor:default; }
.source_line.is_selected { background:rgb(122 196 160 / .28); }
.source_line.is_inspected { background:rgb(255 255 255 / .14); box-shadow:inset 3px 0 0 var(--code); }
.source_line.is_selected.is_inspected { background:rgb(122 196 160 / .42); }
.selector_scene .is_inspected { outline:3px solid var(--ink); outline-offset:3px; }
.combo_tray.is_inspected { outline:3px solid var(--ink); outline-offset:-3px; }
.layout_stage { position:relative; height:240px; }
.layout_layer { position:absolute; inset:0; display:flex; align-items:flex-start; gap:8px; }
.layout_layer.is_target { pointer-events:none; }
.layout_layer.is_target [data-item] { opacity:.35; outline:2px dashed var(--green); outline-offset:2px; }
.layout_layer.is_actual [data-item] { box-shadow:0 2px 3px rgb(36 59 53 / .08); }
.combo_stage { display:grid; gap:20px; }
.combo_tray { background:rgb(255 255 255 / .5); border-radius:14px; padding:16px; }
.tray_label { margin-bottom:12px; font:12px var(--mono); color:var(--green); }
.editor_panel { background:var(--editor); color:var(--code); border-radius:20px; overflow:hidden; }
.editor_heading { padding:16px 20px; border-bottom:1px solid rgb(255 255 255 / .1); display:flex; align-items:center; justify-content:space-between; font:13px var(--mono); }
.editor_heading span { color:var(--code_muted); font-size:11px; }
.editor_body { display:flex; padding:20px 20px 12px; min-height:160px; }
.line_gutter { flex:none; overflow:clip; color:var(--code_muted); opacity:.65; user-select:none; font:14px/1.7 var(--mono); min-width:32px; text-align:right; padding-right:16px; }
.line_numbers { height:0; white-space:pre; }
.code_input { display:block; flex:1; min-width:0; resize:vertical; min-height:120px; max-height:480px; border:0; background:transparent; color:var(--code); font:14px/1.7 var(--mono); outline-offset:2px; padding:0 4px; tab-size:2; white-space:pre; overflow:auto; }
.code_input::placeholder { color:var(--code_muted); }
.code_input:focus-visible { outline:1px dashed var(--code_muted); }
.editor_actions { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:8px 20px 20px; }
.editor_reset { color:var(--code_muted); font-size:12px; }
.editor_reset:hover { color:var(--surface); }
.editor_submit { background:var(--mint); color:var(--green_dark); }
.editor_submit:hover:not(:disabled) { background:var(--surface); }
.feedback { border-radius:14px; padding:16px 20px; background:var(--surface); border:1px solid var(--line); font-size:14px; }
.feedback.is_success { background:var(--success_bg); border-color:var(--success); color:var(--success); }
.feedback.has_error { background:var(--error_bg); border-color:var(--error); color:var(--error); }
.feedback strong { display:block; margin-bottom:4px; }
.feedback .button { margin-top:16px; }
.checks { display:grid; gap:6px; list-style:none; padding:0; margin:12px 0 0; font-size:13px; }
.checks li::before { content:'○'; margin-right:8px; }
.checks li.is_passed::before { content:'✓'; }
@media(max-width:560px) { .editor_heading span { display:none; } }

.stage_game { --stage_edge:clamp(16px,2.6vw,52px); min-height:100svh; }
.stage_nav,.stage_nav_actions,.stage_nav .game_breadcrumb { display:flex; align-items:center; }
.stage_nav { min-height:64px; justify-content:space-between; flex-wrap:wrap; gap:4px 16px; padding:8px var(--stage_edge); border-bottom:1px solid var(--line); }
.stage_nav .game_breadcrumb { padding:0; gap:14px; }
.stage_nav .game_breadcrumb a { display:inline-flex; align-items:center; min-height:40px; }
.stage_nav .game_breadcrumb a:hover { text-decoration:underline; }
.stage_nav strong { padding-left:14px; border-left:1px solid var(--line); color:var(--green_dark); font-size:19px; }
.stage_nav_actions { gap:12px; font-size:13px; }
.stage_nav_actions label { font:700 12px var(--mono); white-space:nowrap; }
.stage_nav_actions select { width:min(22em,34vw); min-height:38px; padding:4px 8px; border-radius:8px; background:var(--surface); border:1px solid var(--line); color:var(--ink); }
.stage_layout { display:grid; grid-template-columns:minmax(340px,42%) minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto auto minmax(0,1fr); min-height:calc(100svh - 64px); }
.stage_brief,.stage_controls { min-width:0; padding-inline:var(--stage_edge); }
.stage_brief { grid-area:2 / 1; padding-top:24px; }
.stage_brief h1 { color:var(--green_dark); font-size:clamp(26px,2.8vw,48px); line-height:1.19; }
.stage_brief p { margin-top:10px; font-size:clamp(15px,1.15vw,19px); line-height:1.65; }
.stage_controls { grid-area:3 / 1; margin-block:18px 22px; }
.stage_controls .editor_panel { border-radius:var(--radius_sm); }
.stage_controls .editor_heading { align-items:baseline; flex-wrap:wrap; gap:4px 12px; padding:10px 14px; }
.stage_controls .editor_heading small { font:13px/1.5 system-ui,sans-serif; color:var(--code_muted); }
.stage_controls .editor_body { min-height:0; padding:12px 14px 4px; }
.stage_controls .code_input { min-height:132px; max-height:clamp(180px,40vh,420px); }
.stage_controls .editor_actions { justify-content:start; flex-wrap:wrap; gap:4px 8px; padding:8px 14px 10px; }
.stage_controls .editor_actions .button { min-height:40px; padding:7px 12px; font-size:13px; }
.stage_next { background:transparent; border:1px solid var(--code_muted); color:var(--code); }
.stage_next:disabled { opacity:.65; }
.stage_next:enabled:hover,.stage_next:focus-visible { background:var(--mint); color:var(--green_dark); }
.stage_next:focus-visible { outline:2px solid var(--mint); outline-offset:2px; }
.stage_controls .editor_reset { min-height:40px; margin-left:auto; }
.stage_controls .feedback { margin-top:10px; padding:10px 14px; font-size:13px; }
.stage_controls .feedback:empty { display:none; }
.stage_controls .feedback .button { margin-top:8px; }
.stage_help { display:flex; align-items:baseline; flex-wrap:wrap; gap:0 16px; margin-top:8px; font-size:13px; }
.stage_help .concept_box { margin:0; padding:0; border:0; }
.stage_help summary,.stage_help .text_button { cursor:pointer; padding-block:8px; font-weight:650; }
.stage_help details[open],.stage_help .hint_box { width:100%; }
.stage_help .requirements,.stage_help .concept_box p,.stage_help .hint_box { margin:4px 0 8px; }
.stage_progress { display:flex; align-items:center; gap:14px; border-top:1px solid var(--line); }
.stage_progress .text_button { flex:none; font-size:12px; color:var(--green); }
.stage_progress .level_dots { flex:auto; margin:0; gap:3px; }
.stage_arena { position:relative; isolation:isolate; grid-area:1 / 2 / -1; display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:0; padding:clamp(20px,3.3vw,64px); background:var(--theme); }
.stage_arena::before { content:''; z-index:-1; position:absolute; inset:0; opacity:.3; background:var(--stage_art) center / cover; }
.theme_html { --stage_art:url('../../public/assets/html-workshop.png'); }
.theme_selector { --stage_art:url('../../public/assets/selector-bakery.png'); }
.theme_combo { --stage_art:url('../../public/assets/combo-cafe.png'); }
.stage_arena > * { width:100%; max-width:1200px; }
.stage_arena .scene_panel { border-color:rgb(36 59 53 / .15); box-shadow:0 8px 24px rgb(36 59 53 / .1); }
.stage_arena .scene_heading { flex-wrap:wrap; padding:8px 12px 12px; }
.stage_arena .html_preview { height:clamp(270px,49svh,540px); border:1px solid var(--line); }
.stage_arena .game_scene { min-height:0; }
.stage_arena .selector_scene { min-height:clamp(160px,28svh,320px); }
.theme_combo .game_scene { container-type:inline-size; }
.combo_stage { position:relative; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:10px; padding:2px; overflow-x:auto; overscroll-behavior-inline:contain; scroll-snap-type:x mandatory; }
.combo_tray { min-width:0; scroll-snap-align:start; padding:12px; }
.combo_tray.is_target { background:var(--surface); border:1px dashed var(--green); }
.combo_tray.is_selected { box-shadow:inset 0 0 0 2px var(--green); }
.combo_tray .tray_label { overflow-wrap:anywhere; line-height:1.4; }
.combo_tray.is_target .tray_label::before { content:'목표 '; color:var(--green_dark); font-weight:750; }
.combo_tray.is_selected .tray_label::after { content:' · 선택'; font-weight:750; }
.tray_chooser { display:none; gap:5px; margin:0 0 8px; }
.tray_chooser button { min-height:36px; border:1px solid var(--line); border-radius:8px; padding:4px 10px; background:var(--surface); color:var(--ink); font-size:12px; }
.tray_chooser button[aria-pressed="true"] { color:var(--surface); background:var(--green_dark); }
@container (max-width:760px) {
  .combo_stage:has(> :nth-child(3)) { grid-auto-columns:100%; }
  .tray_chooser:has(> :nth-child(3)) { display:flex; }
}
@container (max-width:515px) {
  .combo_stage { grid-auto-columns:100%; }
  .tray_chooser { display:flex; }
}
@media(max-width:760px) {
  .stage_nav { flex-wrap:nowrap; min-height:42px; padding:4px 10px; gap:4px; }
  .stage_nav_actions { gap:8px; }
  .stage_nav_actions select { width:clamp(84px,27vw,170px); min-height:34px; }
  .stage_layout { display:flex; flex-direction:column; min-height:0; }
  .stage_brief { align-self:stretch; padding:8px var(--stage_edge); }
  .stage_brief h1 { font-size:22px; }
  .stage_brief p { margin-top:4px; font-size:14px; line-height:1.5; }
  .stage_arena { padding:6px var(--stage_edge); }
  .stage_arena .scene_heading { padding:2px 6px 6px; }
  .stage_arena .selector_scene { min-height:100px; gap:14px; padding:9px; }
  .stage_arena .selector_scene :is(.tray,.plate,.shelf,.box,.basket,.order,.counter,.gift_box,.small_box) { min-height:56px; min-width:54px; gap:12px; padding:10px; }
  .stage_arena .selector_scene [data-item] { width:45px; height:45px; flex-basis:45px; }
  .source_view { padding:6px 8px 4px; margin-bottom:4px; }
  .source_view pre { max-height:clamp(60px,11svh,96px); font-size:11px; line-height:1.6; }
  .source_view summary { margin-bottom:2px; }
  .source_view summary span { display:none; }
  .source_view:not([open]) { padding:3px 8px; margin-bottom:2px; }
  .source_view:not([open]) summary { line-height:1.4; }
  .stage_arena .html_preview { min-height:140px; height:clamp(140px,25svh,260px); }
  .html_goal_frame { max-height:150px; }
  .stage_arena .html_goal ~ .html_preview { height:clamp(140px,25svh,260px); }
  .stage_controls { margin:8px 0 16px; }
  .stage_controls .code_input { height:clamp(46px,9svh,80px); min-height:46px; max-height:22svh; }
  .theme_selector .stage_controls .code_input { height:42px; min-height:42px; }
  .stage_controls .editor_heading { padding:8px 12px; }
  .stage_controls .editor_body { padding:8px 12px 0; }
  .stage_arena .combo_tray .layout_stage { zoom:.75; }
  .stage_arena .game_scene { padding:8px; }
  .stage_arena .combo_tray { padding:8px; }
  .stage_arena .combo_tray .tray_label { margin-bottom:6px; }
  .stage_arena .tray_chooser { margin-bottom:4px; }
  .stage_arena .scene_heading { gap:2px 6px; }
  .stage_arena .scene_legend { gap:6px; }
}
@media(max-width:510px) {
  .stage_nav .game_breadcrumb { gap:6px; }
  .stage_nav strong { font-size:14px; padding-left:6px; }
  .stage_nav_actions { font-size:12px; gap:5px; }
  .stage_nav_actions label { font-size:11px; }
}
@media(max-width:440px) {
  .stage_nav_actions label { position:absolute; clip-path:inset(50%); width:1px; height:1px; overflow:hidden; }
}
@media(max-width:760px) and (max-height:690px) {
  .stage_controls .code_input { height:46px; }
  .stage_controls .editor_actions { padding-top:4px; }
}
