* {
  box-sizing: border-box;
}
body.games-page {
  background: #fafcfb;
  color: #243a36;
  letter-spacing: 0;
}
.games-page button,
.games-page input,
.games-page select {
  font: inherit;
}
.games-page button,
.file-button {
  cursor: pointer;
}
.games-page button:disabled {
  cursor: default;
  opacity: 0.55;
}
.games-page .app-header {
  height: auto;
  min-height: 96px;
  gap: 24px;
  padding: 8px 32px;
  background: #fff;
  border-bottom: 1px solid #c9d3cf;
}
.game-logo {
  width: 240px;
  height: 80px;
  object-fit: contain;
}
.section-nav {
  display: flex;
  gap: 28px;
  align-self: stretch;
  align-items: center;
  margin: auto;
}
.section-nav a {
  padding: 20px 0;
  text-decoration: none;
  color: #52615b;
  font-size: 15px;
  border-bottom: 3px solid transparent;
}
.section-nav a[aria-current] {
  color: #147c95;
  border-color: #147c95;
  font-weight: 700;
}
.game-catalog {
  max-width: 1440px;
  margin: auto;
  padding: 28px 32px 60px;
}
.catalog-title {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 24px;
}
.catalog-title h1 {
  font-size: 27px;
  margin: 0;
}
.catalog-title small {
  font: 14px system-ui;
  background: #dfede9;
  padding: 4px 9px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 8px;
}
.catalog-title > span {
  color: #6e7e77;
  font-size: 13px;
}
.game-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.game-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.game-filters button {
  border: 1px solid transparent;
  padding: 9px 15px;
  border-radius: 5px;
  background: transparent;
  color: #4d5b55;
}
.game-filters button[aria-pressed="true"] {
  background: #d5ede6;
  border-color: #52917f;
  color: #194f40;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.game-card {
  color: inherit;
  text-decoration: none;
  border: 1px solid #52635a;
  border-radius: 7px;
  overflow: hidden;
  background: white;
  box-shadow: 3px 3px 0 #dbe2de;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 3px 6px 0 #dbe2de;
}
.game-card:focus-visible {
  outline: 3px solid #258cb2;
  outline-offset: 4px;
}
.arcade-access { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
.arcade-access:not(:focus-within) { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.game-thumb {
  height: 166px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #84978d;
  background-color: var(--wash);
  background-image:
    linear-gradient(#ffffff80 1px, transparent 1px),
    linear-gradient(90deg, #ffffff80 1px, transparent 1px);
  background-size: 20px 20px;
}
.game-art {
  width: 140px;
  height: 140px;
  display: block;
  background-image: url("/classroom/assets/game-atlas.png");
  background-size: 400% 400%;
  background-position: var(--ax) var(--ay);
  background-repeat: no-repeat;
}
.game-card footer {
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.game-card h2 {
  font-size: 17px;
  margin: 0 0 5px;
}
.game-card small {
  font-size: 12px;
  color: #64736b;
}
.game-card footer svg {
  width: 18px;
}
.play-view {
  max-width: 1500px;
  margin: auto;
  padding: 20px 28px;
}
.play-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.play-heading h1 {
  font-size: 24px;
  margin: 0;
}
.play-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #cad7d1;
  border-radius: 5px;
  background: white;
  color: #345c4e;
  text-decoration: none;
  flex-shrink: 0;
}
.icon-button svg {
  width: 20px;
  height: 20px;
}
.game-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;
}
.game-layout.panel-closed {
  grid-template-columns: 1fr;
}
.word-panel {
  padding: 18px 18px 20px 0;
  border-right: 1px solid #d1ddd6;
}
.word-panel h2 {
  font-size: 17px;
  margin: 0 0 16px;
}
.word-panel label {
  display: block;
  font-size: 13px;
  margin: 12px 0 6px;
}
.word-panel textarea,
.word-panel select {
  width: 100%;
  padding: 9px;
  border: 1px solid #c2d1c9;
  border-radius: 4px;
  background: white;
}
.word-panel textarea {
  font:
    17px CardKaitiM,
    serif;
  line-height: 1.7;
  resize: vertical;
}
.word-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}
.word-actions button,
.word-actions .file-button {
  font-size: 12px;
  margin: 0;
  border: 1px solid #c9d7d0;
  background: white;
  border-radius: 4px;
  padding: 7px;
}
.primary {
  background: #257761;
  color: white;
  border: 1px solid #1c5e4c;
  padding: 11px 24px;
  border-radius: 5px;
  font-weight: 600;
}
.word-panel .primary {
  width: 100%;
  margin-top: 18px;
}
#setupStatus {
  font-size: 12px;
  line-height: 1.6;
  color: #9f3d3a;
}
.game-stage {
  position: relative;
  min-height: 590px;
  background: white;
  border: 1px solid #97aaa0;
  border-radius: 7px;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.game-hud {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 42px;
  font-size: 14px;
}
.game-hud strong {
  margin-left: auto;
}
.game-prompt {
  font-size: 24px;
  font-weight: 600;
  min-height: 60px;
  text-align: center;
  padding: 14px 6px;
  overflow-wrap: anywhere;
}
.game-arena {
  flex: 1;
  min-height: 300px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
}
.game-feedback {
  min-height: 28px;
  text-align: center;
  margin: 12px 0 4px;
  color: #267660;
  overflow-wrap: anywhere;
}
.game-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 44px;
}
.game-controls button,
.answer-option,
.tile-button {
  padding: 12px 18px;
  background: #f5faf7;
  border: 1px solid #7d9b8c;
  border-radius: 5px;
  color: #29463a;
}
.game-controls .primary {
  color: white;
  background: #257761;
}
.question-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 620px;
}
.answer-option {
  min-height: 76px;
  font:
    32px CardKaitiM,
    serif;
  overflow-wrap: anywhere;
  white-space: normal;
}
.answer-option:hover,
.tile-button:hover {
  background: #e1f3ec;
}
.answer-option.correct {
  background: #c9ebd9;
  border-color: #268855;
}
.answer-option.wrong {
  background: #fce0e3;
  border-color: #c45969;
}
.big-word {
  font:
    100px CardKaitiM,
    serif;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.reading {
  font-size: 24px;
  text-align: center;
  margin: 12px 0;
}
.meaning {
  font-size: 25px;
  text-align: center;
}
.flashcard {
  border: 2px solid #5d9b89;
  background: #eff9f4;
  box-shadow: 5px 5px 0 #d6e7df;
  padding: 30px;
  width: min(440px, 100%);
  min-height: 245px;
  border-radius: 7px;
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.match-grid button {
  min-height: 80px;
  font-size: 18px;
  overflow-wrap: anywhere;
}
.match-grid button.selected {
  outline: 3px solid #e0b431;
}
.match-grid button.matched {
  visibility: hidden;
}
.team-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
}
.team-panel {
  padding: 14px;
  border-top: 5px solid #65afd1;
  background: #eff8fc;
}
.team-panel:nth-child(2) {
  border-color: #de8899;
  background: #fff2f4;
}
.team-panel h2 {
  font-size: 20px;
  margin: 0 0 12px;
  text-align: center;
}
.team-panel .answer-option {
  font-size: 26px;
  min-height: 65px;
  padding: 10px;
}
.risk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 640px;
}
.risk-tile {
  background: #edf8f5;
  border: 1px solid #729689;
  border-radius: 6px;
  padding: 4px 10px 12px;
  display: flex;
  align-items: center;
  flex-direction: column;
  min-height: 135px;
}
.risk-tile .game-art {
  width: 78px;
  height: 78px;
}
.risk-tile strong {
  font:
    27px CardKaitiM,
    serif;
}
.risk-tile.used {
  opacity: 0.45;
}
.gomoku-grid {
  display: grid;
  grid-template-columns: repeat(var(--board-size, 9), minmax(0, 1fr));
  grid-template-rows: repeat(var(--board-size, 9), minmax(0, 1fr));
  width: min(var(--board-width, 580px), 100%);
  container-type: inline-size;
  aspect-ratio: 1;
  gap: 1px;
  background: #91aba0;
  border: 2px solid #65867a;
}
.gomoku-grid button {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #f9fbf8;
  font:
    min(22px, calc(75cqw / var(--board-size, 9))) CardKaitiM,
    serif;
  color: #496254;
}
.gomoku-grid button.black {
  background: #273b34;
  color: white;
  border-radius: 50%;
}
.gomoku-grid button.white {
  background: white;
  color: #273b34;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px #809a90;
}
.game-overlay {
  position: absolute;
  inset: 0;
  background: #fffffff2;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 25px;
}
.game-overlay h2 {
  font-size: 30px;
}
.game-overlay[hidden],
[hidden] {
  display: none !important;
}
.result-art {
  width: 155px;
  height: 155px;
}
.result-title {
  font-size: 28px;
  text-align: center;
  margin: 0;
}
.result-score {
  font-size: 20px;
}
.track {
  width: 100%;
  height: 100px;
  background: #edf5f7;
  border-bottom: 4px dashed #88a6a8;
  position: relative;
}
.track .game-art {
  position: absolute;
  width: 80px;
  height: 80px;
  bottom: 0;
  transition: left 0.4s;
}
.thief {
  position: absolute;
  font-size: 30px;
  bottom: 10px;
  transition: left 0.4s;
}
.wheel {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 5px solid #45695a;
  background: conic-gradient(
    #b5e3d7 0deg 45deg,
    #ffe6a0 45deg 90deg,
    #b9dcf1 90deg 135deg,
    #f4c1ce 135deg 180deg,
    #b5e3d7 180deg 225deg,
    #ffe6a0 225deg 270deg,
    #b9dcf1 270deg 315deg,
    #f4c1ce 315deg
  );
  position: relative;
  transition: transform 2s cubic-bezier(0.1, 0.8, 0.2, 1);
}
.wheel span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  margin-left: -40px;
  margin-top: -16px;
  font:
    21px CardKaitiM,
    serif;
  text-align: center;
}
.wheel-pointer {
  font-size: 24px;
  height: 22px;
  color: #b94460;
}
.goose-tray {
  display: flex;
  gap: 5px;
  width: 100%;
  justify-content: center;
  min-height: 60px;
  padding: 10px;
  background: #e8f2ef;
  border-bottom: 4px solid #629c88;
}
.goose-tray span {
  padding: 8px;
  background: white;
  border: 1px solid #acc3b8;
  font:
    20px CardKaitiM,
    serif;
}
.goose-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  width: 100%;
}
.goose-grid button {
  font:
    25px CardKaitiM,
    serif;
  aspect-ratio: 1;
  padding: 4px;
}
.goose-grid button.removed {
  visibility: hidden;
}
.rope-track {
  height: 32px;
  border-bottom: 6px solid #cfa765;
  width: 90%;
  position: relative;
  margin: 12px;
}
.rope-track::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  height: 40px;
  border-left: 2px dashed #758d82;
}
.rope-flag {
  position: absolute;
  bottom: -8px;
  font-size: 34px;
  color: #d54662;
  transition: left 0.3s;
  z-index: 1;
}
.sentence-bank,
.sentence-answer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  padding: 16px;
}
.sentence-answer {
  background: #edf5f1;
  min-height: 80px;
  border-bottom: 2px dashed #77a591;
}
.sentence-bank button,
.sentence-answer button {
  font:
    26px CardKaitiM,
    serif;
}
.spelling-input {
  font-size: 26px;
  padding: 12px;
  width: min(400px, 100%);
  text-align: center;
  border: 2px solid #77a896;
  border-radius: 5px;
}
.tone-keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: 470px;
}
.tone-keys button {
  padding: 6px 10px;
  font-size: 20px;
}
.arcade-host {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 1.8;
  background: #f0f7fa;
  border: 1px solid #b6cdd3;
  border-radius: 6px;
  overflow: hidden;
}
.arcade-host canvas {
  display: block;
  max-width: 100%;
}
.direction-pad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 5px;
}
.direction-pad button {
  padding: 8px;
  width: 44px;
  height: 40px;
}
.direction-pad button:first-child {
  grid-column: 2;
}
.direction-pad button:nth-child(2) {
  grid-column: 1;
}
.games-page :focus-visible {
  outline: 3px solid #288cb3;
  outline-offset: 3px;
}
.game-stage:fullscreen {
  overflow: auto;
  border: 0;
  border-radius: 0;
  padding: 24px;
  background: #fff;
}
.game-stage:fullscreen .game-arena {
  max-width: 1200px;
  width: 100%;
  margin: auto;
}
.game-stage:fullscreen .game-prompt {
  font-size: 32px;
}
.game-stage:fullscreen .arcade-host {
  max-width: 1000px;
}
@media (max-width: 1100px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .games-page .app-header {
    gap: 16px;
    padding: 8px 20px;
  }
  .game-logo {
    width: 200px;
  }
  .section-nav {
    gap: 16px;
  }
  .game-layout {
    grid-template-columns: 235px minmax(0, 1fr);
    gap: 16px;
  }
  .game-stage {
    padding: 15px;
  }
  .team-layout {
    gap: 10px;
  }
  .team-panel {
    padding: 10px;
  }
  .team-panel .question-options {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 750px) {
  .games-page .app-header {
    flex-wrap: wrap;
    gap: 0;
    justify-content: space-between;
    padding: 8px 16px;
  }
  .game-logo {
    width: 195px;
    height: 62px;
  }
  .section-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    border-top: 1px solid #e0e8e3;
    gap: 35px;
  }
  .section-nav a {
    padding: 12px 0;
  }
  .games-page .ui-language-select {
    max-width: 110px;
  }
  .game-catalog {
    padding: 22px 16px;
  }
  .catalog-title h1 {
    font-size: 23px;
  }
  .catalog-title > span {
    display: none;
  }
  .game-toolbar {
    flex-direction: column;
    gap: 12px;
  }
  .game-filters {
    gap: 2px;
  }
  .game-filters button {
    padding: 8px;
    font-size: 13px;
  }
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .game-thumb {
    height: 130px;
  }
  .game-art {
    width: 115px;
    height: 115px;
  }
  .game-card footer {
    padding: 12px 9px;
  }
  .game-card h2 {
    font-size: 15px;
  }
  .game-card small {
    font-size: 11px;
  }
  .play-view {
    padding: 14px 12px;
  }
  .play-heading {
    gap: 8px;
    flex-wrap: wrap;
  }
  .play-heading h1 {
    font-size: 20px;
  }
  .play-actions {
    gap: 5px;
  }
  .icon-button {
    width: 34px;
    height: 36px;
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .word-panel {
    border-right: 0;
    border-bottom: 1px solid #cadbd2;
    padding: 0 0 16px;
  }
  .word-panel textarea {
    max-height: 150px;
  }
  .game-stage {
    min-height: 500px;
    padding: 12px 10px;
  }
  .game-prompt {
    font-size: 21px;
  }
  .game-arena {
    min-height: 250px;
  }
  .big-word {
    font-size: 70px;
  }
  .risk-grid {
    gap: 6px;
  }
  .risk-tile {
    padding: 3px;
    min-height: 110px;
  }
  .risk-tile .game-art {
    width: 60px;
    height: 60px;
  }
  .risk-tile strong {
    font-size: 22px;
  }
  .match-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .match-grid button {
    font-size: 16px;
    padding: 5px;
    min-height: 74px;
  }
  .team-panel .answer-option {
    font-size: 23px;
    min-height: 56px;
  }
  .team-panel h2 {
    font-size: 17px;
  }
  .goose-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }
  .goose-grid button {
    font-size: 21px;
  }
  .sentence-bank button,
  .sentence-answer button {
    font-size: 21px;
    padding: 8px;
  }
}
.game-thumb {
  overflow: hidden;
}
.game-thumb .game-art {
  width: 190px;
  height: 190px;
  flex-shrink: 0;
}
@media (max-width: 750px) {
  .game-thumb .game-art {
    width: 155px;
    height: 155px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
