* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  border-radius: 15px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.back-btn {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.back-btn:hover {
  transform: translateY(-2px);
}

/* Main Content */
.main-content {
  background: white;
  margin: 2rem 0;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.page-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  color: #333;
}

.page-subtitle {
  font-size: 1.1rem;
  color: #666;
  text-align: center;
  margin-bottom: 2rem;
}

/* Game Controls Top */
.game-controls-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 15px;
  border: 2px solid #e9ecef;
}

.difficulty-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.difficulty-selector label {
  font-weight: 600;
  color: #333;
}

.difficulty-selector select {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.difficulty-selector select:focus {
  outline: none;
  border-color: #667eea;
}

.fullscreen-btn {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.fullscreen-btn:hover {
  transform: translateY(-2px);
}

/* Game Container */
.game-container {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 15px;
  border: 2px solid #e9ecef;
}

.game-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  background: white;
  padding: 15px;
  border-radius: 10px;
  border: 2px solid #e9ecef;
}

#gameCanvas {
  border: 3px solid #667eea;
  border-radius: 10px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.5);
  display: block;
  margin: 0 auto 20px auto;
  width: 100%;
  max-width: 900px;
  height: auto;
}

.game-controls {
  margin-top: 20px;
}

.game-controls p {
  margin-bottom: 15px;
  color: #333;
  font-size: 1rem;
  background: white;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

button {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border: none;
  padding: 12px 25px;
  margin: 0 10px;
  border-radius: 25px;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

button:active {
  transform: translateY(0);
}

.game-over {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.98);
  padding: 40px;
  border-radius: 15px;
  border: 3px solid #ff4444;
  box-shadow: 0 0 30px rgba(255, 68, 68, 0.5);
  z-index: 1000;
  text-align: center;
}

.game-over h2 {
  color: #ff4444;
  font-size: 2rem;
  margin-bottom: 20px;
}

.game-over p {
  font-size: 1.3rem;
  margin-bottom: 25px;
  color: #333;
}

#restartBtn {
  background: linear-gradient(45deg, #ff4444, #ff0000);
  font-size: 1.1rem;
  padding: 15px 30px;
}

#restartBtn:hover {
  background: linear-gradient(45deg, #ff0000, #ff4444);
}

/* Fullscreen styles */
.fullscreen-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.fullscreen-container .game-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  width: 100%;
  max-width: 900px;
}

.fullscreen-container .game-stats {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}

.fullscreen-container .game-controls p {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}

.fullscreen-container #gameCanvas {
  max-width: 100%;
  max-height: 70vh;
}

/* Game-only fullscreen mode */
.fullscreen-game-only {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.fullscreen-stats {
  display: flex;
  justify-content: space-around;
  width: 100%;
  max-width: 900px;
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #667eea;
}

.fullscreen-canvas {
  border: 3px solid #667eea;
  border-radius: 10px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
  width: 100%;
  max-width: 900px;
  height: auto;
  max-height: 85vh;
}

.exit-fullscreen {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
  padding: 10px 15px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2rem;
  min-width: 50px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exit-fullscreen:hover {
  background: rgba(255, 255, 255, 0.3);
}

.fullscreen-game-only .exit-fullscreen {
  background: rgba(102, 126, 234, 0.3);
  border: 2px solid #667eea;
  color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-controls-top {
    flex-direction: column;
    gap: 1rem;
  }
  
  .difficulty-selector {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .game-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  #gameCanvas {
    max-width: 100%;
    height: auto;
  }
  
  .tool-header h1 {
    font-size: 2rem;
  }
}

/* Feedback Section */
.feedback-container {
  margin-top: 3rem;
}

.feedback-container .feedback-widget.subpage-widget {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.feedback-container .feedback-widget.subpage-widget .feedback-stats {
  border-bottom: 2px solid #f8f9fa;
}

.feedback-container .feedback-widget.subpage-widget .like-btn-subpage {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
  transition: all 0.3s ease;
}

.feedback-container .feedback-widget.subpage-widget .like-btn-subpage:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.feedback-container .feedback-widget.subpage-widget .comment-submit-btn {
  background: linear-gradient(45deg, #667eea, #764ba2);
  transition: all 0.3s ease;
}

.feedback-container .feedback-widget.subpage-widget .comment-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* Mobile Controls */
.mobile-controls {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 10px;
  border: 2px solid rgba(102, 126, 234, 0.3);
}

.mobile-info {
  color: #333 !important;
  background: rgba(255, 255, 255, 0.8) !important;
  padding: 0.8rem !important;
  border-radius: 8px !important;
  margin-bottom: 1rem !important;
  font-weight: 600;
  text-align: center;
}

.mobile-control-options {
  margin-top: 0.5rem;
}

.control-option {
  color: #333 !important;
  background: rgba(255, 255, 255, 0.6) !important;
  padding: 0.5rem !important;
  border-radius: 6px !important;
  margin-bottom: 0.5rem !important;
  font-size: 0.9rem;
  text-align: left;
}

.tilt-toggle-btn {
  background: linear-gradient(45deg, #667eea, #764ba2) !important;
  color: white !important;
  border: none !important;
  padding: 12px 25px !important;
  border-radius: 25px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

.tilt-toggle-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
}

.tilt-toggle-btn:disabled {
  background: linear-gradient(45deg, #28a745, #20c997) !important;
  cursor: not-allowed !important;
  opacity: 0.8;
}

/* Mobile responsive canvas */
@media (max-width: 768px) {
  #gameCanvas {
    max-width: 100%;
    width: 100%;
    height: auto;
  }
  
  .mobile-controls {
    margin: 0.5rem 0;
    padding: 0.8rem;
  }
  
  .mobile-info {
    font-size: 0.9rem !important;
    padding: 0.6rem !important;
  }
  
  .tilt-toggle-btn {
    font-size: 0.9rem !important;
    padding: 10px 20px !important;
  }
  
  .control-option {
    font-size: 0.8rem !important;
    padding: 0.4rem !important;
  }
  
  /* Fullscreen mobile optimizations */
  .fullscreen-game-only {
    padding: 5px;
  }
  
  .fullscreen-stats {
    font-size: 1rem;
    padding: 8px;
    margin-bottom: 5px;
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }
  
  .fullscreen-canvas {
    max-height: 90vh;
    border-width: 2px;
  }
  
  .exit-fullscreen {
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    font-size: 1rem;
    min-width: 40px;
    min-height: 40px;
  }
  
  /* Make game more touch-friendly on mobile */
  .game-stats {
    font-size: 1rem;
    padding: 10px;
  }
  
  .fullscreen-btn {
    padding: 12px 18px !important;
    font-size: 0.9rem !important;
  }
}

/* Mobile Setup Flow Styles */
.mobile-setup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.mobile-setup-popup {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.mobile-setup-header h2 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mobile-setup-header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  margin-bottom: 25px;
}

.mobile-setup-content {
  margin-bottom: 20px;
}

.permission-info, .fallback-info {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(10px);
}

.permission-icon, .fallback-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.permission-info h3, .fallback-info h3 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.permission-info p, .fallback-info p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.4;
}

.features-list {
  margin-top: 15px;
}

.feature {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  margin: 8px 0;
  text-align: left;
}

.mobile-setup-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.setup-btn {
  background: linear-gradient(45deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 15px 25px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.setup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.setup-btn.reject-btn {
  background: linear-gradient(45deg, #dc3545, #c82333);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.setup-btn.reject-btn:hover {
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

/* Difficulty Selection Styles */
.difficulty-popup {
  max-width: 500px;
}

.difficulty-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.difficulty-option {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  text-align: left;
  backdrop-filter: blur(10px);
}

.difficulty-option:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.difficulty-icon {
  font-size: 2rem;
  margin-right: 15px;
  min-width: 50px;
}

.difficulty-info h3 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.difficulty-info p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  line-height: 1.3;
}

/* Mobile Responsive for Setup Flow */
@media (max-width: 768px) {
  .mobile-setup-popup {
    padding: 20px;
    margin: 10px;
  }
  
  .mobile-setup-header h2 {
    font-size: 1.3rem;
  }
  
  .permission-icon, .fallback-icon {
    font-size: 2.5rem;
  }
  
  .setup-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  
  .difficulty-option {
    padding: 12px;
  }
  
  .difficulty-icon {
    font-size: 1.5rem;
    margin-right: 12px;
    min-width: 40px;
  }
  
  .difficulty-info h3 {
    font-size: 1rem;
  }
  
  .difficulty-info p {
    font-size: 0.8rem;
  }
}

/* Game Over Popup Styles */
.game-over-popup .score-info {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(10px);
}

.score-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.score-info h3 {
  color: white;
  font-size: 1.3rem;
  margin: 0;
}