/* Scene specific styles */

/* -------------------------------------------------- title */
.title-actions { position: absolute; left: 50%; bottom: calc(7vh + var(--safe-b)); transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 14px; }
/* Inside TardiGREATS (js/core/host.js): "Hello Marcel!" above Play. */
.title-hello { padding: 10px 26px; border-radius: 999px; font-size: 26px; font-weight: 800; color: #2B3A67; white-space: nowrap; }
.play-btn { min-height: 84px; padding: 0 56px 0 46px; font-size: 32px; border-radius: 999px; gap: 14px; box-shadow: 0 16px 40px rgba(10, 132, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .35); animation: attn 2.2s ease-in-out infinite; }
.play-btn .ico { width: 34px; height: 34px; }
.title-settings { position: absolute; left: calc(var(--gap) + var(--safe-l)); bottom: calc(var(--gap) + var(--safe-b)); z-index: 25; }

/* -------------------------------------------------- village */
.village .bld { transition: filter .2s; }
.village .bld.pressed { animation: press .35s ease; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes press { 40% { transform: scale(.97); filter: brightness(1.08); } }

/* -------------------------------------------------- rooms */
.room .it.tap { cursor: pointer; }
.room .it.hot { filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 18px rgba(10, 132, 255, .8)); }
.room .ch, .room .pr { cursor: grab; }
.room .ch.dim, .room .pr.dim { opacity: .45; pointer-events: none; }
.room .lifted { animation: wiggle .7s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; }
.room .door .door-panel { transition: transform .22s ease; }
.trampoline-bounce { animation: tramp .7s ease-in-out infinite; }
@keyframes tramp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-60px); } }

.trash-zone {
  position: absolute; left: 50%; bottom: calc(var(--gap) + var(--safe-b)); z-index: 30;
  transform: translate(-50%, 140%); opacity: 0; transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), opacity .2s, background .2s;
  display: flex; align-items: center; gap: 10px; height: 76px; padding: 0 26px; border-radius: 40px; font-weight: 800; font-size: 18px; color: var(--ink-2);
  pointer-events: none;
}
.trash-zone.show { transform: translate(-50%, 0); opacity: 1; }
.trash-zone.hot { background: rgba(255, 69, 58, .9); color: #fff; transform: translate(-50%, 0) scale(1.1); }

.act-bubble {
  position: absolute; z-index: 35; padding: 10px; border-radius: 26px; display: flex; flex-direction: column; gap: 6px; align-items: center;
  animation: bubbleIn .25s cubic-bezier(.2, 1.5, .4, 1);
}
.act-name { font-weight: 800; font-size: 16px; color: var(--ink-2); }
.act-row { display: flex; gap: 8px; }
.act-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; padding: 10px 8px 8px; border: 0; border-radius: 18px;
  background: rgba(0, 0, 0, .05); font-size: 12px; font-weight: 700; color: var(--ink);
}
.act-btn:active { transform: scale(.92); }
.act-btn .ico { color: var(--blue); }
.speech {
  position: absolute; z-index: 35; max-width: 320px; padding: 14px 18px; border-radius: 22px; font-weight: 700; font-size: 18px; line-height: 1.3;
  animation: bubbleIn .25s cubic-bezier(.2, 1.5, .4, 1); pointer-events: none;
}
@keyframes bubbleIn { from { transform: scale(.7) translateY(10px); opacity: 0; } }

/* -------------------------------------------------- character creator */
.creator {
  position: absolute; z-index: 5;
  inset: calc(var(--btn) + var(--gap) * 2 + var(--safe-t)) calc(var(--gap) + var(--safe-r)) calc(var(--gap) + var(--safe-b)) calc(var(--gap) + var(--safe-l));
  display: grid; grid-template-columns: minmax(250px, 33%) 1fr; gap: var(--gap);
}
.scene-creator, .scene-fashion, .scene-kart { background: radial-gradient(120% 90% at 30% 20%, #FDF1FF 0%, #E3F1FF 55%, #D8F3EA 100%); }
.creator-left { border-radius: 32px; display: flex; flex-direction: column; align-items: center; padding: 14px; gap: 12px; min-height: 0; }
.portrait-box { flex: 1; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.portrait-svg { height: 100%; width: 100%; max-height: 100%; }
.name-row { display: flex; gap: 10px; width: 100%; align-items: center; }
.name-input {
  flex: 1; min-width: 0; height: 58px; border-radius: 20px; border: 0; background: rgba(255, 255, 255, .85); font-size: 24px; font-weight: 800; text-align: center;
  color: var(--ink); outline: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); -webkit-user-select: text; user-select: text;
}
.name-input:focus { box-shadow: 0 0 0 3px rgba(10, 132, 255, .35); }
.small-round { --btn: 58px; }
.creator-right { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; min-width: 0; }
.people-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; touch-action: pan-x; scrollbar-width: none; flex: none; }
.people-row::-webkit-scrollbar { display: none; }
.person-chip {
  flex: none; width: 88px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; padding: 8px 4px 6px;
  border-radius: 24px; background: rgba(255, 255, 255, .62); font-size: 13px; font-weight: 700; color: var(--ink-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); transition: transform .15s;
}
.person-chip:active { transform: scale(.93); }
.person-chip .mini { width: 62px; height: 62px; border-radius: 50%; background: #fff; }
.person-chip span { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-chip.on { background: #fff; box-shadow: inset 0 0 0 3px var(--blue); color: var(--ink); }
.person-chip.add .add-ico { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 132, 255, .12); color: var(--blue); }
.creator-card { flex: 1; min-height: 0; border-radius: 32px; display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 10px 10px 8px; overflow-x: auto; flex: none; border-bottom: 1px solid rgba(0, 0, 0, .06); touch-action: pan-x; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px; padding: 9px 10px 7px; border: 0; border-radius: 18px;
  background: transparent; font-size: 13px; font-weight: 700; color: var(--ink-2);
}
.tab.on { background: var(--blue); color: #fff; }
.opt-panel { flex: 1; overflow-y: auto; padding: 8px 16px 100px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.opt-section { margin-top: 10px; }
.opt-title { font-size: 14px; font-weight: 800; color: var(--ink-2); margin: 6px 2px 10px; text-transform: uppercase; letter-spacing: .04em; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.opt {
  position: relative; aspect-ratio: 1 / 1.1; border: 0; border-radius: 22px; background: #fff; padding: 6px 6px 8px; gap: 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
  transition: transform .15s;
}
.opt:active { transform: scale(.94); }
.opt .mini { width: 100%; flex: 1; min-height: 0; }
.opt.on { background: #EEF5FF; box-shadow: inset 0 0 0 3px var(--blue); }
.opt.locked .mini { opacity: .55; filter: saturate(.7); }
.opt-name { font-size: 12px; font-weight: 700; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-price { position: absolute; top: 6px; right: 6px; padding: 2px 8px 2px 2px; border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.opt .none-ico { flex: 1; display: grid; place-items: center; color: var(--ink-3); }
.opt.new-design .none-ico { color: var(--blue); }
.opt-edit { position: absolute; top: 6px; left: 6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(0, 0, 0, .14); }
.opt-hint { color: var(--ink-2); font-size: 15px; line-height: 1.4; margin: 12px 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); transition: transform .15s; flex: none; }
.sw:active { transform: scale(.88); }
.sw.on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--blue); }
.swatches.big .sw { width: 60px; height: 60px; }
.toggles { display: flex; gap: 12px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 18px 0 8px; border: 0; border-radius: 999px; background: #fff; font-size: 16px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.toggle-knob { width: 52px; height: 32px; border-radius: 999px; background: #E3E5EA; position: relative; transition: background .2s; }
.toggle-knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle.on .toggle-knob { background: var(--green); }
.toggle.on .toggle-knob::after { transform: translateX(20px); }
.studio-btn { position: absolute; right: calc(var(--gap) * 2 + var(--safe-r)); bottom: calc(var(--gap) * 2 + var(--safe-b)); z-index: 22; min-height: 64px; font-size: 19px; padding: 0 26px; box-shadow: 0 12px 30px rgba(10, 132, 255, .35); }

/* -------------------------------------------------- fashion studio */
.studio {
  position: absolute; z-index: 5;
  inset: calc(var(--btn) + var(--gap) * 2 + var(--safe-t)) calc(var(--gap) + var(--safe-r)) calc(var(--gap) + var(--safe-b)) calc(var(--gap) + var(--safe-l));
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(220px, 25%); grid-template-rows: minmax(0, 1fr) auto; gap: var(--gap);
}
.tools { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; border-radius: 30px; overflow-y: auto; touch-action: pan-y; scrollbar-width: none; }
.tool {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 84px; padding: 9px 4px 7px; border: 0; border-radius: 20px;
  background: transparent; font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center;
}
.tool:active { transform: scale(.93); }
.tool.on { background: var(--blue); color: #fff; }
.tool-sep { height: 1px; background: rgba(0, 0, 0, .08); margin: 4px 10px; flex: none; }
.paper-wrap { display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
.paper { border-radius: 28px; background: #fff; box-shadow: 0 18px 50px rgba(40, 60, 120, .18), 0 0 0 1px rgba(0, 0, 0, .04); touch-action: none; cursor: crosshair; }
.studio-opts { border-radius: 30px; padding: 6px 14px 14px; overflow-y: auto; touch-action: pan-y; min-height: 0; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl { border: 0; border-radius: 18px; background: #fff; padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.tpl svg { width: 100%; height: 54px; }
.tpl.on { box-shadow: inset 0 0 0 3px var(--blue); background: #EEF5FF; }
.size-row { display: flex; align-items: center; gap: 12px; }
.range { flex: 1; accent-color: var(--blue); height: 36px; }
.size-box { width: 52px; height: 52px; border-radius: 16px; background: #fff; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); flex: none; }
.size-dot { display: block; border-radius: 50%; max-width: 46px; max-height: 46px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.stamp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip-btn { height: 58px; border: 0; border-radius: 18px; background: #fff; display: grid; place-items: center; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.chip-btn.on { background: var(--blue); color: #fff; }
.studio-preview { display: flex; justify-content: center; }
.studio-preview svg { width: 100%; height: 190px; }
.studio-bottom { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--gap); min-width: 0; }
.palette { flex: 1; min-width: 0; display: flex; gap: 10px; padding: 10px 16px; border-radius: 999px; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; }
.palette::-webkit-scrollbar { display: none; }
.save-btn { min-height: 66px; padding: 0 30px; font-size: 20px; flex: none; }

/* -------------------------------------------------- build mode */
.build-drawer {
  position: absolute; z-index: 24; left: 50%; bottom: calc(var(--gap) + var(--safe-b)); width: min(1100px, calc(100vw - var(--gap) * 2));
  transform: translate(-50%, 120%); transition: transform .35s cubic-bezier(.2, 1.2, .4, 1); border-radius: 30px; padding: 10px 12px 12px;
}
.build-drawer.show { transform: translate(-50%, 0); }
.bhead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bcats { display: flex; gap: 4px; overflow-x: auto; flex: 1; touch-action: pan-x; scrollbar-width: none; }
.bcats::-webkit-scrollbar { display: none; }
.bcat { flex: none; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.bcat.on { background: var(--blue); color: #fff; }
.build-done { min-height: 48px; flex: none; }
.blist { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 4px; touch-action: pan-x; scrollbar-width: none; }
.blist::-webkit-scrollbar { display: none; }
.cat-card {
  flex: none; width: 118px; height: 142px; border: 0; border-radius: 22px; background: #fff; padding: 8px 6px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); transition: transform .15s;
}
.cat-card:active { transform: scale(.93); }
.cat-art { flex: 1; min-height: 0; display: grid; place-items: center; color: var(--blue); }
.cat-art .item-prev { width: 86px; height: 80px; }
.cat-name { font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.15; max-width: 108px; }
.cat-card.auto { background: linear-gradient(160deg, #EEF5FF, #FFFFFF); box-shadow: inset 0 0 0 2px rgba(10, 132, 255, .35); }
.sel-tools {
  position: absolute; z-index: 26; display: flex; gap: 6px; padding: 6px; border-radius: 999px; opacity: 0; pointer-events: none;
  transform: scale(.8); transition: opacity .15s, transform .2s cubic-bezier(.2, 1.5, .4, 1);
}
.sel-tools.show { opacity: 1; pointer-events: auto; transform: none; }
.sel-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .05); color: var(--ink); }
.sel-btn:active { transform: scale(.88); }
.sel-btn:last-child { color: var(--red); }
.room .it.editable { cursor: move; }

/* -------------------------------------------------- phone */
.modal.phone-modal { width: auto; max-height: none; background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; }
.phone-body { padding: 0; overflow: visible; }
.phone {
  position: relative; width: min(390px, 92vw); height: min(780px, calc(100vh - 32px)); border-radius: 56px; padding: 12px;
  background: linear-gradient(160deg, #2A2D3A, #11131A); box-shadow: 0 30px 80px rgba(10, 20, 50, .45), inset 0 0 0 2px rgba(255, 255, 255, .12);
  display: flex; flex-direction: column;
}
.phone::before { content: ''; position: absolute; inset: 12px; border-radius: 44px; background: radial-gradient(120% 70% at 20% 0%, #CFE7FF 0%, #EADFFF 45%, #FFE1EC 100%); }
.ph-status { position: relative; display: flex; align-items: center; justify-content: space-between; height: 46px; padding: 0 30px; font-weight: 700; font-size: 15px; color: var(--ink); flex: none; }
.ph-island { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: 112px; height: 32px; border-radius: 20px; background: #0B0C10; }
.ph-bat { width: 28px; height: 14px; border-radius: 5px; border: 2px solid var(--ink); padding: 1px; display: block; }
.ph-bat i { display: block; width: 70%; height: 100%; border-radius: 2px; background: var(--ink); }
.ph-screen { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 8px 18px 30px; touch-action: pan-y; scrollbar-width: none; }
.ph-screen::-webkit-scrollbar { display: none; }
.ph-homebar { position: relative; flex: none; align-self: center; width: 140px; height: 26px; border: 0; background: transparent; margin-bottom: 4px; }
.ph-homebar::after { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 6px; border-radius: 6px; background: rgba(0, 0, 0, .55); }
.ph-widget { margin: 10px 4px 22px; padding: 18px 20px; border-radius: 26px; background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.ph-w-big { font-size: 46px; font-weight: 800; letter-spacing: -.02em; }
.ph-w-small { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.ph-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 8px; }
.ph-app { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.ph-app:active .ph-ico { transform: scale(.9); }
.ph-ico { width: 70px; height: 70px; border-radius: 22px; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 18px rgba(40, 40, 90, .2), inset 0 1px 0 rgba(255, 255, 255, .4); transition: transform .15s; }
.ph-head { display: flex; align-items: center; gap: 6px; margin: 2px -6px 10px; }
.ph-back { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 10px 0 4px; border: 0; background: transparent; color: var(--blue); font-size: 16px; font-weight: 700; }
.ph-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-left: auto; margin-right: 6px; }
.ph-sub { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 16px 4px 8px; }
.ph-sub.row { display: flex; align-items: center; justify-content: space-between; }
.ph-new { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px; border: 0; border-radius: 22px; background: rgba(255, 255, 255, .8); text-align: left; }
.ph-new b { display: block; font-size: 17px; }
.ph-new small { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.ph-new-ico { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--blue); color: #fff; flex: none; }
.ph-people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ph-person { border: 0; border-radius: 22px; background: rgba(255, 255, 255, .8); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ph-person:active { transform: scale(.95); }
.ph-person.here { box-shadow: inset 0 0 0 3px var(--green); }
.ph-av { width: 74px; height: 74px; border-radius: 50%; }
.ph-pname { font-size: 16px; font-weight: 800; }
.ph-where { font-size: 11px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.2; }
.ph-person.here .ph-where { color: var(--green); }
.ph-house-name { text-align: center; font-size: 20px; font-weight: 800; margin-top: 2px; }
.ph-seg { display: flex; gap: 4px; padding: 4px; margin: 10px auto 8px; border-radius: 999px; background: rgba(0, 0, 0, .06); width: max-content; }
.ph-seg-btn { width: 52px; height: 40px; border: 0; border-radius: 999px; background: transparent; font-size: 17px; font-weight: 800; color: var(--ink-2); }
.ph-seg-btn.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.ph-house-wrap { display: flex; justify-content: center; }
.ph-house { width: 100%; max-width: 300px; cursor: pointer; }
.ph-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-top: 10px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, .82); text-align: left; color: var(--ink); }
.ph-row-text { flex: 1; }
.ph-row-text b { display: block; font-size: 16px; }
.ph-row-text small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ph-row-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(48, 194, 90, .14); color: var(--green); flex: none; }
.ph-row.warn .ph-row-ico { background: rgba(255, 69, 58, .14); color: var(--red); }
.ph-row-ico.cam { background: rgba(10, 132, 255, .14); color: var(--blue); }
.ph-switch { width: 52px; height: 32px; border-radius: 999px; background: #E3E5EA; position: relative; flex: none; transition: background .2s; }
.ph-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.ph-switch.on { background: var(--red); }
.ph-switch.on::after { transform: translateX(20px); }
.ph-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .85); font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); }
.ph-room { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-top: 8px; border-radius: 18px; background: rgba(255, 255, 255, .82); }
.ph-room .ph-row-ico { width: 38px; height: 38px; border-radius: 12px; background: rgba(0, 0, 0, .05); color: var(--ink-2); }
.ph-room-name { flex: 1; font-weight: 700; font-size: 15px; }
.ph-tog { width: 48px; height: 48px; border-radius: 14px; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .06); color: var(--ink-3); }
.ph-tog.on { background: #FFD60A; color: #6B4E00; }
.ph-tog.curt.on { background: #FF8FB1; color: #fff; }
.ph-cams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-cam { position: relative; border: 0; padding: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 11; background: #111; }
.ph-cam-view { width: 100%; height: 100%; display: block; filter: saturate(.75) contrast(1.05); }
.ph-cam::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .08) 0 2px, transparent 2px 4px); pointer-events: none; }
.ph-cam-label { position: absolute; left: 6px; top: 6px; display: flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 700; z-index: 1; }
.ph-cam-label i { width: 7px; height: 7px; border-radius: 50%; background: #FF453A; }
.ph-cam-time { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; z-index: 1; }

/* -------------------------------------------------- math */
.math-modal .modal-body { padding-bottom: 22px; }
.skin-notebook.modal { background: #FFFFFF; }
.skin-notebook .modal-body {
  background:
    linear-gradient(90deg, transparent 54px, rgba(255, 120, 130, .45) 54px 56px, transparent 56px),
    repeating-linear-gradient(180deg, transparent 0 41px, rgba(110, 150, 230, .22) 41px 43px);
  background-attachment: local;
}
.skin-classroom.modal { background: #2F6B4F; border: 14px solid #C08A5C; box-shadow: 0 30px 80px rgba(20, 40, 30, .45), inset 0 0 40px rgba(0, 0, 0, .25); color: #F4F6F0; }
.skin-classroom .modal-title, .skin-classroom .modal-title .ico, .skin-classroom .math-h, .skin-classroom .math-p, .skin-classroom .math-label, .skin-classroom .math-count { color: #F4F6F0; }
.skin-classroom .modal-x { background: rgba(255, 255, 255, .15); color: #fff; }
.math { display: flex; flex-direction: column; gap: 16px; }
.math-intro { display: flex; align-items: center; gap: 16px; padding-left: 40px; }
.math-teacher { width: 96px; height: 140px; flex: none; }
.math-h { font-size: clamp(22px, 3.4vmin, 30px); font-weight: 800; letter-spacing: -.02em; }
.math-p { font-size: 17px; color: var(--ink-2); line-height: 1.4; }
.center { text-align: center; }
.math-modes { display: flex; gap: 4px; padding: 4px; margin-left: 40px; align-self: flex-start; border-radius: 999px; background: rgba(0, 0, 0, .06); }
.math-modes .mode { height: 52px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; color: var(--ink-2); transition: background .2s, color .2s; }
.math-modes .mode.on { background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgba(30, 40, 80, .14); }
.math-years { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; padding-left: 40px; }
.math-year {
  position: relative; min-height: 64px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, .92); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .07); transition: transform .12s, background .2s;
}
.math-year b { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.math-year sup { font-size: .6em; }
.math-year small { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.math-year:active { transform: scale(.94); }
.math-year.on { background: var(--lc); color: #fff; box-shadow: 0 6px 16px rgba(30, 40, 80, .18); }
.math-year.on small { color: rgba(255, 255, 255, .88); }
.math-year.fit::after { content: ''; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px #fff; }
.math-year.on.fit::after { background: #fff; box-shadow: none; }
.math-level-card {
  display: flex; align-items: flex-start; gap: 14px; margin-left: 40px; padding: 14px 16px; border-radius: 24px; color: var(--ink);
  background: rgba(255, 255, 255, .92); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 4px 12px rgba(30, 40, 80, .06);
}
.ml-ico { flex: none; width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--lc); color: #fff; }
.ml-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ml-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ml-name { font-size: 19px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.ml-desc { font-size: 14px; color: var(--ink-2); font-weight: 600; line-height: 1.35; }
.ml-cls { display: inline-block; padding: 0 7px; border-radius: 7px; background: var(--lc); color: #fff; font-weight: 800; }
.ml-tag { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: rgba(0, 0, 0, .06); color: var(--ink-2); }
.ml-tag.fit { background: var(--green); color: #fff; }
.ml-tag.hard { background: rgba(255, 159, 10, .16); color: #B25E00; }
.ml-exs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
.ml-ex { display: flex; align-items: center; min-height: 40px; padding: 4px 12px; border-radius: 14px; background: rgba(0, 0, 0, .045); }
.math-tables { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-left: 40px; }
.math-label { font-weight: 800; color: var(--ink-2); margin-right: 6px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.seg { min-width: 58px; height: 50px; padding: 0 16px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .92); font-size: 18px; font-weight: 800; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.seg.on { background: var(--blue); color: #fff; }
.math-step-btn { min-width: 50px; width: 50px; padding: 0; display: inline-grid; place-items: center; color: var(--blue); }
.math-step-btn:active { transform: scale(.92); }
.math-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 124px; height: 50px; padding: 0 18px; border-radius: 999px; background: #fff; color: var(--blue); font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 2px var(--blue); }
.math-go { display: flex; justify-content: center; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.math-top { display: flex; align-items: center; gap: 14px; padding-left: 40px; }
.math-progress { flex: 1; height: 14px; border-radius: 14px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.math-progress i { display: block; height: 100%; border-radius: 14px; background: linear-gradient(90deg, #30C25A, #7ED957); transition: width .4s ease; }
.skin-classroom .math-progress { background: rgba(255, 255, 255, .18); }
.math-count { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.math-earned { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 18px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.math-play { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.math-left { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-left: 40px; }
.math-eq { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.4vw, 18px); font-size: clamp(54px, 10vmin, 104px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.math-eq .op { display: grid; place-items: center; color: var(--blue); }
.skin-classroom .math-eq .op { color: #FFE27A; }
.math-eq .op .ico { width: .55em; height: .55em; }
.math-eq .ans {
  min-width: 1.6em; padding: 0 .18em; border-radius: 22px; text-align: center; background: rgba(10, 132, 255, .1); color: var(--blue);
  box-shadow: inset 0 0 0 4px rgba(10, 132, 255, .35); transition: background .2s, color .2s;
}
.skin-classroom .math-eq .ans { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .4); }
.math-eq .ans.empty { color: rgba(10, 132, 255, .45); }
.math-eq .ans.right { background: var(--green); color: #fff; box-shadow: none; animation: bump .5s cubic-bezier(.3, 1.8, .5, 1); }
.math-eq .ans.wrong { background: rgba(255, 69, 58, .18); color: var(--red); animation: shake .4s ease; }
.math-eq .ans.shown { background: #FFE27A; color: #6B4E00; box-shadow: none; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.math-msg { min-height: 44px; display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; }
.math-msg.good { color: var(--green); }
.math-msg.try { color: var(--orange); }
.math-msg.show { color: var(--ink-2); }
.skin-classroom .math-msg.good { color: #9BFFB0; }
.skin-classroom .math-msg.show { color: #F4F6F0; }
.math-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key {
  height: clamp(58px, 9vmin, 78px); border: 0; border-radius: 22px; background: #fff; font-size: clamp(26px, 4vmin, 34px); font-weight: 800; color: var(--ink);
  box-shadow: 0 3px 0 rgba(30, 40, 80, .12), inset 0 0 0 1px rgba(0, 0, 0, .06); display: grid; place-items: center; transition: transform .1s;
}
.key:active { transform: translateY(2px) scale(.96); box-shadow: 0 1px 0 rgba(30, 40, 80, .12); }
.key.ok { background: var(--green); color: #fff; }
.key.del { background: rgba(255, 255, 255, .7); color: var(--ink-2); }
.math-stars { display: flex; justify-content: center; gap: 14px; margin-top: 4px; }
.mstar { color: #D9DCE3; animation: popstar .5s cubic-bezier(.3, 1.8, .5, 1) both; }
.mstar.on { color: #FFB21E; }
.mstar.on .ico { fill: #FFD45C; }
@keyframes popstar { from { transform: scale(0) rotate(-40deg); } }
.math-reward { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 30px; font-weight: 800; flex-wrap: wrap; }
.math-reward small { width: 100%; text-align: center; font-size: 15px; color: var(--ink-2); font-weight: 600; }
.skin-classroom .math-reward small { color: #DDEAD9; }
@media (max-width: 900px) { .math-years { grid-template-columns: repeat(5, minmax(0, 1fr)); } .math-modes .mode { padding: 0 12px; } }

/* -------------------------------------------------- shop + bag */
.wallet { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 8px; border-radius: 999px; background: #fff; font-size: 20px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); margin-left: auto; }
.shop-hint { margin: 0 0 14px; color: var(--ink-2); font-size: 16px; line-height: 1.4; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-card { position: relative; border-radius: 24px; background: #fff; padding: 12px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 4px 12px rgba(30, 40, 80, .05); }
.shop-card.bought { animation: bump .45s cubic-bezier(.3, 1.8, .5, 1); }
.shop-name { font-weight: 800; font-size: 15px; text-align: center; }
.shop-row { display: flex; align-items: center; gap: 10px; }
.small-pill { min-height: 44px; padding: 0 16px; font-size: 15px; }
.bag-count { position: absolute; top: 10px; right: 10px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 800; display: grid; place-items: center; }
.bag-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.bag-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; }
.bag-empty-ico { width: 100px; height: 100px; border-radius: 34px; display: grid; place-items: center; background: rgba(255, 92, 154, .12); color: var(--pink); }
.bag-pick-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bag-people { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.bag-people .avatar { border-radius: 50%; }
.skin-classroom .pill-btn.ghost { background: rgba(255, 255, 255, .16); color: #fff; }
.skin-classroom .math-year, .skin-classroom .math-level-card { background: rgba(255, 255, 255, .95); }
.skin-classroom .math-year.on { background: var(--lc); }
.skin-classroom .math-modes { background: rgba(255, 255, 255, .14); }
.skin-classroom .math-modes .mode { color: #F4F6F0; }
.skin-classroom .math-modes .mode.on { color: var(--ink); }

/* -------------------------------------------------- go-kart builder */
.kart-stage { position: absolute; inset: 0; width: 100%; height: 100%; }
.kart-bob { animation: bob 2.4s ease-in-out infinite; }
.kart-ui {
  position: absolute; z-index: 5; right: calc(var(--gap) + var(--safe-r)); top: calc(var(--btn) + var(--gap) * 2 + var(--safe-t)); bottom: calc(var(--gap) + var(--safe-b));
  width: min(470px, 44vw); border-radius: 32px; display: flex; flex-direction: column; overflow: hidden;
}
.kart-panel { padding-bottom: 16px; }
.opt-grid.wide { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.opt-grid.wide .opt { aspect-ratio: 1.25 / 1; }
.kart-actions { display: flex; gap: 10px; padding: 12px; border-top: 1px solid rgba(0, 0, 0, .06); }
.kart-actions .go-race { flex: 1; min-height: 64px; }
.num-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0 18px; }
.num-big { min-width: 120px; height: 120px; border-radius: 34px; background: #fff; display: grid; place-items: center; font-size: 64px; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.num-btn { width: 72px; height: 72px; padding: 0; }

/* -------------------------------------------------- race */
.scene-race { background: #86CC66; }
.race-pos { gap: 8px; }
.race-pos .ico { color: #FFB21E; }
.race-controls { position: absolute; z-index: 21; left: 0; right: 0; bottom: calc(var(--gap) + var(--safe-b)); display: flex; justify-content: space-between; padding: 0 calc(var(--gap) + var(--safe-l)); pointer-events: none; }
.race-left, .race-right { display: flex; gap: 14px; pointer-events: auto; }
.race-btn {
  width: clamp(76px, 11vmin, 104px); height: clamp(76px, 11vmin, 104px); border-radius: 50%; border: 1px solid var(--glass-line);
  background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--glass-shadow); display: grid; place-items: center;
  touch-action: none; transition: transform .1s, background .15s;
}
.race-btn.on { transform: scale(.9); background: rgba(10, 132, 255, .85); color: #fff; }
.race-btn.gas { background: rgba(48, 194, 90, .85); color: #fff; width: clamp(90px, 13vmin, 124px); height: clamp(90px, 13vmin, 124px); }
.race-btn.gas.on { background: #1E9E46; }
.race-btn.brake { color: var(--red); }
.start-lights {
  position: absolute; z-index: 30; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 18px; align-items: center;
  padding: 22px 30px; border-radius: 999px; transition: opacity .4s, transform .4s;
}
.start-lights i { width: 72px; height: 72px; border-radius: 50%; background: #3A3F4F; box-shadow: inset 0 4px 10px rgba(0, 0, 0, .4); transition: background .1s, box-shadow .1s; }
.start-lights i.red { background: #FF3B30; box-shadow: 0 0 30px rgba(255, 59, 48, .8), inset 0 -4px 8px rgba(0, 0, 0, .2); }
.start-lights i.green { background: #30D158; box-shadow: 0 0 30px rgba(48, 209, 88, .8), inset 0 -4px 8px rgba(0, 0, 0, .2); }
.start-lights .go { width: 0; overflow: hidden; font-size: 48px; font-weight: 900; color: #1E9E46; transition: width .2s; white-space: nowrap; }
.start-lights.going .go { width: 110px; }
.start-lights.out { opacity: 0; transform: translate(-50%, -80%) scale(.9); }
.results-modal { width: min(700px, 94vw); }
.results { display: flex; flex-direction: column; gap: 12px; }
.podium svg { width: 100%; height: auto; max-height: 42vh; }
.tool.danger { color: var(--red); }
.village .walk-bob { animation: walkbob .42s ease-in-out infinite; }
.village .walker.resting .walk-bob { animation: bob 2.6s ease-in-out infinite; }
.village .walk-bob.jump { animation: jump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes walkbob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }

/* -------------------------------------------------- players */
.players-modal { width: min(820px, 96vw); }
.players-modal.form { width: min(620px, 96vw); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pl-card {
  border: 0; border-radius: 26px; background: #fff; padding: 16px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 4px 14px rgba(30, 40, 80, .06); color: var(--ink); transition: transform .15s;
}
.pl-card:active { transform: scale(.95); }
.pl-card.on { box-shadow: inset 0 0 0 3px var(--ring), 0 6px 18px rgba(30, 40, 80, .1); }
.pl-card.add { background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 2px rgba(10, 132, 255, .25); }
.pl-add { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 132, 255, .12); color: var(--blue); }
.pl-face { border-radius: 50%; flex: none; }
.pl-name { font-size: 19px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-age { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.pl-foot { display: flex; justify-content: center; margin-top: 16px; }
.pl-form { display: flex; flex-direction: column; gap: 10px; }
.pl-form .opt-title { margin: 10px 2px 0; }
.big-input { height: 64px; font-size: 24px; }
.pl-ages { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.pl-age-btn { height: 60px; border: 0; border-radius: 18px; background: #fff; font-size: 22px; font-weight: 800; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .12s; }
.pl-age-btn:active { transform: scale(.92); }
.pl-age-btn.on { background: var(--blue); color: #fff; box-shadow: none; }
.pl-hint { margin: 0 2px; font-size: 14px; color: var(--ink-2); }
.pill-btn.danger-text { color: var(--red); margin-right: auto; }
.pl-head { display: flex; align-items: center; gap: 16px; }
.pl-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.pl-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); color: var(--ink-2); font-size: 13px; font-weight: 700; }
.pl-stat b { font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pl-stat .ico { color: var(--blue); }
.pl-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pl-actions .pill-btn { flex: 1 1 180px; }
.pl-saved { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--green); }
.code-box {
  width: 100%; min-height: 120px; border: 0; border-radius: 16px; padding: 12px 14px; resize: vertical; background: rgba(0, 0, 0, .05); color: var(--ink);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; -webkit-user-select: text; user-select: text; outline: none;
}
.code-box:focus { box-shadow: 0 0 0 3px rgba(10, 132, 255, .35); }
.pl-error { margin: 0; min-height: 20px; color: var(--red); font-weight: 700; }
.player-chip {
  height: var(--btn); padding: 0 18px 0 6px; border-radius: 999px; display: flex; align-items: center; gap: 10px;
  font-size: clamp(15px, 2.2vmin, 19px); font-weight: 800; max-width: 230px;
}
.player-chip .pl-face { width: calc(var(--btn) - 12px); height: calc(var(--btn) - 12px); }
.player-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-chip:active { transform: scale(.95); }
@media (max-width: 760px) { .pl-ages { grid-template-columns: repeat(5, 1fr); } .pl-stats { grid-template-columns: repeat(2, 1fr); } .player-chip span { display: none; } .player-chip { padding: 0 6px; } }

/* math: problem parts (counting dots, words, fractions, percents, negative numbers) and extra pad keys */
.math-eq > * { flex: none; }
.math-eq .eq-break { display: none; }
.math-eq.two-lines { flex-wrap: wrap; row-gap: .06em; }
.math-eq.two-lines .eq-break { display: block; flex-basis: 100%; width: 100%; height: 0; }
.math-eq .num { display: inline-flex; align-items: center; }
.math-eq .num.with-dots { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.math-dots { color: #FF5C9A; }
.skin-classroom .math-dots { color: #FFE27A; }
.math .gap { display: inline-block; width: .22em; }
.math-msg .sign { display: inline-grid; place-items: center; }
.math-eq .word { font-size: .42em; font-weight: 800; letter-spacing: 0; color: var(--ink-2); }
.skin-classroom .math-eq .word { color: #DDEAD9; }
.math-eq .br { font-weight: 500; opacity: .75; }
.math-eq .sign { display: inline-grid; place-items: center; }
.math-eq .sign .ico { width: .5em; height: .5em; }
.math-eq .neg { display: inline-flex; align-items: center; }
.math-eq .pct { display: inline-grid; place-items: center; margin-left: .04em; }
.math-eq .pct .ico { width: .72em; height: .72em; }
.math-eq .frac { display: inline-flex; flex-direction: column; align-items: center; font-size: .62em; line-height: 1.08; }
.math-eq .frac > span { display: flex; justify-content: center; min-width: 1.2em; padding: 0 .12em; }
.math-eq .frac .ft { border-bottom: .08em solid currentColor; padding-bottom: .05em; margin-bottom: .05em; }
.math-eq .frac .ans { border-radius: 16px; min-width: 1.4em; }
.math-eq .ans { display: inline-flex; align-items: center; justify-content: center; }
.math-eq.mini { font-size: 22px; gap: 6px; letter-spacing: 0; }
.math-eq.mini .ans { min-width: 1.3em; padding: 0 .2em; border-radius: 8px; box-shadow: inset 0 0 0 2px rgba(10, 132, 255, .35); color: rgba(10, 132, 255, .6); background: rgba(10, 132, 255, .08); }
.math-eq.mini .frac .ans { border-radius: 6px; }
.math-eq.mini .count .math-dots { height: 1.05em; width: auto; }
.math-eq.mini .math-dots { color: #FF5C9A; }
.math-eq.mini .word { font-size: .62em; color: var(--ink-2); }
.math-eq.mini .op { color: var(--blue); }
.math-pad.has-extra .key { height: clamp(52px, 7.6vmin, 70px); }
.pad-extra { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.key.extra { background: rgba(255, 255, 255, .85); color: var(--ink); }
.key .comma { font-size: 2.2em; line-height: .5; transform: translateY(-.2em); }

/* -------------------------------------------------- furniture that opens (see door() / drawer() in furniture.js) */
.op { transform-box: fill-box; cursor: pointer; transition: transform .55s cubic-bezier(.25, .9, .3, 1.04); }
.op-l { transform-origin: 0% 50%; }
.op-r { transform-origin: 100% 50%; }
.op-l.open { transform: scaleX(-.38) skewY(16deg); }
.op-r.open { transform: scaleX(-.38) skewY(-16deg); }
.op-down { transform-origin: 50% 100%; }
.op-down.open { transform: scaleY(-.62); }
.op-up, .op-lid { transform-origin: 50% 0%; }
.op-up.open { transform: scaleY(-.5); }
.op-lid.open { transform: scaleY(-.82); }
.op .op-in { opacity: 0; }
.op .op-in, .op .op-out { transition: opacity .05s linear .06s; }
.op.open .op-in { opacity: 1; transition-delay: .17s; }
.op.open .op-out { opacity: 0; transition-delay: .17s; }
.op-drawer { transform-origin: 50% 0%; }
.op-drawer.open { transform: translateY(var(--pull, 26px)); }
.op-drawer .op-box { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform .5s cubic-bezier(.25, .9, .3, 1.04); }
.op-drawer.open .op-box { transform: scaleY(1); }
.op-flag { transform-box: fill-box; transform-origin: 15% 100%; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.op-flag.open { transform: rotate(-80deg); }
.room .it.dragging { filter: drop-shadow(0 18px 14px rgba(20, 26, 51, .28)); }
.room .it.moveable { cursor: grab; }

/* -------------------------------------------------- little life everywhere */
.pulse-soft { transform-box: fill-box; transform-origin: center; animation: pulseSoft 2.4s ease-in-out infinite; }
@keyframes pulseSoft { 0%, 100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.steam { transform-box: fill-box; transform-origin: center; animation: steam 2.1s ease-out infinite; opacity: 0; }
@keyframes steam { 0% { transform: translateY(0) scale(.6); opacity: 0; } 25% { opacity: .75; } 100% { transform: translateY(-46px) scale(1.5); opacity: 0; } }
.flow { animation: flow .5s linear infinite; }
@keyframes flow { 0%, 100% { opacity: .95; } 50% { opacity: .7; } }
.ripple { transform-box: fill-box; transform-origin: center; animation: ripple 1s ease-out infinite; }
@keyframes ripple { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }
.bubble { transform-box: fill-box; transform-origin: center; animation: bubble 2.2s ease-in infinite; }
@keyframes bubble { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-60px) scale(1.1); opacity: 0; } }
.flicker { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .5s ease-in-out infinite alternate; }
@keyframes flicker { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.94, 1.08) skewX(3deg); } 100% { transform: scale(1.05, .95) skewX(-3deg); } }
.spin-c { transform-box: fill-box; transform-origin: center; animation: spinr 1.4s linear infinite; }
.globe-turn { animation: globeTurn 3s linear infinite; }
@keyframes globeTurn { from { transform: translateX(0); } to { transform: translateX(68px); } }
.belt { animation: belt 1s linear infinite; }
@keyframes belt { from { transform: translateX(0); } to { transform: translateX(20px); } }
.bag-ride { animation: bagRide 6s linear infinite; }
@keyframes bagRide { 0% { transform: translateX(-170px); opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(170px); opacity: 0; } }
.scan-line { animation: scanLine 1.6s ease-in-out infinite alternate; }
@keyframes scanLine { from { transform: translateX(0); } to { transform: translateX(118px); } }
@media (prefers-reduced-motion: reduce) {
  .op, .op-drawer .op-box, .op-flag { transition-duration: .01s; }
  .steam, .bubble, .flicker, .spin-c, .globe-turn, .belt, .bag-ride, .scan-line, .ripple, .pulse-soft { animation: none !important; }
}
.mote { animation: mote 7s ease-in-out infinite; }
@keyframes mote { 0%, 100% { transform: translate(0, 0); opacity: 0; } 20% { opacity: .8; } 50% { transform: translate(26px, 40px); } 80% { opacity: .6; } }
.cloud-drift { animation: drift 26s linear infinite; }
.curtain-sway { transform-box: fill-box; transform-origin: 50% 0%; animation: curtain 6s ease-in-out infinite; }
@keyframes curtain { 0%, 100% { transform: skewX(0); } 50% { transform: skewX(1.6deg); } }
@media (prefers-reduced-motion: reduce) { .mote, .cloud-drift, .curtain-sway { animation: none !important; } }

/* -------------------------------------------------- airplane: window shades, bins, seatbelt sign, take-off and landing */
.dop { cursor: pointer; }
.dop-win .shade { transform-box: fill-box; transform-origin: 50% 0%; transform: scaleY(.14); transition: transform .5s cubic-bezier(.3, .9, .3, 1); }
.dop-win.open .shade { transform: scaleY(1); }
.dop-sign .lit { opacity: 0; transition: opacity .25s; }
.dop-sign.open .lit, .fl-belts .dop-sign .lit { opacity: 1; }
.op-yoke { transform-box: fill-box; transform-origin: 50% 25%; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.op-yoke.open { transform: rotate(-16deg); }
.fl-land { transition: transform 5.6s cubic-bezier(.55, 0, .85, .6); }
.fl-takeoff .fl-land, .fl-air .fl-land { transform: translateY(260px); }
.fl-landing .fl-land { transform: translateY(0); transition: transform 6.4s cubic-bezier(.2, .5, .4, 1); }
.fl-fast { opacity: 0; transition: opacity 1.6s; }
.fl-takeoff .fl-fast, .fl-air .fl-fast, .fl-landing .fl-fast { opacity: 1; }
.cloud-fast { animation: drift 2.8s linear infinite; }
.fl-bank { transform-box: fill-box; transform-origin: center; }
.fl-air .fl-bank { animation: bank 9s ease-in-out infinite; }
@keyframes bank { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(2.6deg); } 70% { transform: rotate(-2.2deg); } }
.radar { transform-box: fill-box; transform-origin: center; animation: spinr 3s linear infinite; }
.gauge { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(.35); transition: transform 2s; }
.fl-takeoff .gauge, .fl-air .gauge, .fl-landing .gauge { transform: scaleY(1); animation: gauge 1.2s ease-in-out infinite alternate; }
@keyframes gauge { from { transform: scaleY(.8); } to { transform: scaleY(1); } }
.room.fl-takeoff > g, .room.fl-landing > g { transform-origin: 800px 500px; animation: cabinShake .17s linear infinite; }
@keyframes cabinShake { 0%, 100% { transform: rotate(.8deg) translate(0, 0); } 25% { transform: rotate(.8deg) translate(1.5px, -1px); } 50% { transform: rotate(.8deg) translate(-1px, 1.5px); } 75% { transform: rotate(.8deg) translate(1px, 1px); } }
@media (prefers-reduced-motion: reduce) {
  .room.fl-takeoff > g, .room.fl-landing > g, .fl-air .fl-bank, .radar, .gauge, .cloud-fast { animation: none !important; }
}
.lever { transition: transform 1.2s cubic-bezier(.3, .9, .3, 1); }
.fl-takeoff .lever, .fl-air .lever { transform: translateY(-18px); }
.hud-fly { min-height: 60px; padding: 0 22px 0 16px; font-size: 18px; color: var(--ink); }
.hud-fly .ico { color: var(--blue); }
.hud-fly.busy { opacity: .6; }
.chan { animation: chan 9s linear infinite; }
@keyframes chan { 0%, 33.3% { opacity: 1; } 33.4%, 100% { opacity: 0; } }
.tv-kart { animation: tvKart 2.4s linear infinite; }
@keyframes tvKart { from { transform: translateX(0); } to { transform: translateX(230px); } }
.tick { transform-box: fill-box; transform-origin: center; animation: spinr 60s steps(60) infinite; }
.tick-m { transform-box: fill-box; transform-origin: center; animation: spinr 3600s linear infinite; }
.flip { transform-box: fill-box; transform-origin: center; animation: flip 7s ease-in-out infinite; }
@keyframes flip { 0%, 90%, 100% { transform: scaleY(1); } 93% { transform: scaleY(.08); } 96% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .chan, .tv-kart, .tick, .tick-m, .flip { animation: none !important; } .chan + .chan, .chan + .chan + .chan { display: none; } }

/* -------------------------------------------------- school streak card */
.streak-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 22px; background: rgba(255, 255, 255, .92); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 4px 12px rgba(30, 40, 80, .06); color: var(--ink); }
.math .streak-card { margin-left: 40px; }
.sk-flame { position: relative; flex: none; width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; background: #EEF0F4; color: #9AA1AF; }
.sk-flame.on { background: linear-gradient(160deg, #FFB34D, #FF6A2B); color: #fff; box-shadow: 0 6px 16px rgba(255, 106, 43, .35); }
.sk-flame b { position: absolute; right: -6px; bottom: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: #fff; color: var(--ink); font-size: 13px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.sk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sk-title { font-size: 17px; font-weight: 800; }
.sk-reward { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.sk-days { display: flex; gap: 6px; }
.sk-day { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: #EEF0F4; color: #9AA1AF; }
.sk-day.done { background: var(--green); color: #fff; }
.sk-day.today { background: #fff; color: #FF6A2B; box-shadow: inset 0 0 0 3px #FFB34D; }
.sk-today { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.sk-bar { flex: 1; max-width: 220px; height: 8px; border-radius: 8px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.sk-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #FFB34D, #FF6A2B); transition: width .4s; }
.skin-classroom .streak-card { background: rgba(255, 255, 255, .95); }
.streak-card.compact { padding: 8px 14px; gap: 12px; }
.streak-card.compact .sk-flame { width: 46px; height: 46px; border-radius: 16px; }
.streak-card.compact .sk-day { width: 24px; height: 24px; font-size: 11px; }
.streak-card.compact .sk-body { gap: 4px; }
.streak-card.compact .sk-title { font-size: 15px; }

/* -------------------------------------------------- Build Mode: room look (walls, floor, windows) */
.look-group { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border-radius: 22px; background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); height: 142px; box-sizing: border-box; }
.look-label { font-size: 12px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.look-grid { display: grid; grid-template-columns: repeat(6, 52px); gap: 4px 6px; }
.look-swatch { width: 52px; height: 48px; border: 0; border-radius: 16px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .12s; }
.look-swatch.on { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 0 0 3px #fff, 0 0 0 6px var(--blue); }
.look-swatch:active { transform: scale(.9); }
.look-types { display: grid; grid-template-columns: repeat(3, 92px); gap: 6px; }
.look-type { height: 48px; border: 0; border-radius: 14px; background: rgba(0, 0, 0, .05); font-size: 15px; font-weight: 800; color: var(--ink); }
.look-type.on { background: var(--blue); color: #fff; }
.room .win-edit { cursor: ew-resize; }

/* -------------------------------------------------- race: trophies instead of coin prizes, price on the Race button */
.race-trophy { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 19px; font-weight: 700; color: var(--ink); text-align: left; }
.rt-ico { width: 52px; height: 52px; flex: none; border-radius: 18px; display: grid; place-items: center; color: #8E95A6; background: linear-gradient(160deg, #F4F6FA, #DDE2EA); box-shadow: inset 0 1px 0 #fff, 0 4px 10px rgba(30, 40, 80, .12); }
.rt-ico.gold { color: #fff; background: linear-gradient(160deg, #FFE27A, #F2A93B); }
.hud-race { position: relative; }
.hud-race .price { position: absolute; right: -6px; bottom: -6px; padding: 1px 6px 1px 2px; font-size: 12px; border-radius: 999px; background: #fff; box-shadow: 0 2px 6px rgba(30, 40, 80, .2); pointer-events: none; }
