/* Base reset */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
  background: #0f0f0f;
}

/* Roblox-like top bar */
.topbar {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 48px;
  background: #111;
  border-bottom: 2px solid #e2231a;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.5px;
}

.spacer {
  flex: 1;
}

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  background: #1a1a1a;
  color: #eee;
  border: 1px solid #2a2a2a;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn:hover {
  background: #222;
  transform: translateY(-1px);
}

.btn.primary {
  background: #e2231a;
  border-color: #e2231a;
  color: #fff;
}

.btn.primary:hover {
  background: #f2231a;
  box-shadow: 0 2px 8px rgba(226, 35, 26, 0.3);
}

.btn.active {
  background: #e2231a;
  border-color: #e2231a;
  color: #fff;
}

.btn.authenticated {
  background: #27ae60;
  border-color: #27ae60;
  color: #fff;
}

.btn.authenticated:hover {
  background: #2ecc71;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

/* Navigation link styling */
.nav-link {
  text-decoration: none;
  display: inline-block;
}

.nav-link:hover {
  text-decoration: none;
}

/* Hide sign-in button */
#btn-signin {
  display: none !important;
}

.btn.large {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
}

/* Page system */
.page {
  width: 100vw;
  height: calc(100vh - 48px);
  overflow-y: auto;
}

/* Home Page Styles */
.hero-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.hero-content {
  text-align: center;
  max-width: 800px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0 0 16px 0;
  background: linear-gradient(45deg, #e2231a, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #b0b0b0;
  margin: 0 0 40px 0;
  line-height: 1.6;
}

.completion-stats {
  margin: 0 0 40px 0;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.completion-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(226, 35, 26, 0.1);
  border: 2px solid #e2231a;
  border-radius: 25px;
  padding: 12px 24px;
  backdrop-filter: blur(4px);
}

.completion-label {
  font-size: 1rem;
  color: #e0e0e0;
  font-weight: 500;
}

.completion-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: #e2231a;
  background: linear-gradient(45deg, #e2231a, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 215, 0, 0.1);
  border: 2px solid #FFD700;
  border-radius: 25px;
  padding: 12px 24px;
  backdrop-filter: blur(4px);
}

.coin-label {
  font-size: 1rem;
  color: #e0e0e0;
  font-weight: 500;
}

.coin-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFD700;
  background: linear-gradient(45deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin: 40px 0;
}

.feature {
  background: rgba(255, 255, 255, 0.05);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.feature:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.08);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.feature-text {
  font-size: 1rem;
  font-weight: 500;
  color: #e0e0e0;
}

.controls-section {
  background: #111;
  padding: 60px 20px;
  text-align: center;
}

.controls-section h2 {
  font-size: 2.5rem;
  margin: 0 0 40px 0;
  color: #e2231a;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.control-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-key {
  background: #e2231a;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-family: monospace;
  display: inline-block;
  margin-bottom: 8px;
}

.control-desc {
  color: #b0b0b0;
  font-size: 0.9rem;
}

/* Game area */
#game-container {
  position: relative;
  width: 100vw;
  height: calc(100vh - 48px);
  background: linear-gradient(#87ceeb, #9bd4f0 35%, #b4e0f5 70%);
  overflow: hidden;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(17, 17, 17, 0.7);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(2px);
}

.overlay.center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 16px 20px;
}

.overlay .title {
  font-weight: 700;
  margin-bottom: 4px;
}

.overlay .hint {
  font-size: 12px;
  color: #cfd8dc;
}

.hidden {
  display: none !important;
}

/* Shop Overlay Styles */
#shop-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.shop-container {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 2px solid #e2231a;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  overflow-x: hidden;
}

.shop-container h2 {
  color: #e2231a;
  font-size: 2rem;
  margin: 0 0 20px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.coin-display {
  background: rgba(255, 215, 0, 0.1);
  border: 2px solid #FFD700;
  border-radius: 8px;
  padding: 10px;
  margin: 0 0 20px 0;
  font-size: 1.2rem;
  font-weight: bold;
  color: #FFD700;
}

.shop-items {
  display: grid;
  gap: 15px;
  margin: 20px 0;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 10px;
}

.shop-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  transition: transform 0.2s ease;
}

.shop-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.item-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: #e2231a;
  margin-bottom: 5px;
}

.item-description {
  font-size: 0.9rem;
  color: #b0b0b0;
  margin-bottom: 8px;
}

.item-cost {
  font-size: 0.9rem;
  color: #FFD700;
  font-weight: bold;
  margin-bottom: 10px;
}

.buy-btn {
  background: #e2231a;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: all 0.2s ease;
}

.buy-btn:hover {
  background: #f2231a;
  transform: translateY(-1px);
}

.buy-btn.unavailable {
  background: #666;
  cursor: not-allowed;
}

.skin-preview {
  text-align: center;
  margin: 10px 0;
}

.shop-close {
  color: #b0b0b0;
  font-size: 0.9rem;
  margin-top: 20px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-features {
    grid-template-columns: 1fr;
  }
  
  .controls-grid {
    grid-template-columns: 1fr;
  }
  
  .shop-container {
    padding: 20px;
    margin: 20px;
    max-height: 85vh;
  }
  
  .shop-container h2 {
    font-size: 1.5rem;
  }
  
  .shop-items {
    max-height: 45vh;
  }
}

/* Home Page Shop Button */
.home-shop-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.shop-btn {
  background: linear-gradient(135deg, #e2231a, #ff6b35);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(226, 35, 26, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(226, 35, 26, 0.4);
  background: linear-gradient(135deg, #f2231a, #ff7b45);
}

.shop-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(226, 35, 26, 0.3);
}

.shop-icon {
  font-size: 18px;
}

.shop-text {
  font-weight: 600;
}

/* Custom scrollbar for shop */
.shop-container::-webkit-scrollbar,
.shop-items::-webkit-scrollbar {
  width: 8px;
}

.shop-container::-webkit-scrollbar-track,
.shop-items::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.shop-container::-webkit-scrollbar-thumb,
.shop-items::-webkit-scrollbar-thumb {
  background: #e2231a;
  border-radius: 4px;
}

.shop-container::-webkit-scrollbar-thumb:hover,
.shop-items::-webkit-scrollbar-thumb:hover {
  background: #f2231a;
}

/* Firefox scrollbar */
.shop-container,
.shop-items {
  scrollbar-width: thin;
  scrollbar-color: #e2231a rgba(255, 255, 255, 0.1);
}

/* Mobile Touch Controls */
.mobile-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 20px;
  pointer-events: none;
  z-index: 100;
}

.left-controls {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.right-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.center-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.control-btn {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.control-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.3);
}

.left-btn, .right-btn {
  background: rgba(52, 152, 219, 0.8);
  border-color: rgba(52, 152, 219, 0.9);
}

.jump-btn {
  background: rgba(46, 204, 113, 0.8);
  border-color: rgba(46, 204, 113, 0.9);
  width: 80px;
  height: 60px;
  border-radius: 30px;
  font-size: 14px;
}

.dash-btn {
  background: rgba(155, 89, 182, 0.8);
  border-color: rgba(155, 89, 182, 0.9);
  width: 80px;
  height: 60px;
  border-radius: 30px;
  font-size: 14px;
}

.crawl-btn, .dance-btn {
  background: rgba(230, 126, 34, 0.8);
  border-color: rgba(230, 126, 34, 0.9);
  width: 70px;
  height: 50px;
  border-radius: 25px;
  font-size: 12px;
}

/* Hide mobile controls on desktop */
@media (min-width: 768px) {
  .mobile-controls {
    display: none;
  }
}

/* Mobile-specific adjustments */
@media (max-width: 767px) {
  .mobile-controls {
    bottom: 10px;
    padding: 0 10px;
  }
  
  .control-btn {
    width: 50px;
    height: 50px;
    font-size: 16px;
  }
  
  .jump-btn, .dash-btn {
    width: 70px;
    height: 50px;
    font-size: 12px;
  }
  
  .crawl-btn, .dance-btn {
    width: 60px;
    height: 40px;
    font-size: 10px;
  }
  
  .overlay .hint {
    font-size: 10px;
  }
}

/* Sign In Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 2px solid #e2231a;
  border-radius: 12px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  background: rgba(226, 35, 26, 0.1);
  padding: 20px;
  border-bottom: 1px solid rgba(226, 35, 26, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: #e2231a;
  font-size: 1.5rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: #b0b0b0;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.modal-body {
  padding: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #e0e0e0;
  font-weight: 500;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #e2231a;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 2px rgba(226, 35, 26, 0.3);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.form-actions .btn {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
}

.btn.secondary {
  background: #2a2a2a;
  border-color: #4a4a4a;
  color: #e0e0e0;
}

.btn.secondary:hover {
  background: #3a3a3a;
  border-color: #5a5a5a;
}

.guest-login {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.guest-login p {
  margin: 0 0 15px 0;
  color: #b0b0b0;
  font-size: 14px;
}

.btn.guest-btn {
  background: #4CAF50;
  border-color: #4CAF50;
  color: white;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
}

.btn.guest-btn:hover {
  background: #45a049;
  border-color: #45a049;
}

/* Responsive modal */
@media (max-width: 480px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .form-actions {
    flex-direction: column;
  }
}


