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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 480px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

header {
  text-align: center;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #4ecca3, #7b68ee, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 0.85rem;
  color: #666;
  margin-top: 4px;
  letter-spacing: 3px;
  text-transform: lowercase;
}

/* Mode tabs */
#modes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-btn {
  background: #16213e;
  border: 1px solid #2a2a4a;
  color: #aaa;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  border-color: #7b68ee;
  color: #e0e0e0;
}

.mode-btn.active {
  background: linear-gradient(135deg, #4ecca3, #3db89a);
  border-color: #4ecca3;
  color: #fff;
  font-weight: 600;
}

/* Slots */
#slots-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slot {
  background: linear-gradient(135deg, #16213e 0%, #1a1a3e 100%);
  border: 2px solid #2a2a4a;
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  min-height: 68px;
  position: relative;
  overflow: hidden;
}

.slot::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(78, 204, 163, 0.03), transparent);
  transition: left 0.5s ease;
}

.slot:hover {
  border-color: #3a3a5a;
  transform: translateX(2px);
}

.slot:hover::before {
  left: 100%;
}

.slot.locked {
  border-color: #7b68ee;
  background: linear-gradient(135deg, #1a1535 0%, #201540 100%);
  box-shadow: 0 0 20px rgba(123, 104, 238, 0.15), inset 0 0 20px rgba(123, 104, 238, 0.05);
}

.slot.locked .lock-icon {
  color: #7b68ee;
  text-shadow: 0 0 8px rgba(123, 104, 238, 0.5);
}

.slot.spinning {
  border-color: #a78bfa;
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.2);
}

.slot.spinning .slot-value {
  animation: none;
}

.slot-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.slot-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #666;
}

.slot-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s ease;
}

.slot.landed .slot-value {
  animation: landPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slot-empty .slot-value {
  color: #444;
  font-style: italic;
  font-weight: 400;
}

.lock-icon {
  font-size: 1.2rem;
  color: #444;
  margin-left: 12px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

/* Controls */
#controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.primary-btn, .secondary-btn, .ghost-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.primary-btn {
  background: linear-gradient(135deg, #4ecca3, #3db89a);
  color: #fff;
  box-shadow: 0 4px 15px rgba(78, 204, 163, 0.3);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #45b894, #35a88a);
  box-shadow: 0 4px 20px rgba(78, 204, 163, 0.4);
}

.primary-btn:active {
  transform: scale(0.97);
}

.secondary-btn {
  background: transparent;
  border: 2px solid #7b68ee;
  color: #7b68ee;
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(123, 104, 238, 0.1);
}

.secondary-btn:disabled {
  border-color: #333;
  color: #444;
  cursor: not-allowed;
}

.ghost-btn {
  background: transparent;
  color: #666;
  border: 1px solid #2a2a4a;
}

.ghost-btn:hover {
  color: #aaa;
  border-color: #444;
}

#state-label {
  font-size: 0.8rem;
  color: #555;
  text-align: center;
  min-height: 20px;
}

/* Animations */
@keyframes landPop {
  0% {
    transform: scale(1.15);
    opacity: 0.7;
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

.slot {
  animation: fadeIn 0.3s ease;
}

.slot.landed {
  border-color: #4ecca3;
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
  box-shadow: 0 0 12px rgba(78, 204, 163, 0.2);
}

.slot.landed .slot-label {
  color: #4ecca3;
}

/* committed state */
.slot.committed {
  border-color: #a78bfa;
  background: linear-gradient(135deg, #1a1535 0%, #201540 100%);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.12), inset 0 0 20px rgba(167, 139, 250, 0.03);
}

.slot.committed .lock-icon {
  color: #a78bfa;
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}

.slot.committed .slot-label {
  color: #a78bfa;
}

#slots-container.committed .slot {
  cursor: default;
}

/* Hide lock icon before first spin */
.slot-empty .lock-icon {
  visibility: hidden;
}

/* Responsive */
@media (max-width: 360px) {
  .slot-value {
    font-size: 1rem;
  }
  .mode-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}
