/* Baumholz Home Game - Adapted for website integration */
.game-intro {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.game-container {
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(212,161,90,0.2);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.game-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.score-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 600px;
  margin-bottom: 1rem;
}

.score-board > div {
  background: rgba(212,161,90,0.1);
  border: 1px solid rgba(212,161,90,0.3);
  border-radius: 8px;
  padding: 0.8rem;
  text-align: center;
  color: var(--gold-2);
  font-weight: 600;
  font-size: 0.9rem;
}

.game-area {
  position: relative;
  border: 2px solid rgba(212,161,90,0.3);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(40,40,40,0.9) 0%, rgba(60,60,60,0.8) 100%);
}

#gameCanvas {
  display: block;
  width: 100%;
  max-width: 800px;
  height: 400px;
  background: linear-gradient(135deg, #0a0a0a, #1a1a1a, #2a2a2a);
}

.start-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.start-btn {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  color: var(--bg);
  border: none;
  border-radius: 16px;
  padding: 2rem 4rem;
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 3px;
  box-shadow: 0 8px 32px rgba(212,161,90,0.4), 0 0 0 2px rgba(212,161,90,0.2);
  min-width: 300px;
  position: relative;
  overflow: hidden;
}

.start-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.start-btn:hover::before {
  left: 100%;
}

.start-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 40px rgba(212,161,90,0.6), 0 0 0 3px rgba(212,161,90,0.3);
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3));
}

.start-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.start-screen.hidden {
  display: none;
}

.controls {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  padding: 1rem;
  background: rgba(212,161,90,0.05);
  border-radius: 8px;
  border: 1px solid rgba(212,161,90,0.1);
}

.game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.95);
  border: 3px solid var(--gold-2);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  color: var(--text);
  min-width: 400px;
  z-index: 300;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
}

.game-over h2 {
  color: var(--gold-2);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.game-over p {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.highscore-input {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
}

.highscore-input label {
  color: var(--gold-2);
  font-weight: 600;
}

.highscore-input input {
  padding: 0.8rem;
  border: 1px solid rgba(212,161,90,0.3);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-family: inherit;
  width: 200px;
  text-align: center;
}

.highscore-input input:focus {
  outline: none;
  border-color: var(--gold-2);
  background: rgba(255,255,255,0.1);
}

.highscore-list {
  margin: 1rem 0;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 1rem;
}

.highscore-list div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid rgba(212,161,90,0.2);
  color: var(--text);
}

.highscore-list div:last-child {
  border-bottom: none;
}

.highscore-list span:first-child {
  color: var(--gold-2);
  font-weight: 600;
}

.highscore-list span:last-child {
  color: var(--text-light);
  font-size: 0.9rem;
}

.exit-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  border: 2px solid var(--gold-3);
  color: var(--bg);
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(212,161,90,0.4);
  z-index: 10;
}

.exit-btn:hover {
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3));
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(212,161,90,0.6);
}

.exit-btn:active {
  transform: scale(0.95);
}

.hidden {
  display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
  .score-board {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }
  
  .score-board > div {
    font-size: 0.8rem;
    padding: 0.6rem;
  }
  
  #gameCanvas {
    height: 300px;
  }
  
  .game-over {
    min-width: 280px;
    padding: 1.5rem;
  }
  
  .start-btn {
    padding: 1.5rem 3rem;
    font-size: 1.5rem;
    min-width: 250px;
  }
}

/* Enhanced Mobile Game Styling */
@media (max-width: 767px) {
  .game-container {
    padding: 1rem;
    margin: 1rem auto;
    gap: 1rem;
  }
  
  .game-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .game-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }
  
  .highscore-switch {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-height: 50px;
    width: 100%;
    max-width: 200px;
  }
  
  .game-controls {
    font-size: 0.85rem;
    margin: 1rem 0;
    padding: 0 1rem;
  }
  
  .game-score-board {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin: 1rem 0;
  }
  
  .game-score-item {
    padding: 0.8rem;
    min-height: 60px;
  }
  
  .game-score-label {
    font-size: 0.75rem;
  }
  
  .game-score-value {
    font-size: 1rem;
  }
  
  .game-start-btn {
    padding: 1.5rem 2rem;
    font-size: 1.2rem;
    width: 100%;
    max-width: 250px;
    min-height: 60px;
  }
  
  .game-canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-width: 2px;
    border-radius: 8px;
    touch-action: none;
  }
  
  .game-over {
    padding: 1.5rem;
    margin: 1rem;
    min-width: 280px;
    max-width: 90vw;
  }
  
  .game-over h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .game-over p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .game-over input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .game-over button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin: 0.5rem 0;
    min-height: 50px;
  }
  
  .exit-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    padding: 0;
  }
  
  .highscore-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
  }
  
  /* Highscore view mobile improvements */
  .highscore-view {
    padding: 1rem;
  }
  
  .highscore-header h3 {
    font-size: 1.5rem;
  }
  
  .highscore-header p {
    font-size: 0.9rem;
  }
  
  .highscore-table {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .highscore-entry {
    padding: 0.8rem;
    margin: 0.5rem 0;
  }
  
  .highscore-rank {
    font-size: 0.9rem;
    min-width: 30px;
  }
  
  .highscore-name {
    font-size: 0.85rem;
    margin-left: 0.5rem;
  }
  
  .highscore-score {
    font-size: 0.9rem;
  }
  
  .back-to-game-btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    max-width: 250px;
    min-height: 50px;
  }
}

/* Better touch controls for game */
.game-canvas {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: pointer;
}

/* Prevent zoom on game canvas */
.game-canvas:active {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Better focus states for game elements */
.game-start-btn:focus,
.highscore-switch:focus,
.game-over button:focus,
.exit-btn:focus,
.back-to-game-btn:focus {
  outline: 2px solid var(--gold-2);
  outline-offset: 2px;
}

/* Prevent text selection on game buttons */
.game-start-btn,
.highscore-switch,
.game-over button,
.exit-btn,
.back-to-game-btn {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Enhanced START Button - Golden Theme */
.game-start-btn {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #2b1f12;
  font-weight: 600;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(212,161,90,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  border: 2px solid rgba(212,161,90,0.6);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.game-start-btn:hover {
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  box-shadow: 0 8px 25px rgba(212,161,90,0.5), inset 0 1px 0 rgba(255,255,255,0.4);
  transform: translateY(-2px);
  border-color: rgba(212,161,90,0.8);
}

.game-start-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(212,161,90,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.game-start-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.game-start-btn:hover::before {
  left: 100%;
}

/* Enhanced Highscore Table */
.highscore-table {
  background: linear-gradient(135deg, rgba(212,161,90,0.1), rgba(212,161,90,0.05));
  border: 1px solid rgba(212,161,90,0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.highscore-entry {
  display: grid;
  grid-template-columns: 50px 1fr 80px 80px 80px;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  margin: 0.5rem 0;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border: 1px solid rgba(212,161,90,0.2);
  transition: all 0.3s ease;
}

.highscore-entry:hover {
  background: rgba(212,161,90,0.1);
  border-color: rgba(212,161,90,0.4);
  transform: translateX(5px);
}

.highscore-rank {
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  min-width: 50px;
}

.highscore-rank.rank-1 {
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.highscore-rank.rank-2 {
  color: #C0C0C0;
  text-shadow: 0 0 8px rgba(192,192,192,0.5);
}

.highscore-rank.rank-3 {
  color: #CD7F32;
  text-shadow: 0 0 6px rgba(205,127,50,0.5);
}

.highscore-name {
  font-weight: 600;
  color: var(--gold-2);
  font-size: 1rem;
}

.highscore-score {
  font-weight: 700;
  color: #fff;
  text-align: center;
  font-size: 1.1rem;
}

.highscore-time {
  font-weight: 600;
  color: var(--gold-2);
  text-align: center;
  font-size: 0.9rem;
}

.highscore-lives {
  font-weight: 600;
  color: #4CAF50;
  text-align: center;
  font-size: 0.9rem;
}

/* Highscore Table Header */
.highscore-table-header {
  display: grid;
  grid-template-columns: 50px 1fr 80px 80px 80px;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, rgba(212,161,90,0.2), rgba(212,161,90,0.1));
  border-radius: 8px;
  border: 1px solid rgba(212,161,90,0.3);
  font-weight: 700;
  color: var(--gold-2);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.highscore-table-header > div {
  text-align: center;
}

.highscore-table-header > div:first-child {
  text-align: center;
}

.highscore-table-header > div:nth-child(2) {
  text-align: left;
}

/* Empty state */
.highscore-empty {
  text-align: center;
  padding: 2rem;
  color: rgba(212,161,90,0.6);
  font-style: italic;
}

/* Mobile responsive highscore table */
@media (max-width: 767px) {
  .highscore-entry {
    grid-template-columns: 40px 1fr 70px 70px 70px;
    gap: 0.5rem;
    padding: 0.8rem;
    font-size: 0.9rem;
  }
  
  .highscore-table-header {
    grid-template-columns: 40px 1fr 70px 70px 70px;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.7rem;
  }
  
  .highscore-rank {
    font-size: 1rem;
    min-width: 40px;
  }
  
  .highscore-name {
    font-size: 0.9rem;
  }
  
  .highscore-score {
    font-size: 1rem;
  }
  
  .highscore-time,
  .highscore-lives {
    font-size: 0.8rem;
  }
}