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

html, body {
  height: 100vh;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #1a1a2e;
  color: #eee;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

h1 {
  font-size: 1.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #e94560;
}

h2 {
  font-size: 1.2rem;
  color: #ccc;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 4px;
}

.btn {
  background: #16213e;
  color: #eee;
  border: 1px solid #0f3460;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn:hover:not(:disabled) {
  background: #0f3460;
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn.primary {
  background: #e94560;
  border-color: #e94560;
}

.btn.primary:hover:not(:disabled) {
  background: #c73650;
}

.btn.small {
  padding: 5px 14px;
  font-size: 0.75rem;
  background: #16213e;
  border-color: #0f3460;
}

.btn.small:hover:not(:disabled) {
  background: #0f3460;
}

.difficulty-select {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.diff-btn {
  padding: 6px 16px;
  font-size: 0.8rem;
  background: #16213e;
  border: 1px solid #0f3460;
  color: #eee;
  border-radius: 6px;
  cursor: pointer;
}

.diff-btn.active {
  background: #e94560;
  border-color: #e94560;
}

.diff-btn:hover:not(.active) {
  background: #0f3460;
}

.menu-buttons {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.stats-bar {
  display: flex;
  gap: 20px;
  font-size: 0.75rem;
  color: #666;
  margin-top: 4px;
}

.stat-diff.easy {
  color: #2d7ff6;
}

.stat-diff.hard {
  color: #9b59b6;
}

.stat-total {
  color: #eee;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

#game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

#game-header span {
  font-size: 0.85rem;
  color: #888;
}

.header-buttons {
  display: flex;
  gap: 6px;
}

#ring-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px 0;
}

#wheel {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  box-shadow: 0 0 0 3px #1a1a2e, 0 4px 20px rgba(0, 0, 0, 0.3);
}

#wheel.disabled {
  cursor: not-allowed;
}

#message {
  height: 24px;
  font-size: 0.85rem;
  text-align: center;
  color: #aaa;
}

#grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.grid-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.grid-row.current-row {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  padding: 4px 6px;
}

.grid-label {
  width: 20px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: bold;
  color: #555;
  flex-shrink: 0;
  padding-top: 8px;
}

.grid-row.current-row .grid-label {
  color: #e94560;
  font-size: 1rem;
}

.grid-cell-row {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.grid-cell {
  width: 46px;
  height: 30px;
  border-radius: 5px;
  background: #2a2a3e;
  flex-shrink: 0;
  position: relative;
}

.grid-cell.green {
  background: #2ecc71;
}

.grid-cell.yellow {
  background: #f39c12;
}

.grid-cell.red {
  background: #c0392b;
}

.cell-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 0 0 1px #000;
}

.attempt-indicator {
  font-size: 0.75rem;
  color: #888;
  display: block;
  margin-top: 2px;
}

#date-list {
  width: 100%;
  max-width: 500px;
  max-height: 350px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#history {
  width: 100%;
  max-width: 500px;
}

.date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #16213e;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.date-row:hover {
  border-color: #0f3460;
}

.date-row .date-label {
  font-size: 0.85rem;
}

.date-row .date-stats {
  font-size: 0.75rem;
  color: #888;
}

#share-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.share-text {
  font-size: 1.1rem;
  letter-spacing: 2px;
  line-height: 1.6;
  text-align: center;
  padding: 8px 12px;
  background: #16213e;
  border-radius: 8px;
  color: #eee;
  white-space: pre;
}
