:root {
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: #10182b;
  background: #f4f6f9;
  --ink: #10182b;
  --blue: #2457d9;
  --muted: #46546c;
  --line: #dce3ef;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.top { border-bottom: 1px solid var(--line); background: #fff; }
.top > div, main { width: min(100%, 1220px); margin: auto; padding-inline: clamp(16px, 3.9vw, 32px); }
.top > div { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
a { color: inherit; }
.top a { text-decoration: none; font-size: 14px; }
.top .brand { font-weight: 780; }
.brand b { display: inline-block; color: #fff; background: var(--blue); border-radius: 8px; padding: 6px; }
main { padding-block: clamp(25px, 4.2vw, 50px); }
.intro { margin-bottom: 22px; }
h1 { margin: 0; font-size: clamp(29px, 5vw, 47px); letter-spacing: -.055em; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
p { line-height: 1.55; margin: 7px 0 0; color: var(--muted); }
button, .button { font: inherit; font-size: 14px; font-weight: 730; background: #fff; color: var(--ink); padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { border-color: var(--blue); }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
button[aria-pressed="true"] { color: #1e49aa; background: #eaf1ff; border-color: #c6d6fc; }
.primary { display: inline-block; color: #fff; background: var(--blue); border-color: var(--blue); }
.primary:hover { background: #1948c2; }
.locked { display: grid; grid-template-columns: minmax(138px, 245px) minmax(0, 1fr); gap: 25px; align-items: center; padding: clamp(17px, 3.9vw, 29px); background: #fff; border: 1px solid var(--line); border-radius: 17px; }
.locked .button, .locked button { margin-top: 15px; }
.mission { position: relative; aspect-ratio: 1.8; border-radius: 12px; background: #0d1b35; background-image: radial-gradient(#405677 1px, transparent 1px); background-size: 17px 17px; }
.mission span { position: absolute; }
.mission .player { width: 31px; height: 25px; top: 66%; left: 34%; background: #64e3cb; clip-path: polygon(50% 0%, 100% 95%, 50% 80%, 0% 95%); }
.mission .star { font-size: 26px; color: #facc60; top: 22%; left: 55%; }
.mission .rock { border-radius: 7px; background: #7c89a9; width: 21px; height: 21px; top: 61%; left: 71%; transform: rotate(23deg); }
.workbench { display: grid; grid-template-columns: minmax(310px, 1fr) minmax(0, 1.24fr); gap: 14px; }
.play-column, .learn-column { display: grid; align-content: start; gap: 12px; min-width: 0; }
.card { min-width: 0; padding: clamp(14px, 2vw, 20px); background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.screen-title,.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.screen-title { justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.game-frame { background: #0d1b35; border-radius: 12px; overflow: hidden; }
.game-frame iframe { display: block; width: 100%; height: 510px; border: 0; }
.hint { font-size: 14px; line-height: 1.55; }
blockquote { margin: 12px 0; padding: 10px 13px; border-left: 3px solid #6b91ee; color: #283b65; background: #eef4ff; font-size: 15px; line-height: 1.65; border-radius: 0 8px 8px 0; }
details { margin-top: 11px; }
summary { cursor: pointer; font-size: 14px; font-weight: 740; }
pre { max-height: 260px; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; color: #e7efff; background: #13213b; border-radius: 9px; padding: 11px 12px; font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; margin: 8px 0; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 12px 0; }
.fields label { min-width: 0; display: grid; gap: 4px; font-size: 14px; font-weight: 690; }
.fields input, .fields select { min-width: 0; width: 100%; padding: 8px 9px; border-radius: 7px; border: 1px solid var(--line); font: inherit; background: #f7f9fd; color: var(--ink); }
.export { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 12px; }
#prompt-status { display: block; margin-top: 5px; color: var(--muted); overflow-wrap: anywhere; }
#records-list { display: grid; gap: 5px; padding: 0; margin: 9px 0 0; list-style: none; }
#records-list li { display: flex; justify-content: space-between; font-size: 15px; background: #eef4ff; padding: 6px 10px; border-radius: 7px; }
@media(max-width:780px) {
  .workbench { grid-template-columns: minmax(0,1fr); }
  .game-frame iframe { height: clamp(374px, 82vw, 510px); }
}
@media(max-width:450px) {
  .locked { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .mission { aspect-ratio: 2.2; }
}
.roadmap { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.roadmap b { color: var(--ink); margin-right: 4px; }
.fields .wide { grid-column: 1 / -1; }
textarea { min-width: 0; width: 100%; display: block; resize: vertical; padding: 8px 9px; border-radius: 7px; border: 1px solid var(--line); font: inherit; background: #f7f9fd; color: var(--ink); }
textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
#rules-form { margin-top: 9px; }
#rules-input { margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
#rules-form .actions { margin-top: 10px; }
#code-status[data-error="true"], #design-status[data-error="true"] { color: #a32723; }
.game-empty { display: grid; align-content: center; gap: 4px; min-height: 210px; border-radius: 12px; padding: 22px; background: #eaf1ff; color: #1f3e73; }
@media(max-width:780px) {
  .game-empty { min-height: 140px; }
}
@supports (height: 1cqw) {
  .game-frame { container-type: inline-size; }
  .game-frame iframe { height: calc(48.9cqw + 150px); }
  @media(max-width:450px) {
    .game-frame iframe { height: calc(48.9cqw + 175px); }
  }
}
