.cc-game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  max-width: 560px;
  margin: 0 auto;
}
.cc-game-hud-top { padding-top: 14px; }
.cc-hud-item { display: flex; flex-direction: column; gap: 2px; }
.cc-hud-item-right { align-items: flex-end; }
.cc-hud-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--cc-text-dim);
}
.cc-hud-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--cc-text);
}
.cc-quit-btn {
  width: 34px;
  height: 34px;
  font-size: 14px;
  flex: 0 0 auto;
}

/* Color legend — spells out the YOU/AI color mapping explicitly so a
   brand-new player never has to infer it from context. Dot colors are
   hardcoded to match PLAYER_ACCENT/ENEMY_ACCENT + rings in js/config.js. */
.cc-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.cc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cc-text-dim);
}
.cc-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.cc-legend-dot-you {
  background: #F2F7FF;
  box-shadow: inset 0 0 0 2px #3DA8F5;
}
.cc-legend-dot-ai {
  background: #9A1030;
  box-shadow: inset 0 0 0 2px #FF5C7A;
}

.cc-board-wrap {
  position: relative;
  max-width: 560px;
  margin: 6px auto 14px;
  padding: 14px;
  border-radius: var(--cc-radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--cc-panel-border);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.cc-board-wrap.cc-shake { animation: cc-shake 0.32s ease; }
.cc-fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 7;
  width: 32px;
  height: 32px;
  font-size: 14px;
  background: rgba(8, 11, 18, 0.55);
}
@keyframes cc-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.cc-board {
  --cc-size: 6;
  display: grid;
  grid-template-columns: repeat(var(--cc-size), 1fr);
  gap: clamp(3px, 1vw, 6px);
  aspect-ratio: 1 / 1;
  width: 100%;
}
.cc-cell {
  position: relative;
  border-radius: 20%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.cc-cell-swatch {
  position: absolute;
  inset: 0;
  background: var(--cc-color, #222);
  transition: background-color 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 -6px 10px rgba(0, 0, 0, 0.18);
}
.cc-cell[data-owner="1"] .cc-cell-swatch,
.cc-cell[data-owner="2"] .cc-cell-swatch {
  /* Ownership ring (--cc-ring, set in render.js) is a second cue independent
     of fill color, so ownership reads clearly even at a glance. */
  box-shadow: inset 0 0 0 2px var(--cc-ring, rgba(255, 255, 255, 0.22)), 0 0 12px -1px var(--cc-color);
}
.cc-cell[data-owner="0"] .cc-cell-swatch { opacity: 0.72; }

.cc-cell.cc-cell-pop .cc-cell-swatch {
  animation: cc-cell-pop 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cc-cell-pop {
  0% { transform: scale(0.72); filter: brightness(1.9); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); filter: brightness(1); }
}

.cc-particle-canvas {
  position: absolute;
  inset: 14px;
  pointer-events: none;
  z-index: 5;
}

.cc-combo-banner,
.cc-perfect-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  pointer-events: none;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  z-index: 6;
  white-space: nowrap;
}
.cc-combo-banner {
  font-size: clamp(22px, 6vw, 34px);
  color: #FFD23D;
  text-shadow: 0 0 24px rgba(255, 210, 61, 0.6);
}
.cc-perfect-banner {
  font-size: clamp(16px, 4.5vw, 24px);
  color: #7CFFD1;
  text-shadow: 0 0 24px rgba(49, 230, 166, 0.65);
  top: 38%;
}
.cc-combo-pop { animation: cc-banner-pop 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.cc-perfect-pop { animation: cc-banner-pop 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes cc-banner-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  30% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}

.cc-color-picker {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
  padding: 6px 4px 10px;
}
.cc-color-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cc-panel-border);
  min-width: 76px;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
}
.cc-color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--cc-color);
  box-shadow: 0 0 10px -1px var(--cc-glow, var(--cc-color));
}
.cc-color-gain {
  font-weight: 800;
  font-size: 15px;
  color: var(--cc-text);
  font-variant-numeric: tabular-nums;
}
.cc-color-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -8px var(--cc-glow, var(--cc-color));
}
.cc-color-btn:active:not(:disabled) { transform: translateY(0) scale(0.96); }
.cc-color-btn:disabled { opacity: 0.45; }
.cc-no-moves { color: var(--cc-text-dim); font-size: 14px; padding: 12px; }

@media (max-width: 380px) {
  .cc-color-btn { padding: 10px 12px; min-width: 62px; }
  .cc-legend { gap: 7px; }
  .cc-legend-item { font-size: 9px; gap: 3px; }
  .cc-legend-dot { width: 9px; height: 9px; }
}
