/* ===== Tilt Trail page styles: bright jungle palette ===== */

:root {
  --jungle-dark: #1f4d2b;
  --jungle: #2e7d32;
  --leaf: #8bc34a;
  --sun: #ffd60a;
  --orange: #f57c00;
  --cream: #fff8dc;
  --ink: #1b2a1e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
  /* Soft jungle background: two light leaf-colored glows on deep green */
  background-color: var(--jungle-dark);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(139, 195, 74, 0.35), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(255, 214, 10, 0.18), transparent 35%);
  background-attachment: fixed;
}

/* ----- Header ----- */
.page-header {
  text-align: center;
  padding: 28px 16px 8px;
  color: var(--cream);
}

.page-header h1 {
  margin: 0;
  font-size: 3.4rem;
  color: var(--sun);
  text-shadow: 3px 3px 0 var(--orange);
}

.pitch {
  margin: 6px auto 0;
  max-width: 640px;
  font-size: 1.25rem;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

/* ----- The game card (canvas + controls), centered ----- */
.game-card {
  display: grid;
  grid-template-columns: 480px 1fr;
  grid-template-areas: "canvas controls";
  gap: 20px;
  background: var(--cream);
  border: 6px solid var(--leaf);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* p5 adds the canvas at the end of #game-container; the grid area puts it on the left. */
.game-card canvas {
  grid-area: canvas;
  display: block;
  border-radius: 16px;
  max-width: 100%;
  height: auto !important; /* keep the 3:4 shape when the canvas is scaled down */
}

.controls {
  grid-area: controls;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.readouts {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: var(--jungle);
  color: var(--cream);
  border-radius: 14px;
  padding: 8px 12px;
}

.readouts p {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
}

.readouts span {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--sun);
}

label {
  font-weight: 600;
  margin-top: 6px;
}

/* ----- Buttons and form controls: big, rounded, high contrast ----- */
button,
select {
  font-family: inherit;
  font-size: 1.1rem;
  border-radius: 999px;
  border: 3px solid var(--jungle-dark);
  padding: 10px 18px;
  cursor: pointer;
}

button {
  background: var(--sun);
  color: var(--ink);
  font-weight: 600;
}

button:hover {
  background: #ffe55c;
}

.big-button {
  font-size: 1.5rem;
  padding: 14px 20px;
  background: var(--orange);
  color: #fff;
}

.big-button:hover {
  background: #ff9124;
}

button:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select {
  background: #fff;
  color: var(--ink);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--jungle);
  height: 28px;
}

.button-row {
  display: flex;
  gap: 8px;
}

.button-row button {
  flex: 1;
}

.hint,
.privacy {
  margin: 0;
  font-size: 0.95rem;
}

.privacy {
  margin-top: 10px;
  padding: 8px 12px;
  background: #e8f5e9;
  border-radius: 12px;
}

/* Clearly visible keyboard focus on everything you can tab to */
:focus-visible {
  outline: 4px solid var(--orange);
  outline-offset: 3px;
}

/* ----- Info sections ----- */
.info-card {
  background: var(--cream);
  border-radius: 20px;
  padding: 8px 24px 16px;
  margin-bottom: 20px;
}

.info-card h2 {
  color: var(--jungle);
  border-bottom: 3px solid var(--sun);
  padding-bottom: 4px;
}

.info-card h3 {
  color: var(--orange);
  margin-bottom: 4px;
}

.info-card li {
  margin-bottom: 8px;
}

kbd {
  background: #fff;
  border: 2px solid var(--jungle-dark);
  border-radius: 6px;
  padding: 0 6px;
  font-family: inherit;
}

a {
  color: #0d5c9e;
  font-weight: 600;
}

footer {
  text-align: center;
  color: var(--cream);
  padding: 8px 16px 24px;
}

/* ----- Small screens: stack the canvas above the controls ----- */
@media (max-width: 820px) {
  .game-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "canvas"
      "controls";
    padding: 12px;
  }

  .game-card canvas {
    width: 100% !important;
    margin: 0 auto;
  }

  .page-header h1 {
    font-size: 2.6rem;
  }
}
