:root {
  --paper: #f5e7c7;
  --ink: #1b2431;
  --gold: #bf9a58;
  --bronze: #76522b;
  --teal: #2f6077;
  --crimson: #8d3a2e;
  --panel: #fff8e8;
  --shadow: rgba(16, 20, 28, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cardo", Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #fff5da 0, #f2deb5 40%, #d9bf8c 100%),
    linear-gradient(120deg, #f8edcf, #ead2a0);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background-image: url("assets/stage-texture.svg");
  mix-blend-mode: multiply;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 94vw);
  margin: 1rem auto 2rem;
}

.title-block {
  text-align: center;
  margin-bottom: 0.85rem;
}

.eyebrow {
  margin: 0;
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #634b2c;
  text-transform: uppercase;
}

h1 {
  margin: 0.2rem 0 0;
  font-family: "Cinzel", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0.2rem 0 0;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: #3c4452;
}

.game-wrap {
  position: relative;
  overflow: hidden;
  border: 4px solid #4f3a23;
  border-radius: 16px;
  box-shadow: 0 18px 36px var(--shadow);
  background: #0e212e;
}

#gameCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 76vh;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(11, 16, 22, 0.64), rgba(11, 16, 22, 0.74));
  backdrop-filter: blur(2px);
}

.overlay.visible {
  display: flex;
}

.overlay-card {
  width: min(640px, 92%);
  border: 2px solid #8b6740;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8e8, #f6e6c5);
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.28);
  padding: 1.1rem 1.2rem 1.3rem;
}

.overlay-card.small {
  width: min(420px, 92%);
}

.overlay-card h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}

.overlay-card p {
  margin: 0.75rem 0;
  font-size: 1.02rem;
  line-height: 1.45;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.combo-tip {
  margin: 0 0 0.85rem;
  font-style: italic;
  color: #5a4a33;
}

button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(150deg, #9f6e39, #6e4926);
  color: #fff7e4;
  font-family: "Cinzel", serif;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover,
button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.controls-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.controls-panel article {
  border: 2px solid #977145;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel), #f3e1bc);
  padding: 0.75rem 0.85rem;
}

.controls-panel h3 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1rem;
}

.controls-panel p {
  margin: 0.4rem 0 0;
}

.pitch-note {
  margin-top: 0.9rem;
  border: 2px solid #977145;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel), #f3e1bc);
  padding: 0.85rem 0.95rem;
}

.pitch-note h3 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1rem;
}

.pitch-note p {
  margin: 0.45rem 0 0;
  line-height: 1.4;
}

.combo-line {
  font-size: 0.95rem;
  color: #43372a;
}

kbd {
  display: inline-block;
  min-width: 1.35rem;
  border-radius: 5px;
  border: 1px solid #88633c;
  background: #ffefce;
  padding: 0.1rem 0.3rem;
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  text-align: center;
}

kbd + kbd {
  margin-left: 0.16rem;
}

.mobile-controls {
  display: none;
  margin-top: 0.9rem;
  gap: 0.45rem;
}

.control-btn {
  touch-action: none;
  border: 1px solid #6e4b2a;
  background: linear-gradient(160deg, #9e6e39, #744e28);
  color: #ffefcf;
  padding: 0.78rem 0.3rem;
  font-size: 0.82rem;
}

.super-btn {
  background: linear-gradient(160deg, #b54e31, #7d2619);
  border-color: #6a1d15;
}

.control-btn.active {
  transform: translateY(1px) scale(0.98);
  filter: brightness(1.18);
}

@media (max-width: 980px) {
  .controls-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .mobile-controls {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .overlay-card p {
    font-size: 0.95rem;
  }
}
