* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #e8e8e8;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.game-container {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #e94560;
}

.subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  opacity: 0.85;
}

h2 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin: 0 0 1rem;
}

.pick-area,
.draw-area,
.actions,
.result-area {
  margin-bottom: 1.5rem;
}

.number-slots,
.draw-slots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.slot {
  flex: 0 0 auto;
}

.digit-btn {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid rgba(233, 69, 96, 0.5);
  border-radius: 0.5rem;
  background: rgba(233, 69, 96, 0.15);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.digit-btn:hover {
  background: rgba(233, 69, 96, 0.3);
  border-color: #e94560;
  transform: scale(1.05);
}

.digit-btn:focus {
  outline: 2px solid #e94560;
  outline-offset: 2px;
}

.digit-btn.picked {
  background: rgba(233, 69, 96, 0.4);
  border-color: #e94560;
}

.draw-digit {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.draw-digit.revealed {
  background: rgba(233, 69, 96, 0.25);
  border-color: #e94560;
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.hint {
  font-size: 0.8rem;
  opacity: 0.7;
  text-align: center;
  margin: 0;
}

.actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-play {
  background: #e94560;
  color: #fff;
}

.btn-play:hover:not(:disabled) {
  background: #ff6b6b;
  transform: translateY(-1px);
}

.btn-play:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-reset {
  background: rgba(255, 255, 255, 0.15);
  color: #e8e8e8;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-reset:hover {
  background: rgba(255, 255, 255, 0.25);
}

.result-area {
  min-height: 2.5rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.result-area.win {
  color: #4ade80;
}

.result-area.lose {
  color: #f87171;
}

.digit-picker {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.digit-picker[hidden] {
  display: none;
}

.digit-picker-content {
  background: #1a1a2e;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.digit-picker-content h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.digit-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.digit-picker-content button {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.digit-picker-content button:hover {
  background: rgba(233, 69, 96, 0.3);
  border-color: #e94560;
}
