:root {
  font-family:"Segoe UI",system-ui,sans-serif;
  color:#24372e;
  background:#f7f6f1;
  font-synthesis:none;
  --green:#214d3e;
  --muted:#768078;
  --line:#dedfd6;
  --paper:#f1ede4
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  min-height:100vh;
  min-height:var(--app-height,100dvh);
  padding-top:max(env(safe-area-inset-top),var(--app-safe-top,0px));
  padding-right:max(env(safe-area-inset-right),var(--app-safe-right,0px));
  padding-bottom:max(env(safe-area-inset-bottom),var(--app-safe-bottom,0px));
  padding-left:max(env(safe-area-inset-left),var(--app-safe-left,0px))
}
button,a {
  -webkit-tap-highlight-color:transparent
}
button {
  font:inherit;
  cursor:pointer;
  color:inherit
}
button:disabled {
  cursor:default;
  opacity:.38
}
button:focus-visible,a:focus-visible {
  outline:3px solid #b07a28;
  outline-offset:4px
}
button,canvas {
  touch-action:manipulation
}
a {
  color:inherit;
  text-decoration:none
}
button {
  border:0
}
button[hidden],[hidden] {
  display:none!important
}
.site-header {
  max-width:1380px;
  margin:auto;
  height:90px;
  padding:0 52px;
  display:flex;
  align-items:center;
  border-bottom:1px solid var(--line);
  gap:70px
}
.brand {
  display:flex;
  align-items:center;
  font-size:27px;
  font-weight:650;
  letter-spacing:-1.5px
}
.brand img {
  margin-right:10px
}
.brand-period {
  color:#bd8158
}
.site-header nav {
  height:100%;
  display:flex;
  align-items:center;
  gap:32px;
  font-size:13px
}
.nav-current {
  height:100%;
  display:flex;
  align-items:center;
  border-bottom:2px solid var(--green);
  font-weight:600
}
.nav-button {
  background:none;
  padding:14px 0;
  color:#69756b
}
.nav-button span {
  margin-left:8px
}
.storage-status {
  margin-left:auto;
  font-size:12px;
  color:#6c796e;
  display:flex;
  align-items:center;
  gap:8px
}
.status-dot,.mode-dot {
  display:inline-block;
  background:#60876b;
  border-radius:50%;
  width:6px;
  height:6px
}
.status-dot {
  box-shadow:0 0 0 4px #e9eee4
}
main {
  max-width:1276px;
  margin:0 auto;
  padding:43px 32px 0
}
.intro {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:32px
}
.eyebrow {
  font-size:10px;
  font-weight:650;
  letter-spacing:1.8px;
  margin:0 0 13px;
  color:#68766a
}
.eyebrow span {
  padding:0 13px;
  color:#aaa995
}
h1 {
  font-size:49px;
  line-height:1.15;
  letter-spacing:-2px;
  font-weight:500;
  margin:0 0 13px
}
.title-dot {
  color:#bb7859
}
.subtitle {
  font-size:14px;
  color:#7b8075;
  margin:0
}
.intro-note {
  display:flex;
  align-items:center;
  gap:18px;
  padding-right:14px
}
.note-spark {
  font-size:43px;
  font-weight:200;
  color:#b28e57
}
.intro-note p {
  font-size:13px;
  line-height:1.8;
  color:#858878
}
.intro-note strong {
  color:#525e50;
  font-weight:500
}
.game-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) 292px;
  gap:27px;
  align-items:start
}
.game-card {
  border:1px solid #dddfd5;
  border-radius:20px;
  overflow:hidden;
  background:var(--paper)
}
.board-heading {
  padding:22px 25px 0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  position:relative;
  z-index:2
}
.board-heading>div {
  display:flex;
  align-items:center;
  gap:8px
}
.board-heading strong {
  font-weight:500
}
.mode-dot {
  width:5px;
  height:5px
}
.lesson-label {
  font-size:10px;
  padding:5px 8px;
  border:1px solid #d8d6c6;
  border-radius:5px;
  color:#838472;
  margin-left:5px
}
.no-timer {
  color:#8c8d7e;
  font-size:10px
}
.scene {
  position:relative;
  aspect-ratio:1.28;
  margin:0 15px;
  isolation:isolate
}
.scene canvas {
  display:block;
  width:100%;
  height:100%;
  outline:none
}
.scene-cover {
  position:absolute;
  inset:0;
  background:var(--paper);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  z-index:10;
  padding:25px
}
.scene-cover h2 {
  font-size:20px;
  font-weight:500
}
.scene-cover p {
  font-size:13px;
  color:#6c796e;
  max-width:330px;
  line-height:1.65
}
.loading-mark {
  font-size:48px;
  color:#b5915d;
  animation:spin 5s linear infinite
}
.board-corner {
  position:absolute;
  bottom:12px;
  left:12px;
  color:#8e9180;
  font:9px/1.5 Consolas,monospace;
  letter-spacing:1.3px
}
.center-button {
  position:absolute;
  z-index:3;
  width:44px;
  height:44px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  padding:10px;
  background:transparent
}
.center-button::before {
  content:"";
  display:block;
  width:24px;
  height:24px;
  border-radius:50%;
  border:1px solid #fff8;
  background:#fff8;
  box-shadow:0 2px 8px #17281e22;
  transition:background .15s,transform .15s
}
.center-button::after {
  content:"";
  position:absolute;
  width:5px;
  height:5px;
  left:19.5px;
  top:19.5px;
  border-radius:50%;
  background:var(--green)
}
.center-button[aria-pressed=true]::before {
  background:var(--green);
  border-color:#f4edda;
  box-shadow:0 0 0 4px #fff9
}
.center-button[aria-pressed=true]::after {
  background:#f4edda
}
.center-button:hover::before {
  transform:scale(1.12)
}
.center-button:disabled {
  opacity:0;
  pointer-events:none
}
.tile-symbol {
  position:absolute;
  transform:translate(-50%,-50%);
  pointer-events:none;
  font-size:10px;
  line-height:1;
  color:#24372e80
}
.tile-symbol.selected {
  color:#183d2f;
  font-size:12px
}
.tile-symbol.color-2 {
  font-size:12px
}
.board-caption {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  font-size:12px;
  padding:0 25px 19px;
  min-height:42px
}
.save-note {
  font-size:10px;
  color:#8c8d7e;
  white-space:nowrap
}
.solved #game-status {
  color:#237342;
  font-weight:600
}
.game-controls {
  border-top:1px solid #deddd0;
  padding:20px 24px;
  background:#f9f8f3;
  display:flex;
  justify-content:space-between;
  gap:15px;
  align-items:center
}
.rotation-controls {
  display:flex;
  align-items:center;
  gap:17px
}
.angle-control {
  display:flex;
  padding:4px;
  border:1px solid #dddfd3;
  border-radius:8px;
  gap:1px
}
.angle-control button {
  background:none;
  min-width:47px;
  height:38px;
  font-size:11px;
  border-radius:5px;
  padding:0 10px
}
.angle-control button[aria-pressed=true] {
  background:#e6e9dd;
  color:var(--green);
  font-weight:650
}
.turn-buttons {
  display:flex;
  gap:7px
}
.button {
  border-radius:7px;
  min-height:46px;
  padding:12px 17px;
  font-size:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:15px;
  transition:background .15s
}
.primary {
  background:var(--green);
  color:#fffef5
}
.primary:hover:enabled {
  background:#163d2e
}
.secondary {
  background:#edece3
}
.turn-buttons .button {
  min-height:48px;
  padding:12px 15px;
  gap:12px
}
.turn-buttons .button span {
  font-size:24px;
  line-height:1;
  font-weight:300
}
.history-controls {
  display:flex;
  align-items:center;
  gap:2px
}
.icon-button {
  background:none;
  min-width:36px;
  min-height:44px;
  padding:5px;
  font-size:24px;
  color:#647360
}
.icon-button:hover:enabled {
  background:#e9ecdf;
  border-radius:5px
}
.control-divider {
  height:18px;
  width:1px;
  background:#dce0d3;
  margin:0 4px
}
.target-card {
  background:#fdfcf8;
  border:1px solid var(--line);
  border-radius:14px;
  padding:20px 23px 21px
}
.card-label {
  font-size:9px;
  letter-spacing:1.6px;
  font-weight:600;
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:#7c8374
}
.card-label>span+span {
  font-size:18px
}
.target-picture {
  height:139px;
  display:flex;
  justify-content:center;
  align-items:center
}
.target-picture svg {
  width:155px;
  height:135px;
  overflow:visible
}
h2 {
  font-size:15px;
  font-weight:600;
  margin:8px 0 10px
}
.target-card p {
  font-size:12px;
  line-height:1.8;
  color:#7d8378;
  margin:0
}
.color-key {
  display:flex;
  justify-content:space-between;
  padding-top:17px;
  margin-top:17px;
  border-top:1px solid #e8e9df;
  font-size:9px;
  color:#7b8073
}
.color-key span {
  display:flex;
  gap:5px;
  align-items:center
}
.color-key i {
  width:7px;
  height:7px;
  display:inline-block;
  border-radius:50%
}
.teal {
  background:#759ea0
}
.gold {
  background:#edc36e
}
.coral {
  background:#d57d6c
}
.progress-card {
  display:grid;
  grid-template-columns:1fr 1fr;
  margin:20px 0;
  padding:0 4px
}
.progress-card>div {
  padding:3px 20px
}
.progress-card>div:first-child {
  border-right:1px solid #dfe2d7;
  padding-left:4px
}
.metric-label {
  display:block;
  font-size:9px;
  letter-spacing:1.3px;
  color:#848977
}
.progress-card strong {
  font-family:Georgia,serif;
  font-size:38px;
  font-weight:400;
  display:block;
  margin-top:6px;
  color:#304b37
}
.hint-card {
  background:#ebeede;
  border-radius:10px;
  padding:16px 17px;
  display:flex;
  align-items:start;
  gap:11px;
  color:#6c785c
}
.hint-icon {
  font-size:25px;
  line-height:1.25;
  color:#889775
}
.hint-card h3 {
  font-size:11px;
  font-weight:600;
  margin:0 0 6px
}
.hint-card p {
  font-size:11px;
  line-height:1.8;
  margin:0;
  color:#7b856d
}
.new-puzzle {
  margin-top:18px;
  width:100%;
  background:transparent;
  border:1px solid #b9c2af;
  justify-content:space-between;
  color:#35563d;
  font-size:12px;
  padding:13px 18px
}
.new-puzzle:hover:enabled {
  background:#edf0e4
}
.practice-note {
  text-align:center;
  font-size:10px;
  line-height:1.8;
  color:#929584;
  margin-top:13px
}
footer {
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  margin-top:34px;
  padding:22px 0 25px;
  color:#909582;
  font-size:10px
}
footer>span+span {
  font-size:11px;
  color:#70846c
}
footer>span+span span {
  margin-left:16px
}
dialog {
  border:1px solid #dde0d2;
  border-radius:18px;
  max-width:470px;
  width:calc(100% - 36px);
  padding:35px;
  color:#2c4234;
  box-shadow:0 30px 100px #17322020;
  background:#faf9f3
}
dialog::backdrop {
  background:#142b2070;
  backdrop-filter:blur(4px)
}
dialog h2 {
  font-size:29px;
  font-weight:450;
  letter-spacing:-.6px;
  margin-bottom:22px
}
dialog p,dialog li {
  font-size:13px;
  line-height:1.8;
  color:#73806b
}
dialog ol {
  padding-left:18px
}
dialog li {
  padding:0 0 17px 6px
}
dialog li strong {
  display:block;
  color:#294b35;
  font-weight:600
}
dialog .eyebrow {
  font-size:9px;
  line-height:1.6
}
.dialog-close {
  position:absolute;
  right:12px;
  top:10px;
  background:none;
  font-size:25px;
  min-width:44px;
  min-height:44px;
  color:#718269
}
.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:25px
}
#toast {
  position:fixed;
  left:50%;
  bottom:calc(25px + var(--app-safe-bottom,0px));
  transform:translateX(-50%);
  padding:14px 20px;
  max-width:calc(100% - 32px);
  border-radius:9px;
  background:#244637;
  color:#fff9eb;
  font-size:12px;
  box-shadow:0 8px 30px #0002;
  z-index:50;
  line-height:1.7
}
@keyframes spin {
  to {
    transform:rotate(360deg)
  }
}
@media(min-width:781px) {
  .site-header {
    height:76px
  }
  main {
    padding-top:32px
  }
  .intro {
    margin-bottom:24px
  }
  .intro h1 {
    font-size:43px
  }
  .scene {
    height:clamp(330px,calc(100svh - 430px),560px);
    aspect-ratio:auto
  }
}
@media(min-width:1400px) {
  main {
    padding-top:50px
  }
  .intro {
    margin-bottom:38px
  }
}
@media(max-width:1100px) {
  .game-controls {
    flex-wrap:wrap
  }
  .history-controls {
    margin-left:auto
  }
  .game-layout {
    grid-template-columns:minmax(0,1fr) 260px;
    gap:20px
  }
  .lesson-label {
    display:none
  }
  .no-timer {
    font-size:9px
  }
  .board-heading {
    padding:20px 18px 0
  }
  .save-note {
    display:none
  }
  .site-header {
    padding:0 32px;
    gap:40px
  }
  .intro h1 {
    font-size:43px
  }
  .rotation-controls {
    gap:10px
  }
  .turn-buttons .button {
    padding:10px 12px;
    gap:8px
  }
}
@media(max-width:780px) {
  .site-header {
    height:72px;
    padding:0 23px;
    gap:25px
  }
  .brand {
    font-size:24px
  }
  .brand img {
    width:25px;
    height:25px
  }
  .storage-status {
    display:none
  }
  .site-header nav {
    margin-left:auto;
    font-size:12px;
    gap:20px
  }
  main {
    padding:30px 20px 0
  }
  .intro {
    margin-bottom:24px
  }
  .intro h1 {
    font-size:39px
  }
  .intro-note {
    display:none
  }
  .subtitle {
    font-size:12px
  }
  .game-layout {
    grid-template-columns:1fr;
    gap:20px
  }
  .side-panel {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px
  }
  .target-card {
    grid-row:span 3;
    padding:17px
  }
  .target-picture {
    height:120px
  }
  .target-picture svg {
    width:130px;
    height:112px
  }
  .target-card h2 {
    font-size:13px
  }
  .target-card p {
    font-size:11px
  }
  .progress-card {
    margin:0;
    align-items:center
  }
  .progress-card strong {
    font-size:33px
  }
  .hint-card {
    padding:13px
  }
  .new-puzzle {
    margin:0
  }
  .practice-note {
    grid-column:1/-1;
    margin:0
  }
  .game-controls {
    flex-wrap:nowrap
  }
  .game-card {
    border-radius:14px
  }
  .board-heading {
    padding-top:18px
  }
  .scene {
    margin:0 6px
  }
  .board-caption {
    padding:0 18px 17px
  }
  .game-controls {
    padding:16px 17px
  }
  .history-controls {
    gap:0
  }
  .icon-button {
    min-width:32px
  }
  footer {
    font-size:9px;
    gap:20px;
    margin-top:28px
  }
  .color-key {
    gap:7px;
    font-size:8px
  }
  .eyebrow {
    font-size:8px
  }
  .hint-card p {
    font-size:10px
  }
}
@media(max-width:480px) {
  main {
    padding:27px 14px 0
  }
  .site-header {
    padding:0 18px
  }
  .intro {
    padding:0 5px
  }
  .intro h1 {
    font-size:35px;
    letter-spacing:-1.4px
  }
  .site-header nav {
    gap:18px
  }
  .brand {
    font-size:22px
  }
  .nav-current {
    display:none
  }
  .scene {
    aspect-ratio:1.03;
    margin:0
  }
  .game-controls {
    flex-wrap:wrap;
    gap:12px;
    padding:15px
  }
  .rotation-controls {
    width:100%;
    justify-content:space-between
  }
  .turn-buttons {
    flex:1
  }
  .turn-buttons .button {
    flex:1;
    min-height:48px
  }
  .angle-control button {
    min-width:40px;
    padding:0 8px;
    height:40px
  }
  .history-controls {
    margin:0 auto
  }
  .history-controls .icon-button {
    min-width:60px
  }
  .control-divider {
    margin:0 14px
  }
  .side-panel {
    gap:12px
  }
  .target-card {
    padding:14px 12px
  }
  .target-card h2 {
    font-size:12px
  }
  .target-card p {
    font-size:10px
  }
  .color-key {
    flex-wrap:wrap;
    justify-content:start;
    gap:8px;
    margin-top:12px;
    padding-top:12px
  }
  .hint-card {
    gap:6px;
    padding:11px
  }
  .hint-icon {
    font-size:20px
  }
  .progress-card>div {
    padding:3px 10px
  }
  .metric-label {
    font-size:8px;
    letter-spacing:.7px
  }
  .board-caption {
    font-size:11px;
    min-height:40px
  }
  .board-heading {
    font-size:10px;
    padding:18px 15px 0
  }
  .no-timer {
    font-size:9px
  }
  .new-puzzle {
    padding:12px;
    font-size:11px
  }
  footer>span+span {
    display:none
  }
  .tile-symbol {
    font-size:8px
  }
  .tile-symbol.color-2 {
    font-size:10px
  }
  .practice-note br {
    display:none
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    animation:none!important;
    transition:none!important
  }
}
@media(max-width:480px) {
  .rotation-controls {
    flex-direction:column;
    gap:10px
  }
  .angle-control button {
    min-width:44px;
    height:44px
  }
  .turn-buttons {
    width:100%
  }
  .turn-buttons .button {
    min-width:0;
    padding:10px 12px;
    gap:8px
  }
}
/* Platform controls share the training scene's colors and spacing. */
.platform-bar {
  margin: 0 0 24px;
  padding: 24px;
  background: #fffefa;
  border: 1px solid #dedfd3;
  border-radius: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.platform-bar > div:first-child {
  flex: 1 1 260px;
}
.platform-bar strong {
  font-size: 24px;
}
.platform-bar small {
  font-size: 13px;
  font-weight: 500;
}
.platform-bar p {
  margin: 6px 0 0;
  font-size: 13px;
}
.platform-bar .eyebrow {
  margin: 0 0 8px;
}
.platform-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.platform-actions .button {
  min-height: 44px;
}
.platform-bar .demo-note {
  flex-basis: 100%;
  color: #677165;
}
.round-result {
  padding: 24px;
  margin-bottom: 24px;
  background: #e3eee2;
  border: 1px solid #b6cdb3;
  border-radius: 20px;
}
.round-result h2 {
  margin: 0 0 8px;
}
.round-result p {
  margin: 0 0 16px;
}
.wide-dialog {
  width: min(760px, calc(100vw - 32px));
}
.history-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.history-item {
  border-bottom: 1px solid #dedfd3;
  padding: 0 0 14px;
  overflow-wrap: anywhere;
}
.history-item p {
  margin: 5px 0;
}
.history-item small {
  color: #677165;
}
@media (max-width: 600px) {
  .platform-bar {
    padding: 18px;
  }
  .platform-actions {
    width: 100%;
  }
  .platform-actions .button {
    flex: 1 1 140px;
  }
  .board-heading {
    flex-wrap: wrap;
    gap: 8px;
  }
}
