/* ===========================================
   Board Styles - Board, Cells, Layers
   Farm Theme
   =========================================== */

/* Board Container */
.board-container {
  position: relative;
  width: calc(var(--cell-size) * 7 + var(--board-gap) * 6);
  height: calc(var(--cell-size) * 7 + var(--board-gap) * 6);
  box-sizing: border-box;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(93, 64, 55, 0.3), inset 0 0 20px rgba(139, 195, 74, 0.1);
  background: linear-gradient(135deg, var(--farm-green-pale) 0%, var(--farm-green-bg) 100%);
}

/* Loneliness Count Overlay */
.loneliness-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.loneliness-count {
  font-size: 20rem;
  font-weight: bold;
  color: rgba(121, 85, 72, 0.5);
  line-height: 1;
  user-select: none;
  mix-blend-mode: multiply;
}

/* Board Layer Common */
.board-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, var(--cell-size));
  grid-template-rows: repeat(7, var(--cell-size));
  gap: var(--board-gap);
}

/* Background Layer */
.board-bg {
  z-index: 1;
}

/* Object Layer */
.board-objects {
  z-index: 2;
  pointer-events: none;
}

/* Character Layer */
.board-characters {
  z-index: 3;
  pointer-events: none;
}

/* Cell Common - Light pastel grass */
.cell {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--emoji-size);
  background: linear-gradient(145deg, #FFFFFF 0%, #F1F8E9 50%, #DCEDC8 100%);
  border: 2px solid var(--farm-green-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cell:hover {
  background: linear-gradient(145deg, #FFFFFF 0%, #E8F5E9 50%, #C8E6C9 100%);
  transform: scale(1.03);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6), 0 3px 6px rgba(0, 0, 0, 0.12);
}

/* Safe Area (9 cells around rabbit) - Lighter grass */
.cell.safe-area {
  background: linear-gradient(145deg, #DCEDC8 0%, #C5E1A5 50%, #AED581 100%);
  border-color: var(--farm-green-light);
}

/* Impassable Cell (rabbit position and holes) - Light gray base */
.cell.impassable {
  background: linear-gradient(145deg, #F5F5F5 0%, #EEEEEE 50%, #E0E0E0 100%);
  border-color: #BDBDBD;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: default;
}

.cell.impassable:hover {
  background: linear-gradient(145deg, #F5F5F5 0%, #EEEEEE 50%, #E0E0E0 100%);
  transform: none;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Rabbit Cell Hover - Golden wheat highlight like movable cells */
.cell.rabbit-cell:hover {
  background: linear-gradient(145deg, var(--farm-wheat) 0%, #FFE082 50%, #FFD54F 100%) !important;
  border-color: var(--farm-orange) !important;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
  cursor: pointer;
}

/* Impassable cell in safe area - Light gray base */
.cell.safe-area.impassable {
  background: linear-gradient(145deg, #F5F5F5 0%, #EEEEEE 50%, #E0E0E0 100%);
  border-color: #BDBDBD;
}

/* Movable Cell (on hover) - Golden wheat highlight */
.cell.movable-hover {
  background: linear-gradient(145deg, var(--farm-wheat) 0%, #FFE082 50%, #FFD54F 100%) !important;
  border-color: var(--farm-orange) !important;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

/* Lovesick Danger Area (cells outside safe area during lovesick status) */
.cell.lovesick-danger {
  background: linear-gradient(145deg, #FFEBEE 0%, #FFCDD2 50%, #EF9A9A 100%);
  border-color: #E57373;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 1px 2px rgba(198, 40, 40, 0.15);
}

.cell.lovesick-danger:hover {
  background: linear-gradient(145deg, #FFCDD2 0%, #EF9A9A 50%, #E57373 100%);
  border-color: #EF5350;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 3px 6px rgba(198, 40, 40, 0.25);
}

/* Object/Character Cell (transparent background) */
.cell-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--emoji-size);
  background-color: transparent;
  user-select: none;
  position: relative;
}

/* キャラクター重ね表示（ウサギと飼い主が同じマス） */
.char-rabbit,
.char-player {
  position: absolute;
  top: 50%;
  left: 50%;
  line-height: 1;
}

.char-rabbit {
  z-index: 1;
  transform: translate(-50%, -50%);
}

.char-player {
  z-index: 2;
  transform: translate(-70%, -70%);
  font-size: 0.8em;
}

/* Cure Target Blink (施設またはウサギのマスを黄色点滅) */
.cell.cure-target-blink {
  animation: cureBlink 0.8s ease-in-out infinite;
  background: linear-gradient(145deg, #FFF9C4 0%, #FFEE58 50%, #FDD835 100%) !important;
  border-color: #FBC02D !important;
}
