@font-face {
  font-family: Pixel;
  src: url(VT323.ttf) format("truetype");
  font-display: swap;
}
* {
  box-sizing: border-box;
}
:root {
  --ink: #172458;
  --purple: #7045ff;
  --yellow: #ffda48;
  --orange: #ff9144;
  --mint: #3bdc88;
  --paper: #fafaff;
}
body {
  margin: 0;
  min-height: 100vh;
  background-color: #14bbed;
  color: var(--ink);
  font-family: Pixel, "Courier New", monospace;
  font-size: 24px;
  background-image:
    linear-gradient(transparent 70%, #6edff3),
    repeating-linear-gradient(45deg, #ffffff05 0 9px, transparent 9px 35px);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible {
  outline: 4px solid #ffcc00;
  outline-offset: 4px;
}
button,
.button {
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow:
    inset 0 3px #ffffff80,
    inset 0 -4px #0002,
    3px 4px 0 #16235380;
  background: var(--purple);
  color: white;
  padding: 8px 20px;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 0.12s,
    filter 0.12s;
}
button:hover:not(:disabled),
.button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}
button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 0 2px #0002;
}
input,
select,
textarea {
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  padding: 9px 12px;
  min-width: 0;
  width: 100%;
  outline-offset: 3px;
}
input:focus,
select:focus {
  outline: 2px solid #7355ff;
}
label {
  display: block;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 60px;
  font-weight: 400;
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 3px 3px #2774ad;
}
h2 {
  font-size: 38px;
  font-weight: 400;
}
h3 {
  font-size: 28px;
  font-weight: 400;
}
small {
  font-size: 20px;
}
.cloud {
  position: fixed;
  z-index: -1;
  background: #faf7ff;
  box-shadow: inset 0 -20px #c6c3fa;
  width: 160px;
  height: 85px;
  clip-path: polygon(
    0 50%,
    12% 50%,
    12% 32%,
    25% 32%,
    25% 12%,
    40% 12%,
    40% 0,
    62% 0,
    62% 15%,
    75% 15%,
    75% 35%,
    88% 35%,
    88% 50%,
    100% 50%,
    100% 80%,
    80% 80%,
    80% 92%,
    60% 92%,
    60% 100%,
    30% 100%,
    30% 90%,
    12% 90%,
    12% 75%,
    0 75%
  );
}
.cloud-one {
  left: 1%;
  top: 7%;
}
.cloud-two {
  right: 1%;
  top: 22%;
  width: 185px;
}
.ground {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  z-index: -1;
  background: url(ground.svg) bottom left / auto 100% repeat-x;
  pointer-events: none;
}
.panel {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 9px;
  box-shadow:
    7px 7px 0 #1f346260,
    inset 0 0 0 4px #fff;
  padding: 18px;
}
.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 18px 100px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  min-height: 70px;
}
.brand {
  text-align: center;
}
.brand small {
  text-transform: uppercase;
}
.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}
.userbox button {
  padding: 0;
  background: #d9faff;
  box-shadow: 2px 3px #385791;
}
.userbox .avatar {
  width: 50px;
  height: 50px;
}
.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pill {
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: #fff9d5;
  padding: 3px 18px;
  white-space: nowrap;
}
.orange {
  background: var(--orange);
  color: var(--ink);
}
.green {
  background: var(--mint);
  color: var(--ink);
}
.yellow {
  background: var(--yellow);
  color: var(--ink);
}
.light {
  background: #e5e1ff;
  color: var(--ink);
}
.danger {
  background: #ff786c;
  color: var(--ink);
}
.small {
  font-size: 20px;
  padding: 5px 12px;
}
.full {
  width: 100%;
}
.link {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #5b43cd;
  padding: 4px;
  font-size: 21px;
  text-transform: none;
}
.section-bar {
  background: var(--purple);
  color: white;
  border: 3px solid var(--ink);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 15px;
  margin-bottom: 15px;
  gap: 10px;
  text-transform: uppercase;
}
.section-bar.math {
  background: var(--orange);
  color: var(--ink);
}
.section-bar h2 {
  font-size: 34px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.catalog-grid.math {
  grid-template-columns: repeat(6, 1fr);
}
.catalog-grid.math .game-card {
  grid-column: span 2;
}
.catalog-grid.math .game-card:nth-child(4) {
  grid-column: 2 / span 2;
}
.game-card {
  border: 2px solid var(--ink);
  outline: 2px solid #d4def1;
  outline-offset: -6px;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(130deg, #fff, #f0f3ff);
}
.game-card .thumb {
  height: 100px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: #e1e9ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  letter-spacing: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.math .thumb {
  background: #d3fae9;
}
.game-card h3 {
  line-height: 1;
  margin: 4px 0;
}
.game-card p {
  font-size: 22px;
  line-height: 0.95;
  flex: 1;
  min-height: 63px;
  text-transform: uppercase;
  margin: 5px 0 10px;
}
.game-card button {
  padding: 5px;
  width: 100%;
}
.game-card small {
  margin: 4px 0;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar input {
  flex: 1;
  min-width: 180px;
}
.toolbar select {
  width: auto;
}
.empty {
  text-align: center;
  padding: 35px;
}
.muted {
  color: #626a91;
}
.notice {
  background: #fff1bd;
  border: 2px solid #dec055;
  padding: 12px;
  margin: 12px 0;
}
.error {
  background: #ffe5e0;
  border: 2px solid #e0524f;
  padding: 12px;
}
.loading {
  max-width: 600px;
  margin: 20vh auto;
  text-align: center;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #182853;
  color: white;
  border: 3px solid white;
  box-shadow: 5px 5px #0005;
  padding: 12px 20px;
  max-width: 90vw;
  z-index: 100;
  display: none;
}
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 50px 16px 100px;
}
.login-heading {
  text-align: center;
  margin-bottom: 48px;
  background: #21afdd;
  padding: 8px 20px;
}
.login-heading h1 {
  font-size: 72px;
  letter-spacing: 2px;
}
.login-panel {
  width: 480px;
  max-width: 100%;
  position: relative;
  padding: 30px 24px 20px;
  background: #f6f5ff;
}
.login-panel legend {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--yellow);
  border: 3px solid var(--ink);
  padding: 0 22px;
  font-size: 38px;
  text-transform: uppercase;
  white-space: nowrap;
}
.tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
}
.tabs button {
  flex: 1;
  background: #dfdfff;
  color: var(--ink);
  padding: 4px;
}
.tabs button.active {
  background: var(--yellow);
}
.field {
  margin: 10px 0;
}
.field label {
  font-size: 23px;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.password {
  position: relative;
}
.password input {
  padding-right: 55px;
}
.password button {
  position: absolute;
  right: 8px;
  top: 9px;
}
.login-panel .start {
  font-size: 48px;
  line-height: 1;
  margin: 16px 0;
}
.login-panel .visitor {
  background: white;
  color: var(--ink);
  font-size: 22px;
  padding: 3px;
}
.login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.login-meta label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 21px;
}
.login-meta input {
  width: 18px;
  height: 18px;
  accent-color: #30ce85;
}
.login-panel footer {
  text-align: center;
  margin-top: 12px;
}
.form-error {
  margin-top: 12px;
  color: #b82e35;
  font-size: 22px;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 120px;
  height: 145px;
}
.avatar svg {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}
.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}
.profile-sidebar {
  border: 2px solid var(--ink);
  border-radius: 5px;
  padding: 12px;
  background: #f6f6ff;
}
.profile-sidebar h3 {
  margin: 12px 0;
}
.characters {
  display: flex;
  gap: 10px;
}
.characters button {
  flex: 1;
  padding: 0;
  background: #e8ecff;
  color: var(--ink);
}
.characters .avatar {
  height: 110px;
  width: 100%;
}
.chosen {
  outline: 4px solid #7750ff;
  outline-offset: -2px;
}
.avatar-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dfdcff;
  border: 2px solid var(--ink);
  min-height: 200px;
}
.avatar-preview .avatar {
  width: 150px;
  height: 190px;
}
.speech {
  max-width: 100px;
  background: white;
  border: 2px solid var(--ink);
  padding: 10px;
  font-size: 23px;
}
.clothes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 12px 0 25px;
}
.shirt {
  padding: 8px;
  background: #f1f1ff;
  position: relative;
  min-width: 0;
}
.shirt svg {
  width: 100%;
  height: 110px;
  filter: drop-shadow(2px 3px 0 #22345b44);
}
.subbar {
  padding: 7px 14px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--orange);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}
.subbar small {
  font-size: 18px;
}
.progress {
  height: 20px;
  background: #d8d7ef;
  border: 2px solid var(--ink);
  margin: 8px 0;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--mint);
  transition: width 0.3s;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.stat {
  background: #e9e4ff;
  border: 2px solid var(--ink);
  padding: 10px;
  text-align: center;
}
.stat strong {
  display: block;
  font-size: 36px;
  font-weight: 400;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 22px;
}
th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #daddec;
}
th {
  background: #e4ddff;
  text-transform: uppercase;
}
tr.me {
  background: #fff3b8;
}
td .avatar {
  width: 36px;
  height: 40px;
  vertical-align: middle;
  margin-right: 10px;
}
.rank-tabs button.active {
  background: var(--yellow);
  color: var(--ink);
}
.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.badge {
  background: #fff3b4;
  border: 2px solid var(--ink);
  padding: 8px 14px;
}
.game-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.game-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 0;
}
.game-meta span {
  background: #eae8ff;
  border: 2px solid var(--ink);
  padding: 4px 14px;
}
.game-stage {
  background: linear-gradient(#e1f7ff, #eef0ff);
  border: 3px solid var(--ink);
  border-radius: 8px;
  min-height: 390px;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.game-stage h2 {
  font-size: 36px;
  max-width: 850px;
  margin: 5px auto 20px;
  line-height: 1.05;
}
.topic {
  text-transform: uppercase;
  color: #6251a0;
  font-size: 20px;
  letter-spacing: 1px;
}
.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  max-width: 800px;
  margin: 25px auto;
}
.options button {
  min-height: 64px;
  text-transform: none;
}
.answer-form {
  display: flex;
  max-width: 560px;
  gap: 12px;
  margin: 25px auto;
}
.answer-form input {
  flex: 1;
}
.feedback {
  padding: 20px;
  border: 3px solid var(--ink);
  background: #fff7da;
  text-align: center;
  margin-top: 16px;
}
.feedback.good {
  background: #d1ffe4;
}
.feedback.bad {
  background: #ffe0da;
}
.feedback h3 {
  font-size: 34px;
}
.feedback p {
  font-size: 25px;
  margin: 10px 0 18px;
}
.result {
  text-align: center;
  padding: 30px;
}
.result .trophy {
  font-size: 75px;
  color: #efb70a;
  text-shadow: 3px 3px var(--ink);
}
.result h2 {
  font-size: 52px;
}
.tile-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0;
}
.tile-row button {
  min-width: 48px;
  padding: 8px 13px;
  font-size: 30px;
}
.tile-row .selected {
  background: var(--yellow);
  color: var(--ink);
}
.token-slot {
  min-height: 75px;
  border: 3px dashed #9281c5;
  padding: 10px;
  margin: 20px 0;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  background: #fff9;
}
.keyboard {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  max-width: 650px;
  justify-content: center;
  margin: 25px auto;
}
.keyboard button {
  width: 48px;
  padding: 5px;
}
.word-mask {
  font-size: 50px;
  letter-spacing: 12px;
  margin: 10px;
}
.hangman {
  width: 130px;
  height: 145px;
  stroke: var(--ink);
  stroke-width: 5;
  fill: none;
}
.letter-grid {
  display: grid;
  gap: 3px;
  max-width: 510px;
  margin: 20px auto;
}
.letter-grid button {
  border-width: 1px;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  aspect-ratio: 1;
  background: #fff;
  color: var(--ink);
  font-size: 26px;
}
.letter-grid button.marked {
  background: var(--yellow);
}
.crossword {
  display: grid;
  grid-template-columns: repeat(5, 45px);
  grid-auto-rows: 45px;
  gap: 3px;
  margin: 20px auto;
  justify-content: center;
}
.crossword input {
  width: 45px;
  height: 45px;
  padding: 0;
  text-align: center;
  text-transform: uppercase;
}
.crossword .blank {
  background: #d6d4ee;
}
.clue-list {
  text-align: left;
  max-width: 600px;
  margin: 10px auto;
}
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 850px;
  margin: 20px auto;
}
.memory-card {
  min-height: 115px;
  font-size: 23px;
  text-transform: none;
  padding: 8px;
  word-break: break-word;
}
.memory-card.open {
  background: #fff;
  color: var(--ink);
}
.memory-card.matched {
  background: var(--mint);
  color: var(--ink);
}
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  max-width: 850px;
  margin: 20px auto;
}
.match-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.match-column button {
  text-transform: none;
  min-height: 70px;
  font-size: 24px;
}
.match-column .selected {
  background: var(--yellow);
  color: var(--ink);
}
.match-column .matched {
  background: var(--mint);
  color: var(--ink);
}
.drop-zones {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.drop-zone {
  background: #fff;
  border: 3px dashed #6347a6;
  min-width: 150px;
  min-height: 130px;
  padding: 18px;
  flex: 1;
  max-width: 250px;
}
.drop-zone strong {
  font-size: 50px;
  display: block;
}
.draggable {
  cursor: grab;
}
.naval-grid {
  display: grid;
  grid-template-columns: 30px repeat(6, 1fr);
  gap: 4px;
  max-width: 420px;
  margin: 20px auto;
}
.naval-grid button {
  aspect-ratio: 1;
  background: #0bc1ec;
  padding: 0;
}
.naval-grid .hit {
  background: var(--yellow);
}
.naval-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
}
.dice {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 80px;
}
.figure-options button {
  font-size: 30px;
}
.clue-box {
  padding: 15px;
  background: white;
  border: 2px solid var(--ink);
  margin: 15px auto;
  max-width: 700px;
  text-align: left;
}
.track {
  height: 110px;
  background: repeating-linear-gradient(0deg, #9c8cad 0 34px, #fff 35px 38px);
  border: 3px solid var(--ink);
  position: relative;
  margin: 20px 0;
}
.car {
  position: absolute;
  left: 0;
  font-size: 50px;
  transition: left 0.6s;
  line-height: 1;
  top: 0;
}
.car.rival {
  top: 50px;
}
.track::after {
  content: "⚑";
  position: absolute;
  right: 5px;
  font-size: 55px;
  color: #fff;
}
.rainfield {
  position: relative;
  height: 140px;
  border-bottom: 8px solid #57ba79;
  background: #cceeff;
  overflow: hidden;
}
.falling {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 0;
  background: #fff8d5;
  border: 3px solid var(--ink);
  padding: 7px;
  font-size: 24px;
  animation: fall linear forwards;
}
@keyframes fall {
  to {
    transform: translateY(145px);
  }
}
.defense {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100px;
  background: #c2ecb9;
  border-bottom: 8px solid #7e552a;
  padding: 15px;
}
.castle {
  font-size: 65px;
}
.enemy {
  font-size: 45px;
  animation: advance linear forwards;
}
@keyframes advance {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50vw);
  }
}
.bomb {
  font-size: 52px;
  color: #ba2639;
  display: block;
  margin: 20px;
}
.balance {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 35px;
  margin: 15px;
  font-size: 38px;
}
.pan {
  background: #fff1b3;
  border: 3px solid var(--ink);
  border-bottom-width: 10px;
  padding: 14px 30px;
}
.map {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 10px;
  padding: 20px;
  background: #c9edb4;
  border: 3px solid var(--ink);
  margin: 15px 0;
}
.map .node {
  border: 3px solid var(--ink);
  background: #e4d3b2;
  padding: 10px;
  font-size: 30px;
}
.map .node.active {
  background: var(--yellow);
  box-shadow: 0 0 0 4px #fff;
}
.map .node.passed {
  background: var(--mint);
}
.doors {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.doors button {
  min-height: 125px;
  min-width: 130px;
  max-width: 250px;
  background: #995b37;
  border-width: 5px;
  color: white;
}
.targets button {
  border-radius: 50%;
  aspect-ratio: 1;
  min-height: 100px;
  max-width: 180px;
  background: radial-gradient(
    #fff 0 30%,
    #ff7c71 31% 50%,
    #fff 51% 70%,
    #ff7c71 71%
  );
  color: var(--ink);
  border: 4px solid var(--ink);
}
.targets {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 15px;
}
.typing-model {
  background: white;
  border: 2px solid var(--ink);
  padding: 20px;
  margin: 20px;
  font-size: 30px;
}
.syllables {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 25px 0;
}
.syllables span {
  font-size: 40px;
}
.syllables button {
  padding: 2px;
  width: 22px;
  height: 45px;
  margin: 0 3px;
  background: #ded5ff;
  color: var(--ink);
}
.syllables button.selected {
  background: var(--yellow);
}
.punctuation {
  font-size: 32px;
  margin: 30px 0;
}
.punctuation select {
  display: inline-block;
  width: 65px;
  margin: 0 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.install {
  max-width: 700px;
  margin: 10vh auto;
}
.install li {
  margin: 12px 0;
}
.install code {
  font-family: monospace;
  font-size: 16px;
  overflow-wrap: anywhere;
}
@media (min-width: 1450px) {
  .shell {
    padding-top: 35px;
  }
  .catalog-grid .thumb {
    height: 120px;
  }
  .game-card p {
    min-height: 75px;
  }
  .ground {
    height: 100px;
  }
}
@media (max-width: 1000px) {
  h1 {
    font-size: 44px;
  }
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .profile-grid {
    grid-template-columns: 250px 1fr;
  }
  .clothes {
    grid-template-columns: repeat(3, 1fr);
  }
  .shirt svg {
    height: 90px;
  }
  .topbar {
    gap: 10px;
  }
  .userbox {
    min-width: 0;
  }
  .userbox small {
    display: block;
  }
  .topbar .actions {
    gap: 5px;
  }
  .topbar .actions button {
    padding: 5px 10px;
  }
  .game-card p {
    font-size: 20px;
  }
  .subbar small {
    display: none;
  }
}
@media (max-width: 680px) {
  body {
    font-size: 22px;
  }
  .shell {
    padding: 12px 10px 90px;
  }
  .topbar {
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .brand {
    order: -1;
    width: 100%;
  }
  h1 {
    font-size: 43px;
  }
  .brand small {
    font-size: 18px;
  }
  .userbox {
    font-size: 19px;
  }
  .panel {
    padding: 12px;
  }
  .catalog-grid,
  .catalog-grid.math {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .catalog-grid.math .game-card,
  .catalog-grid.math .game-card:nth-child(4) {
    grid-column: auto;
  }
  .game-card .thumb {
    height: 80px;
    font-size: 30px;
  }
  .game-card h3 {
    font-size: 25px;
  }
  .game-card p {
    min-height: 80px;
  }
  .section-bar h2 {
    font-size: 27px;
  }
  .section-bar small {
    font-size: 18px;
  }
  .section-bar {
    padding: 6px 9px;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .profile-sidebar > h3,
  .profile-sidebar > input {
    grid-column: span 2;
  }
  .avatar-preview {
    min-height: 160px;
  }
  .avatar-preview .avatar {
    width: 100px;
    height: 140px;
  }
  .characters .avatar {
    height: 130px;
  }
  .speech {
    display: none;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .clothes {
    grid-template-columns: repeat(3, 1fr);
  }
  .game-stage {
    padding: 15px 10px;
    min-height: 350px;
  }
  .game-stage h2 {
    font-size: 29px;
  }
  .options {
    gap: 10px;
  }
  .options button {
    padding: 8px;
    font-size: 23px;
  }
  .game-meta {
    gap: 5px;
  }
  .game-meta span {
    padding: 4px 8px;
  }
  .game-head h2 {
    font-size: 30px;
  }
  .word-mask {
    font-size: 37px;
    letter-spacing: 6px;
  }
  .memory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .memory-card {
    min-height: 100px;
  }
  .answer-form {
    flex-direction: column;
  }
  .map {
    gap: 4px;
    padding: 10px;
  }
  .map .node {
    padding: 6px;
    font-size: 23px;
  }
  .balance {
    gap: 15px;
    font-size: 30px;
  }
  .pan {
    padding: 10px;
  }
  .login-page {
    padding-top: 30px;
    background: #29b8e0;
  }
  .login-heading {
    margin-bottom: 35px;
    padding: 10px;
  }
  .login-heading h1 {
    font-size: 45px;
  }
  .login-heading small {
    font-size: 22px;
  }
  .login-panel {
    padding: 25px 18px 18px;
  }
  .match-grid {
    gap: 12px;
  }
  .match-column button {
    font-size: 21px;
    padding: 6px;
  }
  .typing-model {
    margin: 15px 0;
    padding: 10px;
    font-size: 26px;
  }
  .ground {
    height: 65px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .falling,
  .enemy {
    animation-play-state: paused;
  }
}
/* Cenário sem textos impressos por trás dos controles reais. */
.login-page {
  background: none;
  position: relative;
  isolation: isolate;
  padding-top: 48px;
}
.login-heading {
  background: none;
  margin-bottom: 40px;
}
.login-panel {
  z-index: 2;
}
.game-card h3 {
  text-transform: uppercase;
}
.shell {
  padding-top: 15px;
}
.topbar {
  min-height: 65px;
  margin-bottom: 15px;
}
.catalog-grid .thumb {
  height: 90px;
}
.game-card button {
  line-height: 1;
  padding: 4px;
}
.game-card p {
  min-height: 55px;
  margin: 4px 0 8px;
  font-size: 21px;
}
.game-card h3 {
  font-size: 27px;
  margin: 2px 0;
}
.game-card {
  padding: 9px;
}
.section-bar {
  margin-bottom: 12px;
}
.catalog-grid {
  gap: 12px;
}
@media (max-width: 680px) {
  .login-page {
    padding-top: 22px;
  }
  .login-heading {
    margin-bottom: 30px;
  }
  .catalog-grid .thumb {
    height: 75px;
  }
  .game-card h3 {
    font-size: 24px;
  }
  .game-card p {
    font-size: 20px;
    min-height: 80px;
  }
  .shell {
    padding-top: 12px;
  }
}
@media (max-width: 680px) {
  .profile-sidebar .characters,
  .profile-sidebar .avatar-preview {
    grid-column: span 2;
  }
  .profile-sidebar > label {
    grid-column: span 2;
  }
  .profile-sidebar .characters .avatar {
    width: 110px;
    height: 120px;
  }
  .profile-sidebar .avatar-preview .avatar {
    width: 140px;
    height: 170px;
  }
}
@media (max-width: 680px) {
  .map .node {
    flex: 1;
    min-width: 0;
  }
  .map .node small {
    font-size: 16px;
    overflow-wrap: anywhere;
  }
  .targets button {
    width: 130px;
  }
  .section-bar {
    flex-wrap: wrap;
  }
  .clothes {
    min-width: 0;
  }
}

/* A sala dos livros é construída com botões, texto e ilustrações separadas. */
.home {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(24px, 5vh, 52px) 0 105px;
}
.home-heading {
  text-align: center;
  margin-bottom: clamp(18px, 4vh, 36px);
}
.home-kicker {
  display: inline-block;
  padding: 4px 13px;
  background: #fff3cf;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px var(--ink);
  font-size: clamp(16px, 2.5vw, 22px);
  letter-spacing: 1px;
}
.home-heading h1 {
  color: #fffaf1;
  font-size: clamp(42px, 8.2vw, 94px);
  margin: 8px 0 0;
  line-height: 0.95;
  -webkit-text-stroke: 1px var(--ink);
  text-shadow:
    3px 4px var(--ink),
    6px 7px #286a9b;
}
.home-heading h1 span {
  color: #ffde64;
}
.home-heading p {
  margin: 12px 0 0;
  font-size: clamp(22px, 3.4vw, 34px);
}
.book-selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(14px, 3vw, 34px);
}
.subject-book {
  --book-main: #d95251;
  --book-light: #ee7a66;
  --book-edge: #9e344b;
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  gap: 13px;
  padding: 13px;
  background: #fffcf0;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow:
    0 5px 0 var(--ink),
    6px 10px 0 #247aa6;
  text-transform: none;
}
.subject-book-mat {
  --book-main: #3777d8;
  --book-light: #5ca3ed;
  --book-edge: #28529e;
}
.subject-book:hover:not(:disabled) {
  transform: translateY(-5px);
}
.book-cover {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 18px 12px 14px 23px;
  border: 3px solid var(--ink);
  border-radius: 6px 10px 8px 5px;
  background: linear-gradient(155deg, var(--book-light), var(--book-main) 63%);
  box-shadow:
    inset 9px 0 var(--book-edge),
    inset 0 4px #ffffff45,
    0 4px #fff0c6,
    0 7px var(--ink);
}
.book-edition {
  color: #fff2ba;
  font-size: clamp(14px, 1.8vw, 20px);
  letter-spacing: 1px;
}
.book-cover strong {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 2.5em;
  margin-top: 8px;
  padding: 5px;
  color: #182752;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff0d2;
  font-weight: normal;
  font-size: clamp(21px, 3vw, 35px);
  line-height: 0.95;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.book-emblem {
  width: clamp(70px, 12vw, 135px);
  height: auto;
  display: block;
  margin: 12px 0 3px;
  filter: drop-shadow(2px 3px 0 var(--book-edge));
  shape-rendering: crispEdges;
}
.book-caption {
  color: #fff8e2;
  font-size: clamp(17px, 2.2vw, 23px);
  line-height: 0.95;
}
.book-open {
  display: block;
  padding: 6px;
  margin-top: 5px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: #7149e9;
  color: white;
  font-size: clamp(18px, 2.4vw, 28px);
  line-height: 1.05;
  box-shadow:
    inset 0 2px #ffffff60,
    inset 0 -3px #35218350;
  text-transform: uppercase;
}
.subject-book-mat .book-open {
  background: #2861b6;
}
.book-character {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}
.book-greeting {
  position: relative;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: 9px;
  background: #fffcf0;
  box-shadow: 3px 3px #287cab;
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1;
  overflow-wrap: anywhere;
}
.book-greeting::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: calc(50% - 8px);
  width: 13px;
  height: 13px;
  background: #fffcf0;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
}
.book-character .avatar {
  width: min(100%, 171px);
  height: clamp(150px, 25vw, 224px);
}
.character-level {
  border: 2px solid var(--ink);
  border-radius: 5px;
  padding: 3px 10px;
  background: #fff0b4;
  font-size: clamp(16px, 2.2vw, 23px);
}
.home-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 27px auto 0;
}
.home-nav button {
  padding: 6px 14px;
}
.shirt {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 3px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  text-transform: none;
}
.shirt svg {
  width: min(100%, 84px);
  height: 75px;
}
.shirt span {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.catalog-section + .catalog-section {
  border-top: 2px solid #d9d4f3;
  padding-top: 16px;
  margin-top: 22px;
}
.catalog-section > h3 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1;
}
.catalog-section > p {
  margin: 0 0 10px;
  color: #394569;
}
.thumb {
  min-width: 0;
}
.thumb span {
  display: block;
  padding: 5px 9px;
  border: 2px solid var(--ink);
  background: #f8f5ff;
  box-shadow: 3px 3px #1c326b50;
  color: var(--ink);
  font-size: clamp(18px, 2.7vw, 32px);
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}
.thumb-mat {
  background: #d3fae9 !important;
}
.thumb-mat span {
  background: #fff7cb;
}
.thumb-misto {
  background: #ffe3c5 !important;
}
@media (max-width: 620px) {
  .home {
    width: calc(100% - 24px);
    padding-top: 19px;
  }
  .book-selection {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }
  .book-character {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 5px;
  }
  .book-character .avatar {
    width: 100px;
    height: 126px;
  }
  .book-greeting {
    margin-bottom: 8px;
  }
  .subject-book {
    padding: 7px;
    gap: 7px;
  }
  .book-cover {
    padding: 10px 5px 8px 13px;
    box-shadow:
      inset 5px 0 var(--book-edge),
      0 3px #fff0c6,
      0 5px var(--ink);
  }
  .book-cover strong {
    font-size: clamp(17px, 5vw, 24px);
  }
  .book-caption {
    font-size: 16px;
  }
  .book-open {
    padding: 4px 2px;
    font-size: 18px;
  }
  .home-nav {
    gap: 8px;
  }
  .home-nav button {
    font-size: 20px;
  }
  .shirt svg {
    height: 62px;
  }
}
/* LearnCraft */
.brand-word {
  text-transform: none;
  white-space: nowrap;
}
.brand-word span,
.home-heading h1 span {
  color: #ff625b;
}
.book-edition > span {
  color: #7f2030;
  text-shadow: 0 1px #ffb5a4;
}
.game-illustration {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 135px;
  shape-rendering: crispEdges;
}
#mechanic > .game-illustration {
  height: 135px;
  margin: 0 auto 12px;
}
.skin-options {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.skin-options button {
  display: grid;
  justify-items: center;
  gap: 4px;
  flex: 1;
  padding: 6px 4px;
  background: #f5eaff;
  color: var(--ink);
  font-size: 20px;
  text-transform: none;
}
.skin-options span {
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.teacher-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 15px 0 24px;
}
.teacher-tabs button {
  flex: 1;
}
.teacher-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0;
}
.student-identity {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 15px;
  background: #eee8ff;
  border: 2px solid var(--ink);
  margin: 15px 0 25px;
}
.student-identity .avatar {
  flex: 0 0 90px;
  height: 120px;
}
.section-title {
  margin-top: 28px;
}
.editor-settings {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
}
.editor-settings input {
  width: 100px;
}
.editor-fields,
.assignment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  margin-top: 18px;
}
.editor-fields label,
.assignment-form label {
  font-size: 23px;
}
.editor-fields input,
.editor-fields select,
.editor-fields textarea,
.assignment-form input,
.assignment-form select,
.assignment-form textarea {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}
.editor-fields textarea {
  resize: vertical;
}
.wide-field {
  grid-column: 1/-1;
}
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
}
.editor-footer p {
  flex: 1;
}
#entrySelect {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}
.assignment-form fieldset {
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.assignment-form .checkbox-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px;
}
.assignment-form .checkbox-line input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 20px;
}
.student-choices:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.lesson-card {
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #f0eaff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
}
.lesson-card h3 {
  font-size: 32px;
}
.lesson-card button {
  align-self: stretch;
  margin-top: auto;
}
.lesson-instructions {
  white-space: pre-wrap;
}
.status {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  white-space: nowrap;
  background: #fff1bf;
  font-size: 21px;
}
.status-concluida {
  background: #b8efce;
}
.status-em_andamento {
  background: #d1ddff;
}
.late-label {
  display: block;
  color: #9f2837;
  margin-top: 5px;
}
#editorMessage,
#assignmentMessage {
  overflow-wrap: anywhere;
}
[hidden] {
  display: none !important;
}
@media (max-width: 680px) {
  .skin-options {
    grid-column: 1/-1;
  }
  .editor-fields,
  .assignment-form,
  .lesson-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .student-identity {
    padding: 10px;
    gap: 10px;
  }
  .student-identity .avatar {
    flex-basis: 60px;
    height: 90px;
  }
  .teacher-tabs {
    gap: 8px;
  }
  .teacher-tabs button {
    font-size: 21px;
    padding: 6px 10px;
    flex-basis: 100%;
  }
  .brand-word {
    font-size: 43px;
  }
  .editor-settings {
    align-items: flex-start;
  }
  .editor-settings input {
    width: 85px;
  }
}
.sesi-logo {
  display: block;
  width: 88px;
  height: auto;
  margin: 5px auto 7px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 3px;
}
.home-heading .sesi-logo {
  width: 128px;
  margin-top: 12px;
}
.login-heading .sesi-logo {
  width: 118px;
}
.rpg-shell {
  text-align: left;
}
.rpg-hud {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0;
  font-size: 22px;
}
.rpg-hud strong {
  flex: 1;
  font-weight: normal;
}
#rpgHealth {
  color: #aa3348;
  white-space: nowrap;
}
.rpg-viewport {
  position: relative;
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 7px;
  overflow: hidden;
  background: #30594a;
}
#rpgCanvas {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 5 / 3;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
}
#rpgCanvas:focus-visible {
  outline: 3px solid #ffe181;
  outline-offset: -4px;
}
.rpg-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  padding: 15px;
  background: #1a2934dd;
  text-align: center;
  color: #fff4cc;
}
.rpg-overlay h3 {
  font-size: 34px;
}
.rpg-overlay p {
  font-size: 25px;
  line-height: 1.15;
}
.rpg-overlay button {
  font-size: 26px;
}
.rpg-message {
  min-height: 48px;
  padding: 9px 12px;
  margin: 10px 0;
  background: #fff1bd;
  border: 2px solid #b59b68;
  font-size: 23px;
  line-height: 1.1;
}
.rpg-answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.rpg-answers > div {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid #74849d;
  background: #fffaf0;
  padding: 8px;
  font-size: 24px;
  line-height: 1;
  overflow-wrap: anywhere;
}
.rpg-answers b {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  height: 34px;
  border: 2px solid var(--ink);
  background: #f8ce7d;
  font-weight: normal;
}
.rpg-answers > div:nth-child(2) b {
  background: #9ad9ee;
}
.rpg-answers > div:nth-child(3) b {
  background: #dfb3f0;
}
.rpg-answers > div:nth-child(4) b {
  background: #faa29b;
}
.rpg-answers > div:nth-child(5) b {
  background: #c0df97;
}
.rpg-answers > div:nth-child(6) b {
  background: #ebbf90;
}
.rpg-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.rpg-controls p {
  flex: 1;
  min-width: 150px;
  font-size: 21px;
}
.rpg-directions {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 4px;
}
.rpg-directions button {
  padding: 2px;
  height: 40px;
  font-size: 28px;
  user-select: none;
  touch-action: none;
}
.rpg-directions [data-move="up"] {
  grid-column: 2;
}
.rpg-directions [data-move="left"] {
  grid-column: 1;
}
#rpgAttack {
  height: 60px;
  touch-action: none;
  user-select: none;
}
.rpg-stage {
  padding: 15px !important;
}
.rpg-stage > h2 {
  font-size: 29px;
  margin-bottom: 10px;
}
@media (max-width: 680px) {
  .home-heading .sesi-logo {
    width: 104px;
  }
  .brand .sesi-logo {
    width: 70px;
  }
  .rpg-stage {
    padding: 8px !important;
  }
  .rpg-hud {
    gap: 7px;
    font-size: 20px;
  }
  .rpg-hud strong {
    flex-basis: 100%;
  }
  .rpg-overlay {
    gap: 7px;
    padding: 7px;
  }
  .rpg-overlay h3 {
    font-size: 23px;
  }
  .rpg-overlay p {
    font-size: 19px;
  }
  .rpg-overlay button {
    padding: 4px 10px;
    font-size: 21px;
  }
  .rpg-answers {
    grid-template-columns: minmax(0, 1fr);
  }
  .rpg-answers > div {
    font-size: 22px;
  }
  .rpg-controls {
    justify-content: space-between;
    gap: 8px;
  }
  .rpg-controls p {
    flex-basis: 100%;
    order: 3;
  }
}
@media (min-width: 900px) {
  .rpg-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.38fr);
    gap: 12px;
  }
  .rpg-hud {
    grid-column: 1 / -1;
    margin: 0;
  }
  .rpg-viewport {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }
  .rpg-answers {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }
  .rpg-answers > div {
    min-height: 62px;
    font-size: 23px;
  }
  .rpg-message {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 0;
  }
  .rpg-controls {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 0;
  }
}
@media (max-width: 680px) {
  .rpg-viewport .rpg-controls {
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 7px;
    margin: 0;
    z-index: 2;
    pointer-events: none;
  }
  .rpg-viewport .rpg-controls p {
    display: none;
  }
  .rpg-viewport .rpg-directions {
    grid-template-columns: repeat(3, 32px);
    gap: 3px;
    pointer-events: auto;
  }
  .rpg-viewport .rpg-directions button {
    height: 30px;
    font-size: 22px;
    opacity: 0.88;
  }
  .rpg-viewport #rpgAttack {
    height: 44px;
    padding: 5px 8px;
    font-size: 20px;
    opacity: 0.9;
    pointer-events: auto;
  }
}
.rpg-overlay:not([hidden]) ~ .rpg-controls {
  visibility: hidden;
}

/* Identidade LearnCraft e acesso */
.logo-title {margin:0;line-height:0}
.learncraft-logo {display:block;width:min(610px,84vw);height:auto;margin:0 auto;max-height:390px;object-fit:contain;filter:drop-shadow(0 7px 0 #05609a33)}
.home-heading {padding-top:4px}
.home-heading p {margin:6px 0 24px}
.sesi-pixel {display:inline-flex;align-items:center;gap:5px;background:#de1024;color:white;font-family:Pixel,monospace;font-size:27px;line-height:1;padding:3px 9px;border:3px solid #172458;box-shadow:3px 3px #17245866;transform:skew(-5deg);letter-spacing:1px}
.sesi-pixel i {font-style:normal;font-size:20px}
.login-panel legend,.login-panel .tabs button.active {background:#ed525a;color:#fff5e4}
.login-page {position:relative;isolation:isolate}
.login-books {position:absolute;z-index:-1;width:clamp(130px,20vw,245px);bottom:35px;pointer-events:none}
.login-books svg {width:100%;height:auto;overflow:visible}
.login-books-left {left:max(-140px,calc(50% - 490px));transform:rotate(-6deg)}
.login-books-right {right:max(-140px,calc(50% - 490px));transform:rotate(5deg)}
.hair-options {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.hair-options button {padding:5px 2px;background:#ebeaff;color:var(--ink);font-size:18px;min-width:0}
.hair-options .avatar {width:65px;height:78px;display:block;margin:auto}
.hair-options button.chosen {outline:3px solid var(--purple);outline-offset:0}
.approval-icon {width:120px;margin:0 auto}
.approval-panel>button {margin:5px}
.sr-only {position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}

/* Tuca: companheiro flutuante com conversa persistente durante a navegação. */
#studyTutor {position:fixed;right:18px;bottom:18px;z-index:1000;font-size:21px;max-width:calc(100vw - 24px)}
.tutor-launcher {display:flex;align-items:center;gap:4px;padding:0 12px 0 0;min-width:116px;height:88px;color:#172458;background:#fff4d5;border:3px solid #172458;border-radius:18px 18px 6px 18px;box-shadow:4px 5px #17245866;text-transform:none;animation:toucan-bob 4s ease-in-out infinite}
.tutor-launcher svg {width:86px;height:86px;flex:none;margin-top:-14px;overflow:visible}
.tutor-launcher span {max-width:60px;font-size:21px;line-height:.9;text-align:left}
.toucan-wing {transform-origin:28px 46px;animation:toucan-wing 4s ease-in-out infinite}
.tutor-panel[hidden],.tutor-speech[hidden] {display:none}
.tutor-panel {width:min(390px,calc(100vw - 24px));height:min(620px,calc(100dvh - 135px));display:flex;flex-direction:column;overflow:hidden;background:#faf8ef;border:3px solid #172458;border-radius:14px;box-shadow:6px 7px #153c7577;margin-bottom:10px;text-align:left}
.tutor-header {display:flex;align-items:center;gap:8px;padding:7px 10px;color:#fff;background:#6b43df;border-bottom:3px solid #172458}
.tutor-header strong {font-size:30px;line-height:.9}
.tutor-header small {display:block;font-size:17px;margin-top:3px}
.tutor-header button {margin-left:auto;padding:1px 9px;font-size:30px}
.tutor-mini {width:52px;height:52px;flex:none;background:#baa1ff;border:2px solid #172458;border-radius:8px}
.tutor-mini svg {width:100%;height:100%}
.tutor-location {padding:7px 12px;background:#d8f6ff;border-bottom:2px solid #a5c3dc;font-size:19px}
.tutor-location small {display:block;font-size:16px;color:#47607e;margin-top:2px}
.tutor-messages {flex:1;min-height:70px;overflow-y:auto;overscroll-behavior:contain;padding:12px;scroll-behavior:smooth}
.tutor-message {padding:8px 10px;background:white;border:2px solid #d4d4ed;border-radius:9px 9px 9px 2px;margin-bottom:10px;max-width:94%;overflow-wrap:anywhere}
.tutor-message strong {color:#6740ce;font-size:17px}
.tutor-message p {white-space:pre-wrap;line-height:1.15;margin:3px 0 0;font-size:21px;text-transform:none}
.tutor-user {margin-left:auto;background:#ede4ff;border-color:#c3b1ed;border-radius:9px 9px 2px 9px}
.tutor-user strong {color:#334678}
.tutor-thinking {margin:2px;font-size:18px;color:#6a5a88}
.tutor-suggestions {display:flex;gap:5px;padding:5px 8px;flex-wrap:wrap;border-top:1px solid #dbd8eb}
.tutor-suggestions button {font-size:16px;padding:4px 5px;border-width:2px;box-shadow:none;background:#e6ddff;color:#4e338c;text-transform:none}
#tutorForm {display:flex;gap:5px;padding:6px 8px;margin:0;align-items:stretch}
#tutorInput {resize:none;font-size:20px;line-height:1.1;padding:7px;border-width:2px;flex:1;min-width:0;text-transform:none}
#sendTutor {padding:7px 12px;border-width:2px;box-shadow:none;background:#e24c57}
.tutor-panel footer {font-size:14px;color:#606080;padding:0 9px 7px;line-height:1.1}
.tutor-panel footer .link {font-size:15px;display:block;margin-top:3px;padding:0;color:#6541ba}
.tutor-speech {position:absolute;bottom:104px;right:0;width:250px;max-width:80vw;border:3px solid #172458;background:#fff5cf;border-radius:12px 12px 0 12px;padding:12px;box-shadow:3px 4px #17245866;line-height:1.05}
.tutor-cheer {animation:toucan-cheer .4s ease-in-out 4}
.is-open .tutor-launcher {height:56px;margin-left:auto;animation:none}
.is-open .tutor-launcher svg {width:65px;height:65px;margin-top:-10px}
.is-open .tutor-speech {display:none}
@keyframes toucan-bob {0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
@keyframes toucan-wing {0%,40%,100%{transform:rotate(0)}45%{transform:rotate(-13deg)}50%{transform:rotate(0)}}
@keyframes toucan-cheer {0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-9px) rotate(3deg)}}
@media(max-width:700px) {
  .learncraft-logo {width:min(520px,93vw);max-height:330px}
  .login-books {width:95px;bottom:-45px;z-index:0}
  .login-books-left {left:8px}.login-books-right {right:8px}
  .login-page {padding-bottom:75px}
  .login-panel {z-index:1;position:relative}
  #studyTutor {right:10px;bottom:10px}
  .tutor-launcher {height:66px;padding-right:8px;min-width:96px}
  .tutor-launcher svg {width:68px;height:68px}
  .tutor-launcher span {font-size:18px;max-width:48px}
  .tutor-panel {height:min(560px,calc(100dvh - 100px))}
  .tutor-speech {bottom:80px}
  .home-nav {padding-bottom:95px}
}
@media(prefers-reduced-motion:reduce) {
 .tutor-launcher,.toucan-wing {animation:none}
 .tutor-messages {scroll-behavior:auto}
}
.login-heading .sesi-pixel {display:flex;width:max-content;margin:9px auto 12px}
.hair-options {grid-template-columns:repeat(6,minmax(0,1fr));margin:12px 0 20px;gap:8px}
.hair-options button {font-size:18px;padding:7px 2px}
.hair-options .avatar {width:70px;max-width:100%;height:86px}
@media(min-width:850px) {
 .home {padding-top:16px;padding-bottom:85px}
 .home-heading {margin-bottom:18px}
 .learncraft-logo {width:min(460px,60vw);max-height:290px}
 .home-heading p {margin:5px 0 12px}
 .home-nav {margin-top:21px}
}
@media(max-width:600px) {
 .hair-options {grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* Companheiros sem cartão: sprites voam pela página e pousam para conversar. */
#studyTutor {position:fixed;inset:0;max-width:none;pointer-events:none;font-size:21px}
#studyTutor .tutor-launcher {position:fixed;right:auto;bottom:auto;width:88px;height:96px;min-width:0;padding:0;background:transparent;border:0;border-radius:0;box-shadow:none;animation:none;pointer-events:auto;z-index:1002;transition:none;filter:drop-shadow(0 5px 0 #1b365326)}
#studyTutor .tutor-launcher {touch-action:none;cursor:grab}
#studyTutor .tutor-launcher.pet-dragging {cursor:grabbing;filter:drop-shadow(0 0 8px #ffe37f);z-index:1005}
#studyTutor .tutor-launcher:hover {transform:none;background:transparent;filter:drop-shadow(0 0 5px #fff8)}
#studyTutor .tutor-launcher svg {width:100%;height:100%;margin:0;transform:scaleX(var(--pet-facing,1));overflow:visible}
#studyTutor .tutor-launcher span {width:1px;height:1px;overflow:hidden}
#studyTutor .tutor-panel {position:fixed;right:18px;bottom:18px;margin:0;pointer-events:auto;z-index:1001;height:min(640px,calc(100dvh - 36px))}
#studyTutor .tutor-speech {position:fixed;right:auto;bottom:auto;pointer-events:none;z-index:1003}
.toucan-wing {animation:pet-flap .45s ease-in-out infinite;transform-origin:27px 44px}
.pet-wing-left {transform-origin:27px 40px;animation:pet-flap .5s ease-in-out infinite}
.pet-wing-right {transform-origin:62px 40px;animation:pet-flap-right .5s ease-in-out infinite}
.pet-tail {transform-origin:65px 61px;animation:pet-tail 1.1s ease-in-out infinite}
#studyTutor.is-open .tutor-launcher,#studyTutor .tutor-cheer {animation:none}
#studyTutor .tutor-cheer svg {filter:drop-shadow(0 0 5px #ffe37f)}
.flight-paused .pet-wing,.flight-paused .toucan-wing {animation:none}
.tutor-footer-actions {display:flex;gap:12px;flex-wrap:wrap;margin-top:6px}
#studyTutor .tutor-footer-actions button {display:inline-block;font-size:16px}
@keyframes pet-flap {0%,100%{transform:rotate(5deg)}50%{transform:rotate(-35deg)}}
@keyframes pet-flap-right {0%,100%{transform:rotate(-5deg)}50%{transform:rotate(35deg)}}
@keyframes pet-tail {0%,100%{transform:rotate(0)}50%{transform:rotate(9deg)}}
.profile-uniform-note {padding:10px;border:2px solid #b8b5dd;background:#eeedff;font-size:20px;margin:12px 0}
.premium-clothes {margin-bottom:24px}
.shirt small {display:block;font-size:17px;color:#605189}
.shirt.locked,.pet-choice.locked {background:#e1dfed;color:#72718e;box-shadow:3px 4px #65718b66}
.shirt.locked svg,.pet-choice.locked svg {filter:grayscale(.7);opacity:.8}
.premium-shirt {background:linear-gradient(160deg,#fff8d8,#e9dfff)}
.login-heading .login-learncraft-logo {display:block;width:min(410px,82vw);height:auto;max-height:176px;object-fit:contain;margin:4px auto 2px;image-rendering:pixelated;filter:drop-shadow(0 4px 0 #17245855)}
.avatar-clothing {shape-rendering:crispEdges}
.recovery-code {display:inline-block;padding:9px 12px;font-size:24px;letter-spacing:2px;color:#172458;background:#fff3ce;border:2px solid #172458;border-radius:8px}
.pet-choices {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0 20px}
.pet-choice {padding:8px 4px;background:#e8e5ff;color:var(--ink);display:flex;flex-direction:column;align-items:center;min-width:0;text-transform:none}
.pet-choice svg {width:85px;max-width:100%;height:85px;display:block}
.pet-choice strong {font-size:24px}.pet-choice span {font-size:16px;line-height:1.1}
.pet-choice small {font-size:17px;margin-top:6px}
.unlock-celebration {background:#fff0b9;border:3px solid #b78244;border-radius:6px;padding:15px;margin:18px 0}
.unlock-celebration>div {display:inline-flex;align-items:center;gap:8px;max-width:100%;margin:5px 10px}
.unlock-celebration svg {width:65px;height:65px;flex:none}
.profile-class {margin:12px 0;padding:7px;background:#e6e4ff}
.toolbar label {font-size:20px;min-width:165px}
.student-choices small {margin-left:5px;color:#6a6892}
.ai-settings {max-width:900px;margin:auto}
.ai-settings label {display:block;margin:16px 0 5px}
.ai-settings small {display:block;margin:6px 0;font-size:18px}
.ai-checks {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}
.ai-settings details {padding:12px;background:#eeedff;border:2px solid #bdb7dc}
@media(max-width:600px) {
 #studyTutor .tutor-launcher {width:72px;height:80px}
 #studyTutor .tutor-panel {right:10px;bottom:10px;width:calc(100vw - 20px);height:min(610px,calc(100dvh - 100px))}
 .pet-choices {grid-template-columns:repeat(2,minmax(0,1fr))}
 .premium-clothes {grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(prefers-reduced-motion:reduce) { .pet-wing,.toucan-wing,.pet-tail {animation:none} }
.profile-sidebar {align-self:start}
@media(min-width:1000px) {.profile-sidebar {position:sticky;top:12px}}

/* Novas roupas e desafios de arcade */
.security-box{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px;margin:12px 0;border:2px solid var(--ink);border-radius:8px;background:#e9e7ff}.security-box h3,.security-box p{grid-column:1/-1;margin:2px 0}.security-box label{display:grid;gap:6px}.pants-grid{grid-template-columns:repeat(6,minmax(90px,1fr));gap:10px}.pants-card svg{width:70px;height:62px;image-rendering:pixelated}.arcade{border:3px solid #172458;border-radius:10px;background:#e9faff;padding:12px;box-shadow:0 5px #7380a0}.arcade>header{display:flex;justify-content:space-between;align-items:center;padding:3px 6px 10px;color:#172458}.arcade-canvas{display:block;width:100%;max-width:800px;height:auto;aspect-ratio:800/260;margin:auto;border:3px solid #172458;border-radius:6px;image-rendering:pixelated;touch-action:none}.arcade-instructions{text-align:center;font-weight:bold;margin:8px}.arcade-status{text-align:center;min-height:28px;color:#4630b5;font-weight:bold}.arcade-question{text-align:center;padding:10px;background:#fff5d5;border:2px solid #172458;border-radius:6px;margin:8px auto;max-width:720px}.arcade-options{display:flex;justify-content:center;flex-wrap:wrap;gap:8px}.arcade-options:empty{display:none}.arcade-options button{min-width:min(240px,100%);background:#7650ed;color:white;border:2px solid #172458;box-shadow:0 3px #52618c}.arcade-touch{display:flex;justify-content:center;gap:6px;margin:8px auto}.arcade-touch button{min-width:44px;padding:8px;background:#ffe16b;color:#172458;touch-action:none}.ai-game-builder{max-width:880px;margin:18px auto;padding:20px;background:#f5f6ff;border:2px solid #172458;border-radius:10px}.ai-game-builder label{display:grid;gap:6px;margin:12px 0}.ai-game-builder textarea{width:100%;font:inherit;padding:10px;border:2px solid #172458;border-radius:6px}.ai-game-builder p[role=status]{min-height:28px;color:#3b3583;font-weight:bold}
@media(max-width:700px){.security-box{grid-template-columns:1fr}.pants-grid{grid-template-columns:repeat(3,minmax(80px,1fr))}.arcade-touch button{min-width:38px;padding:6px}}
.game-card .game-illustration{animation:card-art-float 2.8s ease-in-out infinite;transform-origin:center;will-change:transform}.game-card:hover .game-illustration{animation-duration:1.2s}.game-card{transition:transform .18s ease,box-shadow .18s ease}.game-card:hover{transform:translateY(-3px);box-shadow:0 6px 0 #7c89ad}.arcade-question{font-size:1.05em}.arcade-options button:hover{transform:translateY(-2px)}@keyframes card-art-float{0%,100%{transform:translateY(1px)}50%{transform:translateY(-4px)}}
.arcade{overflow:hidden;padding:clamp(12px,2vw,24px);border:3px solid #192759;border-radius:16px;background:linear-gradient(145deg,#f7f8ff,#e5f7ff 64%,#f2edff);box-shadow:0 7px 0 #64759c,0 16px 35px #17345c22}
.arcade>header{max-width:1000px;margin:0 auto 12px;padding:0 4px;color:#192759;font-size:1.1rem}
.arcade-canvas{width:min(100%,1000px);aspect-ratio:20/9;height:auto;max-width:1000px;margin:0 auto;border:3px solid #1b285b;border-radius:12px;background:#061026;box-shadow:0 6px 0 #7183aa;image-rendering:auto;touch-action:none}
.arcade-instructions{max-width:1000px;margin:14px auto 5px;font-size:1rem;line-height:1.5;color:#1b285b}
.arcade-status{max-width:800px;min-height:38px;margin:8px auto;padding:9px 14px;border:2px solid #d8b84e;border-radius:9px;background:#fff4c7;color:#263265;box-shadow:0 3px #e8d985;font-weight:700}
.arcade-question{max-width:800px;margin:12px auto;padding:13px 16px;border:2px solid #1b285b;border-radius:10px;background:#fff9e9;color:#202d62;box-shadow:0 3px #8592b2}
.arcade-options{max-width:900px;margin:10px auto;gap:10px}.arcade-options button{min-width:min(210px,100%);border-radius:9px;background:linear-gradient(#7955f2,#6040d1);box-shadow:0 4px #3a337f;color:#fff}
.arcade-touch{gap:9px;margin:14px auto 4px}.arcade-touch button{min-width:48px;min-height:44px;border:2px solid #1b285b;border-radius:9px;background:linear-gradient(#ffe778,#f6c944);box-shadow:0 4px #7d82aa;color:#1b285b;font-size:1rem;touch-action:none}.arcade-touch [data-shoot]{background:linear-gradient(#9cebd1,#48c78f)}
.pants-card svg{width:64px;height:64px;overflow:visible}.avatar>svg{overflow:visible}
.teacher-register-note{margin:4px 0 12px;padding:10px;border:1px solid #8270dc;border-radius:8px;background:#f0edff;color:#302c68;font-size:.88rem}
@media(max-width:700px){.arcade{padding:9px}.arcade-canvas{aspect-ratio:4/3}.arcade-touch{gap:5px;flex-wrap:wrap}.arcade-touch button{min-width:40px;min-height:40px;padding:4px}.arcade-options button{min-width:100%}.arcade-instructions{font-size:.9rem}}
@media(prefers-reduced-motion:reduce){.game-card,.game-card .game-illustration{animation:none!important;transition:none!important}}
.festival-art{display:grid;place-items:center;min-height:90px;border-radius:8px;font:48px/1.4 system-ui;color:white;background:radial-gradient(ellipse at center,#ffffff38,transparent 65%),repeating-linear-gradient(135deg,transparent 0 18px,#ffffff0d 18px 21px),var(--scene);text-shadow:0 4px 0 #18254555}
.festival-stage{max-width:640px;margin:auto;background:#fffaf0;border:3px solid var(--scene);border-radius:14px;overflow:hidden}.festival-stage .festival-art{min-height:105px;border-radius:0}.festival-steps{text-align:center;padding:.5em;color:var(--scene)}.festival-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px}.festival-options button{background:var(--scene);color:white}
.festival-readout{display:block;margin:0 auto 8px;padding:2px 14px;border-radius:6px;background:#101d31bb;color:#fff0af;font:26px Pixel,monospace}.festival-options[data-theme=correio] button{border-top:7px double #f8de9a}.festival-options[data-theme=ponte] button{border-bottom:6px double #f3bf70}.festival-options[data-theme=espelho] button{border-radius:50%}.festival-options[data-theme=palco] button{border-inline:8px double #df866d}.festival-options[data-theme=bilhete] button{border-inline:4px dashed #fce7a5}.festival-options[data-theme=sinal] button{border-radius:24px}.festival-options[data-theme=mosaico] button{border:6px double #ffe3b5}
