/* Dino Game Dev Console Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* Floating gear button */
#dev-btn-toggle {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1f2937;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#dev-btn-toggle:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  color: #4f46e5;
}

#dev-btn-toggle:active {
  transform: translateY(0);
}

body.inverted #dev-btn-toggle {
  background: rgba(30, 30, 40, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.inverted #dev-btn-toggle:hover {
  background: #1e1e24;
  color: #818cf8;
}

/* Sliding Console Drawer */
#dev-console {
  position: absolute;
  top: 0;
  right: -320px; /* Initially hidden offscreen */
  width: 300px;
  height: 100%;
  z-index: 99999;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.06);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  font-family: 'Inter', sans-serif;
  color: #1f2937;
  text-align: left;
}

#dev-console.active {
  right: 0;
}

body.inverted #dev-console {
  background: rgba(18, 18, 24, 0.78);
  border-left-color: rgba(255, 255, 255, 0.06);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
  color: #f3f4f6;
}

/* Header */
.dev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 12px;
}

body.inverted .dev-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dev-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #4f46e5;
}

body.inverted .dev-title {
  color: #818cf8;
}

.dev-close-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #9ca3af;
  transition: color 0.2s;
}

.dev-close-btn:hover {
  color: #ef4444;
}

/* Control blocks */
.dev-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dev-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}

body.inverted .dev-section-title {
  color: #9ca3af;
}

.dev-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dev-label {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Switches (Toggles) */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.1);
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 24px;
}

body.inverted .slider {
  background-color: rgba(255, 255, 255, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
  background-color: #4f46e5;
}

body.inverted input:checked + .slider {
  background-color: #818cf8;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Sliders */
.range-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6b7280;
}

body.inverted .range-labels {
  color: #9ca3af;
}

.range-val {
  font-weight: 700;
  color: #4f46e5;
}

body.inverted .range-val {
  color: #818cf8;
}

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
}

body.inverted input[type=range]::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.08);
}

input[type=range]::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #4f46e5;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.1s ease;
}

body.inverted input[type=range]::-webkit-slider-thumb {
  background: #818cf8;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Button Group selector */
.btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}

.btn-group-opt {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #4b5563;
  text-align: center;
}

body.inverted .btn-group-opt {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
  color: #d1d5db;
}

.btn-group-opt.active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

body.inverted .btn-group-opt.active {
  background: #818cf8;
  color: #121214;
  border-color: #818cf8;
}

/* Action button style */
.dev-action-btn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.12);
  border-radius: 10px;
  color: #ef4444;
  padding: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.dev-action-btn:hover {
  background: #ef4444;
  color: white;
}

/* Keyboard Controls Guide Overlay */
.help__outer {
  position: absolute;
  bottom: 25px;
  left: 25px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  font-family: 'Inter', sans-serif;
  color: #4b5563;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none; /* Let clicks pass through to game frame */
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

body.inverted .help__outer {
  background: rgba(18, 18, 24, 0.68);
  border-color: rgba(255, 255, 255, 0.08);
  color: #9ca3af;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.help {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.help__space {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6b7280;
}

body.inverted .help__space {
  color: #9ca3af;
}

.help__keys {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.help__keys-line {
  display: inline-block;
}

.help__key_small, .help__key_big {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #ffffff, #f3f4f6);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #1f2937;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  box-shadow: 0 3px 0 #9ca3af, 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.08s ease;
  user-select: none;
}

body.inverted .help__key_small, body.inverted .help__key_big {
  background: linear-gradient(to bottom, #374151, #1f2937);
  border-color: #4b5563;
  color: #f3f4f6;
  box-shadow: 0 3px 0 #111827, 0 4px 6px rgba(0, 0, 0, 0.3);
}

.help__key_small {
  width: 28px;
  height: 28px;
  font-size: 1.05rem;
}

.help__key_big {
  padding: 0 10px;
  height: 28px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Pressed Animation */
.help__key_small.pressed, .help__key_big.pressed {
  transform: translateY(3px);
  box-shadow: 0 0px 0 #9ca3af, 0 1px 3px rgba(0, 0, 0, 0.1);
  background: linear-gradient(to bottom, #e5e7eb, #d1d5db);
}

body.inverted .help__key_small.pressed, body.inverted .help__key_big.pressed {
  transform: translateY(3px);
  box-shadow: 0 0px 0 #111827, 0 1px 3px rgba(0, 0, 0, 0.5);
  background: linear-gradient(to bottom, #1f2937, #111827);
}

.help__tap {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
  animation: pulse-glow 2s infinite ease-in-out;
}

body.inverted .help__tap {
  color: #818cf8;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.96); }
}

/* Arcade Mode Sizing & Smooth Scale Expansion Transitions */
.arcade-mode,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas {
  image-rendering: pixelated;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode #buttons,
.arcade-mode #main-content {
  opacity: 0;
  overflow: hidden;
}

.arcade-mode .interstitial-wrapper {
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode .runner-container {
  left: 0;
  margin: auto;
  right: 0;
  transform-origin: top center;
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
  z-index: 2;
}

/* Initial size of runner container to support Chrome Dino intro width animation */
.runner-container {
  direction: ltr;
  height: 150px;
  max-width: 600px;
  overflow: hidden;
  position: absolute;
  top: 35px;
  width: 44px; /* Default start narrow, will expand to 600px on play */
}

.runner-canvas {
  height: 150px;
  max-width: 600px;
  opacity: 1;
  overflow: hidden;
  position: absolute;
  top: 0;
  z-index: 2;
}

/* Onscreen Pause/Resume Button */
#game-pause-btn {
  position: absolute;
  top: 15px;
  right: 140px; /* Positioned left of the Dev Tools button */
  z-index: 9999;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1f2937;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#game-pause-btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  color: #4f46e5;
}

#game-pause-btn:active {
  transform: translateY(0);
}

body.inverted #game-pause-btn {
  background: rgba(30, 30, 40, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.inverted #game-pause-btn:hover {
  background: #1e1e24;
  color: #818cf8;
}

