/* Kiwi Game — 17×10 grid */

.kiwi-game-wrap {
  margin: 0 auto 2rem;
  max-width: 100%;
}

.game-hud {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.hud-label {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

#score,
#timer {
  min-width: 2.5rem;
  text-align: center;
  color: var(--color-accent-hover);
}

#timer.timer-ended {
  color: #ff6b6b;
  font-size: 0.9375rem;
}

.board {
  display: grid;
  grid-template-columns: repeat(17, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  aspect-ratio: 17 / 10;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  user-select: none;
  touch-action: none;
  cursor: crosshair;
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: clamp(0.625rem, 1.8vw, 0.9375rem);
  font-weight: 700;
  background: linear-gradient(145deg, #7cb342 0%, #558b2f 100%);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.1s, opacity 0.15s, box-shadow 0.1s;
  position: relative;
}

.cell::before {
  content: "🥝";
  position: absolute;
  font-size: 0.55em;
  opacity: 0.35;
  top: 2px;
  left: 3px;
  pointer-events: none;
}

.cell.selected {
  outline: 2px solid #dcedc8;
  outline-offset: -1px;
  box-shadow: 0 0 0 2px rgba(220, 237, 200, 0.5), inset 0 0 12px rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
  z-index: 1;
}

.cell.cleared {
  background: transparent;
  box-shadow: none;
  opacity: 0.25;
  pointer-events: none;
}

.cell.cleared::before {
  display: none;
}

.game-hint {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.result-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.result-screen.visible {
  display: flex;
}

.result-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow);
}

.result-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.result-card p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.result-card .final-score {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-accent-hover);
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .game-hud {
    gap: 0.75rem;
    font-size: 1rem;
  }

  .hud-item {
    padding: 0.4rem 0.75rem;
  }

  .board {
    gap: 2px;
    padding: 4px;
  }

  .cell {
    border-radius: 4px;
  }
}
