/* Claire’s Sloppy Bird — colorful desktop layout (pink, purple, white, blue, black) */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #ffffff;
  /* Layered gradient background: sky + purple mood */
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 182, 255, 0.55), transparent 55%),
    linear-gradient(165deg, #1a0a2e 0%, #2d1b69 35%, #4c1d95 65%, #0f172a 100%);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  transition: background 1.2s ease;
  display: flex;
  flex-direction: column;
}

/* Page tint follows weather a little (script sets data-weather on body) */
body[data-weather="rain"],
body[data-weather="sparkles"] {
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(59, 130, 246, 0.12), transparent 50%),
    linear-gradient(165deg, #020617 0%, #1e1b4b 40%, #312e81 70%, #0f172a 100%);
}

body[data-weather="snow"] {
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(226, 232, 240, 0.4), transparent 55%),
    linear-gradient(165deg, #334155 0%, #64748b 50%, #e2e8f0 100%);
}

/* Soft clouds + stars as decorative layers (not the game canvas) */
.page {
  position: relative;
  z-index: 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  /* Fill the window so the game canvas always has room (fixes “empty” or squashed layout) */
  min-height: 100vh;
  min-height: 100dvh;
}

.decor {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
}

.decor-clouds {
  background:
    radial-gradient(ellipse 80% 50% at 10% 20%, rgba(255, 255, 255, 0.12), transparent 50%),
    radial-gradient(ellipse 70% 45% at 85% 15%, rgba(255, 255, 255, 0.1), transparent 45%),
    radial-gradient(ellipse 60% 40% at 50% 8%, rgba(236, 72, 153, 0.15), transparent 40%);
}

.decor-stars {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(147, 197, 253, 0.85) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(244, 114, 182, 0.8) 1px, transparent 1.5px);
  background-size: 120px 120px, 180px 180px, 220px 220px;
  background-position: 0 0, 40px 60px, 90px 20px;
  opacity: 0.35;
}

.header {
  text-align: center;
  margin: 0;
  padding: 14px 16px 10px;
  flex-shrink: 0;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.title {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 8px;
  letter-spacing: 0.03em;
  text-shadow:
    0 0 12px rgba(236, 72, 182, 0.9),
    0 0 28px rgba(168, 85, 247, 0.75),
    2px 4px 0 #000000;
}

.tagline {
  margin: 6px 0 0;
  font-size: clamp(18px, 2.2vw, 24px);
  color: #e9d5ff;
  text-shadow: 0 1px 3px #000000;
}

/* One row: score on the left, weather + timer on the right */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 12px;
  padding: 12px 16px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 14px;
  border: 1px solid rgba(147, 197, 253, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.status-bar__score {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.status-bar__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: flex-end;
  text-align: right;
}

.status-bar__divider {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 700;
  user-select: none;
}

.weather-name {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 800;
  color: #fde68a;
  text-shadow: 0 1px 3px #000000;
}

.timer-wrap {
  font-size: clamp(15px, 1.8vw, 20px);
  font-weight: 600;
  color: #e9d5ff;
  text-shadow: 0 1px 3px #000000;
}

.minute-timer {
  display: inline-block;
  min-width: 3.2ch;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #ffffff;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(147, 197, 253, 0.45);
}

.game-shell {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(49, 46, 129, 0.88));
  border-radius: 0;
  padding: 12px 16px 16px;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(236, 72, 182, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border: none;
  border-top: 2px solid rgba(147, 197, 253, 0.35);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  align-items: stretch;
}

.control-panel {
  width: 100%;
  max-width: 960px;
  margin: 14px auto 0;
  padding-top: 14px;
  border-top: 1px solid rgba(147, 197, 253, 0.22);
  flex-shrink: 0;
}

.score-label {
  font-size: 26px;
  font-weight: 700;
  color: #fce7f3;
  text-shadow: 0 2px 0 #000000;
}

.score-value {
  font-size: 34px;
  font-weight: 800;
  min-width: 3ch;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(90deg, #ec4899, #8b5cf6, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #000000);
}

.canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
  min-height: min(58vh, 520px);
}

#gameCanvas {
  display: block;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  height: 100%;
  min-height: min(58vh, 520px);
  border-radius: 12px;
  background: linear-gradient(180deg, #38bdf8 0%, #a78bfa 55%, #f472b6 100%);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    inset 0 0 0 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: box-shadow 1s ease, background 1s ease;
}

.sliders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .sliders {
    grid-template-columns: 1fr;
  }

  .status-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .status-bar__meta {
    justify-content: flex-start;
    text-align: left;
  }
}

.slider-block {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(236, 72, 182, 0.35);
}

.slider-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.slider-label {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #fbcfe8;
  margin-bottom: 0;
}

.slider-hint {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.35;
  color: #e9d5ff;
}

.slider-block input[type="range"] {
  width: 100%;
  accent-color: #ec4899;
  height: 10px;
  cursor: pointer;
}

.slider-value {
  display: inline-block;
  margin-top: 0;
  font-size: 22px;
  font-weight: 700;
  color: #93c5fd;
  flex-shrink: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  flex-shrink: 0;
}

.btn {
  font-size: 22px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, #ec4899, #7c3aed);
  box-shadow:
    0 0 18px rgba(236, 72, 182, 0.75),
    0 6px 0 #1e1b4b,
    0 10px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(2px);
  box-shadow:
    0 0 14px rgba(236, 72, 182, 0.6),
    0 3px 0 #1e1b4b,
    0 6px 14px rgba(0, 0, 0, 0.4);
}

.btn-glow {
  text-shadow: 0 1px 2px #000000;
}

.btn-outline {
  background: linear-gradient(135deg, #2563eb, #4c1d95);
  box-shadow:
    0 0 16px rgba(59, 130, 246, 0.7),
    0 6px 0 #0f172a,
    0 10px 20px rgba(0, 0, 0, 0.45);
}

/* Instructions overlay */
.instructions-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.instructions-panel.hidden {
  display: none;
}

.instructions-card {
  max-width: 520px;
  width: 100%;
  background: linear-gradient(160deg, #312e81, #581c87);
  border-radius: 22px;
  padding: 24px 26px 22px;
  box-shadow:
    0 0 0 3px rgba(236, 72, 182, 0.45),
    0 20px 50px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(147, 197, 253, 0.45);
}

.instructions-title {
  margin: 0 0 14px;
  font-size: 30px;
  text-align: center;
  color: #fce7f3;
  text-shadow: 0 2px 0 #000000;
}

.instructions-list {
  margin: 0 0 18px;
  padding-left: 22px;
  font-size: 22px;
  line-height: 1.45;
  color: #f5f3ff;
}

.instructions-list li {
  margin-bottom: 10px;
}

.instructions-list strong {
  color: #ffffff;
}

#btnCloseInstructions {
  display: block;
  margin: 0 auto;
}

/* When the page is in full screen mode, fill the screen nicely */
#fullscreenRoot:fullscreen {
  max-width: none;
  width: 100%;
  min-height: 100vh;
  padding: 16px 12px 32px;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 182, 255, 0.55), transparent 55%),
    linear-gradient(165deg, #1a0a2e 0%, #2d1b69 35%, #4c1d95 65%, #0f172a 100%);
}

#fullscreenRoot:-webkit-full-screen {
  max-width: none;
  width: 100%;
  min-height: 100vh;
  padding: 16px 12px 32px;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 182, 255, 0.55), transparent 55%),
    linear-gradient(165deg, #1a0a2e 0%, #2d1b69 35%, #4c1d95 65%, #0f172a 100%);
}
