:root {
  color-scheme: light;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --paper: #faf7ef;
  --white: #fffcf6;
  --ink: #32283f;
  --soft: #655b69;
  --rule: #d9d2cf;
  --berry: #ff765e;
  --lilac: #ded5fb;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; color: inherit; }
button, a, summary, input, select { -webkit-tap-highlight-color: transparent; }
button, select, summary { cursor: pointer; }
button { background: var(--white); }
button:disabled, select:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 3px solid #7550a9; outline-offset: 3px; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.shell { width: min(1200px, calc(100% - 72px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner { min-height: 70px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.brand { width: fit-content; display: inline-flex; gap: 0; align-items: center; text-decoration: none; font-family: "Archivo Black", "Arial Black", system-ui, sans-serif; font-weight: 1000; font-size: 1.82rem; font-style: italic; line-height: 1; letter-spacing: -.1em; }
.brand-dot { color: #ec604b; }
.brand-mark { position: relative; display: inline-block; width: 34px; height: 36px; background: var(--ink); clip-path: polygon(50% 0, 99% 23%, 99% 76%, 50% 100%, 1% 76%, 1% 23%); margin-inline-end: 9px; }
.brand-mark::before, .brand-mark::after, .brand-mark i { content: ""; position: absolute; inset: 0; }
.brand-mark::before { background: #ffb491; clip-path: polygon(50% 6%, 90% 24%, 50% 45%, 10% 24%); }
.brand-mark::after { background: #f57464; clip-path: polygon(7% 31%, 47% 52%, 47% 91%, 7% 72%); }
.brand-mark i { background: #ab97dc; clip-path: polygon(54% 52%, 93% 31%, 93% 72%, 54% 91%); }
.versions { display: inline-flex; padding: 3px; background: #eee9e1; border: 1px solid #dcd5d1; border-radius: 20px; }
.versions a { min-height: 32px; padding: 6px 14px; border-radius: inherit; font-weight: 720; font-size: .875rem; text-decoration: none; color: #6e6370; }
.versions [aria-current] { background: var(--ink); color: #fffaf2; }
#music { justify-self: end; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 20px; font-size: .875rem; font-weight: 650; }
.music-icon { display: flex; height: 15px; gap: 2px; align-items: center; }
.music-icon i { width: 2px; height: 7px; background: currentColor; border-radius: 2px; }
.music-icon i:nth-child(2) { height: 14px; }
.music-icon i:nth-child(3) { height: 10px; }
#music[aria-pressed="true"] { background: #e5f5ec; }
.intro { padding: 34px 0 24px; }
h1,h2,p { margin: 0; }
h1 { width: fit-content; display: flex; align-items: center; gap: .18em; font-size: clamp(2.3rem, 4.2vw, 3.7rem); font-weight: 900; letter-spacing: -.075em; line-height: 1.22; }
.heading-star { display: inline-block; color: #ef6e55; font-size: .63em; transform: translateY(-.11em) rotate(13deg); }
.intro p { margin-top: 6px; color: var(--soft); font-size: 1rem; line-height: 1.55; word-break: keep-all; }
.layout { display: grid; grid-template-columns: minmax(0,1.66fr) minmax(338px,1fr); gap: 22px; align-items: start; }
.play-column, .atelier { min-width: 0; }
.game-panel, .atelier { border: 1.5px solid var(--ink); border-radius: 23px; background: var(--white); box-shadow: 0 4px 0 -1px #3a2f43; }
.game-panel { overflow: hidden; }
.game-stage { position: relative; height: clamp(365px,37.5vw,500px); overflow: hidden; isolation: isolate; background-color: #ddd6f6; background-image: radial-gradient(#5d50762f .85px, transparent .95px), radial-gradient(ellipse at 50% 38%,#f1eafa 0,transparent 65%), linear-gradient(155deg,#ddd0f3,#e9e1f7 55%,#c8bfed); background-size: 9px 9px,100% 100%,100% 100%; }
.stage-tools { position: absolute; z-index: 2; inset: 18px 18px auto; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.metrics { display: inline-flex; align-items: center; background: #fffcf6eF; border: 1px solid #65596d; border-radius: 11px; box-shadow: 0 2px 0 #584b6433; padding: 6px 0; }
.metrics div { display: flex; gap: 6px; align-items: baseline; padding-inline: 11px; }
.metrics div + div { border-left: 1px solid #c8bfc9; }
.metrics span { font-size: .82rem; color: #625665; font-weight: 600; }
.metrics strong { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .98rem; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; }
#orient { pointer-events: auto; width: 39px; height: 39px; display: grid; place-content: center; border: 1px solid #65596d; border-radius: 50%; background: #fffcf6ef; }
#orient span { font-family: system-ui,sans-serif; font-size: 1.45rem; line-height: 1; }
.field-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.orbit { position: absolute; width: 70%; height: 34%; border: 1px solid #9887b348; bottom: 13%; left: 16%; border-radius: 50%; transform: rotate(-12deg); }
.doodle-star { position: absolute; width: 24px; height: 35px; background: #7b659b; clip-path: polygon(50% 0,62% 37%,100% 48%,63% 57%,50% 100%,38% 58%,0 49%,37% 38%); }
.doodle-star.a { left: 13%; top: 33%; transform: rotate(13deg); color: #857097; }
.doodle-star.b { left: 17%; top: 31%; width: 9px; height: 12px; background: #9e8ab9; }
.doodle-star.c { right: 11%; bottom: 25%; width: 19px; height: 24px; background: #9b87b8; transform: rotate(-18deg); }
.doodle-star.d { right: 17%; top: 18%; width: 10px; height: 13px; background: #917da9; }
.cube-shadow { position: absolute; left: 27%; top: 76%; width: 46%; height: 9%; border-radius: 50%; background: #72568459; filter: blur(15px); }
#cube { position: absolute; inset: 38px 0 35px; width: 100%; height: calc(100% - 73px); touch-action: none; cursor: grab; }
#cube:active { cursor: grabbing; }
#cube.complete { filter: drop-shadow(0 0 10px #ffeb9d); }
.hint { position: absolute; bottom: 13px; left: 50%; transform: translateX(-50%); color: #4c405d; white-space: nowrap; font-size: .85rem; font-weight: 550; pointer-events: none; }
.hint span { padding-inline: 4px; }
.round-settings { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; padding: 12px 17px; border-top: 1.5px solid var(--ink); background: #f8f2e9; }
.difficulty-control { display: flex; align-items: center; gap: 8px; }
.difficulty-control label { font-size: .875rem; font-weight: 680; }
.difficulty-control select { min-width: 81px; min-height: 42px; }
.round-record { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 8px; }
.round-record span { font-size: .875rem; }
.round-record strong { font: 750 1.05rem/1.2 "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.round-record small { grid-column: 1 / -1; margin-top: 2px; font-size: .78rem; color: var(--soft); }
.play-actions { display: flex; gap: 9px; padding: 13px 17px; border-top: 1px solid var(--rule); }
#session-note { padding: 0 17px 12px; color: var(--soft); font-size: .82rem; line-height: 1.4; }
#session-note:empty { display: none; }
.primary, .quiet, .dark { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 8px 17px; border: 1.5px solid var(--ink); border-radius: 11px; color: var(--ink); font-weight: 750; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.primary { background: var(--berry); box-shadow: 0 2px 0 var(--ink); }
.quiet { background: var(--white); }
.dark { background: var(--ink); color: var(--white); }
button:enabled:active, a.primary:active { transform: translateY(1px); }
button:enabled:hover, a.primary:hover { filter: brightness(.975); }
.act-icon { font: 800 1.36rem/1 system-ui,sans-serif; }
.share-trigger { margin-left: auto; background: #ede7fb; }
.camera-icon { position: relative; display: inline-block; width: 19px; height: 13px; border: 1.6px solid currentColor; border-radius: 3px; }
.camera-icon::before { content: ""; position: absolute; top: -4px; left: 4px; width: 8px; height: 3px; background: currentColor; border-radius: 2px 2px 0 0; }
.camera-icon::after { content: ""; position: absolute; inset: 2px auto auto 5px; width: 5px; height: 5px; border: 1.5px solid currentColor; border-radius: 50%; }
.assist { margin-top: 19px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #c6beb8; border-radius: 17px; background: #f6efde; }
.assist-info { display: flex; align-items: center; gap: 11px; }
.assist-icon { display: grid; place-content: center; min-width: 35px; height: 37px; border-radius: 11px; color: var(--ink); background: #ffdc82; border: 1px solid #9a8460; font-size: 1.5rem; }
h2 { font-size: 1.24rem; line-height: 1.3; letter-spacing: -.045em; }
.assist h2 { font-size: 1rem; }
#assist-note { font-size: .82rem; line-height: 1.45; color: var(--soft); margin-top: 2px; word-break: keep-all; }
.assist-actions { display: flex; gap: 7px; align-items: center; }
.assist .dark { min-height: 40px; padding-inline: 12px; font-size: .875rem; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; top: calc(50% - 5px); right: 10px; width: 5px; height: 5px; border: solid var(--ink); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
select { appearance: none; min-height: 40px; min-width: 73px; padding: 7px 24px 7px 10px; border: 1px solid #9f928e; background: var(--white); border-radius: 9px; font-weight: 650; }
.atelier { padding: 21px; }
.atelier-head { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding-bottom: 15px; border-bottom: 1px solid var(--rule); }
.atelier-head h2 { font-size: 1.42rem; }
.palette-icon { position: relative; display: inline-block; width: 31px; height: 31px; border: 1.5px solid var(--ink); border-radius: 10px; background: #ffdb86; transform: rotate(-6deg); }
.palette-icon i { position: absolute; width: 7px; height: 19px; border: 1.4px solid var(--ink); border-radius: 2px 2px 1px 1px; background: linear-gradient(0deg,var(--ink) 13%,#fff4dc 15% 31%,#ff8e71 34% 84%,#efd8ed 85%); transform: rotate(39deg); top: 5px; left: 11px; }
#studio { display: grid; gap: 15px; }
.studio-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.studio-label, .studio-field > label:not(.upload-button,.color-choice) { display: block; margin: 0 0 8px; padding: 0; font-size: .94rem; font-weight: 750; }
.character-list, .palette-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.character-choice, .palette-choice { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 7px 3px; border: 1px solid var(--rule); border-radius: 11px; background: #faf7f1; font-size: .875rem; font-weight: 650; }
.character-choice { min-height: 81px; }
.character-choice:nth-child(1) { background: #fae6ef; }
.character-choice:nth-child(2) { background: #e3f1e6; }
.character-choice:nth-child(3) { background: #e7eafa; }
.character-choice canvas { width: 51px; height: 51px; object-fit: contain; }
.character-choice[aria-pressed="true"], .palette-choice[aria-pressed="true"] { outline: 1px solid var(--ink); outline-offset: -1px; border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.character-choice[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 16px; height: 16px; font-size: 11px; color: #fff; background: var(--ink); border-radius: 100%; }
.palette-choice { background: var(--white); min-height: 54px; font-size: .82rem; }
.palette-chips { display: flex; align-items: center; padding-inline: 3px; }
.palette-chips i { display: inline-block; width: clamp(10px,1.1vw,14px); height: clamp(10px,1.1vw,14px); border-radius: 50%; border: 1px solid #6458694d; margin-left: -1px; }
.color-details { border-block: 1px solid var(--rule); padding-block: 4px; }
.color-details summary.studio-label { position: relative; padding: 9px 26px 9px 0; margin: 0; cursor: pointer; }
.color-details summary::-webkit-details-marker { display: none; }
.color-details summary::after { content: ""; position: absolute; top: calc(50% - 6px); right: 6px; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.color-details[open] summary::after { top: calc(50% - 2px); transform: rotate(225deg); }
.color-details[open] .color-list { margin-bottom: 8px; }
.color-list { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px; }
.color-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 0; cursor: pointer; font-size: .81rem; color: var(--soft); }
.color-choice input[type="color"] { appearance: none; width: 100%; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.color-choice input::-webkit-color-swatch-wrapper { padding: 0; }
.color-choice input::-webkit-color-swatch { border: 1px solid #796d7b; border-radius: 8px; }
.color-choice input::-moz-color-swatch { border: 1px solid #796d7b; border-radius: 8px; }
.upload-row { display: flex; flex-wrap: wrap; gap: 7px; }
.upload-button, #custom-choose { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px dashed #9a8aa4; border-radius: 10px; padding: 8px 13px; background: #f6f1fa; font-size: .875rem; font-weight: 650; cursor: pointer; }
.upload-button { flex: 1; }
.upload-button::before { content: "+"; display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid currentColor; border-radius: 4px; font: 700 15px/1 system-ui,sans-serif; }
#custom-choose[aria-pressed="true"] { background: #e4d9f4; border: 1.5px solid var(--ink); }
.upload-note { color: var(--soft); font-size: .81rem; line-height: 1.5; }
.upload-note:not(:empty) { margin-top: 6px; }
.below { display: flex; justify-content: space-between; gap: 12px; margin: 19px 0 30px; font-size: .875rem; color: var(--soft); }
.below details { max-width: 66ch; }
.below details p { padding-top: 8px; line-height: 1.5; }
#status { font-weight: 650; }
dialog { width: min(420px,calc(100% - 28px)); max-height: 92svh; overflow: auto; background: var(--white); color: var(--ink); padding: 23px; border: 1.5px solid var(--ink); border-radius: 20px; box-shadow: 0 5px 0 var(--ink), 0 15px 60px #30233e55; }
dialog::backdrop { background: #30243c88; }
dialog p { color: var(--soft); font-size: .94rem; line-height: 1.55; margin: 10px 0; word-break: keep-all; }
[hidden] { display: none !important; }
.cube-shop { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--rule); }
.cube-shop p { margin: 0; font-size: .875rem; }
.cube-shop a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.share-close { border: 1px solid var(--rule); border-radius: 50%; min-width: 36px; min-height: 36px; }
#result-record { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-top: 9px; padding: 9px 12px; border-radius: 10px; background: #eee7fa; color: #473157; }
#result-record .record-caption { font-size: .85rem; font-weight: 700; }
#result-record .record-clock { font: 750 1rem ui-monospace, monospace; font-variant-numeric: tabular-nums; }
#result-record .record-comparison, #result-record .record-target { flex-basis: 100%; margin: 0; color: #52445f; font-size: .83rem; }
#share-dialog[data-photo-view] #result-record { display: none; }
.share-preview { -webkit-touch-callout: default; touch-action: auto; display: block; width: 100%; max-height: 44svh; margin: 12px auto; object-fit: contain; border-radius: 10px; }
#share-dialog[data-photo-view] { width: min(760px,calc(100% - 12px)); padding: 10px; }
#share-dialog[data-photo-view] .share-preview { max-height: 65svh; height: auto; margin: 7px auto; }
#view-shot { min-height: 44px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-actions a,.share-actions button { flex: 1; }
.share-status { margin: 8px 0 0; font-size: .83rem; }
@media (max-width: 1100px) {
  .shell { width: calc(100% - 48px); }
  .layout { grid-template-columns: minmax(0,1.48fr) minmax(314px,1fr); gap: 17px; }
  .atelier { padding: 16px; }
  .assist { flex-wrap: wrap; }
}
@media (max-width: 780px) {
  .shell { width: calc(100% - 30px); max-width: 620px; }
  .header-inner { min-height: 61px; }
  .layout { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .intro { padding: 24px 0 17px; }
  .game-stage { height: clamp(318px,86vw,478px); }
  .atelier { padding: 20px; }
  .play-column { display: contents; }
  .game-panel { order: 1; }
  .atelier { order: 3; }
  .assist { order: 2; margin-top: 0; }
  .palette-chips i { width: 14px; height: 14px; }
}
@media (max-width: 520px) {
  .header-inner { gap: 6px; }
  .brand { font-size: 1.34rem; }
  .brand-mark { width: 23px; height: 25px; margin-inline-end: 5px; }
  .versions { padding: 2px; }
  .versions a { min-height: 30px; padding: 6px 8px; font-size: .76rem; }
  #music { min-height: 35px; padding: 5px 8px; gap: 5px; font-size: .78rem; }
  .intro p { font-size: .91rem; }
  .game-panel,.atelier { border-radius: 17px; }
  .stage-tools { inset: 12px 12px auto; }
  .round-settings { padding: 10px 12px; gap: 8px; }
  .difficulty-control { display: grid; gap: 4px; }
  .difficulty-control select { min-width: 92px; }
  .round-record { text-align: right; }
  .play-actions { gap: 6px; padding: 10px; }
  #session-note { padding: 0 12px 10px; }
  .play-actions button { flex: 1; padding: 7px 4px; min-height: 42px; gap: 5px; font-size: .85rem; }
  .hint { font-size: .77rem; }
  .atelier { padding: 15px; }
  .assist { padding: 13px; }
  .assist-actions { flex: 1; justify-content: flex-end; }
  .below { flex-wrap: wrap; }
}
@media (max-width: 345px) {
  .shell { width: calc(100% - 20px); }
  .brand-mark { display: none; }
  .versions a { padding-inline: 6px; }
  .palette-chips i { width: 11px; height: 11px; }
  .share-trigger .camera-icon { display: none; }
}

/* Playfield controls */
.clock-ending { color: #a92e20; background: #ffe7cf; border-radius: 4px; box-shadow: 0 0 0 2px #ffe7cf; }
.view-stack { display: grid; gap: 6px; justify-items: end; }
#immersive-sound:empty { display: none; }
#immersive-sound { pointer-events: auto; }
#immersive-sound #music { min-height: 40px; border-color: #837589; box-shadow: 0 2px 0 #584b642b; }
.view-tools { display: flex; align-items: center; gap: 6px; pointer-events: auto; }
#fullscreen {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 7px 12px;
  border: 1px solid #65596d; border-radius: 12px; background: #fffcf6f5; box-shadow: 0 2px 0 #584b6433;
  font-size: .87rem; font-weight: 750; line-height: 1.2;
}
.view-icon {
  width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 2px;
  clip-path: polygon(0 0,40% 0,40% 30%,60% 30%,60% 0,100% 0,100% 40%,70% 40%,70% 60%,100% 60%,100% 100%,60% 100%,60% 70%,40% 70%,40% 100%,0 100%,0 60%,30% 60%,30% 40%,0 40%);
}
#fullscreen[aria-pressed="true"] { background: var(--ink); color: var(--white); }
#orient { width: 42px; height: 42px; }
.game-messages p { font-weight: 650; font-size: .88rem; }
.game-messages p:not(:empty) { padding: 9px 16px; background: #ede5fa; border-top: 1px solid #c7bada; }
.game-messages #challenge-note:not(:empty) { background: #e4f3e8; border-color: #b4d3be; }
.next-round { display: flex; align-items: end; gap: 9px; }
.next-round .difficulty-control { display: grid; gap: 4px; }
.difficulty-control select, .play-actions button { min-height: 44px; }
.play-actions { flex-wrap: wrap; }
.play-actions button { padding-inline: 12px; }
.challenge-trigger { background: #e4f3e8; }
.challenge-trigger span { font-size: 1.1em; }
#retry { background: #ffebbf; }
#challenge-copy {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px;
  background: #edf5ef; border-block: 1px solid #bdd4c2;
}
#challenge-copy label { display: block; flex-basis: 100%; font-size: .875rem; font-weight: 700; }
#challenge-copy input { min-width: 0; flex: 1 1 14ch; max-width: 100%; min-height: 44px; padding: 7px 10px; border: 1px solid #a7bbaa; background: var(--white); border-radius: 8px; font-size: 1rem; }
#challenge-copy button { min-height: 44px; }
.challenge-choices { display: flex; flex-wrap: wrap; gap: 7px; flex: 1 0 100%; }
.challenge-choices > button { flex: 1; min-height: 44px; white-space: normal; }
.challenge-choices #share-seed { background: #fef1ce; }
.challenge-choices #share-relay { background: #e5dcfa; }
.challenge-trigger[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--ink); }
#challenge-copy .challenge-note { width: 100%; color: var(--soft); font-size: .85rem; }
#challenge-copy:not([hidden]) + #session-note { padding-top: 8px; }
@media (max-width:520px) {
  .stage-tools { align-items: center; }
  .metrics div { display: grid; gap: 1px; padding-inline: 9px; }
  .metrics span { line-height: 1.15; }
  .metrics strong { line-height: 1.05; }
  .round-settings { align-items: end; }
  .difficulty-control select { min-width: 78px; }
  .round-record { flex: 1 0 100%; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; text-align: left; }
  .round-record small { margin: 0; }
  .play-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .play-actions button { width: 100%; min-height: 44px; margin: 0; }
  .play-actions #retry:not([hidden]) { grid-column: 1/-1; }
  #challenge-copy input { flex-basis: 100%; }
}
@media (max-width:345px) {
  #fullscreen { padding-inline: 8px; }
  .view-tools { gap: 3px; }
}

/* The same canvas remains interactive in both native and embedded fullscreen. */
html.cubix-immersive, .cubix-immersive body { overflow: hidden; overscroll-behavior: none; background: #ded6f5; }
.cubix-immersive .site-header, .cubix-immersive .intro, .cubix-immersive .atelier,
.cubix-immersive .assist, .cubix-immersive .below, .cubix-immersive .round-settings,
.cubix-immersive #session-note, .cubix-immersive .hint { display: none; }
.cubix-immersive .game-panel {
  position: fixed; inset: 0; z-index: 10; isolation: isolate; width: 100%; height: 100%;
  height: 100dvh; max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none;
  display: flex; flex-direction: column; align-items: center; justify-content: end;
  gap: 7px; padding: max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right))
    max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
  pointer-events: none;
}
.cubix-immersive .game-stage, .cubix-immersive #cube { position: absolute; inset: 0; width: 100%; height: 100%; }
.cubix-immersive .game-stage { z-index: -1; pointer-events: auto; }
.cubix-immersive .stage-tools {
  inset: max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) auto max(12px,env(safe-area-inset-left));
  align-items: start;
}
.cubix-immersive .play-actions, .cubix-immersive #challenge-copy, .cubix-immersive .game-messages {
  position: relative; pointer-events: auto; max-width: 100%; border: 1px solid #65596d;
  border-radius: 14px; box-shadow: 0 2px 0 #59446b45; background: #fffcf9f5;
}
.cubix-immersive .play-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 5px; }
.cubix-immersive .play-actions button { width: auto; flex: 0 1 auto; margin: 0; min-height: 41px; padding: 6px 10px; }
.cubix-immersive #challenge-copy { order: -1; max-width: min(100%,510px); max-height: 42dvh; overflow: auto; }
.cubix-immersive .game-messages { border: 0; box-shadow: none; background: transparent; text-align: center; }
.cubix-immersive .game-messages p:not(:empty) { border: 1px solid #baafc5; border-radius: 12px; padding: 6px 12px; margin-top: 3px; }
.cubix-immersive .game-messages p:empty { display: none; }
.cubix-immersive .game-messages:has(p:empty + p:empty) { display: none; }
.cubix-immersive .orbit { width: 70%; left: 15%; bottom: 14%; }
@media (max-width:560px) {
  .cubix-immersive .play-actions button { font-size: .85rem; padding: 5px 8px; }
  .cubix-immersive .play-actions .act-icon, .cubix-immersive .play-actions .camera-icon,
  .cubix-immersive .challenge-trigger > span { display: none; }
}
@media (max-height:450px) and (orientation:landscape) {
  .cubix-immersive .game-panel { gap: 3px; padding-bottom: max(5px,env(safe-area-inset-bottom)); }
  .cubix-immersive .stage-tools { top: max(6px,env(safe-area-inset-top)); }
  .cubix-immersive .play-actions button { min-height: 36px; }
  .cubix-immersive .game-messages p:not(:empty) { padding-block: 3px; }
}

/* The daily puzzle sits alongside the title on desktop and above the board on mobile. */
.intro { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
#daily-panel {
  display: grid; flex: 0 1 auto; grid-template-columns: minmax(0,1fr) auto; column-gap: 18px;
  border: 1.5px solid #657964; border-radius: 17px; background: #edf5e6;
  min-width: 305px; padding: 13px 15px; box-shadow: 0 2px 0 #65796440;
}
.daily-summary { display: flex; align-items: center; gap: 9px; }
.daily-summary h2 { color: #2c4433; font-size: 1.12rem; letter-spacing: -.045em; }
.daily-calendar { position: relative; display: grid; flex: none; place-items: center; width: 29px; height: 30px; border: 1.7px solid #3e5445; border-radius: 5px; background: linear-gradient(#aed3b3 0 7px,#fffaf0 7px); transform: rotate(-6deg); }
.daily-calendar::before { content: ""; position: absolute; top: -4px; left: 5px; width: 3px; height: 7px; border-radius: 3px; background: #3e5445; box-shadow: 13px 0 #3e5445; }
.daily-calendar i { width: 3px; height: 3px; background: #536c57; box-shadow: 6px 0 #536c57, 0 6px #536c57, 6px 6px #536c57; margin: 0 6px 0 0; }
#daily-panel[data-completed] .daily-calendar i { background: transparent; box-shadow: none; margin: 0; width: 11px; height: 6px; margin-top: 3px; border: solid #3e5445; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.daily-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 6px; font-size: .82rem; line-height: 1.45; color: #475847; }
#daily-panel .daily-rule { grid-column: 1 / -1; margin: 6px 0 0; font-size: .82rem; line-height: 1.4; color: #475847; }
#daily-panel .daily-best { margin: 7px 0 0; color: #475847; font-size: .82rem; line-height: 1.3; }
.daily-best strong { margin-inline-start: 3px; color: #2b4033; font-variant-numeric: tabular-nums; }
.daily-actions { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 6px; }
.daily-actions button { min-height: 44px; border-radius: 10px; padding: 7px 12px; font-size: .875rem; }
.daily-actions .dark { background: #354f3c; border-color: #354f3c; }
.daily-actions .quiet { background: #fffdf6; border-color: #839583; }
#daily-notice:empty { display: none; }
#daily-panel #daily-notice { grid-column: 1 / -1; margin: 9px 0 0; padding-top: 7px; border-top: 1px solid #c7d7c4; color: #475847; font-size: .82rem; line-height: 1.5; }
@media (max-width:830px) {
  .intro { display: grid; gap: 15px; }
  #daily-panel { min-width: 0; width: 100%; }
  .daily-actions { flex-direction: row; align-items: center; }
}
@media (max-width:520px) {
  .intro { gap: 12px; }
  #daily-panel { gap: 0 7px; border-radius: 14px; padding: 10px 12px; }
  .daily-actions { flex-direction: column; align-items: stretch; }
  .daily-actions button { padding-inline: 10px; }
  #daily-panel .daily-best { margin-top: 4px; }
}

/* A single hint control follows the board into fullscreen. */
#hint-panel {
  display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px 13px;
  padding: 10px 16px; border-top: 1px solid #cdb780; background: #fff4d6;
}
#hint {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  min-height: 44px; min-width: 105px; padding: 7px 10px; border: 1.5px solid #756442;
  border-radius: 11px; background: #ffe09a; box-shadow: 0 2px 0 #75644269;
  color: #3e3022; font-size: .92rem; line-height: 1.25; font-weight: 750; white-space: nowrap;
}
.hint-balance { display: inline-flex; align-items: baseline; gap: 1px; padding: 3px 5px; border-radius: 6px; background: #fff8df; font-size: .78rem; }
#hint-count { font-variant-numeric: tabular-nums; }
.hint-guidance { min-width: 0; }
#hint-direction { font-size: .92rem; font-weight: 700; line-height: 1.45; color: #3e3022; }
#hint-score-note { color: #685837; font-size: .83rem; line-height: 1.45; }
#hint-direction:not(:empty) + #hint-score-note:not(:empty) { margin-top: 3px; }
#hint-grant-area {
  grid-column: 1/-1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 10px; padding-top: 6px; border-top: 1px dashed #c1a76c;
}
#hint-refill { min-height: 44px; border-color: #97825a; background: #fffdf4; font-size: .88rem; }
.hint-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.hint-dialog-actions button { min-height: 44px; }
@media (max-width:520px) {
  #hint-panel { padding: 9px 11px; gap: 7px 9px; }
  #hint { padding-inline: 7px; min-width: 95px; }
  .hint-dialog-actions { display: grid; }
}
.cubix-immersive #hint-panel {
  position: relative; z-index: 1; max-width: min(100%,620px); max-height: 32dvh; overflow: auto;
  pointer-events: auto; overscroll-behavior: contain; border: 1px solid #97825a; border-radius: 14px;
  background: #fff4d6f7; box-shadow: 0 2px 0 #59446b3b;
}
.cubix-immersive .game-panel:has(#challenge-copy:not([hidden])) #hint-panel { display: none; }
@media (max-height:480px) and (orientation:landscape) and (min-width:620px) {
  .cubix-immersive #hint-panel {
    position: absolute; left: max(8px,env(safe-area-inset-left)); bottom: max(66px,env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: start; gap: 4px; padding: 7px;
    width: clamp(135px,calc((100vw - 80vh) / 2 - 32px),220px); max-height: 51dvh;
  }
}
/* Keep the empty-balance action and its counter on one line over a small playfield. */
@media (max-width:600px) {
  .cubix-immersive #hint-panel:has(#hint-grant-area:not([hidden])) {
    grid-template-columns: auto auto; justify-content: center; gap: 4px 9px;
  }
  .cubix-immersive #hint-panel:has(#hint-grant-area:not([hidden])) .hint-guidance {
    grid-row: 2; grid-column: 1/-1; text-align: center;
  }
  .cubix-immersive #hint-grant-area {
    grid-row: 1; grid-column: 2; border: 0; padding: 0;
  }
}
