body { min-width: 320px; }
.player-topbar { min-height: 68px; display: flex; align-items: center; gap: 16px; padding: 10px max(20px,calc((100vw - 1320px)/2)); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 22px; letter-spacing: -.055em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50%; font: 21px Georgia,serif; transform: rotate(-6deg); }
#loginButton,.account-menu { margin-left: auto; }
.player-main { width: min(1320px,calc(100% - 40px)); margin: 0 auto; padding: 28px 0 32px; }
.player-heading { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 22px; }
.eyebrow { color: var(--green); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 800; margin: 0 0 8px; }
h1 { font: 500 clamp(29px,3vw,40px)/1.1 Georgia,serif; letter-spacing: -.035em; margin: 0; }
#taskRule { max-width: 560px; font-size: 13px; line-height: 1.55; color: #59665b; margin: 0; padding-left: 16px; border-left: 3px solid var(--yellow); }
.playground { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(380px,.85fr); gap: 18px; align-items: stretch; }
.game-panel { border: 1px solid var(--line); border-radius: var(--radius-panel); overflow: hidden; display: flex; flex-direction: column; min-width: 0; background: #e5eee3; }
.game-scene { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: center; padding: 25px 24px; min-height: 450px; flex: 1; }
.game-scene svg.world-svg { width: 100%; height: 370px; overflow: visible; }
.scene-toolbar { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: #fffaf2; border-top: 1px solid #dae0d0; color: #54614f; font-size: 12px; }
.speed-selector { display: flex; gap: 2px; }
.speed-selector .is-active { background: var(--green); color: white; }
.player-editor { border-radius: var(--radius-panel); overflow: hidden; min-width: 0; display: grid; grid-template-rows: 50px minmax(340px,1fr) auto 68px; }
.player-editor .editor-content { min-height: 340px; max-height: 540px; overflow: auto; padding: 16px; }
.player-editor .editor-tools { display: flex; gap: 3px; }
.player-editor .editor-tools .control { color: var(--editor-muted); }
.execution-context { margin-left: auto; color: var(--yellow); font-size: 11px; font-weight: 650; }
.player-editor .rows { gap: 7px; }
.player-editor .repeat-block { margin: 9px 0; }
.player-editor .loop-header { flex-wrap: wrap; }
.player-editor .loop-title { flex: 0 0 auto; white-space: nowrap; }
.player-editor .stepper { flex: 0 0 auto; }
.player-editor .times-label { white-space: nowrap; }
.block-tools { display: flex; gap: 1px; margin-left: auto; }
.block-tools .control { min-height: 32px; min-width: 27px; width: 27px; padding: 3px; color: var(--editor-muted); }
.block-tools .icon { width: 16px; height: 16px; flex-basis: 16px; }
.block-actions { display: flex; justify-content: end; padding: 3px 0 8px; }
.block-actions .block-tools { margin: 0; }
.condition-select { max-width: 100%; min-width: 0; min-height: 36px; color: var(--editor-text); background: #2c3e31; border: 1px solid #ffffff26; border-radius: var(--radius); font-family: inherit; font-size: 11px; font-weight: 600; padding: 4px 8px; }
.condition-select:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.conditional { border-left-color: #8ab7d1; }
.branch-label { font-size: 10px; color: var(--editor-muted); padding: 8px 2px; }
.node-selected { scroll-margin: 30px; }
.repeat-block.is-error { border-left-color: var(--red); }
.repeat-block.is-current > .loop-header { color: var(--yellow); }
.insert-menu { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 12px; }
.insert-menu .control { font-size: 11px; min-height: 38px; color: var(--editor-text); border-color: #ffffff24; }
.insert-menu .loop-option { color: var(--yellow); }
.insert-target { margin: 6px 0; }
.nested-list { min-width: 0; }
.root-empty { color: var(--editor-muted); line-height: 1.5; font-size: 12px; margin: 5px 0 14px; }
.iteration { margin-left: 5px; }
.player-editor .feedback { min-height: 49px; }
.player-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 16px; color: var(--muted); font-size: 11px; }
.archive-link { color: var(--muted); margin-left: auto; padding-block: 12px; }
.task-status { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 11px; }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 12px; margin: 20px 0 36px; }
.archive-grid a { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--ink); text-decoration: none; }
.archive-grid a:hover { background: #e3ebdb; }
.archive-grid strong,.archive-grid small { display: block; }
.archive-grid small { margin-top: 6px; color: var(--muted); }
.hint-dialog { width: min(620px,calc(100% - 28px)); }
.hint-dialog p { font-size: 14px; line-height: 1.6; }
.hint-loop,.hint-condition { background: var(--editor); color: var(--editor-text); border-radius: var(--radius); border-left: 3px solid var(--yellow); padding: 14px; margin: 10px 0; }
.hint-loop .hint-loop { background: #314639; }
.hint-loop strong,.hint-condition strong { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.hint-condition { background: #314639; border-left-color: #8ab7d1; }
.hint-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 13px; }
.hint-sequence { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hint-piece small { color: var(--muted); }
.hint-piece div { display: flex; gap: 8px; margin-top: 8px; color: var(--green); }
.hint-dialog .control { min-height: 44px; }
#nextTask { text-decoration: none; color: var(--green); }
[hidden] { display: none !important; }
.task-dialog { width: min(720px,calc(100% - 28px)); max-height: 85dvh; border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 20px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #17211c88; }
.task-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 15px; }
.task-dialog h2 { margin: 0; font: 28px Georgia,serif; }
#taskList { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
#taskList a { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; min-width: 0; }
#taskList a:hover { background: #e4e9db; }
#taskList a[aria-current="page"] { border-color: var(--green); background: #e3ebdb; }
#taskList .task-number { color: var(--green); font: 700 12px ui-monospace,SFMono-Regular,Menlo,monospace; padding-top: 2px; }
#taskList strong { display: block; font-size: 12px; }
#taskList small { display: block; font-size: 10px; margin-top: 4px; color: var(--muted); }
.guest-button { margin-top: 9px; background: transparent !important; color: var(--green) !important; box-shadow: none !important; }
.scene-label { text-align: center; font-size: 11px; color: #687d62; margin: 0 0 9px; }
.lamp-pattern { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lamp-pattern .lamp { width: 26px; height: 26px; border-radius: 50%; background: #a3bfa0; border: 4px solid #f5f4e6; box-shadow: 0 2px #859b7c; transition: background-color .25s,opacity .25s; }
.lamp.red { background: #e48d73; }.lamp.blue { background: #70a9c4; }.lamp.empty { background: #cad5c1; opacity: .6; }
.lamp-pattern.output { margin-top: 26px; }
.world-object { transition: transform var(--world-duration,360ms) var(--ease); }
.world-mark { transition: opacity var(--world-duration,360ms) var(--ease),fill var(--world-duration,360ms) var(--ease); }
.game-scene.no-motion .world-object,.game-scene.no-motion .world-mark { transition: none; }
.dance-model { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.dance-beat { width: 31px; height: 31px; display: grid; place-items: center; color: #6e8c65; border-radius: 6px; background: #f5f3e4; transition: color .2s,background-color .2s; }
.dance-beat.done { color: white; background: var(--green); }
.dance-pose { text-align: center; color: var(--green); font-weight: 650; font-size: 13px; margin-top: -10px; }
.scene-result { text-align: center; min-height: 24px; color: var(--green); font-weight: 700; font-size: 13px; margin-top: 15px; opacity: 0; transition: opacity .2s; }
.scene-result.visible { opacity: 1; }
.world-grid-dot { fill: #b5c6b0; }
@media (max-width: 900px) {
  .player-heading { display: block; }
  #taskRule { margin-top: 15px; max-width: none; }
  .playground { grid-template-columns: minmax(0,1fr) minmax(330px,1fr); gap: 12px; }
  .player-main { width: calc(100% - 28px); }
  .game-scene { padding-inline: 12px; }
}
@media (max-width: 700px) {
  .player-topbar { min-height: 58px; padding: 8px 12px; gap: 7px; }
  .player-topbar .brand { font-size: 18px; }
  .player-topbar .brand-mark { width: 27px; height: 27px; font-size: 18px; }
  .player-topbar .control { font-size: 10px; min-height: 36px; padding-inline: 7px; }
  #loginButton { max-width: 128px; }
  .player-main { padding: 19px 0 20px; width: calc(100% - 24px); }
  .player-heading { margin-bottom: 16px; }
  h1 { font-size: 29px; }
  #taskRule { margin-top: 10px; padding-left: 11px; font-size: 11px; }
  .playground { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - 24px); min-height: 530px; max-height: 860px; scroll-margin-top: 12px; }
  .game-panel { flex: 0 0 auto; box-shadow: 0 3px 12px #2631290b; }
  .game-scene { min-height: 205px; padding: 13px 13px 8px; }
  .game-scene svg.world-svg { height: 180px; }
  .scene-toolbar { min-height: 43px; padding: 5px 12px; font-size: 10px; }
  .speed-selector .control { min-height: 30px; padding: 3px 7px; font-size: 10px; }
  .player-editor { flex: 1; min-height: 0; grid-template-rows: 46px minmax(0,1fr) auto 66px; }
  .player-editor .editor-content { min-height: 0; max-height: none; padding: 12px 10px; }
  .player-editor .editor-tools .control { font-size: 11px; padding-inline: 7px; }
  .player-editor .command-row { min-height: 45px; }
  .player-editor .row-tools .control { min-height: 32px; }
  .player-editor .loop-header { gap: 5px; }
  .player-editor .loop-title { font-size: 11px; }
  .player-editor .stepper .control { width: 30px; min-width: 30px; min-height: 32px; }
  .player-editor .times-label { font-size: 10px; }
  .player-editor .loop-header > .icon { width: 17px; height: 17px; flex-basis: 17px; }
  .player-editor .repeat-block { padding-left: 9px; }
  .player-editor .row-label { font-size: 11px; }
  .player-editor .feedback { font-size: 10px; padding-inline: 12px; }
  .player-editor .playback { padding-inline: 10px; gap: 5px; }
  .player-editor .playback .control { padding-inline: 8px; font-size: 11px; gap: 5px; }
  .player-bottom { align-items: start; gap: 12px; font-size: 10px; }
  #nextTask { max-width: 160px; font-size: 10px; }
  #taskList { grid-template-columns: 1fr; }
  .lamp-pattern { gap: 6px; }.lamp-pattern .lamp { width: 20px; height: 20px; border-width: 3px; }
  .lamp-pattern.output { margin-top: 17px; }
  .dance-model { gap: 3px; }.dance-beat { width: 25px; height: 25px; }.dance-beat .icon { width: 16px; height: 16px; }
  .scene-result { margin-top: 8px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
