* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { color-scheme: light; }
body { margin: 0; background: #f8f6f0; color: #24343d; font: 1rem/1.5 system-ui, sans-serif; }
.shell { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.site-head { display: flex; flex-wrap: wrap; gap: .6rem 1.3rem; justify-content: space-between; align-items: center; padding-block: 1rem .55rem; }
.rispiego-brand { text-decoration: none; }
.title { margin: 1rem 0 1.35rem; }
h1, h2 { color: #17365f; font-family: Georgia, serif; line-height: 1.08; }
h1 { margin: 0; font-size: clamp(2rem, 5.5vw, 3.5rem); }
.title p, .note { margin-block: .4rem; color: #4b5f64; }
a { color: #174f73; text-underline-offset: .2em; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); align-items: start; gap: 1rem; }
.studio, .controls, .study { border: 1px solid #c5cfc6; border-radius: 1rem; background: #fffdf6; overflow: hidden; }
.studio { position: sticky; top: .75rem; }
.stage { position: relative; min-height: 360px; background: radial-gradient(ellipse at 51% 38%, #fdf9ea, #e8efe2 64%, #d9e5e2); }
#avatar-canvas { display: block; width: 100%; height: clamp(360px, 49vw, 540px); min-width: 0; touch-action: pan-y; cursor: grab; }
#avatar-canvas:active { cursor: grabbing; }
.stage-id { position: absolute; inset: auto auto 1rem 1rem; display: grid; pointer-events: none; background: #fffdf2e8; border: 1px solid #d2d8cf; padding: .35rem .65rem; border-radius: .5rem; }
.stage-id strong { font-size: 1.05rem; }
.stage-id span { font-size: .8rem; color: #455a60; }
#webgl-fallback { margin: 0; padding: 1rem; }
.view-actions, .studio-voice, .gestures, .editor-actions, .study-actions, .study nav { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.view-actions, .studio-voice { padding: .55rem .8rem; border-top: 1px solid #dce1d6; }
#tutor-mode { font-size: .84rem; color: #385b54; }
.controls, .study { padding: clamp(.8rem, 2.4vw, 1.2rem); }
.preset-row { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-bottom: .75rem; }
.preset-row label { flex: 1 1 13rem; }
label { display: grid; gap: .28rem; min-width: 0; font-weight: 650; }
input, select, button, .primary { border: 1px solid #9aaba6; border-radius: .5rem; min-height: 44px; padding: .48rem .65rem; background: #fffdf6; color: #24343d; font: inherit; }
input, select { width: 100%; min-width: 0; }
button, .primary { font-weight: 700; cursor: pointer; }
button[disabled] { opacity: .6; cursor: default; }
.primary { display: inline-flex; align-items: center; justify-content: center; background: #1b5045; color: #fff; border-color: #1b5045; text-decoration: none; }
#avatar-name { margin-block: .25rem .65rem; }
#avatar-fields { display: grid; gap: .42rem; }
.field-section { border: 1px solid #d6ddd3; border-radius: .58rem; margin-bottom: .45rem; }
.field-section > summary { padding: .5rem .68rem; font-weight: 750; cursor: pointer; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; padding: 0 .65rem .65rem; }
.field-grid label { font-size: .87rem; }
.gestures { padding: 0 .65rem .65rem; }
.editor-actions { margin-top: .7rem; }
.study-start { margin-top: 1rem; }
#notice { color: #385b54; margin: .6rem 0 0; }
#notice:empty { display: none; }
.study { margin-block: 1rem 2rem; }
.study h2 { margin-block: 0 .5rem; }
.active-classroom .studio-voice { display: none; }
.simple-classroom .stage { min-height: 242px; }
.simple-classroom #avatar-canvas { height: clamp(242px, 30vw, 360px); }
.classroom-head, .classroom-settings { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .8rem; }
.classroom-head { justify-content: space-between; }
.classroom-settings { margin-top: .75rem; }
.classroom-settings label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.classroom-settings input { min-height: 1.3rem; height: 1.3rem; width: 1.3rem; }
.classroom-settings select { width: auto; }
.classroom-example { display: grid; margin: 1rem auto; }
.classroom-example span { background: #d7d0ae; }
.classroom-example .marked { background: #9b591c; }
.classroom-example.pizza { grid-template-columns: repeat(2, 1fr); width: 8.3rem; height: 8.3rem; overflow: hidden; border-radius: 50%; gap: 4px; }
.classroom-example.tiles { grid-template-columns: repeat(3, 1fr); width: 11rem; gap: .3rem; }
.classroom-example[data-example="chocolate"] { grid-template-columns: repeat(2, 1fr); width: 8rem; }
.classroom-example.tiles span { aspect-ratio: 1; border-radius: .22rem; }
.classroom-example[data-example="transfer"] .marked { background: #5265aa; }
.classroom-example[data-example="review"] .marked { background: #34756f; }
.study label { margin-block: .65rem .3rem; }
.reply { background: #e9f0e8; border-left: .24rem solid #688e79; border-radius: .4rem; padding: .7rem .85rem; margin-block: .8rem; white-space: pre-line; }
.study-actions, .study nav { gap: .55rem .85rem; margin-top: .65rem; }
:focus-visible { outline: 3px solid #876400; outline-offset: 3px; }
.skip { position: absolute; margin: .4rem; padding: .4rem; transform: translateY(-250%); background: #fff; }
.skip:focus { transform: none; z-index: 2; }

@media (max-width: 720px) {
  .workspace { grid-template-columns: 1fr; }
  .studio { position: static; }
  #avatar-canvas { height: clamp(320px, 88vw, 430px); }
  .stage { min-height: 320px; }
}
