/* style.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  /* 高级舒适调色板: 更具活力但不炫目的半透或实色 */
  --color-0: #FFE1E8; /* Soft Rose Pink */
  --color-1: #D6EAF8; /* Baby Blue */
  --color-2: #D1F2EB; /* Mint Green */
  --color-3: #FFF3B0; /* Butter Yellow */
  --color-4: #E8DAEF; /* Lavender */
  --color-5: #FDEBD0; /* Warm Peach */
}

body {
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: #F4F7FC; /* App-like subtle grayish blue base */
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(214, 234, 248, 0.5), transparent 60%),
    radial-gradient(circle at 90% 80%, rgba(255, 225, 232, 0.4), transparent 60%);
  background-attachment: fixed;
}

/* Glass board */
.glass-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 3px;
  background: white;
}

/* Cells */
.cell {
  position: relative;
  border-radius: 6px; /* slightly smaller radius for more play area */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.15s ease;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.7), 0 1px 2px rgba(0,0,0,0.06);
  border: 1px solid rgba(255,255,255,0.5);
}

.cell:hover {
  transform: scale(0.96);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.9), 0 3px 6px rgba(0,0,0,0.06);
  filter: brightness(0.97);
  z-index: 5;
}

.cell:active {
  transform: scale(0.91);
}

/* Base region solid pastel colors */
.cell[data-region="0"] { background-color: var(--color-0); }
.cell[data-region="1"] { background-color: var(--color-1); }
.cell[data-region="2"] { background-color: var(--color-2); }
.cell[data-region="3"] { background-color: var(--color-3); }
.cell[data-region="4"] { background-color: var(--color-4); }
.cell[data-region="5"] { background-color: var(--color-5); }

/* Auto Cross (White) */
.cell[data-state="cross"]::after {
  content: 'x';
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: min(4rem, 12vw);
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  animation: popScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

/* Manual Cross (Red) */
.cell[data-state="cross-red"]::after {
  content: 'x';
  color: #F43F5E;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: min(4rem, 12vw);
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(244, 63, 94, 0.25));
  animation: popScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

/* Character Placement */
.cell[data-state="char"] {
  background-color: rgba(255,255,255,0.7) !important;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.8), 0 2px 6px rgba(0,0,0,0.12) !important;
}

.cell[data-state="char"] img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18));
  animation: popInBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

/* Animations */
@keyframes popInBounce {
  0% { transform: scale(0.1) translateY(15px); opacity: 0; }
  50% { transform: scale(1.15) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes popScale {
  0% { transform: scale(0.2) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Mode Switcher Buttons */
.mode-btn {
  background: transparent;
  color: #64748B;
  border: 1px solid transparent;
}
.mode-btn.active {
  background: white;
  color: #3b82f6;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(0,0,0,0.03);
}
