@font-face {
  font-family: "LePorsche";
  src: url("/fonts/AL_LePORSCHE.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "PXCountryTypewriter";
  src: url("/fonts/PxCountryTypewriterRegular-2vGmK.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Voltaire";
  src: url("/fonts/Voltaire-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vanilla:hover {
  filter: drop-shadow(0 0 2em #f7df1eaa);
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: #888;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}
#idle-helper {
  position: fixed;
  bottom: 5%;
  left: 5%;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.3s ease-in;
}

#idle-helper img {
  width: auto;
  height: 120px;
  display: block;
}

/* Animation for the idle helper - fade in, pulse, fade out */
@keyframes idle-helper-cycle {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  /* Pulse between 15% and 85% */
  20% {
    opacity: 0.4;
  }
  30% {
    opacity: 1;
  }
  40% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
  60% {
    opacity: 0.4;
  }
  70% {
    opacity: 1;
  }
  80% {
    opacity: 0.4;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

#idle-helper.animating {
  animation: idle-helper-cycle 7s ease-in-out forwards;
}
#intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
}

.intro-tagline {
  font-family: "Voltaire", Arial, sans-serif;
  font-size: 42px;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 40px;
  margin-left: 0;
  margin-right: 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.intro-tagline img {
  width: 400px;
  max-width: 90vw;
  height: auto;
  filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.9));
  display: block;
  margin: 0 auto;
}

.intro-button {
  font-family: "Voltaire", Arial, sans-serif;
  font-size: 42px;
  color: #fff;
  background: transparent;
  border: none;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 20px 60px;
  cursor: pointer;
  letter-spacing: 4px;
  transition: all 0.3s ease-in-out;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
  min-width: 400px;
  max-width: 90vw;
  pointer-events: all;
  box-sizing: border-box;
  text-align: center;
  margin: 0;
}

.intro-button.selected {
  border-top: 3px solid #fff;
  border-bottom: 3px solid #fff;
  font-size: 64px;
}

@media (max-width: 768px) {
  .intro-tagline {
    font-size: 28px;
    margin-bottom: 30px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .intro-tagline img {
    width: 100%;
    max-width: 85vw;
    display: block;
    margin: 0 auto;
  }

  .intro-button {
    font-size: 32px;
    padding: 15px 30px;
    min-width: 0;
    width: 85vw;
    max-width: 85vw;
    letter-spacing: 2px;
    margin-left: auto;
    margin-right: auto;
  }

  .intro-button.selected {
    font-size: 42px;
  }

  #intro-overlay {
    gap: 15px;
    padding: 20px;
    padding-left: env(safe-area-inset-left, 20px);
    padding-right: env(safe-area-inset-right, 20px);
  }
}

@media (max-width: 480px) {
  .intro-tagline {
    font-size: 24px;
    margin-bottom: 20px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .intro-tagline img {
    max-width: 90vw;
    display: block;
    margin: 0 auto;
  }

  .intro-button {
    font-size: 28px;
    padding: 12px 20px;
    width: 90vw;
    max-width: 90vw;
    letter-spacing: 1px;
    margin-left: auto;
    margin-right: auto;
  }

  .intro-button.selected {
    font-size: 36px;
  }

  #intro-overlay {
    gap: 12px;
    padding: 15px;
    padding-left: env(safe-area-inset-left, 15px);
    padding-right: env(safe-area-inset-right, 15px);
  }
}

.intro-button:focus {
  outline: none;
}

.title-images-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  pointer-events: none;
  z-index: 1000;
}

.title-image,
.byline-image {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transition: opacity 0.1s linear;
  filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.9));
}

@media (max-width: 768px) {
  .title-image {
    width: 90% !important;
  }

  .byline-image {
    width: 60% !important;
  }
}/* Options Menu Styles */

.options-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* z-index managed by UIManager */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.options-menu.hidden {
  opacity: 0;
  pointer-events: none;
}

.options-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}

.options-container {
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 2px solid #444;
  border-radius: 16px;
  padding: 40px;
  min-width: 500px;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.close-button {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 2px solid #666;
  border-radius: 50%;
  color: #ccc;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: Arial, sans-serif;
  flex-shrink: 0;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
  transform: rotate(90deg);
}

.close-button:active {
  transform: rotate(90deg) scale(0.95);
}

.options-menu.hidden .options-container {
  transform: translateY(-20px);
}

.options-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.options-title {
  margin: 0;
  font-family: "LePorsche", Arial, sans-serif;
  font-size: 36px;
  color: #fff;
  letter-spacing: 3px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.options-content {
  margin-bottom: 30px;
}

.option-group {
  margin-bottom: 25px;
}

.option-group.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.performance-select {
  width: 100%;
  margin-top: 10px;
  padding: 10px 16px;
  background: transparent;
  border: 2px solid #444;
  border-radius: 8px;
  color: #ccc;
  font-family: "LePorsche", Arial, sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ccc' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.performance-select:hover {
  border-color: #666;
  background-color: rgba(255, 255, 255, 0.05);
}

.performance-select:focus {
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.performance-select option {
  background: #1a1a1a;
  color: #ccc;
  padding: 10px;
}

.performance-select option:disabled {
  color: #666;
  opacity: 0.5;
  cursor: not-allowed;
}

.option-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: "LePorsche", Arial, sans-serif;
  font-size: 16px;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.option-label.checkbox-label {
  margin-bottom: 0;
}

.option-value {
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  min-width: 50px;
  text-align: right;
}

/* Checkbox styling */
.option-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid #666;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.option-checkbox:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.option-checkbox:checked {
  background: #4caf50;
  border-color: #4caf50;
}

.option-checkbox:checked::after {
  content: "✓";
  position: absolute;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}

.option-slider {
  width: 100%;
  height: 6px;
  background: #444;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.option-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 24px;
  background: #fff;
  border-radius: 0 0 3px 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  clip-path: polygon(50% 0%, 100% 30%, 100% 100%, 0% 100%, 0% 30%);
  transform: translateY(-5px);
}

.option-slider::-webkit-slider-thumb:hover {
  transform: translateY(-5px) scale(1.2);
  background: #f0f0f0;
}

.option-slider::-moz-range-thumb {
  width: 20px;
  height: 24px;
  background: #fff;
  border: none;
  border-radius: 0 0 3px 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  clip-path: polygon(50% 0%, 100% 30%, 100% 100%, 0% 100%, 0% 30%);
  transform: translateY(-5px);
}

.option-slider::-moz-range-thumb:hover {
  transform: translateY(-5px) scale(1.2);
  background: #f0f0f0;
}

.option-slider::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    #4caf50 0%,
    #4caf50 var(--value, 60%),
    #444 var(--value, 60%),
    #444 100%
  );
  border-radius: 3px;
  height: 6px;
}

.option-slider::-moz-range-track {
  background: #444;
  border-radius: 3px;
  height: 6px;
}

.option-slider::-moz-range-progress {
  background: #4caf50;
  border-radius: 3px;
  height: 6px;
}

/* Refresh Confirmation Modal */
.refresh-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6000; /* MODAL layer */
  opacity: 1;
  transition: opacity 0.3s ease;
}

.refresh-confirm-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.refresh-confirm-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

.refresh-confirm-container {
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 2px solid #444;
  border-radius: 16px;
  padding: 40px;
  min-width: 400px;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.refresh-confirm-modal.hidden .refresh-confirm-container {
  transform: translateY(-20px);
}

.refresh-confirm-title {
  margin: 0 0 20px 0;
  font-family: "LePorsche", Arial, sans-serif;
  font-size: 28px;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
}

.refresh-confirm-message {
  margin: 0 0 30px 0;
  font-family: Arial, sans-serif;
  font-size: 16px;
  color: #ccc;
  text-align: center;
  line-height: 1.5;
}

.refresh-confirm-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.refresh-confirm-button {
  padding: 12px 32px;
  border: 2px solid #666;
  border-radius: 8px;
  background: transparent;
  color: #ccc;
  font-family: "LePorsche", Arial, sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.refresh-confirm-button:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.refresh-confirm-button:active {
  transform: scale(0.95);
}

.refresh-confirm-ok {
  border-color: #4caf50;
  color: #4caf50;
}

.refresh-confirm-ok:hover {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.refresh-confirm-cancel {
  border-color: #666;
  color: #ccc;
}

.refresh-confirm-cancel:hover {
  border-color: #999;
  color: #fff;
}

/* Responsive design */
@media (max-width: 600px) {
  .options-container {
    min-width: 90%;
    padding: 30px 20px;
  }

  .options-title {
    font-size: 28px;
  }

  .refresh-confirm-container {
    min-width: 90%;
    padding: 30px 20px;
  }

  .refresh-confirm-title {
    font-size: 24px;
  }
}
/* Dialog Caption Styles */
#dialog-caption {
  position: fixed;
  bottom: 6.5%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  color: white;
  padding: 20px 40px;
  font-family: "PXCountryTypewriter", Arial, sans-serif;
  font-size: clamp(18px, 3vw, 28px);
  max-width: 90%;
  margin: 0 auto;
  text-align: center;
  z-index: 1000;
  pointer-events: none;
  line-height: 1.4;
  box-sizing: border-box;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
}

#dialog-caption:empty {
  display: none;
}

/* Dialog Choice Options - Centered */
@keyframes slideUpFadeInCentered {
  from {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.dialog-choices-container {
  left: 50% !important;
  transform: translateX(-50%) !important;
  right: auto !important;
  animation: slideUpFadeInCentered 0.4s ease-out !important;
}

/* Mobile: anchor caption to top instead of bottom */
@media (max-width: 600px) {
  #dialog-caption {
    top: 6.5%;
    bottom: auto;
    padding: 15px 0px;
    font-size: clamp(24px, 5vw, 36px);
  }

  /* When mobile button is visible during cursor gameplay, position captions below it */
  /* After CURSOR/CURSOR_FINAL states, captions return to top */
  body.cursor-gameplay:has(#space-bar-hint.mobile-button) #dialog-caption {
    top: calc(5% + 80px);
    max-width: 90%;
    left: 0;
    right: 0;
    padding: 15px 40px;
  }
}
/* LoadingScreen - Minimal loading screen styling */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
}

.loading-content {
  text-align: center;
  max-width: 600px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-svg-container {
  width: 100%;
  max-width: 500px;
}

.loading-svg-container svg {
  width: 100%;
  height: auto;
}

.loading-title {
  font-family: "Voltaire", monospace;
  font-size: 1.5rem;
  color: #ffffff;
  letter-spacing: 0.2em;
  margin-bottom: 4rem;
}

.loading-progress-text {
  font-family: "Voltaire", monospace;
  font-size: 0.9rem;
  color: #888888;
  letter-spacing: 0.1em;
  margin-bottom: -1rem;
}
@keyframes fullscreenButtonPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 1.15;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.fullscreen-button {
  position: fixed;
  bottom: var(--fb-bottom, 7%);
  right: var(--fb-right, 20px);
  width: var(--fb-width, 48px);
  height: var(--fb-height, 48px);
  cursor: var(--fb-cursor, pointer);
  opacity: var(--fb-opacity, 0.7);
  transition: var(--fb-transition, opacity 0.3s ease, transform 0.2s ease);
  pointer-events: var(--fb-pointer-events, all);
  z-index: var(--fb-z-index, 2000);
  display: block;
}

.fullscreen-button:hover {
  animation: fullscreenButtonPulse 1.5s ease-in-out infinite;
  opacity: 1;
}

.fullscreen-button.is-hidden {
  display: none;
}

.fullscreen-button.is-touching {
  transform: scale(1.15);
  opacity: 1;
}

.fullscreen-button.is-pointer-locked {
  opacity: 0;
  pointer-events: none;
}

.fullscreen-button img {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  object-fit: contain;
  image-orientation: from-image;
}
