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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.screen {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.hidden {
  display: none !important;
}

h1 {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 10px;
}

h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 20px;
}

.tagline {
  text-align: center;
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 30px;
}

.rules {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  text-align: center;
  line-height: 1.6;
}

.name-input {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.name-input input, #playerName {
  padding: 15px 20px;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.buttons {
  text-align: center;
}

.btn {
  padding: 15px 30px;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: #e0e0e0;
}

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

.btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.or {
  margin: 15px 0;
  color: #999;
}

.join-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.join-row input {
  width: 100px;
  padding: 15px;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  text-align: center;
  text-transform: uppercase;
}

#playerList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.player-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 500;
}

.player-item.current {
  box-shadow: 0 0 0 3px #ffd700;
}

.player-item.imposter {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

#playerCount {
  text-align: center;
  color: #666;
  margin-bottom: 20px;
}

/* Game layout */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.turn-info {
  font-size: 1.3rem;
  font-weight: bold;
  color: #667eea;
}

.round-info {
  color: #666;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

.board-wrapper {
  overflow: auto;
}

#board {
  display: grid;
  grid-template-columns: repeat(15, 32px);
  grid-template-rows: repeat(15, 32px);
  gap: 1px;
  background: #999;
  padding: 2px;
  border-radius: 5px;
  width: fit-content;
}

.cell {
  width: 32px;
  height: 32px;
  background: #f5deb3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.1s;
}

.cell:hover {
  background: #ffe4b5;
}

.cell.tile {
  background: #fff5e6;
  border: 2px solid #8b4513;
  border-radius: 3px;
}

.cell.highlighted {
  background: #90ee90 !important;
}

.cell.bonus-DL { background: #a8d5ff; }
.cell.bonus-TL { background: #5fa8ff; }
.cell.bonus-DW { background: #ffb3b3; }
.cell.bonus-TW { background: #ff6b6b; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#scoreboard {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
}

#scoreboard h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.score-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.score-item:last-child {
  border-bottom: none;
}

.score-name {
  font-weight: 500;
}

.score-value {
  color: #667eea;
  font-weight: bold;
}

.tiles-container {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
}

.tiles-container h3 {
  margin-bottom: 10px;
}

#tileRack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 50px;
}

.tile {
  width: 40px;
  height: 45px;
  background: #fff5e6;
  border: 2px solid #8b4513;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.1s;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.tile.selected {
  background: #90ee90;
  transform: translateY(-5px);
}

.tile .points {
  font-size: 0.6rem;
  position: absolute;
  bottom: 2px;
  right: 3px;
}

.note {
  background: #fff3cd;
  padding: 10px;
  border-radius: 5px;
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.controls input {
  padding: 12px;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  text-align: center;
}

/* Voting screen */
#voteOptions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  margin: 30px auto;
}

.vote-btn {
  padding: 20px;
  font-size: 1.1rem;
  background: #f8f9fa;
  border: 2px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.vote-btn:hover {
  border-color: #667eea;
  background: #f0f3ff;
}

/* Results */
#resultsContent {
  text-align: center;
  margin-bottom: 30px;
}

.result-section {
  margin: 20px 0;
  padding: 20px;
  border-radius: 10px;
}

.result-section.winners {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.result-section.imposter {
  background: #ffebee;
}

.imposter-reveal {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.scores-list {
  margin-top: 20px;
  text-align: left;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.scores-list li {
  padding: 5px 0;
  list-style: none;
}