﻿* {
  box-sizing: border-box;
}

body.draw-game-standalone {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #eff5fa 0%, #dce9f4 100%);
  font-family: "Segoe UI", Arial, sans-serif;
  color: #153047;
}

.game-shell {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}

.game-frame {
  position: relative;
  width: min(100%, 1024px);
  aspect-ratio: 1024 / 715;
  overflow: hidden;
  background: #ffffff;
}

.ui-layer,
.worksheet-stage,
.start-overlay,
.character-selection,
.hud-next-number,
.progress-text,
.icon-button {
  position: absolute;
}

.ui-layer {
  pointer-events: none;
  user-select: none;
}

.topbar { left: 0; top: 0; width: 1024px; height: 97px; }
.leftbar { left: 0; top: 92px; width: 125px; height: 623px; }
.rightbar { left: 900px; top: 92px; width: 125px; height: 623px; }
.bottombar { left: 125px; top: 707px; width: 774px; height: 8px; }
.worksheet { left: 124px; top: 92px; width: 785px; height: 615px; }
.progress-frame { left: 433px; top: 11px; width: 158px; height: 67px; }

.progress-text {
  left: 433px;
  top: 11px;
  width: 158px;
  height: 67px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 30px;
  color: #0d6d98;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.hud-next-number {
  left: 497px;
  top: 18px;
  width: 28px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0;
}

.icon-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.info-button { left: 957px; top: 24px; width: 38px; height: 38px; }
.replay-button { left: 890px; top: 24px; width: 38px; height: 38px; }
.sound-button { left: 823px; top: 24px; width: 38px; height: 38px; }

.worksheet-stage {
  left: 124px;
  top: 92px;
  width: 785px;
  height: 615px;
}

.stage-image {
  position: absolute;
  object-fit: none;
  opacity: 0;
  pointer-events: none;
}

#game-board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-image.visible {
  opacity: 1;
}

.stage-outline.visible {
  opacity: 0.36;
}

.stage-outline.revealing {
  animation: outline-reveal 4.8s ease forwards;
}

.stage-color.revealing {
  animation: horse-reveal 5.6s ease forwards;
}

#game-board {
  display: block;
  touch-action: none;
}

.start-overlay {
  inset: 0;
  display: none;
}

.start-overlay.visible {
  display: block;
}

.start-frame {
  position: absolute;
  left: 204px;
  top: 116px;
  width: 616px;
  height: 309px;
  pointer-events: none;
}

.overlay-text {
  position: absolute;
  left: 262px;
  top: 174px;
  width: 500px;
  text-align: center;
  font-size: 25px;
  line-height: 1.38;
  color: #19435f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.overlay-text p {
  margin: 0 0 4px;
}

.start-button {
  position: absolute;
  left: 416px;
  top: 640px;
  width: 181px;
  height: 75px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.start-button img {
  width: 100%;
  height: 100%;
  display: block;
}

.start-button,
.continue-button {
  display: grid;
  place-items: center;
}

.start-button .button-label,
.continue-button .button-label {
  position: absolute;
  z-index: 1;
  min-width: 70%;
  text-align: center;
  font-size: 31px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(7, 52, 89, 0.45), 0 4px 8px rgba(7, 52, 89, 0.22);
  pointer-events: none;
}

.start-button img,
.continue-button img {
  position: absolute;
  inset: 0;
}

.character-selection {
  inset: 0;
  pointer-events: none;
}

.character-choice {
  position: absolute;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
}

.character-choice img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.character-choice .character-choice-off {
  opacity: 0;
}

.character-choice:not(.selected) .character-choice-on {
  opacity: 0;
}

.character-choice:not(.selected) .character-choice-off {
  opacity: 1;
}

.character-choice.disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.mini-choice img {
  object-fit: contain;
}

.point-hit {
  fill: transparent;
  cursor: pointer;
}

.point-circle {
  fill: #ffffff;
  stroke: #17324a;
  stroke-width: 3;
  transition: fill 140ms ease;
}

.point-circle.done {
  fill: #8ce0b6;
}

.point-label {
  font-size: 19px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  fill: #17324a;
}

.segment-path {
  fill: none;
  stroke: #0f8196;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 5px 6px rgba(15, 129, 150, 0.18));
}

.temp-line {
  fill: none;
  stroke: rgba(255, 141, 95, 0.92);
  stroke-width: 7;
  stroke-linecap: round;
}

.sparkle {
  fill: #fff0a6;
  opacity: 0;
  animation: sparkle-burst 2200ms ease forwards;
}

.hidden-layer {
  opacity: 0;
  transition: opacity 900ms ease;
  pointer-events: none;
}

@keyframes outline-reveal {
  0% { opacity: 0; transform: scale(0.975); }
  100% { opacity: 0.36; transform: scale(1); }
}

@keyframes horse-reveal {
  0% { opacity: 0; transform: scale(0.955); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes sparkle-burst {
  0% { opacity: 0; transform: scale(0.3); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.35); }
}

@media (max-width: 1080px) {
  .game-frame {
    width: min(100vw - 16px, 1024px);
  }
}




.endgame-overlay {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}

.endgame-overlay.visible {
  display: block;
}

.endgame-banner {
  position: absolute;
  left: 215px;
  top: 11px;
  width: 594px;
  height: 67px;
  pointer-events: none;
}

.endgame-text {
  position: absolute;
  left: 232px;
  top: 17px;
  width: 560px;
  text-align: center;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.12;
  padding: 0 12px;
  color: #0d6d98;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.continue-button {
  position: absolute;
  left: 416px;
  top: 640px;
  width: 181px;
  height: 75px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.continue-button img {
  width: 100%;
  height: 100%;
  display: block;
}

.character-selection.locked {
  pointer-events: none;
}

.character-selection.locked .character-choice {
  pointer-events: none;
}


.start-button:focus,
.start-button:focus-visible,
.continue-button:focus,
.continue-button:focus-visible {
  outline: none;
  box-shadow: none;
}


button, img, svg, text {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button::-moz-focus-inner {
  border: 0;
}


.level-selection {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.level-choice {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  border-radius: 12px;
  opacity: 0.52;
  transform: scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
  filter: saturate(0.82);
}

.level-choice img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.level-choice:hover {
  opacity: 0.8;
}

.level-choice.selected {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1.08);
  box-shadow: 0 0 0 3px rgba(13, 109, 152, 0.55);
}

.level-choice:focus,
.level-choice:focus-visible {
  outline: none;
  box-shadow: none;
}

.level-selection.locked {
  pointer-events: none;
}

.level-selection.locked .level-choice {
  pointer-events: none;
}


.continue-button {
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease;
}

.continue-button.ready {
  opacity: 1;
  visibility: visible;
}



