/* Tater Tot Trot — sunny San Diego: sky, ocean, sand, FUN.
   Font: the system's rounded face (SF Pro Rounded on iPad/Mac), no downloads. */
:root {
  --sky-top: #3fb8ff;
  --sky: #8fdcff;
  --sun: #fff3a8;
  --ocean: #19b5c9;
  --ocean-deep: #0e8fb3;
  --foam: #e9fbff;
  --sand: #ffe3a3;
  --sand-deep: #f7c873;
  --ink: #0b4467;
  --coral: #ff5f7e;
  --sunset: #ff9a3c;
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--round);
  font-weight: 600;
  background: var(--sand);
  color: var(--ink);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- The game fills the screen, on a sunny sky ---------- */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
           70px max(10px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 88% 8%, var(--sun) 0, rgba(255, 243, 168, 0.65) 7%, rgba(255, 243, 168, 0) 22%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky) 55%, #c8f0ff 100%);
  overflow: hidden;
}
/* ocean + foam along the bottom of the sky */
.stage::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20' preserveAspectRatio='none'%3E%3Cpath d='M0 10 Q15 0 30 10 T60 10 T90 10 T120 10 V20 H0Z' fill='%23ffe3a3'/%3E%3C/svg%3E") bottom / 120px 22px repeat-x,
    linear-gradient(180deg, var(--ocean) 0%, var(--ocean-deep) 100%);
  z-index: 0;
}
.stage > * { position: relative; z-index: 1; }

.game-wrap {
  position: relative;
  container-type: inline-size; /* the jukebox lyrics panel sizes itself in cqw (turns with the game on phones) */
  /* as big as fits, keeping 2:1 */
  width: min(100%, calc((100vh - 110px) * 2));
  width: min(100%, calc((100svh - 110px) * 2));
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 24px;
  border: 6px solid #fff;
  background: var(--sky);
  touch-action: none; /* the wash bay is scrubbed by dragging */
  display: block;
  box-shadow: 0 0 0 4px var(--ocean), 0 14px 34px rgba(11, 68, 103, 0.35);
}

.game-btns {
  position: absolute;
  top: 2.5%;
  right: 2%;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.gbtn {
  width: clamp(34px, 6.5vw, 58px);
  height: clamp(34px, 6.5vw, 58px);
  font-size: clamp(18px, 3vw, 28px);
  line-height: 1;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--ocean);
  background: #fff;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 0 var(--ocean-deep);
}
.gbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ocean-deep); }
.gbtn[hidden] { display: none; }

/* Real full screen (tablets / desktop) */
.game-wrap:fullscreen, .game-wrap:-webkit-full-screen {
  width: 100vw; height: 100vh;
  background: linear-gradient(180deg, var(--sky-top), var(--ocean-deep));
  display: flex; align-items: center; justify-content: center;
}
.game-wrap:fullscreen canvas, .game-wrap:-webkit-full-screen canvas {
  width: min(100vw, 200vh); border-radius: 0; border: 0; box-shadow: none;
}
.game-wrap:fullscreen .game-btns, .game-wrap:-webkit-full-screen .game-btns { top: 16px; right: 16px; }

.rotate-hint {
  display: none; margin: 12px 0 0; font-size: 1.1rem; font-weight: 800; color: #fff;
  text-shadow: 0 2px 0 var(--ocean-deep);
}
/* ---------- Phones: the game takes over the whole screen ---------- */
/* Phone held sideways: edge to edge, no frame */
@media (orientation: landscape) and (max-height: 520px) {
  .stage { min-height: 100vh; min-height: 100svh; height: 100svh; padding: 0; justify-content: center; }
  .stage::after, .rotate-hint, .scroll-hint { display: none; }
  .game-wrap { width: min(100vw, 200vh); width: min(100vw, 200svh); }
  canvas { border: 0; border-radius: 0; box-shadow: none; }
}
/* Phone held upright: turn the game sideways so it fills the screen; the kid just turns the phone */
@media (orientation: portrait) and (max-width: 700px) {
  .stage { min-height: 100vh; min-height: 100svh; height: 100svh; padding: 0; background: #3fb8ff; }
  .stage::after, .rotate-hint, .scroll-hint { display: none; }
  .game-wrap {
    position: absolute; top: 50%; left: 50%;
    width: min(100vh, 200vw); width: min(100svh, 200vw); /* its long side runs down the screen */
    transform: translate(-50%, -50%) rotate(90deg);
  }
  canvas { border: 0; border-radius: 0; box-shadow: none; }
}

.scroll-hint {
  margin-top: 12px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  font-size: 1.05rem;
  background: rgba(11, 68, 103, 0.25);
  padding: 6px 16px;
  border-radius: 20px;
}

/* ---------- Home page on the sand ---------- */
.home { max-width: 780px; margin: 0 auto; padding: 24px 16px 8px; }
h1 { margin: 0; }
.logo { width: min(280px, 58vw); height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 6px 10px rgba(11, 68, 103, 0.2)); }
h2 {
  font-weight: 900;
  color: var(--coral);
  font-size: 2rem;
  margin: 34px 0 14px;
  text-shadow: 0 3px 0 #fff, 0 5px 0 rgba(255, 95, 126, 0.2);
}
.lead { font-size: 1.35rem; margin: 10px 0 0; font-weight: 700; }

.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; text-align: left; }
.rules li {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border-radius: 22px;
  padding: 10px 18px; font-size: 1.2rem;
  box-shadow: 0 0 0 4px var(--foam), 0 6px 0 var(--sand-deep);
}
.rules li:nth-child(odd) { box-shadow: 0 0 0 4px #ffe0e8, 0 6px 0 var(--sand-deep); }
.rules img { width: 84px; height: 66px; object-fit: contain; flex: none; }
.rules b { color: var(--ocean-deep); font-weight: 900; }

/* Songs on the home page (share.js fills #song-list): ▶ Listen opens the jukebox on that song */
.songs li { flex-wrap: wrap; }
.songs li span { flex: 1 1 180px; }
.song-btn {
  font: inherit; font-size: 1.05rem; font-weight: 900; cursor: pointer;
  padding: 8px 16px; border-radius: 22px; border: 3px solid var(--ocean);
  background: #fff; color: var(--ocean-deep); text-decoration: none;
  box-shadow: 0 3px 0 var(--ocean-deep); touch-action: manipulation;
}
.song-btn:active, .share-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ocean-deep); }
.share-btn {
  display: inline-block; margin: 22px 10px 8px 0; padding: 14px 30px;
  font: inherit; font-size: 1.35rem; font-weight: 900; cursor: pointer;
  border-radius: 40px; border: 3px solid var(--ocean); background: #fff; color: var(--ocean-deep);
  box-shadow: 0 5px 0 var(--ocean-deep); touch-action: manipulation;
}
/* the share symbol, three joined dots (share.js / index.html) */
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.18em; fill: currentColor; stroke: currentColor;
  stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gbtn .ico { width: 58%; height: 58%; vertical-align: middle; color: var(--ocean-deep); }
/* "Link copied!" (share.js, when the device has no share menu) */
.share-toast {
  position: absolute; left: 50%; bottom: 8%; transform: translate(-50%, 20px); z-index: 3;
  background: var(--ink); color: #fff; font-weight: 900; font-size: clamp(16px, 2.6vw, 24px);
  padding: 10px 22px; border-radius: 30px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.share-toast.show { opacity: 1; transform: translate(-50%, 0); }

.btn-key { font-size: 1.25rem; font-weight: 800; }
.small { font-size: 1rem; opacity: 0.8; }

.play-btn {
  display: inline-block; margin: 22px 0 8px; padding: 16px 48px;
  background: linear-gradient(180deg, var(--sunset), var(--coral));
  color: #fff; text-decoration: none; font-size: 1.7rem; font-weight: 900;
  border-radius: 40px; box-shadow: 0 6px 0 #d63d5f;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.play-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #d63d5f; }

kbd {
  font-family: var(--round);
  background: #fff;
  border: 2px solid var(--ocean);
  border-radius: 8px;
  padding: 1px 8px;
}

/* ---------- Footer (part of Rocko's World, like Super Rocko) ---------- */
.site-foot {
  margin-top: 24px; padding: 26px 16px 34px;
  background: linear-gradient(180deg, var(--sand-deep), #eeb35a);
  color: #5a3a12;
}
.site-foot .promise {
  display: inline-block; margin: 0 0 14px; padding: 8px 16px; font-weight: 800; font-size: 15px;
  background: #fff; border-radius: 999px; color: var(--ink); box-shadow: 0 3px 0 rgba(11, 68, 103, 0.2);
}
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 12px; }
.foot-links a { color: var(--ink); font-weight: 800; font-size: 15px; text-decoration: none; border-bottom: 2px solid var(--coral); }
.foot-links a:hover { color: var(--coral); }
.site-foot .legal { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.site-foot .tms { margin: 0; font-size: 12px; opacity: 0.75; }

/* ---------- Jukebox lyrics panel (lyrics-panel.js) ----------
   Covers the game inside .game-wrap (so it rotates with it). Left: picture, title, ⏮ ⏯ ⏭, progress.
   Right: the lyrics, scrolling. Sizes in cqw (% of the game's width) with px fallbacks for old browsers.
   Every height is definite (grid rows + height:100%): Safari collapses flex-filled scroll areas. */
.lyr {
  position: absolute; top: 6px; left: 6px; right: 6px; bottom: 6px; z-index: 5;
  display: grid; grid-template-columns: 34% 66%; grid-template-rows: 100%;
  background: #fffdf6; color: var(--ink); border-radius: 18px; overflow: hidden;
  box-shadow: inset 0 0 0 4px var(--ocean); text-align: left;
}
.lyr[hidden] { display: none; }
.lyr-side {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  gap: 1.1cqw; padding: 14px; padding: 2cqw; border-right: 3px dashed var(--sand); text-align: center; min-height: 0;
}
.lyr-side img { width: 100%; aspect-ratio: 1200 / 630; border-radius: 10px; border-radius: 1.4cqw; background: var(--sky); }
.lyr-now { font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--coral); font-size: 11px; font-size: 1.35cqw; }
.lyr-side h2 { margin: 0; color: var(--ink); line-height: 1.12; font-size: 18px; font-size: 2.3cqw; }
.lyr-ctrl { display: flex; align-items: center; gap: 8px; gap: 1.2cqw; }
.lyr-ctrl button {
  font: inherit; cursor: pointer; border-radius: 50%; border: 3px solid var(--ocean); background: #fff; color: var(--ocean-deep);
  width: 44px; height: 44px; font-size: 18px; width: 5.6cqw; height: 5.6cqw; font-size: 2.4cqw; touch-action: manipulation; padding: 0;
}
.lyr-ctrl button.big {
  border: 0; color: #fff; background: linear-gradient(180deg, var(--sunset), var(--coral)); box-shadow: 0 3px 0 #d63d5f;
  width: 54px; height: 54px; font-size: 22px; width: 7cqw; height: 7cqw; font-size: 3cqw;
}
.lyr-ctrl button:disabled { opacity: .35; cursor: default; }
.lyr-bar { width: 100%; height: 10px; height: 1.3cqw; border-radius: 8px; background: var(--sand); position: relative; cursor: pointer; }
.lyr-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 8px; background: var(--coral); }
.lyr-time { font-weight: 800; font-size: 12px; font-size: 1.5cqw; min-height: 1.2em; }
.lyr-ride {
  font: inherit; font-weight: 900; cursor: pointer; color: #fff; border: 0; border-radius: 999px; touch-action: manipulation;
  background: linear-gradient(180deg, var(--sunset), var(--coral)); box-shadow: 0 3px 0 #d63d5f;
  font-size: 16px; padding: 8px 20px; font-size: 2.1cqw; padding: 1cqw 2.8cqw;
}
.lyr-ride:active { transform: translateY(2px); box-shadow: 0 1px 0 #d63d5f; }
.lyr-body { height: 100%; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 56px 18px 22px; padding: 1.4cqw 7cqw 2.4cqw 3cqw; }
.lyr-body .stanza { margin-top: 12px; margin-top: 1.6cqw; }
.lyr-body h3 { margin: 0 0 2px; color: var(--coral); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-size: 1.3cqw; }
.lyr-body p { margin: 0; font-weight: 800; line-height: 1.4; font-size: 17px; font-size: 2.3cqw; }
.lyr-body p.cue { font-style: italic; font-weight: 700; color: var(--ocean-deep); opacity: .85; }
.lyr-x {
  position: absolute; top: 10px; right: 10px; top: 1.3cqw; right: 1.3cqw; cursor: pointer; padding: 0;
  width: 40px; height: 40px; font-size: 18px; width: 5.2cqw; height: 5.2cqw; font-size: 2.4cqw; font-weight: 900;
  border-radius: 50%; border: 3px solid var(--ocean); background: #fff; color: var(--ocean-deep);
}
