/* ========================================
   ハンドレンジチャート CSS
   ======================================== */

.range-chart-wrapper {
  margin: 24px 0;
}

.range-chart-wrapper__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-chart-wrapper__subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Legend */
.range-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: center;
}

.range-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.range-legend__dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.range-legend__dot--raise { background: #ef5350; }
.range-legend__dot--call  { background: #43a047; }
.range-legend__dot--fold  { background: #37474f; }
.range-legend__dot--mixed-raise { background: linear-gradient(135deg, #ef5350 50%, #43a047 50%); }
.range-legend__dot--mixed-fold  { background: linear-gradient(135deg, #ef5350 50%, #546e7a 50%); }

/* Chart Container */
.range-chart {
  display: grid;
  grid-template-columns: 24px repeat(13, 1fr);
  grid-template-rows: 24px repeat(13, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 520px;
  user-select: none;
}

.range-chart__axis-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Cell */
.range-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.45rem, 1.2vw, 0.68rem);
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s, box-shadow 0.1s;
  overflow: hidden;
}

.range-cell:hover {
  transform: scale(1.15);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.range-cell__label {
  pointer-events: none;
  z-index: 1;
  font-size: clamp(0.5rem, 1.1vw, 0.65rem);
  line-height: 1;
  text-align: center;
}

/* Cell types */
.range-cell--raise {
  background: #c62828;
  color: #ffcdd2;
  border: 1px solid #ef5350;
}

.range-cell--call {
  background: #2e7d32;
  color: #c8e6c9;
  border: 1px solid #43a047;
}

.range-cell--fold {
  background: #263238;
  color: #546e7a;
  border: 1px solid #37474f;
}

.range-cell--mixed-raise {
  background: linear-gradient(135deg, #c62828 55%, #2e7d32 45%);
  color: #ffffff;
  border: 1px solid #7b1fa2;
}

.range-cell--mixed-fold {
  background: linear-gradient(135deg, #c62828 55%, #263238 45%);
  color: #ffcdd2;
  border: 1px solid #ef5350;
}

/* Pocket pair cells (diagonal) have bold border */
.range-cell--pair {
  border-width: 2px;
}

.range-cell--pair.range-cell--raise { border-color: #ff5252; }
.range-cell--pair.range-cell--call  { border-color: #69f0ae; }
.range-cell--pair.range-cell--fold  { border-color: #455a64; }

/* Tooltip */
.range-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a2e1a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  white-space: nowrap;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  display: none;
}

.range-cell:hover .range-tooltip { display: block; }

/* Stats bar below chart */
.range-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.range-stat {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.range-stat strong {
  font-weight: 700;
}

.range-stat--raise strong { color: #ef5350; }
.range-stat--call strong  { color: #43a047; }
.range-stat--total strong { color: var(--green-accent); }

/* Compact mode for sidebar */
.range-chart--compact {
  max-width: 300px;
  gap: 1px;
}

.range-chart--compact .range-cell {
  border-radius: 2px;
}

.range-chart--compact .range-cell__label {
  font-size: 0.45rem;
}

/* Range comparison */
.range-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.range-comparison__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
}

.range-comparison__label--cash {
  background: rgba(66,165,245,0.15);
  color: var(--blue);
}

.range-comparison__label--tournament {
  background: rgba(255,193,7,0.15);
  color: var(--yellow);
}

@media (max-width: 640px) {
  .range-chart {
    max-width: 100%;
    gap: 1px;
  }

  .range-chart__axis-label {
    font-size: 0.55rem;
  }

  .range-cell__label {
    font-size: 0.45rem;
  }

  .range-comparison {
    grid-template-columns: 1fr;
  }
}
