:root {
  color-scheme: light;
}

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

body {
  background-color: #000;
  background-image: url('landingbg.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

body.is-landing {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 24px;
  box-sizing: border-box;
}

body.is-playing {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  overflow: hidden;
}

canvas {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
  background-color: rgba(0, 0, 0, 0);
  width: min(90vw, 1024px);
  max-width: 100%;
  aspect-ratio: 1024 / 720;
  height: auto;
  max-height: calc(100vh - 64px);
  border-radius: 12px;
  touch-action: none;
  display: block;
}

body.is-playing canvas {
  box-shadow: none;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
}

#startPanel {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 10;
  padding: clamp(16px, 4vw, 32px);
  box-sizing: border-box;
}

.startPanelFrame {
  --card-width: min(90vw, 360px);
  width: var(--card-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 5vw, 24px);
}

.startPanelLogoWrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.startPanelLogo {
  width: min(calc(var(--card-width) * 1.2), 95vw);
  height: auto;
  display: block;
  opacity: 0.8;
}

.startPanelCard {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: clamp(20px, 6vw, 28px) clamp(20px, 8vw, 40px);
  font-family: Lexend, sans-serif;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.startPanelOptions {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 4vw, 24px);
}

.categoryRow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: center;
}

.categoryRow--types {
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.categoryRowTitle {
  font-weight: 700;
  margin-right: 8px;
}

.categoryRow--types .categoryRowTitle {
  margin-right: 0;
  text-align: center;
  font-family: "Lexend", sans-serif;
  font-weight: 600;
  color: #123a70;
  letter-spacing: 0.5px;
  text-transform: lowercase;
}

.categoryRowTypes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.categoryRowTypeGroup {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  width: 100%;
}

.categoryRowTypeGroup--primary {
  row-gap: 12px;
}

.categoryActions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.categoryActions button {
  padding: 8px 24px;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #4caf50;
  color: #fff;
  font-family: Lexend, sans-serif;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  width: min(100%, 240px);
  margin: 0;
}

.categoryActions button:hover {
  background: #43a047;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.categoryActions button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.categoryActions button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.startPanelCard label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 16px;
}

#refreshBtn {
  position: fixed;
  top: 12px;
  right: 16px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #0b2f6b;
  font-size: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  z-index: 35;
}

#refreshBtn:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

#refreshBtn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

#refreshBtn:focus-visible {
  outline: 3px solid rgba(11, 47, 107, 0.8);
  outline-offset: 2px;
}

body.is-playing #refreshBtn {
  display: flex;
}

#reloadPromptOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
  box-sizing: border-box;
}

#reloadPromptDialog {
  position: relative;
  width: min(90vw, 460px);
  aspect-ratio: 699 / 388;
  display: flex;
  align-items: stretch;
  justify-content: center;
  text-align: center;
  font-family: Lexend, sans-serif;
  color: #0b2f6b;
  box-sizing: border-box;
}

#reloadPromptDialog::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('reloadprompt.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.reloadPromptContent {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(12px, 4vw, 32px);
  padding: clamp(24px, 8vw, 72px) clamp(16px, 6vw, 32px) clamp(20px, 7vw, 40px);
  width: 100%;
  box-sizing: border-box;
}

.reloadPromptContent h3 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.reloadPromptButtons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.reloadPromptButtons button {
  background: #0b2f6b;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 32px;
  font-size: 18px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.reloadPromptButtons button:hover {
  background: #0d3d8f;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.reloadPromptButtons button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.reloadPromptButtons button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

#pausePanel {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 30;
}

#pausePanel > div {
  background: #fff;
  border-radius: 12px;
  padding: 24px 32px;
  font-family: Lexend, sans-serif;
  min-width: 320px;
}

label {
  display: block;
  margin: 8px 0;
  font-size: 14px;
}

label.sliderRow {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label.sliderRow .sliderLabel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

label.sliderRow .sliderValue {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.toggleRow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 14px;
}

.toggleRow label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: inherit;
}

.toggleRow--split {
  justify-content: flex-start;
  flex-wrap: wrap;
}

input[type='range'] {
  width: 100%;
}

button {
  margin-top: 16px;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #2196f3;
  color: #fff;
}
