:root {
  --bg-top: #f6dd76;
  --bg-mid: #ffd48a;
  --bg-bottom: #ffeec2;
  --ocean-deep: #0f3d66;
  --ocean-mid: #1e6a92;
  --ocean-light: #49a4bc;
  --accent: #ff7043;
  --ink: #173046;
  --panel: rgba(255, 248, 226, 0.9);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 18%, #fff6cd 0%, transparent 35%),
    radial-gradient(circle at 82% 25%, #ffd9a7 0%, transparent 42%),
    linear-gradient(180deg, var(--bg-top), var(--bg-mid) 42%, var(--bg-bottom));
  display: grid;
  place-items: center;
  padding: 20px 14px;
}

.app {
  width: min(1100px, 100%);
  background: rgba(255, 255, 255, 0.32);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 24px;
  backdrop-filter: blur(4px);
  box-shadow: 0 18px 42px rgba(23, 48, 70, 0.2);
  padding: 20px;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 10px 14px;
}

h1 {
  margin: 0;
  font-size: clamp(1.3rem, 1.7vw + 1rem, 2.05rem);
  letter-spacing: 0.05em;
}

.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats p {
  margin: 0;
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.95rem;
}

.stage-wrap {
  display: grid;
  gap: 12px;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 20px;
  border: 2px solid rgba(23, 48, 70, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, #8ec6f5 0%, #8ec6f5 40%, var(--ocean-mid) 40%);
  display: block;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(180deg, #ff925f, var(--accent));
  box-shadow: 0 6px 14px rgba(255, 112, 67, 0.28);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 160ms ease, opacity 150ms ease;
}

button:hover:enabled {
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(255, 112, 67, 0.32);
}

button:active:enabled {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cast-btn {
  margin-left: auto;
  background: linear-gradient(180deg, #2c8bbb, #1a6f9e);
  box-shadow: 0 6px 14px rgba(30, 106, 146, 0.32);
}

.tips {
  margin: 0;
  font-size: 0.9rem;
  background: var(--panel);
  border-radius: 12px;
  padding: 8px 10px;
}

@media (max-width: 760px) {
  body {
    padding: 10px;
  }

  .app {
    border-radius: 18px;
    padding: 12px;
  }

  .hud {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .stats {
    justify-content: flex-start;
  }

  .cast-btn {
    margin-left: 0;
  }
}
