/* Game Room: card games, Mystery Picture, sticker book, and rewards chips. Loaded after trail.css. */
@import "./arcade-games.css";
@import "./hiding-game.css";
.gm-room {
  --trail: #3b6fb6;
}

.gm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.gm-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
}

.gm-head p {
  margin: 0.25rem 0 0;
  color: var(--t-ink-soft);
}

.gm-rank {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  border: 2px solid var(--t-rule);
  border-radius: 999px;
  background: var(--t-paper);
  color: var(--t-ink) !important;
  font-weight: 700;
}

.gm-rank b {
  font-size: 1.8rem;
}

.gm-rank small {
  display: block;
  color: var(--t-ink-soft);
  font-size: 0.8rem;
  font-weight: 500;
}

.gm-stop {
  display: inline-flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 1.2rem 0 0.4rem;
  font-weight: 600;
}

.gm-stop select {
  min-height: 48px;
  padding: 0 0.8rem;
  border: 2px solid var(--t-rule);
  border-radius: 12px;
  background: #fff;
  color: var(--t-ink);
  font: inherit;
}

.gm-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin: 0.8rem 0 1.6rem;
}

.gm-game {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 1.2rem 1rem;
  border: 2px solid var(--t-rule);
  border-radius: 20px;
  background: var(--t-paper);
  color: var(--t-ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.gm-game:hover {
  border-color: var(--trail);
  transform: translateY(-3px);
}

.gm-game b {
  font-size: 1.25rem;
}

.gm-game small {
  color: var(--t-ink-soft);
  font-size: 0.95rem;
  line-height: 1.35;
}

.gm-icon {
  font-size: 2.6rem;
}

.gm-book h3 {
  margin: 0 0 0.6rem;
}

/* Rewards: sticker shelf, chips, toast, confetti */
.rw-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rw-shelf li {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.7rem 0.5rem;
  border: 2px dashed var(--t-rule);
  border-radius: 16px;
  background: #f6f8fb;
  color: var(--t-ink-soft);
  text-align: center;
}

.rw-shelf li.on {
  border: 2px solid var(--t-gold);
  background: #fff9e6;
  color: var(--t-ink);
}

.rw-shelf span {
  font-size: 2rem;
}

.rw-shelf small {
  font-size: 0.78rem;
}

.rw-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.4rem 0 1.1rem;
}

.rw-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--t-rule);
  border-radius: 999px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

.rw-chip b {
  font-size: 1.3rem;
}

.rw-chip small {
  display: block;
  color: var(--t-ink-soft);
  font-size: 0.72rem;
  font-weight: 500;
}

.rw-chip {
  flex-wrap: wrap;
}

.rw-toast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.8rem auto;
  padding: 0.6rem 1.1rem;
  border-radius: 16px;
  background: #fff4cf;
  color: var(--t-ink);
  font-size: 1.05rem;
}

.rw-toast span {
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
}

.rw-confetti {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}

.rw-confetti i {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: 10px;
  height: 16px;
  border-radius: 2px;
  background: var(--c);
  transform: rotate(var(--r));
  animation: rw-fall 2.2s ease-in var(--d) forwards;
}

@keyframes rw-fall {
  to {
    transform: translateY(105vh) rotate(calc(var(--r) + 540deg));
  }
}

/* Playing */
.gm-play {
  display: grid;
  gap: 0.8rem;
}

.gm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gm-bar span {
  color: var(--t-ink-soft);
  font-weight: 600;
}

.gm-note {
  min-height: 1.6rem;
  margin: 0;
  color: var(--t-ink-soft);
  font-size: 1.05rem;
  text-align: center;
}

.gm-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.gm-card {
  min-height: clamp(84px, 16vh, 120px);
  border: 3px solid var(--t-rule);
  border-radius: 16px;
  background: var(--trail);
  color: #fff;
  font: inherit;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--trail) 70%, #000);
}

.gm-card.up,
.gm-hunt .gm-card {
  background: #fff;
  color: var(--t-ink);
  box-shadow: none;
}

.gm-card.up.a {
  background: #fff4cf;
  border-color: var(--t-gold);
}

.gm-card.up.q {
  border-color: var(--trail);
}

.gm-card.done {
  border-color: var(--t-good);
  background: var(--t-good-soft);
  color: var(--t-good);
}

.gm-card.nope {
  border-color: var(--t-practice);
  background: var(--t-practice-soft);
  color: var(--t-ink);
  animation: gm-shake 0.35s;
}

@keyframes gm-shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.gm-target {
  display: grid;
  justify-items: center;
  padding: 0.6rem;
  border-radius: 18px;
  background: var(--t-ink);
  color: #fff;
}

.gm-target strong {
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.05;
}

.gm-target em {
  color: #cfe0f5;
  font-style: normal;
}

/* Mystery Picture */
.gm-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.gm-scene {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 3px solid var(--t-ink);
  border-radius: 18px;
  background: #cfe0f5;
}

.gm-scene svg,
.gm-final svg {
  display: block;
  width: 100%;
  height: 100%;
}

.gm-fog {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(4, 1fr);
}

.gm-tile {
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(145deg, #6d7f9c, #4d5f7e);
  color: #fff;
  font: inherit;
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.5s, background 0.2s;
}

.gm-tile.on {
  background: var(--trail);
  outline: 4px solid var(--t-gold);
  outline-offset: -6px;
}

.gm-tile.clear {
  opacity: 0;
  pointer-events: none;
}

.gm-q {
  margin: 0 0 0.8rem;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 700;
}

.gm-ask {
  padding: 1rem;
  border-radius: 16px;
  background: #fff;
  font-size: 1.15rem;
}

.gm-ask-form .tr-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.gm-result {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.2rem 0;
  text-align: center;
}

.gm-final {
  width: min(420px, 100%);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 3px solid var(--t-ink);
  border-radius: 18px;
}

.gm-review {
  width: min(720px, 100%);
  text-align: left;
}

.gm-review > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.gm-review article {
  padding: 0.8rem 1rem;
  border: 2px solid var(--t-rule);
  border-radius: 14px;
  background: #fff;
}

.gm-review-q {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .gm-stage {
    grid-template-columns: 1fr;
  }

  .gm-cards {
    gap: 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gm-card.nope,
  .gm-tile,
  .gm-game {
    animation: none;
    transition: none;
  }
}

.rw-go {
  border-color: var(--t-gold);
  background: #fff9e6;
  color: var(--t-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.rw-go:hover {
  background: #fff1c2;
}

.gm-game {
  position: relative;
}

.gm-today {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--t-gold);
  color: var(--t-ink);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
}

.gm-game.today {
  border-color: var(--t-gold);
}

.gm-ask-form .tr-answer {
  justify-content: flex-start;
}

.gm-ask-form .gm-note {
  text-align: left;
}

.rw-shelf .lock {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: #5b6578; /* white glyph measured 1.42:1 on the light rule colour */
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Answer Sort, calm mode, options row */
.gm-cards.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gm-card.pick {
  border-color: var(--t-focus);
  background: #e8f0ff;
  box-shadow: 0 0 0 4px rgba(31, 95, 191, 0.25);
}

.gm-bins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.gm-bin {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  min-height: 110px;
  padding: 0.8rem;
  border: 3px dashed var(--t-rule);
  border-radius: 18px;
  background: #fff;
  color: var(--t-ink);
  font: inherit;
  text-align: left;
}

.gm-bin:not(:disabled) {
  border-color: var(--trail);
  cursor: pointer;
}

.gm-bin b {
  font-size: 1.15rem;
}

.gm-bin span {
  color: var(--t-ink-soft);
  font-size: 1.05rem;
  font-weight: 600;
}

.gm-options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 1.4rem;
}

.gm-calm {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  font-weight: 600;
}

.gm-calm input {
  width: 1.3rem;
  height: 1.3rem;
}

.gm-calm small {
  color: var(--t-ink-soft);
  font-weight: 400;
}

.gm-menu {
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
}

.gm-target .tr-tool {
  margin-top: 0.4rem;
  background: #fff;
}

.tr-tip-card,
.tr-teachback {
  margin: 0.4rem 0 1rem;
  padding: 0.7rem 1rem;
  border: 2px solid var(--t-rule);
  border-radius: 16px;
  background: #fff;
}

.tr-tip-card b {
  display: block;
  font-size: 1.05rem;
}

.tr-tip-card span {
  color: var(--t-ink-soft);
}

.tr-teachback h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.tr-teachback div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tr-teachback button {
  min-height: 44px;
  padding: 0 0.9rem;
  border: 2px solid var(--t-rule);
  border-radius: 999px;
  background: #fff;
  color: var(--t-ink);
  font: inherit;
  cursor: pointer;
}

.tr-teachback button:hover,
.tr-teachback button[aria-pressed="true"] {
  border-color: var(--trail);
  background: #eef6ff;
}

.tr-teachback p {
  margin: 0;
  color: var(--t-good);
  font-weight: 700;
}

.class-snapshot {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border: 2px solid var(--t-rule);
  border-radius: 16px;
  background: #fff;
}

.snap-facts {
  display: grid;
  gap: 0.4rem;
  padding-left: 1.4rem;
}

.snap-facts span {
  color: var(--t-ink-soft);
}

.snap-skills {
  width: 100%;
  border-collapse: collapse;
}

.snap-skills th,
.snap-skills td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--t-rule);
  text-align: left;
}

.snap-skills td {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Boss round */
.tr-boss {
  display: flex;
  justify-content: center;
  margin: 0.4rem 0 1.2rem;
}

.tr-boss button {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  min-width: 220px;
  padding: 0.8rem 1.4rem;
  border: 3px dashed var(--t-rule);
  border-radius: 20px;
  background: #f6f8fb;
  color: var(--t-ink-soft);
  font: inherit;
}

.tr-boss.open button {
  border: 3px solid var(--t-gold);
  background: #fff9e6;
  color: var(--t-ink);
  cursor: pointer;
}

.tr-boss .tr-medal {
  display: block;
  width: auto;
  height: auto;
  border: 0;
  background: none;
  font-size: 2.2rem;
  line-height: 1.2;
}

.tr-boss.done button {
  border-color: var(--t-good);
  background: var(--t-good-soft);
}

/* Paper game sheets */
.paper-match {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2in;
  margin-top: 0.3in;
}

.paper-match ol,
.paper-answers,
.paper-sort-cards {
  margin: 0;
  padding: 0;
  list-style: none;
}

.paper-match li,
.paper-sort-cards li {
  display: flex;
  justify-content: space-between;
  gap: 0.2in;
  padding: 0.12in 0;
  font-size: 15pt;
}

.paper-answers li {
  padding: 0.12in 0;
  font-size: 15pt;
}

.paper-hunt h2 {
  margin: 0.25in 0 0.1in;
  font-size: 14pt;
}

.paper-hunt > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.08in;
}

.paper-hunt span {
  padding: 0.14in 0.05in;
  border: 1.5px solid #333;
  border-radius: 8px;
  font-size: 14pt;
  text-align: center;
}

.paper-bins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2in;
  margin-top: 0.3in;
}

.paper-bins div {
  min-height: 1.6in;
  padding: 0.12in;
  border: 2px dashed #333;
  border-radius: 10px;
  font-size: 14pt;
}

/* Spot the Mistake */
.gm-steps {
  display: grid;
  gap: 0.5rem;
  margin: 0.4rem 0;
  padding: 0;
  list-style: none;
}

.gm-step {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 3px solid var(--t-rule);
  border-radius: 14px;
  background: #fff;
  color: var(--t-ink);
  font: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.gm-step b {
  display: inline-block;
  min-width: 1.6rem;
  margin-right: 0.5rem;
  color: var(--trail);
}

.gm-step.nope {
  border-color: var(--t-practice);
  background: var(--t-practice-soft);
}

.gm-step.pick {
  border-color: var(--t-gold);
  background: #fff9e6;
}

.gm-claim {
  margin: 0.4rem 0;
  font-size: 1.5rem;
}

.gm-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.gm-fix label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

/* Accessibility: touch targets, forced-colors (Windows high contrast), and clear states without color alone */
.gm-bar .tr-back {
  min-height: 44px;
  padding-inline: 1rem;
}

.gm-bar b:focus,
.gm-head h2:focus {
  outline: 3px solid var(--t-focus);
  outline-offset: 4px;
}

@media (forced-colors: active) {
  .gm-card,
  .gm-step,
  .gm-bin,
  .gm-tile,
  .gm-game,
  .tr-boss button,
  .rw-chip {
    border: 3px solid ButtonText;
  }

  .gm-card.done,
  .gm-card.up.a {
    border-style: double;
    border-width: 5px;
  }

  .gm-card.nope,
  .gm-step.nope {
    border-style: dashed;
  }

  .gm-card.pick,
  .gm-tile.on,
  .gm-step.pick {
    outline: 4px solid Highlight;
    outline-offset: 2px;
  }

  .gm-tile.clear {
    opacity: 0;
  }

  .gm-card:disabled,
  .gm-bin:disabled {
    border-color: GrayText;
    color: GrayText;
  }
}

/* Make It, Fact Family Builder, Balance It */
.gm-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.4rem 0;
  padding: 0;
  list-style: none;
}

.gm-pairs li {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--t-good-soft);
  color: var(--t-good);
  font-size: 1.1rem;
  font-weight: 700;
}

/* Make 24 */
.gm-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.gm-ops button {
  min-width: 44px;
  min-height: 44px;
  font-size: 1.2rem;
}

.gm-ops button.pick {
  background: var(--t-ink);
  color: #fff;
}

.gm-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.gm-tiles .gm-card {
  min-width: 90px;
}

.gm-eqs {
  display: grid;
  gap: 0.6rem;
  margin: 0.4rem 0;
  padding: 0;
  list-style: none;
}

.gm-eq {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border: 3px solid var(--t-rule);
  border-radius: 16px;
  background: #fff;
  font-size: 1.6rem;
  font-weight: 700;
}

.gm-eq.ok {
  border-color: var(--t-good);
  background: var(--t-good-soft);
}

.gm-eq.bad {
  border-color: var(--t-practice);
  background: var(--t-practice-soft);
}

.gm-eq em {
  margin-left: auto;
  font-style: normal;
}

.gm-slot {
  width: 72px;
  height: 56px;
  border: 3px dashed var(--t-rule);
  border-radius: 12px;
  background: #f6f8fb;
  color: var(--t-ink);
  font: inherit;
  cursor: pointer;
}

.gm-slot.filled {
  border-style: solid;
  border-color: var(--trail);
  background: #fff;
}

.gm-scale-wrap {
  max-width: 460px;
  margin: 0 auto;
}

.gm-scale {
  display: block;
  width: 100%;
  height: auto;
}

@media (forced-colors: active) {
  .gm-slot,
  .gm-eq {
    border: 3px solid ButtonText;
  }

  .gm-eq.ok {
    border-style: double;
  }

  .gm-eq.bad {
    border-style: dashed;
  }
}

/* Buddy, weekly goal, Tricky Facts */
.bd-panel {
  margin: 1.2rem 0;
  padding: 1rem 1.2rem;
  border: 2px solid var(--t-rule);
  border-radius: 18px;
  background: #fff;
}

.bd-panel h3 {
  margin: 0 0 0.6rem;
}

.bd-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
}

.bd-view {
  width: 150px;
}

.bd-svg {
  display: block;
  width: 100%;
  height: auto;
}

.bd-controls {
  display: grid;
  gap: 0.6rem;
  min-width: 220px;
}

.bd-colors {
  display: flex;
  gap: 0.5rem;
}

.bd-swatch {
  width: 44px;
  height: 44px;
  border: 3px solid var(--t-rule);
  border-radius: 50%;
  background: var(--sw);
  cursor: pointer;
}

.bd-swatch[aria-pressed="true"] {
  border-color: var(--t-ink);
  box-shadow: 0 0 0 3px var(--t-gold);
}

.bd-slot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.bd-slot select {
  flex: 1;
  min-height: 44px;
  padding: 0 0.6rem;
  border: 2px solid var(--t-rule);
  border-radius: 10px;
  background: #fff;
  color: var(--t-ink);
  font: inherit;
}

.bd-note {
  margin: 0;
  color: var(--t-ink-soft);
  font-size: 0.9rem;
}

.bd-cheer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.bd-cheer .bd-svg {
  width: 110px;
}

.bd-bubble {
  position: relative;
  max-width: 320px;
  margin: 0;
  padding: 0.7rem 1rem;
  border: 2px solid var(--t-rule);
  border-radius: 16px;
  background: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
}

.rw-buddy {
  display: inline-block;
  width: 56px;
}

.rw-buddy .bd-svg {
  width: 100%;
}

.rw-chip.met {
  border-color: var(--t-good);
  background: var(--t-good-soft);
}

.gm-goal-progress {
  margin: 0.2rem 0 0;
  color: var(--t-ink-soft);
  font-weight: 600;
}

@media (forced-colors: active) {
  .bd-swatch[aria-pressed="true"] {
    outline: 4px solid Highlight;
  }
}

/* Spot the Mistake: "a student solved this" rounds */
.gm-work-pick {
  min-width: 0;
  margin: 0.8rem 0;
  padding: 0;
  border: 0;
}

.gm-work-pick legend {
  margin-bottom: 0.5rem;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.gm-work-options {
  display: grid;
  gap: 0.6rem;
}

.gm-work-options button {
  min-height: 44px;
  text-align: left;
}

.gm-fixopt {
  font-size: 1.3rem;
}

.gm-found {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  font-weight: 700;
}
/* Puzzle worlds: math state is shown in a responsive, high-contrast model workspace. */
.pw-playing { max-width: 100%; }
.pw-head { display: grid; gap: .4rem; margin-bottom: 1rem; }
.pw-head h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.pw-head p { margin: 0; }
.pw-scene { display: grid; justify-items: center; gap: 1rem; padding: clamp(1rem, 3vw, 2rem); border: 1px solid #cbd5e1; border-radius: 1.25rem; background: linear-gradient(145deg, #fff, #f2f7fb); color: #17243a; }
.pw-prompt { max-width: 42rem; margin: 0; text-align: center; font-size: clamp(1.15rem, 2.3vw, 1.55rem); font-weight: 750; line-height: 1.45; }
.pw-machine, .pw-bridge, .pw-scale, .pw-ratio, .pw-percent { width: min(100%, 40rem); min-height: 7rem; display: flex; align-items: center; justify-content: center; gap: clamp(.5rem, 2vw, 1.25rem); }
.pw-machine strong { min-width: 3rem; padding: .8rem; border-radius: .9rem; background: #173b63; color: white; text-align: center; font-size: 1.5rem; }
.pw-machine-step { padding: .7rem; border: 2px solid #78b8d6; border-radius: .8rem; background: #e9f8ff; font-weight: 750; }
.pw-bridge-deck { flex: 1; display: grid; grid-template-columns: repeat(var(--parts), minmax(1rem, 1fr)); gap: .25rem; height: 3.5rem; padding: .35rem; border-bottom: .7rem solid #815636; border-radius: .3rem; background: #e8f3fa; }
.pw-bridge-deck i { border-radius: .25rem; background: #fff; border: 1px solid #9fb6c7; }
.pw-bridge-deck i.filled { background: #48a8ce; border-color: #237b9f; }
.pw-scale { position: relative; align-items: end; padding: 1rem 1rem 2rem; }
.pw-pan { z-index: 1; min-width: 36%; max-width: 48%; min-height: 3.5rem; display: grid; place-items: center; padding: .6rem; border: 2px solid #7d9aab; border-radius: .8rem  .8rem 1.4rem 1.4rem; background: #fff; font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 750; text-align: center; }
.pw-beam { position: absolute; top: 35%; left: 12%; right: 12%; height: .55rem; border-radius: 1rem; background: #4a6477; }
.pw-scale-base { position: absolute; bottom: .8rem; width: 2.5rem; height: 2rem; border-radius: 50% 50% .25rem .25rem; background: #4a6477; }
.pw-ratio { display: grid; grid-template-columns: 1fr auto 1fr; text-align: center; }
.pw-ratio div { display: grid; gap: .25rem; padding: .9rem; border-radius: .85rem; background: #eaf4ff; border: 1px solid #94b9d5; }
.pw-ratio b { font-size: 1.75rem; }
.pw-ratio small { grid-column: 1 / -1; font-weight: 750; }
.pw-percent { align-items: stretch; min-height: 5rem; }
.pw-percent span { display: grid; place-items: center; min-width: 0; padding: .75rem; background: #c8e8cf; font-weight: 750; }
.pw-percent span + span { background: #f2d9a7; }
.pw-tenframe { width: min(100%, 28rem); display: grid; grid-template-columns: repeat(5, minmax(2.5rem, 1fr)); gap: .35rem; padding: .8rem; border: 3px solid #55778e; border-radius: .8rem; background: #f8fcff; }
.pw-tenframe > span, .pw-tenframe-controls button { min-height: 2.8rem; display: grid; place-items: center; border: 1px solid #8ca7b8; border-radius: .4rem; background: white; font-size: 1.35rem; color: #526d81; }
.pw-tenframe > span.filled, .pw-tenframe-controls button[aria-pressed="true"] { background: #c9e8f4; color: #15566e; }
.pw-tenframe strong { grid-column: 1 / -1; text-align: center; font-size: 1.2rem; }
.pw-tenframe-controls { border-style: dashed; }
.pw-tenframe-controls button { min-width: 2.8rem; cursor: pointer; }
.pw-tenframe-controls button:focus-visible { outline: 3px solid #ab5b20; outline-offset: 2px; }
.pw-harbor { width: min(100%, 42rem); display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; }
.pw-harbor > div { min-width: 5.5rem; display: grid; gap: .25rem; justify-items: center; padding: .65rem; border: 2px solid #7eb8d1; border-radius: 1rem 1rem .5rem .5rem; background: linear-gradient(#eaf9ff 65%, #89c8df 65%); }
.pw-harbor > div span { font-size: 1.4rem; }
.pw-harbor > div small { font-size: .8rem; }
.pw-harbor > p { flex-basis: 100%; margin: 0; text-align: center; font-weight: 750; }
.pw-decimal { width: min(100%, 38rem); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .8rem; padding: 1rem; border: 2px solid #8aa8b9; border-radius: 1rem; background: linear-gradient(135deg,#e4f6ed,#e5f2ff); font-size: clamp(1.25rem, 4vw, 2rem); font-weight: 800; }
.pw-decimal small { flex-basis: 100%; text-align: center; font-size: .9rem; }
.pw-integerline { position: relative; width: min(100%, 42rem); display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); padding: 1.4rem .3rem; border-bottom: 4px solid #47677d; }
.pw-integerline > span { position: relative; display: grid; justify-items: center; font-size: .8rem; }
.pw-integerline > span.zero { color: #9a4a11; font-weight: 900; }
.pw-integerline > span.start::before, .pw-integerline > span[data-current="true"]::before { content: ""; position: absolute; top: -.65rem; width: .65rem; height: .65rem; border-radius: 50%; background: #267e9c; }
.pw-integerline > span[data-current="true"]::before { background: #d26c27; }
.pw-integerline small { position: absolute; top: -1.5rem; font-size: .7rem; }
.pw-graph { position: relative; width: min(100%, 28rem); aspect-ratio: 1; overflow: hidden; background-color: #f8fcff; background-image: linear-gradient(#bfd0db 1px,transparent 1px),linear-gradient(90deg,#bfd0db 1px,transparent 1px); background-size: 10% 10%; border: 2px solid #6d8799; }
.pw-graph-axis-x, .pw-graph-axis-y { position: absolute; background: #34536b; }
.pw-graph-axis-x { left: 0; right: 0; bottom: 0; height: 2px; }
.pw-graph-axis-y { top: 0; bottom: 0; left: 0; width: 2px; }
.pw-graph-point { position: absolute; left: calc(var(--x) * 10%); bottom: calc(var(--y) * 4%); width: .85rem; height: .85rem; transform: translate(-50%, 50%); border-radius: 50%; background: #c44831; box-shadow: 0 0 0 3px white; }
.pw-graph p { position: absolute; right: .35rem; top: .2rem; margin: 0; padding: .2rem .4rem; background: #fff; font-weight: 800; }
.pw-coordinate-input, .pw-harbor-controls { width: min(100%, 35rem); display: grid; grid-template-columns: repeat(auto-fit,minmax(9rem,1fr)); gap: .65rem; }
.pw-coordinate-input label, .pw-harbor-controls label { display: grid; gap: .3rem; font-weight: 700; }
.pw-coordinate-input input, .pw-harbor-controls input { min-width: 0; min-height: 3rem; padding: .5rem; border: 2px solid #5a7285; border-radius: .65rem; color: #12243a; background: white; font: inherit; font-size: 1.15rem; }
.pw-live { width: min(100%, 40rem); min-height: 2.8rem; margin: 0; padding: .65rem .85rem; border-radius: .75rem; background: #eef2f7; color: #26384a; font-weight: 650; text-align: center; }
.pw-live[data-state="balanced"] { background: #e0f5e8; color: #14532d; }
.pw-live[data-state="unbalanced"] { background: #fff4dc; color: #70480c; }
.pw-controls { width: min(100%, 35rem); display: grid; justify-content: center; gap: .8rem; }
.pw-answer-label, .pw-fraction-input label { display: grid; gap: .35rem; font-weight: 700; }
.pw-answer-label input, .pw-fraction-input input { width: 100%; min-height: 3rem; padding: .5rem .75rem; border: 2px solid #5a7285; border-radius: .65rem; color: #12243a; background: #fff; font: inherit; font-size: 1.2rem; }
.pw-fraction-input { display: flex; align-items: end; justify-content: center; gap: .4rem; }
.pw-fraction-input label { width: min(7rem, 28vw); }
.pw-fraction-input > span, .pw-fraction-input > b { padding-bottom: .7rem; font-size: 1.3rem; }
.pw-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; margin: 0; padding: 0; border: 0; }
.pw-choices legend { width: 100%; margin-bottom: .25rem; text-align: center; font-weight: 750; }
.pw-choices label { min-width: 6rem; display: flex; align-items: center; gap: .55rem; min-height: 3rem; padding: .55rem .8rem; border: 2px solid #698296; border-radius: .7rem; background: white; font-size: 1.1rem; font-weight: 700; }
.pw-choices input { width: 1.25rem; height: 1.25rem; accent-color: #155e75; }
.pw-playing .sig-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; margin: .9rem 0; }
.pw-reflect { max-width: 42rem; margin: 1rem auto; padding: .8rem 1rem; border-left: 4px solid #2688ad; background: #eef8fc; font-weight: 650; }
.pw-icon { display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 1rem; background: linear-gradient(145deg, #dff5ff, #b8e6f5); font-size: 1.7rem; box-shadow: inset 0 0 0 1px #fff; }
.gm-equationfactory .pw-icon { background: #eee5d4; }
.gm-fractionbridge .pw-icon { background: #d7f0f4; }
.gm-balancestation .pw-icon { background: #e3e7f8; }
.gm-ratiocity .pw-icon { background: #dcefdc; }
.gm-tenframefactory .pw-icon { background: #f8ead3; }
.gm-divisionharbor .pw-icon { background: #d7f2f5; }
.gm-decimaldashboards .pw-icon { background: #e0eaff; }
.gm-integerexpedition .pw-icon { background: #F7F4EC; }
.gm-graphcity .pw-icon { background: #f7e3dd; }
.pw-balanced .pw-bridge-deck, .pw-balanced .pw-machine strong, .pw-balanced .pw-pan { animation: pw-confirm .45s ease-out; }
@keyframes pw-confirm { 50% { transform: translateY(-.25rem); box-shadow: 0 0 .9rem #4cae78; } }
@media (max-width: 600px) {
  .pw-scene { padding: .9rem; }
  .pw-machine { gap: .35rem; }
  .pw-machine strong { min-width: 2.5rem; padding: .55rem .35rem; font-size: 1.15rem; }
  .pw-machine-step { padding: .5rem .35rem; font-size: .9rem; }
  .pw-bridge-deck { height: 2.7rem; }
  .pw-playing .sig-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pw-playing .sig-actions [data-pw-check] { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .pw-balanced .pw-bridge-deck, .pw-balanced .pw-machine strong, .pw-balanced .pw-pan { animation: none; } }

.pw-beam { transform: rotate(var(--tilt, 0deg)); transform-origin: center; transition: transform .28s ease-out; }
.pw-built-track { width: min(100%, 40rem); height: 1.3rem; overflow: hidden; border: 2px solid #6b8798; border-radius: .5rem; background: repeating-linear-gradient(90deg, #fff 0 9%, #e5edf2 9% 10%); }
.pw-built-bar { height: 100%; width: 0; background: #43a7cb; transition: width .25s ease-out; }
.pw-built-bar[data-overlap="true"] { background: #df8f40; }
@media (max-width: 600px) { .pw-playing .sig-actions { display: grid; grid-template-columns: 1fr 1fr; } .pw-playing .sig-actions [data-pw-check] { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .pw-beam, .pw-built-bar { transition: none; } }

.pw-replay .pw-machine-step { animation: pw-step-in .3s ease-out both; }
.pw-replay .pw-machine-step:nth-of-type(2) { animation-delay: .2s; }
.pw-replay .pw-machine-step:nth-of-type(3) { animation-delay: .4s; }
.pw-replay .pw-bridge-deck { animation: pw-bridge-in .65s ease-out both; }
.pw-motion-paused *, .pw-motion-paused *::before, .pw-motion-paused *::after { animation-play-state: paused !important; transition-duration: 0s !important; }
@keyframes pw-step-in { from { opacity: .35; transform: translateX(-.65rem); } to { opacity: 1; transform: translateX(0); } }
@keyframes pw-bridge-in { from { opacity: .4; transform: scaleX(.55); } to { opacity: 1; transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .pw-replay .pw-machine-step, .pw-replay .pw-bridge-deck { animation: none; } }

.gm-hive-target { display: grid; justify-items: center; gap: .25rem; width: min(12rem, 70vw); margin: 1rem auto; padding: 1rem; border: 3px solid #d9a322; border-radius: 50% 50% 44% 44%; background: #fff8db; color: #362c14; }
.gm-hive-target strong { font-size: clamp(2rem, 6vw, 3.5rem); line-height: 1.1; }
.gm-hive-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 1rem auto; }
.gm-hive-tile { min-width: 3.5rem; min-height: 3.5rem; border: 2px solid #cf9e1e; border-radius: .75rem; background: #fff; color: #3d3217; font: inherit; font-size: 1.25rem; font-weight: 850; cursor: pointer; }
.gm-hive-ops { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin: .7rem 0; }
.gm-hive-entry { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.gm-hive-entry input { flex: 1 1 14rem; min-width: 0; }
.gm-hive-found { max-width: 38rem; margin: .75rem auto; }
.gm-ghost-settings { display: grid; gap: .7rem; max-width: 36rem; margin: 1rem auto; padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; }
.gm-ghost-settings label { display: flex; align-items: center; gap: .55rem; min-height: 2.75rem; }
.gm-ghost-settings input { width: 1.15rem; height: 1.15rem; }
.gm-path-map { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem; margin: 1rem auto; }
.gm-path-step { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border: 2px solid #7893a3; border-radius: 50%; background: white; font-weight: 800; }
.gm-path-step.current { border-color: #ba8b14; background: #fff4c2; box-shadow: 0 0 0 3px #f9e8a7; }
.gm-path-step.built { border-color: #2b7a60; background: #e2f5ed; color: #165a42; }
.gm-path-arrow { color: #526978; font-weight: 800; }
.gm-target-hive button:focus-visible, .gm-ghost-sprint button:focus-visible, .gm-path-builder button:focus-visible { outline: 3px solid #1665a8; outline-offset: 3px; }
@media (max-width: 520px) { .gm-hive-entry { align-items: stretch; } .gm-hive-entry button { width: 100%; } }

.gm-match-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 1rem 0; }
.gm-match-card { display: grid; place-items: center; min-height: 132px; padding: .6rem; border: 2px solid #cbd5e1; border-radius: 14px; background: #fff; color: #17345f; font: inherit; cursor: pointer; text-align: center; }
.gm-match-card:focus-visible { outline: 3px solid #d17b1f; outline-offset: 2px; }
.gm-match-card.face-down { background: linear-gradient(135deg,#eef4fb,#dce8f4); border-color: #9db3c9; }
.gm-match-card.face-down .gm-match-question { font-size: 2.4rem; font-weight: 900; color: #4b6b88; }
.gm-match-card.revealed { border-color: #5397a3; background: #f0fbfc; }
.gm-match-card.matched { border-color: #68a981; background: #edf8f0; box-shadow: inset 0 0 0 2px #c4e7ce; }
.gm-match-expression { font-size: clamp(1.1rem,2vw,1.55rem); line-height: 1.35; }
.gm-match-card svg { width: min(100%, 240px); height: auto; }
.gm-match-axis { stroke: #45647e; stroke-width: 3; }
.gm-match-tick { stroke: #45647e; stroke-width: 2; }
.gm-match-jump { fill: none; stroke: #16829a; stroke-width: 3; }
.gm-match-cell { fill: #c8eaf0; stroke: #417e8c; stroke-width: 1.5; }
.gm-match-shaded { fill: #f2c95e; }
.gm-match-point { fill: #f2c95e; stroke: #9b6b00; stroke-width: 3; }
.gm-match-label { fill: #17345f; font: 700 12px system-ui,sans-serif; }
@media(max-width: 650px) { .gm-match-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gm-match-card { min-height: 112px; padding: .45rem; } }

/* Buddy shop, coins, Team Relay */
.shop-panel {
  margin: 1.2rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--t-rule);
  border-radius: 18px;
  background: #fff;
}

.shop-panel h3 {
  margin: 0 0 0.4rem;
}

.shop-balance {
  margin: 0 0 0.8rem;
  font-weight: 700;
}

.shop-balance small {
  margin-inline-start: 0.5rem;
  color: var(--t-ink-soft);
  font-weight: 400;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-item {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 0.7rem;
  border: 1px solid var(--t-rule);
  border-radius: 14px;
  text-align: center;
}

.shop-art {
  width: 84px;
}

.shop-item .tr-tool {
  min-height: 44px;
}

.shop-owned {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--t-good);
  font-weight: 700;
}

.gm-coins {
  margin: 0.3rem 0;
  font-weight: 700;
}

.team-board {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
}

.team-board li {
  padding: 0.35rem 0.8rem;
  border: 2px solid var(--team);
  border-radius: 999px;
  color: var(--team);
  font-weight: 700;
}

.team-board li[aria-current="step"] {
  background: var(--team);
  color: #fff;
}

.team-turn {
  margin: 0.4rem 0;
  color: var(--team);
  font-size: 1.25rem;
  font-weight: 800;
}

.team-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin: 0 0 0.8rem;
  padding: 0;
  border: 0;
}

/* Spell Duel */
.gm-duel section { margin: 1rem 0; }

.gm-duel h3 { margin: 0 0 0.5rem; }

.dl-gold {
  margin-left: auto;
  padding: 0.2rem 0.7rem;
  border: 2px solid var(--t-rule);
  border-radius: 999px;
  background: var(--t-paper);
  font-weight: 700;
}

.dl-creatures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
  margin: 0.4rem 0 0.8rem;
  padding: 0;
  list-style: none;
}

.dl-creature,
.dl-pet {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  width: 100%;
  min-height: 44px;
  padding: 0.8rem 0.5rem;
  border: 2px solid var(--t-rule);
  border-radius: 16px;
  background: var(--t-paper);
  color: var(--t-ink);
  font: inherit;
  cursor: pointer;
}

.dl-creature:hover:not(:disabled),
.dl-pet:hover,
.dl-pet[aria-pressed="true"] { border-color: var(--trail); }

.dl-pet[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--trail); }
.dl-creature.done { background: color-mix(in srgb, var(--trail) 8%, var(--t-paper)); }
.dl-creature:disabled { cursor: not-allowed; opacity: 0.6; }
.dl-creature small, .dl-pet small { color: var(--t-ink-soft); }
.dl-face { font-size: 2.2rem; line-height: 1; }
.dl-face.big { font-size: 4.5rem; }

.dl-quests ul { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }

.dl-quests li {
  display: grid;
  grid-template-columns: 1fr minmax(80px, 140px) auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--t-rule);
  border-radius: 12px;
}

.dl-claimed { color: var(--t-ink-soft); font-weight: 700; }

.dl-arena { display: grid; justify-items: center; gap: 0.4rem; margin: 0.6rem 0; }
.dl-energy { width: min(100%, 22rem); height: 1.1rem; accent-color: var(--trail); }

.dl-spells {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.dl-spell {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--t-rule);
  border-radius: 999px;
  background: var(--t-paper);
  color: var(--t-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dl-spell[aria-pressed="true"] {
  border-color: var(--trail);
  background: var(--t-ink);
  color: #fff;
}

@media (max-width: 520px) {
  .dl-quests li { grid-template-columns: 1fr auto; }
  .dl-quests progress { grid-column: 1 / -1; width: 100%; }
}
