:root { color-scheme: light; font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; color: #342c23; background: #ede9df; line-height: 1.4; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 18rem; }
a { color: #30594b; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #30594b; outline-offset: 3px; }
button, select, .primary { font: inherit; color: inherit; min-height: 44px; border: 1px solid #b4aa99; border-radius: .5rem; padding: .55rem .9rem; background: #fffcf6; }
button, select, summary { cursor: pointer; }
/* Native option text may be wider than the lesson panel after translation. */
select { min-inline-size: 0; max-inline-size: 100%; }
button:disabled { cursor: default; }
button:hover:not(:disabled) { border-color: #30594b; }
.site-header, main { width: min(100% - 1.5rem, 46rem); margin: auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; padding-block: .25rem; }
.site-header a { display: inline-flex; min-height: 44px; align-items: center; }
.site-header img { width: 6rem; height: auto; }
#lesson { padding: 0; border: 0; background: transparent; }
h1 { margin: .2rem 0; font-family: Georgia, serif; font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.2; }
.lesson-top, .score-row { display: flex; gap: .6rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.lesson-top { font-size: .85rem; }
.lesson-top p { margin: 0; color: #30594b; font-weight: 700; }
.sound-toggle { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; cursor: pointer; }
#tutorial-sound { width: 1.1rem; height: 1.1rem; accent-color: #30594b; }
#tutorial-volume { min-width: 0; min-height: 44px; flex: 1; accent-color: #30594b; }
#prompt { margin-block: .4rem; }
#board-style-status { font-size: .85rem; margin-block: .3rem; }
/* Once answered, the explanation replaces the question instead of repeating it. */
body[data-phase="answered"] #prompt { display: none; }
.score-row { font-size: .9rem; font-weight: 650; }
#score > span { display: inline-block; font-variant-numeric: tabular-nums; }
#capture-flights { position: fixed; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
#capture-flights .tutorial-capture-bead { position: absolute; left: 0; top: 0; will-change: transform, opacity; background-image: radial-gradient(circle at 28% 22%, #f7d19a88, #633d1e88), url('/assets/textures/beech-beads-v2.png'); background-size: cover; }
.score-arrival { animation: score-arrival 180ms ease-out; }
@keyframes score-arrival { 0% { transform: scale(1.12); color: #977024; } 100% { transform: scale(1); } }
.row-label { margin: .15rem 0; font-size: .8rem; color: #514939; display: flex; justify-content: space-between; }
#stage { --board-ink: #fff2db; --theme-accent: #eac58a; position: relative; width: 100%; aspect-ratio: 2.5; min-height: 148px; border: 0; border-radius: 0; box-shadow: none; overflow: hidden; background: transparent; }
.row-label[data-side="south"] { position: relative; min-height: 20px; align-items: center; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; pointer-events: none; }
#board-loading { display: none; position: absolute; inset: 0; place-content: center; justify-items: center; gap: .5rem; background: transparent; font-size: .9rem; }
#board-loading img { width: 7rem; height: auto; }
#stage[data-renderer="loading"] #board-loading { display: grid; }
#stage[data-renderer="loading"] #board { visibility: hidden; }
#board { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 16px 8px; padding: 14px 12px; margin: 0; direction: ltr; }
#board .house { min-width: 0; position: relative; }
.house .pit { position: relative; min-width: 0; min-inline-size: 0; min-height: 44px; min-block-size: 44px; height: 100%; padding: 0; color: #fff5df; font-size: .85rem; }
.pit .name { display: block; font-size: .65rem; font-weight: 650; }
.pit .count { font-size: .95rem; font-variant-numeric: tabular-nums; }
.pit .seeds { position: absolute; inset: 18% 12% 28%; display: flex; align-content: center; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px; pointer-events: none; }
.seed { width: clamp(5px, 1.3vw, 12px); height: clamp(5px, 1.3vw, 12px); border-radius: 50%; background: radial-gradient(circle at 28% 22%, #f7d19a, #ae793c 65%, #633d1e); box-shadow: inset -1px -1px 2px #64421e, 0 1px 2px #120900aa; }
.pit[aria-disabled="true"] { cursor: default; }
#stage[data-renderer="flat"] { aspect-ratio: auto; min-height: 0; }
#stage[data-renderer="flat"] #board { position: relative; inset: auto; grid-template-rows: repeat(2, auto); border-radius: .9rem; background: repeating-linear-gradient(4deg, #d4a77118 0 1px, transparent 2px 9px), linear-gradient(110deg, #855331, #bd8550 45%, #81502c); }
#stage[data-renderer="flat"] .house { left: auto !important; top: auto !important; width: auto !important; height: auto !important; aspect-ratio: 1; }
#stage[data-renderer="flat"] .pit { width: 100%; border: 1px solid #dfb67b; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, #6c4328, #382317 72%, #24170f); box-shadow: inset 0 4px 8px #120800a0, 0 2px 0 #f8d09477; }
#stage[data-renderer="flat"] .pit .name { position: absolute; top: -13px; width: 100%; color: #fff2d9; text-shadow: 0 1px 2px #24140a; }
#stage[data-renderer="flat"] .pit .count { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); min-width: 1.3em; line-height: 1.25; padding: 0 .15em; border-radius: .4em; background: #24190fea; }
#stage[data-renderer="flat"] .pit::before { content: ""; position: absolute; display: block; inset: 2px; border: 1px solid; border-radius: 46%; pointer-events: none; }
#stage[data-renderer="flat"] .pit:is([data-focus="true"], [data-hint="true"], :focus-visible) { outline: 3px solid #ffe5a3; outline-offset: -2px; }
#stage[data-renderer="webgl"] #canvas { visibility: visible; }
#stage[data-renderer="webgl"] #board { display: block; padding: 0; }
#stage[data-renderer="webgl"] #board .house { position: absolute; }
#stage[data-renderer="webgl"] .pit { position: absolute; min-height: 44px; height: var(--renderer-house-hit-height); background: transparent; border: 0; padding: 0; }
#stage[data-renderer="webgl"] .pit .seeds { display: none; }
#stage[data-renderer="webgl"] .pit .name { top: calc(var(--house-pit-y) - var(--house-pit-height) / 2 - 10px); left: var(--house-pit-x); bottom: auto; right: auto; padding: 0; transform: translateX(-50%); background: #20150ec0; color: #fff2db; pointer-events: none; }
#stage[data-renderer="webgl"] .pit .count { top: calc(var(--house-pit-y) + var(--house-pit-height) / 2 - 4px); left: var(--house-pit-x); bottom: auto; transform: translate(-50%, -50%); padding: .05em .25em; border-radius: .4em; pointer-events: none; }
#stage[data-renderer="webgl"] .pit:is([data-focus="true"], [data-hint="true"], :focus-visible) { outline: none; }
#stage[data-renderer="webgl"] .pit:is([data-focus="true"], [data-hint="true"], :focus-visible) .pit-legal-outline { display: block; opacity: 1; stroke: #ffe5a3; stroke-width: 2.5px; }
.pit[data-owner="south"] { --ownership-color: #a4e8d3; }
.pit[data-owner="north"] { --ownership-color: #ebc18c; }
#stage[data-renderer="webgl"] .pit .pit-legal-outline { display: block; stroke: var(--ownership-color); opacity: .65; }
#stage[data-renderer="webgl"] .pit[data-owner="north"] .pit-legal-outline polygon { stroke-dasharray: 3 3; }
#stage[data-renderer="flat"] .pit::before { border-color: var(--ownership-color); opacity: .75; }
#stage[data-renderer="flat"] .pit[data-owner="north"]::before { border-style: dashed; }
body[data-phase="active"] #stage .pit .pit-legal-outline,
body[data-phase="active"] #stage[data-renderer="flat"] .pit::before { animation: ownership-cue 3.2s ease-in-out 2; }
body[data-phase="active"] #stage .pit[data-owner="north"] .pit-legal-outline,
body[data-phase="active"] #stage[data-renderer="flat"] .pit[data-owner="north"]::before { animation-delay: 1.6s; }
.row-label > span:first-child::before { content: ""; display: inline-block; width: .6rem; height: .6rem; margin-right: .4rem; border: 2px solid #537e70; border-radius: 50%; background: #a4e8d3; }
.row-label[data-side="north"] > span:first-child::before { border-style: dashed; border-color: #8c6341; background: #ebc18c; }
@keyframes ownership-cue { 0%, 100% { opacity: .4; } 45%, 60% { opacity: 1; } }
#feedback { margin-block: .4rem; }
#feedback:empty { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
#next, .primary { background: #30594b; color: #fff; border-color: #30594b; text-decoration: none; }
#more { padding: .3rem 0; font-size: .9rem; }
summary { min-height: 44px; padding-block: .6rem; }
#more label { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
#reset-confirm { border-left: 3px solid #30594b; padding: .7rem; }
#account-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .6rem; align-items: center; margin-bottom: .3rem; font-size: .8rem; }
#account-status { grid-column: 1; grid-row: 1; margin: 0; }
#account-progress > .actions { grid-column: 2; grid-row: 1; }
#achievement-status { grid-column: 1 / -1; margin: 0; }
#achievement-retry { grid-column: 1 / -1; justify-self: start; }
#account-progress button { font-size: inherit; padding: .3rem .5rem; }
#reload-confirm { grid-column: 1 / -1; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 5; background: white; padding: .7rem; }
.skip-link:focus { top: 1rem; }
@media (max-width: 350px) { #board { gap: 16px 4px; padding: 14px 4px; } .pit .name { font-size: .6rem; } }
@media (min-width: 640px) and (max-height: 540px) {
  #more { padding-block: 0; }
  #lesson { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1rem; align-items: start; font-size: .875rem; }
  .lesson-top { grid-column: 1; grid-row: 1; }
  #lesson-title { grid-column: 2; grid-row: 1; font-size: 1.4rem; }
  #play-area { grid-column: 1; grid-row: 2 / 5; }
  #prompt { grid-column: 2; grid-row: 2; }
  #feedback { grid-column: 2; grid-row: 3; }
  #lesson > .actions { grid-column: 2; grid-row: 4; }
  #finish { grid-column: 2; grid-row: 5; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } #stage .pit .pit-legal-outline, #stage .pit::before { animation: none !important; opacity: .9; } .score-arrival { animation: none; } }
@media (forced-colors: active) {
  #stage[data-renderer="flat"] #board { background: Canvas; }
  #stage[data-renderer="flat"] .pit { background: ButtonFace; color: ButtonText; border-color: ButtonText; box-shadow: none; }
  #stage[data-renderer="flat"] .pit .name, #stage[data-renderer="flat"] .pit .count { color: ButtonText; background: ButtonFace; text-shadow: none; }
  #stage[data-renderer="flat"] .pit::before { border-color: ButtonText; opacity: 1; animation: none; }
  #stage[data-renderer="flat"] .seeds { display: none; }
  #stage[data-renderer="flat"] .pit:is([data-hint="true"], [data-focus="true"], :focus-visible) { outline: 3px solid Highlight; }
}
