﻿:root {
  color-scheme: light;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 30px 16px 16px;
}

.stage-frame {
  position: relative;
  z-index: 1;
  width: 1024px;
  height: 815px;
  transform-origin: top center;
}

.stage-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 24px;
  background-image: var(--loader-image);
  background-color: transparent;
  background-position: 124px 89px;
  background-size: 776px 627px;
  background-repeat: no-repeat;
  box-shadow: 0 24px 60px rgba(26, 70, 100, 0.24);
  opacity: 0;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.stage-frame.has-loader-image::before {
  opacity: 1;
}

.stage-frame.is-loaded::before {
  visibility: hidden;
  opacity: 0;
}

.stage {
  position: relative;
  width: 1024px;
  height: 815px;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(26, 70, 100, 0.24);
  background: #f0f8d8;
  opacity: 0;
  transition: opacity 220ms ease;
}

.stage-frame.is-loaded .stage {
  opacity: 1;
}

.asset,
.text-layer,
.board-grid,
.player-token,
.answer-panel {
  position: absolute;
}

.answer-frame,
.answer-input,
.answer-submit {
  position: absolute;
}

.answer-frame,
.answer-submit-image {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}


.asset {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.asset img,
.player-token img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  pointer-events: none;
}

.asset.is-hidden,
.board-grid.is-hidden,
.player-token.is-hidden,
.answer-panel.is-hidden,
.end-overlay.is-hidden {
  display: none;
}

.asset-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

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

.asset-button:focus-visible,
.answer-submit:focus-visible {
  outline: 4px solid rgba(17, 131, 37, 0.55);
  outline-offset: 4px;
  border-radius: 20px;
}

.asset-button.is-selected {
  transform: translateY(-4px) scale(1.05);
  filter: brightness(1.08) saturate(1.2) drop-shadow(0 0 16px rgba(255, 242, 138, 0.98)) drop-shadow(0 0 26px rgba(255, 214, 64, 0.88));
}

.asset-button.is-ready {
  filter: drop-shadow(0 0 14px rgba(255, 217, 61, 0.92));
}

.asset-button.is-waiting {
  filter: drop-shadow(0 0 8px rgba(29, 117, 27, 0.32));
}

.asset-button.is-pulsing {
  animation: gentlePulse 1.5s ease-in-out infinite;
}

.asset.is-disabled {
  opacity: 0.55;
  filter: grayscale(0.2);
}

.monster-name-label {
  font-weight: 700;
  letter-spacing: 0.4px;
}

.text-layer {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  white-space: pre-wrap;
  line-height: 1.05;
  pointer-events: none;
}

.text-layer.is-hidden {
  display: none;
}

.text-layer.is-text-ready {
  color: #0a7e16;
}

.turn-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.turn-text {
  display: inline-flex;
  align-items: center;
}

.exercise-text {
  align-items: flex-start;
  padding-top: 2px;
  direction: ltr;
  unicode-bidi: isolate;
}

.board-grid {
  display: grid;
  padding: 8px;
  gap: 0;
}

.board-cell {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.board-cell-image {
  width: 100%;
  height: 100%;
  display: block;
}

.board-cell-label {
  position: absolute;
  top: 7px;
  left: 10px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  color: #165d0d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.player-token {
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.18));
}
.answer-input {
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #1c5713;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
  padding: 0 8px;
}

.answer-input::-webkit-outer-spin-button,
.answer-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.answer-input:disabled {
  color: rgba(28, 87, 19, 0.65);
}

.answer-submit {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.answer-submit:disabled {
  cursor: default;
  opacity: 0.75;
}

@keyframes gentlePulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}

.end-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(19, 70, 24, 0.28);
}

.end-overlay-panel {
  width: min(420px, calc(100% - 96px));
  padding: 24px 28px 26px;
  border-radius: 28px;
  background: rgba(255, 250, 225, 0.98);
  box-shadow: 0 20px 44px rgba(37, 72, 23, 0.24);
  text-align: center;
}

.end-overlay-title,
.end-overlay-winner-name,
.end-overlay-preview-name {
  margin: 0;
}

.end-overlay-title {
  color: #14801d;
  font-size: 34px;
  font-weight: 700;
}

.end-overlay-winner-name {
  margin-top: 8px;
  color: #f19a16;
  font-size: 28px;
  font-weight: 700;
}

.end-overlay-preview {
  margin-top: 18px;
  height: 170px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(180deg, rgba(206, 249, 216, 0.95) 0%, rgba(239, 252, 227, 0.95) 100%);
  box-shadow: inset 0 0 0 2px rgba(81, 160, 65, 0.18);
}

.end-overlay-preview-name {
  color: #386018;
  font-size: 22px;
  line-height: 1.4;
  font-weight: 700;
}

.end-overlay-preview-image {
  width: 180px;
  height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.end-overlay-preview-image.is-hidden {
  display: none;
}

.end-overlay-button {
  margin-top: 18px;
  min-width: 170px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  background: #f4b83f;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(177, 118, 17, 0.22);
}

.end-overlay.is-hidden {
  display: none;
}


.answer-input:focus,
.answer-input:focus-visible {
  outline: none;
  box-shadow: none;
}




.info-overlay {
  position: absolute;
  inset: 0;
  z-index: 88;
  display: grid;
  place-items: center;
  background: rgba(13, 61, 29, 0.34);
}

.info-overlay-panel {
  position: relative;
  width: min(760px, calc(100% - 80px));
  max-height: calc(100% - 96px);
  overflow: auto;
  padding: 30px 34px 28px;
  border-radius: 28px;
  background: rgba(255, 251, 232, 0.98);
  box-shadow: 0 20px 44px rgba(37, 72, 23, 0.24);
}

.info-overlay-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #f4b83f;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.info-overlay-title {
  margin: 0 40px 18px 0;
  color: #14801d;
  font-size: 36px;
  font-weight: 700;
}

.info-overlay-list {
  margin: 0;
  padding-left: 26px;
  color: #255a1b;
  font-size: 22px;
  line-height: 1.55;
}

.info-overlay-list li + li {
  margin-top: 10px;
}

.info-overlay.is-hidden {
  display: none;
}





