:root {
  --purple-dark: #250a52;
  --purple: #51158b;
  --purple-light: #7a2fc2;
  --yellow: #ffd33d;
  --orange: #ff7a00;
  --pink: #e94479;
  --teal: #00a9a1;
  --cream: #fff9e9;
  --ink: #241344;
  --cube-size: clamp(176px, 20vw, 250px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 211, 61, 0.24) 0 4px, transparent 5px),
    radial-gradient(circle at 90% 80%, rgba(0, 169, 161, 0.22) 0 5px, transparent 6px),
    linear-gradient(135deg, #24064e 0%, #4c1483 48%, #28105c 100%);
  font-family: "Montserrat", system-ui, sans-serif;
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  width: 250px;
  height: 250px;
  content: "";
  opacity: 0.24;
  pointer-events: none;
  background: repeating-conic-gradient(from 22deg, var(--yellow) 0 8deg, transparent 8deg 24deg);
  mask: radial-gradient(circle, transparent 0 32%, #000 33% 51%, transparent 52%);
}

body::before {
  top: -80px;
  left: -75px;
}

body::after {
  right: -90px;
  bottom: -75px;
  background: repeating-conic-gradient(from 10deg, var(--teal) 0 8deg, transparent 8deg 24deg);
}

button {
  font: inherit;
}

.page-glow {
  position: fixed;
  z-index: 0;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  pointer-events: none;
}

.page-glow--one {
  top: 12%;
  left: -180px;
  background: var(--pink);
}

.page-glow--two {
  right: -150px;
  bottom: 2%;
  background: var(--yellow);
}

.game {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 34px));
  margin: 0 auto;
  padding: 28px 0 38px;
}

.game__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 20px;
  color: white;
  text-align: left;
}

.brand-logo {
  display: block;
  width: clamp(230px, 32vw, 360px);
  height: auto;
  padding: 8px 13px;
  transform: rotate(-1deg);
  border-radius: 22px 9px 22px 9px;
  background: rgba(255, 249, 233, 0.94);
  box-shadow: 7px 7px 0 var(--pink), 0 18px 34px rgba(12, 1, 34, 0.24);
}

.brand-copy {
  min-width: 180px;
}

.game__header h1 {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.eyebrow,
.section-kicker,
.tagline {
  margin: 0;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 900;
}

.eyebrow {
  color: var(--yellow);
}

h1 {
  margin: -8px 0 -10px;
  color: white;
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(2.8rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 4px 4px 0 var(--pink), -2px -2px 0 var(--purple-dark);
}

.tagline {
  color: #eadcff;
  letter-spacing: 0.08em;
}

.teacher-guide {
  margin: 0 0 20px;
}

.teacher-guide__bar {
  display: grid;
  padding: 14px 16px;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 2.15fr) auto;
  grid-template-areas: "intro steps toggle";
  gap: 16px;
  align-items: center;
  border: 3px solid rgba(255, 211, 61, 0.82);
  border-radius: 24px 9px 24px 9px;
  background: rgba(35, 7, 76, 0.82);
  box-shadow: 0 14px 30px rgba(14, 2, 35, 0.28);
  backdrop-filter: blur(12px);
}

.teacher-guide.is-collapsed .teacher-guide__bar {
  width: min(560px, 100%);
  margin-inline: auto;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "intro toggle";
}

.teacher-guide__intro {
  grid-area: intro;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: white;
}

.teacher-guide__info {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  transform: rotate(-5deg);
  border: 3px solid var(--purple-dark);
  border-radius: 14px 6px 14px 6px;
  color: var(--purple-dark);
  background: var(--yellow);
  font-family: Georgia, serif;
  font-size: 1.55rem;
  font-weight: 900;
  font-style: italic;
  box-shadow: 4px 4px 0 var(--pink);
}

.teacher-guide__intro p {
  margin: 0;
  color: var(--yellow);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.teacher-guide__intro h2 {
  margin-top: 2px;
  color: white;
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
}

.teacher-guide__steps {
  grid-area: steps;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  animation: guideControlsIn 180ms ease-out both;
}

.teacher-guide__steps[hidden] {
  display: none;
}

.teacher-guide__toggle {
  grid-area: toggle;
  display: inline-flex;
  min-width: 82px;
  padding: 9px 10px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform 150ms ease, color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  border: 2px solid var(--yellow);
  border-radius: 13px 5px 13px 5px;
  color: var(--purple-dark);
  background: var(--yellow);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--pink);
}

.teacher-guide__toggle:hover {
  transform: translateY(-2px);
  background: #ffe678;
}

.teacher-guide__chevron {
  display: inline-block;
  font-size: 1.1rem;
  line-height: 0.7;
  transition: transform 180ms ease;
}

.teacher-guide:not(.is-collapsed) .teacher-guide__chevron {
  transform: rotate(180deg);
}

.guide-trigger {
  display: flex;
  min-width: 0;
  padding: 8px 7px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform 150ms ease, color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  border: 2px solid rgba(255, 255, 255, 0.52);
  border-radius: 13px 5px 13px 5px;
  color: white;
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.guide-trigger:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
}

.guide-trigger.is-active {
  color: var(--purple-dark);
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--pink);
}

.guide-trigger__icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--purple-dark);
  background: var(--yellow);
  font-family: Georgia, serif;
  font-size: 0.9rem;
  font-weight: 900;
  font-style: italic;
}

.teacher-guide__bubble {
  position: relative;
  display: grid;
  width: min(820px, calc(100% - 28px));
  margin: 13px auto 2px;
  padding: 16px 54px 16px 18px;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
  border: 4px solid var(--purple-dark);
  border-radius: 22px 8px 22px 8px;
  color: var(--ink);
  background: var(--cream);
  box-shadow: 7px 7px 0 var(--pink), 0 18px 34px rgba(14, 2, 35, 0.3);
  animation: guideBubbleIn 180ms ease-out both;
}

.teacher-guide__bubble::before {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 18px;
  height: 18px;
  content: "";
  transform: translateX(-50%) rotate(45deg);
  border-top: 4px solid var(--purple-dark);
  border-left: 4px solid var(--purple-dark);
  background: var(--cream);
}

.teacher-guide__bubble[hidden] {
  display: none;
}

.teacher-guide__step {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  transform: rotate(-4deg);
  border-radius: 13px 5px 13px 5px;
  color: white;
  background: var(--purple);
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--yellow);
}

.teacher-guide__bubble h3 {
  margin: 0 0 3px;
  color: var(--purple-dark);
  font-family: "Baloo 2", sans-serif;
  font-size: 1.2rem;
  line-height: 1.1;
}

.teacher-guide__bubble p {
  margin: 0;
  color: #5c477a;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}

.teacher-guide__close {
  position: absolute;
  top: 9px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--pink);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

@keyframes guideBubbleIn {
  from { transform: translateY(-7px) scale(0.985); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes guideControlsIn {
  from { transform: translateY(-4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.playboard {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  overflow: hidden;
  min-height: 650px;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 42px 14px 42px 14px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.97), rgba(255,249,233,0.97)),
    var(--cream);
  box-shadow:
    0 24px 60px rgba(19, 3, 47, 0.45),
    0 0 0 7px rgba(255, 211, 61, 0.3);
}

.playboard::before,
.playboard::after {
  position: absolute;
  z-index: 0;
  width: 180px;
  height: 20px;
  content: "";
  background: repeating-linear-gradient(90deg, var(--pink) 0 15px, var(--orange) 15px 30px, var(--yellow) 30px 45px, var(--teal) 45px 60px);
}

.playboard::before {
  top: 0;
  left: 0;
}

.playboard::after {
  right: 0;
  bottom: 0;
}

.panel {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  padding: 42px 34px 32px;
  align-items: center;
  flex-direction: column;
}

.section-heading {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
}

.section-number {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  transform: rotate(-3deg);
  border-radius: 14px 6px 14px 6px;
  color: white;
  background: var(--purple);
  font-size: 0.85rem;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--yellow);
}

.section-kicker {
  color: var(--pink);
  font-size: 0.64rem;
}

h2 {
  margin: 0;
  color: var(--purple-dark);
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.1;
}

.dice-mode {
  display: grid;
  width: min(330px, 100%);
  margin: 19px auto 0;
  padding: 5px;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  border: 3px solid var(--purple-dark);
  border-radius: 15px 7px 15px 7px;
  background: #eadffc;
  box-shadow: 4px 4px 0 rgba(81, 21, 139, 0.2);
}

.dice-mode__button {
  padding: 9px 8px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
  border: 0;
  border-radius: 10px 4px 10px 4px;
  color: #654b83;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.dice-mode__button span {
  margin-right: 4px;
  color: var(--pink);
}

.dice-mode__button:hover {
  color: var(--purple-dark);
  background: rgba(255,255,255,0.7);
}

.dice-mode__button.is-selected {
  transform: translateY(-1px);
  color: white;
  background: linear-gradient(105deg, var(--purple), var(--purple-light));
  box-shadow: 3px 3px 0 var(--yellow);
}

.dice-mode__button.is-selected span {
  color: var(--yellow);
}

.board-divider {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.board-divider::before {
  position: absolute;
  width: 3px;
  height: 78%;
  content: "";
  background: repeating-linear-gradient(to bottom, var(--purple-light) 0 11px, transparent 11px 20px);
  opacity: 0.26;
}

.board-divider span {
  z-index: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  transform: rotate(45deg);
  border: 4px solid var(--cream);
  border-radius: 9px;
  color: var(--yellow);
  background: var(--purple);
  box-shadow: 0 0 0 3px var(--purple);
}

.board-divider span::first-letter {
  transform: rotate(-45deg);
}

.dice-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 312px;
  place-items: center;
  perspective: 900px;
}

.dice-scene {
  width: var(--cube-size);
  height: var(--cube-size);
  perspective: 900px;
}

.dice {
  position: relative;
  width: 100%;
  height: 100%;
  transform: rotateX(-8deg) rotateY(18deg);
  transform-style: preserve-3d;
  will-change: transform;
}

.dice__face {
  position: absolute;
  display: grid;
  width: var(--cube-size);
  height: var(--cube-size);
  overflow: hidden;
  place-items: center;
  border: 5px solid #32116e;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.98), rgba(255,242,183,0.93));
  box-shadow:
    inset 10px 10px 22px rgba(255,255,255,0.85),
    inset -13px -13px 25px rgba(81,21,139,0.14),
    0 0 18px rgba(255,211,61,0.22);
  backface-visibility: hidden;
}

.dice__face::after {
  position: absolute;
  top: 10px;
  left: 13px;
  width: 60%;
  height: 28%;
  content: "";
  transform: rotate(-18deg);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.75), transparent);
  pointer-events: none;
}

.dice__face img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: contrast(1.1);
  transition: opacity 150ms ease, transform 220ms ease;
}

.dice.is-3d .dice__face {
  border-color: #4a2317;
  background: linear-gradient(145deg, #fffdf8, #f2dfc1);
  box-shadow:
    inset 10px 10px 22px rgba(255,255,255,0.92),
    inset -16px -16px 28px rgba(104,55,27,0.18),
    0 0 18px rgba(154,84,42,0.22);
}

.dice.is-3d .dice__face img {
  width: 88%;
  height: 88%;
  filter: contrast(1.05) saturate(1.04);
}

.dice__face--front  { transform: rotateY(0deg) translateZ(calc(var(--cube-size) / 2)); }
.dice__face--back   { transform: rotateY(180deg) translateZ(calc(var(--cube-size) / 2)); }
.dice__face--right  { transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2)); }
.dice__face--left   { transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2)); }
.dice__face--top    { transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2)); }
.dice__face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2)); }

.dice-shadow {
  position: absolute;
  bottom: 35px;
  left: 50%;
  width: min(270px, 70%);
  height: 48px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(49, 14, 87, 0.3);
  filter: blur(14px);
}

.sparkle {
  position: absolute;
  z-index: 3;
  width: 30px;
  height: 30px;
  animation: twinkle 1.8s ease-in-out infinite;
  background: var(--yellow);
  clip-path: polygon(50% 0, 60% 38%, 100% 50%, 60% 62%, 50% 100%, 40% 62%, 0 50%, 40% 38%);
  filter: drop-shadow(0 0 9px rgba(255, 211, 61, 0.9));
}

.sparkle--one { top: 56px; right: 14%; }
.sparkle--two { top: 154px; left: 10%; width: 19px; height: 19px; animation-delay: -0.7s; }
.sparkle--three { right: 11%; bottom: 54px; width: 16px; height: 16px; animation-delay: -1.1s; }

@keyframes twinkle {
  0%, 100% { transform: scale(0.62) rotate(0); opacity: 0.45; }
  50% { transform: scale(1.18) rotate(45deg); opacity: 1; }
}

.result {
  min-height: 25px;
  margin: -4px 0 14px;
  color: var(--purple-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

.result span {
  color: var(--pink);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.roll-button {
  position: relative;
  width: min(310px, 100%);
  padding: 16px 32px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  border: 3px solid var(--purple-dark);
  border-radius: 18px 7px 18px 7px;
  color: white;
  background: linear-gradient(105deg, var(--pink), var(--orange) 48%, #f6bb00);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  box-shadow: 7px 7px 0 var(--purple-dark), 0 13px 24px rgba(77, 20, 127, 0.22);
}

.roll-button:hover {
  transform: translateY(-3px);
  box-shadow: 8px 10px 0 var(--purple-dark), 0 16px 28px rgba(77, 20, 127, 0.28);
}

.roll-button:active {
  transform: translate(4px, 5px);
  box-shadow: 3px 3px 0 var(--purple-dark);
}

.roll-button:disabled {
  cursor: wait;
  filter: saturate(0.75);
}

.button-diamond {
  margin-right: 9px;
  color: var(--yellow);
}

.timer-display {
  margin: 22px 0 -4px;
  color: var(--purple-dark);
  font-family: "Baloo 2", monospace;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.hourglass-wrap {
  position: relative;
  display: grid;
  width: 100%;
  height: 347px;
  place-items: center;
  transform-origin: 50% 70%;
}

.hourglass {
  width: min(236px, 70%);
  overflow: visible;
  filter: drop-shadow(0 16px 14px rgba(45, 12, 86, 0.22));
}

.glass-fill {
  fill: rgba(225, 244, 255, 0.37);
}

.glass-outline {
  fill: none;
  stroke: var(--purple-dark);
  stroke-width: 11;
  stroke-linejoin: round;
}

.glass-shine {
  fill: none;
  stroke: white;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: 0.9;
}

.hourglass-bar {
  fill: url(#frameGradient);
  stroke: var(--purple-dark);
  stroke-width: 8;
}

.bar-highlight {
  fill: rgba(255,255,255,0.45);
}

.sand-top,
.sand-bottom {
  transform-box: fill-box;
  transform-origin: center bottom;
}

.sand-bottom {
  transform: scaleY(0.06);
}

.sand-stream {
  fill: none;
  stroke: #ffb000;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(255,157,0,0.7));
}

.hourglass-wrap.is-running .sand-stream {
  opacity: 1;
  animation: streamPulse 0.24s linear infinite alternate;
}

@keyframes streamPulse {
  from { stroke-width: 4; }
  to { stroke-width: 8; }
}

.hourglass-wrap.is-finished {
  animation: finishShake 0.78s cubic-bezier(.36,.07,.19,.97) both 3;
}

@keyframes finishShake {
  10%, 90% { transform: translateX(-4px) rotate(-2deg); }
  20%, 80% { transform: translateX(7px) rotate(3deg); }
  30%, 50%, 70% { transform: translateX(-10px) rotate(-4deg); }
  40%, 60% { transform: translateX(10px) rotate(4deg); }
}

.time-up {
  position: absolute;
  z-index: 4;
  top: 46%;
  left: 50%;
  padding: 10px 20px;
  transform: translate(-50%, -50%) rotate(-6deg) scale(0);
  transition: transform 260ms cubic-bezier(.2,1.5,.5,1);
  border: 4px solid var(--purple-dark);
  border-radius: 13px 4px 13px 4px;
  color: var(--purple-dark);
  background: var(--yellow);
  font-family: "Baloo 2", sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  box-shadow: 6px 6px 0 var(--pink);
}

.time-up.is-visible {
  transform: translate(-50%, -50%) rotate(-6deg) scale(1);
}

.time-options {
  display: grid;
  width: 100%;
  max-width: 370px;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.time-button {
  display: flex;
  padding: 10px 6px 9px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
  border: 3px solid var(--purple-dark);
  border-radius: 14px 6px 14px 6px;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  color: var(--purple-dark);
  background: white;
  box-shadow: 4px 4px 0 var(--purple-dark);
}

.time-button:nth-child(2) { color: #0b716f; }
.time-button:nth-child(3) { color: #b1265c; }

.time-button strong {
  font-family: "Baloo 2", sans-serif;
  font-size: 1.65rem;
  line-height: 1;
}

.time-button span {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.time-button:hover {
  transform: translateY(-2px);
}

.time-button:active {
  transform: translate(2px, 3px);
  box-shadow: 2px 2px 0 var(--purple-dark);
}

.time-button.is-selected {
  color: white;
  background: var(--purple);
  box-shadow: 4px 4px 0 var(--yellow);
}

.time-button:nth-child(2).is-selected { background: var(--teal); }
.time-button:nth-child(3).is-selected { background: var(--pink); }

.timer-hint {
  margin: 13px 0 0;
  color: #765f91;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.method-card {
  display: grid;
  margin-top: 28px;
  padding: clamp(22px, 3vw, 34px);
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: clamp(22px, 4vw, 42px);
  align-items: center;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 34px 12px 34px 12px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.97), rgba(255,249,233,0.96)),
    var(--cream);
  box-shadow:
    0 20px 46px rgba(19, 3, 47, 0.34),
    0 0 0 7px rgba(0, 169, 161, 0.18);
}

.method-card__visual {
  position: relative;
  display: grid;
  place-items: center;
}

.method-card__visual::before {
  position: absolute;
  inset: 13% 5% 6%;
  content: "";
  border-radius: 30px;
  background: linear-gradient(135deg, var(--yellow), var(--pink));
  filter: blur(22px);
  opacity: 0.35;
}

.method-card__visual img {
  position: relative;
  display: block;
  width: min(100%, 270px);
  height: auto;
  filter: drop-shadow(0 18px 18px rgba(35, 9, 74, 0.28));
}

.method-card__content .eyebrow {
  color: var(--pink);
}

.method-intro {
  max-width: 700px;
  margin: 10px 0 16px;
  color: #5c477a;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.65;
}

.method-steps {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 10px;
  list-style: none;
  counter-reset: method-step;
}

.method-steps li {
  position: relative;
  min-height: 42px;
  padding: 9px 12px 9px 54px;
  border: 2px solid rgba(81, 21, 139, 0.18);
  border-radius: 16px 6px 16px 6px;
  background: rgba(255,255,255,0.72);
  color: #3d2a5c;
  font-size: 0.86rem;
  line-height: 1.45;
  counter-increment: method-step;
}

.method-steps li::before {
  position: absolute;
  top: 8px;
  left: 10px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  transform: rotate(-5deg);
  border-radius: 10px 4px 10px 4px;
  color: white;
  background: var(--purple);
  font-weight: 900;
  content: counter(method-step);
  box-shadow: 3px 3px 0 var(--yellow);
}

.method-steps strong {
  color: var(--purple-dark);
}

.method-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.method-variants span {
  padding: 7px 10px;
  border: 2px solid var(--purple-dark);
  border-radius: 999px;
  color: white;
  background: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 3px 3px 0 var(--purple-dark);
}

.method-variants span:nth-child(2) { background: var(--orange); }
.method-variants span:nth-child(3) { background: var(--pink); }
.method-variants span:nth-child(4) { background: var(--purple); }

.resource-button {
  display: inline-flex;
  margin-top: 18px;
  padding: 13px 18px;
  align-items: center;
  justify-content: center;
  transition: transform 150ms ease, box-shadow 150ms ease;
  border: 3px solid var(--purple-dark);
  border-radius: 16px 6px 16px 6px;
  color: white;
  background: linear-gradient(105deg, var(--purple), var(--purple-light));
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 var(--yellow);
}

.resource-button:hover {
  transform: translateY(-2px);
  box-shadow: 6px 7px 0 var(--yellow);
}

button:focus-visible,
.resource-button:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

@media (max-width: 820px) {
  .game { width: min(620px, calc(100% - 24px)); }
  .game__header { flex-direction: column; gap: 12px; text-align: center; }
  .brand-logo { width: min(330px, 86vw); }
  .brand-copy { min-width: 0; }
  .teacher-guide__bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "intro toggle"
      "steps steps";
  }
  .teacher-guide.is-collapsed .teacher-guide__bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "intro toggle";
  }
  .teacher-guide__intro { justify-content: center; text-align: left; }
  .teacher-guide__steps { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
  .playboard { grid-template-columns: 1fr; }
  .board-divider { height: 58px; }
  .board-divider::before { width: 78%; height: 3px; background: repeating-linear-gradient(to right, var(--purple-light) 0 11px, transparent 11px 20px); }
  .dice-stage { min-height: 304px; }
  .panel { padding-inline: 28px; }
  .timer-panel { padding-top: 8px; }
  .method-card { grid-template-columns: 1fr; text-align: center; }
  .method-intro { margin-inline: auto; }
  .method-steps { text-align: left; }
  .method-variants { justify-content: center; }
}

@media (max-width: 470px) {
  :root { --cube-size: 176px; }
  .game { width: calc(100% - 18px); padding-top: 18px; }
  .game__header { margin: -2px 0 12px; }
  .brand-logo { width: min(286px, 88vw); }
  .teacher-guide { margin-bottom: 14px; }
  .teacher-guide__bar { padding: 13px 10px; }
  .teacher-guide__intro h2 { font-size: 1.05rem; }
  .teacher-guide__intro p { font-size: 0.52rem; }
  .teacher-guide__info { width: 38px; height: 38px; }
  .teacher-guide__toggle { min-width: 72px; padding-inline: 7px; font-size: 0.61rem; }
  .teacher-guide__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-trigger { white-space: normal; }
  .teacher-guide__bubble { width: calc(100% - 8px); padding: 16px 44px 16px 13px; grid-template-columns: 38px 1fr; }
  .teacher-guide__step { width: 36px; height: 36px; }
  .teacher-guide__bubble p { font-size: 0.76rem; }
  .playboard { border-width: 3px; border-radius: 28px 10px 28px 10px; }
  .panel { padding: 34px 18px 28px; }
  .dice-stage { min-height: 272px; }
  .dice-mode { margin-top: 16px; }
  .dice-mode__button { padding-inline: 5px; font-size: 0.7rem; }
  .dice-shadow { bottom: 28px; }
  .hourglass-wrap { height: 320px; }
  .time-button strong { font-size: 1.4rem; }
  .method-card { padding: 20px 14px; border-width: 3px; }
  .method-steps li { padding-right: 10px; font-size: 0.8rem; }
  .resource-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
