/* CSS proměnná pro škálování */
:root {
  --game-scale: 1;
}

/* Základní styly */
body { 
  font-family: "Courier New", Courier, monospace;
  padding: 0; 
  margin: 0; 
  overflow: hidden;
  background: black;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#elm-node {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Layout třídy */
.game-container {
  position: relative;
  width: 640px;
  height: 384px;
  transform: scale(var(--game-scale, 1));
  transform-origin: center center;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  color: white;
}

.status-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 14px;
  font-family: monospace;
}

.menu-title {
  font-size: 25px;
  margin-bottom: 20px;
}

/* Utility třídy */
.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-10 {
  gap: 10px;
}

.gap-15 {
  gap: 15px;
}

.gap-20 {
  gap: 20px;
}

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

.margin-top-30 {
  margin-top: 30px;
}

/* Tlačítka - základní styly */
.btn-primary,
.btn-secondary,
.btn-level,
.btn-speed {
  padding: 10px 30px;
  margin: 8px;
  font-size: 16px;
  background-color: #333;
  color: white;
  border: 2px solid #666;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Courier New", Courier, monospace;
}

.btn-primary:hover,
.btn-secondary:hover {
  background-color: #444;
  border-color: #777;
}

.btn-selected {
  background-color: #FFD700 !important;
  border-color: #FFA500 !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Primární tlačítka - modrá barva */
.btn-primary {
  background-color: #2196F3;
  border-color: #1976D2;
}

.btn-primary:hover {
  background-color: #42A5F5;
  border-color: #2196F3;
}

.btn-primary.btn-selected {
  background-color: #FFD700 !important;
  border-color: #FFA500 !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Sekundární tlačítka - šedá barva */
.btn-secondary {
  background-color: #666;
  border-color: #555;
}

.btn-secondary:hover {
  background-color: #777;
  border-color: #666;
}

.btn-secondary.btn-selected {
  background-color: #FFD700 !important;
  border-color: #FFA500 !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Tlačítka levelů */
.btn-level {
  padding: 15px;
  font-size: 18px;
  border-radius: 8px;
  font-weight: bold;
  min-width: 60px;
  min-height: 60px;
  margin: 0;
}

.btn-level-completed {
  background-color: #4CAF50;
  border-color: #45a049;
  color: white;
}

.btn-level-completed:hover {
  background-color: #66BB6A;
  border-color: #4CAF50;
}

.btn-level-completed.btn-selected {
  background-color: #FFD700 !important;
  border-color: #FFA500 !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.btn-level-available {
  background-color: #2196F3;
  border-color: #1976D2;
  color: white;
}

.btn-level-available:hover {
  background-color: #42A5F5;
  border-color: #2196F3;
}

.btn-level-available.btn-selected {
  background-color: #FFD700 !important;
  border-color: #FFA500 !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.btn-level-locked {
  background-color: #666;
  border-color: #555;
  color: #999;
  cursor: not-allowed;
}

.btn-level-locked:hover {
  background-color: #666;
  border-color: #555;
}

/* Tlačítka rychlosti */
.btn-speed {
  padding: 8px 16px;
  border: 1px solid #666;
  border-radius: 5px;
  margin: 0;
}

.btn-speed-active {
  background-color: #FFD700 !important;
  border-color: #FFA500 !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.btn-speed.btn-selected {
  background-color: #FFD700 !important;
  border-color: #FFA500 !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Touch ovládací tlačítka - odlišný styl */
.btn-touch {
  width: 60px;
  height: 60px;
  font-size: 24px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.btn-touch:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Game over overlay */
.game-over-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 48px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  z-index: 2000;
}

.level-complete-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 48px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  z-index: 2000;
}

/* Help scroll container */
.help-scroll-container {
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.help-content {
  max-width: 600px;
  text-align: center;
}

.help-section {
  margin-bottom: 20px;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.help-section-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #FFD700;
}

.help-section-content {
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.help-link {
  color: #87CEEB;
  text-decoration: none;
}

.help-link:hover {
  text-decoration: underline;
}
