@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap");

:root {
  --game-bg: radial-gradient(circle at top, #fff3d8 0%, #ffe5cf 42%, #e8f5ff 100%);
  --game-btn: linear-gradient(135deg, #ff6f5e, #ff9a45);
  --game-ink: #1f2133;
  --game-panel: rgba(255, 255, 255, 0.86);
  --game-stroke: rgba(31, 33, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--game-ink);
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(90% 60% at 0% 0%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)),
    var(--game-bg);
}

.game-shell {
  width: min(860px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 24px;
  display: grid;
  gap: 14px;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid var(--game-stroke);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 28px rgba(27, 37, 64, 0.12);
}

header img {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 10px 26px rgba(27, 37, 64, 0.16);
}

.hud {
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--game-stroke);
  background: var(--game-panel);
  box-shadow: 0 10px 24px rgba(27, 37, 64, 0.12);
  display: grid;
  gap: 4px;
  font-weight: 700;
}

canvas {
  width: 100%;
  height: 520px;
  border-radius: 22px;
  border: 1px solid var(--game-stroke);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 42px rgba(27, 37, 64, 0.16);
}

.actions {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--game-stroke);
  background: rgba(255, 255, 255, 0.62);
  display: grid;
  gap: 10px;
}

.actions p {
  margin: 0;
  color: rgba(31, 33, 51, 0.82);
}

button {
  border: none;
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 16px;
  background: var(--game-btn);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(27, 37, 64, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(27, 37, 64, 0.24);
  filter: saturate(1.03);
}

.difficulty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.difficulty-row label {
  font-weight: 700;
}

.difficulty-row select {
  border: 1px solid var(--game-stroke);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  color: var(--game-ink);
  font-weight: 600;
}

.record-panels {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel-card {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--game-stroke);
  background: rgba(255, 255, 255, 0.78);
}

.panel-card h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.record-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.record-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.record-list small {
  color: rgba(31, 33, 51, 0.72);
}

@media (max-width: 640px) {
  .game-shell {
    width: min(860px, calc(100% - 16px));
    padding-top: 10px;
    gap: 10px;
  }

  header {
    justify-content: center;
  }

  header img {
    width: 80px;
    height: 80px;
  }

  .hud {
    width: 100%;
    min-width: 0;
  }

  canvas {
    height: 420px;
  }
}
