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

body {
  font-family: 'Noto Sans', sans-serif;
  background: #fff;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* Setup Screen */
.setup-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
}

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

.setup-content {
  text-align: center;
  padding: 32px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.logo {
  width: 120px;
  height: auto;
  margin-bottom: 16px;
}

.setup-content h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #0066cc;
}

.setup-content h2 {
  font-size: 20px;
  margin-bottom: 24px;
  color: #333;
}

.team-count-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.team-count-btn {
  width: 64px;
  height: 64px;
  font-size: 28px;
  font-weight: 700;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.team-count-btn:active {
  transform: scale(0.95);
  background: #0052a3;
}

.game-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 10px;
}

.game-container.hidden {
  display: none;
}

.game-logo {
  width: 60px;
  height: auto;
  flex-shrink: 0;
  margin-left: 8px;
}

.settings-btn {
  width: 40px;
  height: 40px;
  font-size: 20px;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
}

.settings-btn:active {
  transform: scale(0.95);
  background: #e0e0e0;
}

/* Scores */
.scores {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex: 1;
}

.team {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.3s, box-shadow 0.3s;
  border: 2px solid transparent;
  flex: 1;
}

.team.active {
  background: #e3f2fd;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.2);
}

.team-name-container {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.team-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team.active .team-name {
  color: #0066cc;
}

.edit-btn {
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 2px;
  opacity: 0.6;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.edit-btn:active {
  opacity: 1;
}

.coins {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
}

.coin-stack {
  position: absolute;
  width: 45px;
  height: 45px;
  background: radial-gradient(circle, #FFD700 0%, #FFA500 100%);
  border-radius: 50%;
  border: 2px solid #DAA520;
  box-shadow: 
    0 2px 0 #DAA520,
    0 4px 0 #B8860B,
    0 6px 8px rgba(0,0,0,0.3);
}

.score {
  position: relative;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
  z-index: 1;
}

/* Dreidel Grid */
.dreidel-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding-bottom: 8px;
  align-content: start;
}

.dreidel {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.dreidel:active {
  transform: scale(0.95) rotate(15deg);
}

.dreidel.used {
  opacity: 0.3;
  pointer-events: none;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.question-header {
  text-align: center;
  margin-bottom: 20px;
}

.points {
  display: inline-block;
  font-size: 32px;
  font-weight: 700;
  color: #FFD700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  padding: 8px 20px;
  background: linear-gradient(135deg, #FFA500 0%, #FF6B00 100%);
  border-radius: 12px;
  border: 3px solid #FFD700;
}

.question-text {
  font-size: 18px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 24px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn {
  width: 100%;
  padding: 14px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.close-btn:active {
  background: #0052a3;
}

.answer-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.success-btn, .fail-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.success-btn {
  background: #4caf50;
  color: white;
}

.fail-btn {
  background: #f44336;
  color: white;
}

.success-btn:active, .fail-btn:active {
  transform: scale(0.95);
  opacity: 0.9;
}

.team-selector {
  text-align: center;
  padding-top: 16px;
  border-top: 2px solid #e0e0e0;
}

.team-selector.hidden {
  display: none;
}

.team-selector p {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.team-select-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.team-select-btn {
  padding: 12px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.team-select-btn:active {
  transform: scale(0.95);
  background: #0052a3;
}

.team-select-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Edit Modal */
.edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 20px;
}

.edit-modal.hidden {
  display: none;
}

.edit-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 300px;
  width: 100%;
  animation: slideUp 0.3s ease-out;
}

.edit-modal-content h3 {
  font-size: 18px;
  margin-bottom: 16px;
  text-align: center;
  color: #333;
}

.team-name-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 12px;
  text-align: center;
  font-family: inherit;
}

.team-score-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 16px;
  text-align: center;
  font-family: inherit;
}

.edit-buttons {
  display: flex;
  gap: 8px;
}

.save-btn, .cancel-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.save-btn {
  background: #0066cc;
  color: white;
}

.cancel-btn {
  background: #e0e0e0;
  color: #333;
}

.save-btn:active, .cancel-btn:active {
  opacity: 0.7;
}

/* Settings Modal */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  padding: 20px;
  overflow-y: auto;
}

.settings-modal.hidden {
  display: none;
}

.settings-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

.settings-modal-content h3 {
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
  color: #333;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h4 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #0066cc;
  font-weight: 600;
}

.questions-list, .surprises-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.question-item, .surprise-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #f8f8f8;
  border-radius: 8px;
}

.question-item input, .surprise-item input {
  flex: 1;
  padding: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.surprise-item input.points-input {
  width: 80px;
  flex: none;
}

.delete-item-btn {
  background: #f44336;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.delete-item-btn:active {
  opacity: 0.7;
}

.add-question-btn, .add-surprise-btn {
  width: 100%;
  padding: 10px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.add-question-btn:active, .add-surprise-btn:active {
  opacity: 0.7;
}

.close-settings-btn {
  width: 100%;
  padding: 14px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.close-settings-btn:active {
  opacity: 0.7;
}