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

:root {
  --ink: #1f2133;
  --stroke: rgba(31, 33, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(90% 70% at 0% 0%, rgba(79, 124, 255, 0.26), rgba(79, 124, 255, 0)),
    radial-gradient(90% 70% at 100% 0%, rgba(56, 200, 168, 0.26), rgba(56, 200, 168, 0)),
    linear-gradient(160deg, #fff9ea 0%, #e9f5ff 100%);
}

.game-shell {
  width: min(900px, calc(100% - 22px));
  margin: 0 auto;
  padding: 16px 0 20px;
  display: grid;
  gap: 12px;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 24px rgba(27, 37, 64, 0.12);
}

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

.hud {
  min-width: 230px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.84);
  display: grid;
  gap: 4px;
  font-weight: 700;
}

canvas {
  width: 100%;
  height: 540px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  box-shadow: 0 14px 32px rgba(27, 37, 64, 0.16);
  background: rgba(255, 255, 255, 0.95);
}

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

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

button {
  border: none;
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #4f7cff, #38c8a8);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(27, 37, 64, 0.22);
}

label {
  font-weight: 700;
}

select {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  min-height: 38px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

#helpText {
  margin: 0;
  color: rgba(31, 33, 51, 0.82);
}

.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(--stroke);
  background: rgba(255, 255, 255, 0.82);
}

.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(900px, calc(100% - 14px));
    padding-top: 10px;
  }

  header {
    justify-content: center;
  }

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

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

  canvas {
    height: 430px;
  }
}
