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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 440px;
  width: 100%;
  border: 1px solid #e5e7eb;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
}

twisty-player {
  width: 100%;
  max-width: 320px;
  height: 320px;
}

.status {
  font-size: 14px;
  font-weight: 500;
  color: #666;
  min-height: 20px;
  text-align: center;
}

.status.solving {
  color: #111;
  font-weight: 600;
}

.status.solved {
  color: #111;
  font-weight: 600;
}

.status.error {
  color: #ef4444;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.button-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  width: 44px;
  height: 44px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #d1d5db;
  background: white;
  color: #111;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 6px;
  user-select: none;
}

button:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
  background: #e5e7eb;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.action-buttons {
  margin-top: 4px;
}

.action-buttons button {
  width: 100px;
  height: 40px;
  font-size: 14px;
}

button.primary {
  background: #111;
  color: white;
  border: 1px solid #111;
}

button.primary:hover:not(:disabled) {
  background: #374151;
  border-color: #374151;
}

button.primary:active:not(:disabled) {
  background: #1f2937;
}

.solution {
  width: 100%;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #111;
  text-align: center;
  min-height: 40px;
  display: none;
  word-wrap: break-word;
}

.solution.visible {
  display: block;
}

.solution strong {
  display: block;
  margin-bottom: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #111;
  font-size: 13px;
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
    gap: 14px;
  }

  h1 {
    font-size: 20px;
  }

  twisty-player {
    max-width: 280px;
    height: 280px;
  }

  button {
    width: 40px;
    height: 40px;
    font-size: 13px;
  }

  .action-buttons button {
    width: 90px;
    height: 38px;
  }
}

@media (max-height: 800px) {
  body {
    padding: 12px;
  }
  
  .container {
    padding: 20px;
    gap: 12px;
  }
  
  h1 {
    font-size: 20px;
    margin-bottom: 0;
  }
  
  twisty-player {
    max-width: 280px;
    height: 280px;
  }
  
  button {
    width: 40px;
    height: 40px;
  }
  
  .action-buttons button {
    width: 90px;
    height: 36px;
  }
}