:root {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-strong: #1f2330;
  --text: #f5f7fb;
  --muted: #a8b2c1;
  --accent: #6dd2ff;
  --danger: #ff7f7f;
  --success: #7cf29c;
  --card-radius: 16px;
  --transition: 0.25s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--card-radius);
  border: 1px solid #222733;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.logo {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.user-info {
  color: var(--muted);
  font-size: 14px;
}

.main {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--card-radius);
  border: 1px solid #222733;
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 10px;
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-strong);
  border-radius: 12px;
  border: 1px solid #2a3040;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
  transition: transform var(--transition), border-color var(--transition);
}

.cell.current {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(109, 210, 255, 0.25);
  transform: translateY(-2px);
}

.cell .gift {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 16px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.cell .player {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0b0e14;
  box-shadow: 0 4px 14px rgba(109, 210, 255, 0.35);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
  color: var(--muted);
}

.action-panel {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(180deg, transparent, rgba(15, 17, 21, 0.85));
}

.action-card {
  background: var(--surface);
  border-radius: var(--card-radius);
  border: 1px solid #222733;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.primary-btn {
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6dd2ff, #4aa8ff);
  color: #081019;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 12px 32px rgba(77, 171, 255, 0.35);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.secondary-btn {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #2a3040;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.secondary-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.hidden {
  display: none;
}

.modal {
  background: var(--surface);
  border: 1px solid #222733;
  border-radius: 18px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.modal h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 22px;
}

.modal p {
  margin: 0 0 16px;
  color: var(--muted);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(60px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.color-swatch {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}

.color-swatch:hover {
  transform: translateY(-2px);
}

.color-swatch.selected {
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(109, 210, 255, 0.35);
}

.color-swatch .check {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.animation-box {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.animation-card {
  width: min(360px, 90%);
  padding: 24px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid #2a3040;
  text-align: center;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.55);
}

.animation-preview {
  height: 160px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #0b0e14;
  margin-top: 12px;
  border: 1px solid #0b0e14;
}

.bundle-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.bundle-item {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-strong);
  border: 1px solid #2a3040;
  display: flex;
  gap: 10px;
  align-items: center;
}

.bundle-swatch {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.timer {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 700;
}

.small-text {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 600px) {
  .board {
    grid-template-columns: repeat(5, 1fr);
  }
}
