:root {
  --paper: #f3ecd8;
  --paper-shadow: #d9ccb2;
  --ink: #243028;
  --soft-ink: #546154;
  --copper: #b5673d;
  --berry: #874c43;
  --moss: #5d7154;
  --gold: #c4a24b;
  --line: #c9baa1;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 250, 236, 0.9), rgba(243, 236, 216, 0.85) 32%, rgba(213, 197, 166, 0.95) 100%),
    repeating-linear-gradient(0deg, rgba(36, 48, 40, 0.03), rgba(36, 48, 40, 0.03) 2px, transparent 2px, transparent 9px);
  color: var(--ink);
  font-family: "Georgia", "Times New Roman", serif;
  touch-action: none;
  user-select: none;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.game-shell {
  width: 100%;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: center;
}

.plate {
  width: min(100%, 900px);
  height: min(100dvh - 32px, 1180px);
  background:
    linear-gradient(180deg, rgba(255, 252, 243, 0.8), rgba(243, 236, 216, 0.95)),
    repeating-linear-gradient(90deg, rgba(36, 48, 40, 0.02), rgba(36, 48, 40, 0.02) 1px, transparent 1px, transparent 6px);
  border: 1px solid rgba(36, 48, 40, 0.18);
  box-shadow:
    0 18px 40px rgba(76, 59, 39, 0.18),
    inset 0 0 0 3px rgba(255, 252, 243, 0.7),
    inset 0 0 0 10px rgba(201, 186, 161, 0.16);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 18px;
  position: relative;
}

.plate::before,
.plate::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(36, 48, 40, 0.15);
  opacity: 0.5;
}

.plate::before {
  top: 10px;
  right: 10px;
  border-left: none;
  border-bottom: none;
}

.plate::after {
  left: 10px;
  bottom: 10px;
  border-right: none;
  border-top: none;
}

.heading,
.footer-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--soft-ink);
}

h1 {
  margin: 2px 0 0;
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  line-height: 0.95;
  font-weight: 600;
}

.season-note,
.hint {
  margin: 0;
  max-width: 34ch;
  color: var(--soft-ink);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.35;
}

.stage-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(36, 48, 40, 0.14);
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 249, 236, 0.95), rgba(246, 237, 214, 0.82) 55%, rgba(232, 220, 193, 0.95) 100%);
}

#stage {
  width: 100%;
  height: 100%;
  display: block;
}

.controls-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cut-button {
  position: absolute;
  width: clamp(24px, 4.6vw, 34px);
  height: clamp(24px, 4.6vw, 34px);
  margin-left: calc(clamp(24px, 4.6vw, 34px) / -2);
  margin-top: calc(clamp(24px, 4.6vw, 34px) / -2);
  left: var(--x);
  top: var(--y);
  border: 1px solid rgba(107, 90, 71, 0.42);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 250, 239, 0.95), rgba(196, 152, 102, 0.92) 62%, rgba(140, 98, 67, 0.95) 100%);
  box-shadow:
    0 2px 5px rgba(76, 59, 39, 0.16),
    inset 0 0 0 1px rgba(255, 250, 239, 0.5);
  color: transparent;
  pointer-events: auto;
  touch-action: manipulation;
}

.cut-button::before,
.cut-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 2px;
  border-radius: 999px;
  background: rgba(36, 48, 40, 0.85);
  transform-origin: center;
}

.cut-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.cut-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.cut-button:active {
  transform: translateY(1px) scale(0.96);
}

.replay {
  border: 1px solid rgba(36, 48, 40, 0.3);
  background: rgba(255, 252, 243, 0.8);
  color: var(--ink);
  font: inherit;
  padding: 10px 14px;
  border-radius: 999px;
}

.replay:active {
  transform: translateY(1px);
}

@media (max-width: 720px) {
  .plate {
    height: min(100dvh - 20px, 1100px);
    padding: 14px;
  }

  .heading,
  .footer-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .season-note,
  .hint {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
