/**
 * Calcudoku / KenKen Stylesheet
 * Arithmetic Cross-Grid, Cage Borders, Keypad, Pencil Notes, and Conflict Highlights
 */

.calcu-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  max-width: 650px;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #030712 100%);
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  overflow-y: auto;
}

/* --- HUD BAR --- */
.calcu-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.calcu-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calcu-tier-badge {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 800;
}

.calcu-puzzle-name {
  font-size: 16px;
  font-weight: 800;
  color: #f1f5f9;
}

/* --- GRID WRAPPER --- */
.calcu-stage-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.calcu-grid-container {
  display: grid;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  background: #0f172a;
  border-radius: 12px;
  border: 3px solid #f59e0b;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.calcu-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, box-shadow 0.15s;
}

/* Thick Cage Boundary Borders */
.calcu-cell.border-top { border-top: 3px solid #f59e0b; }
.calcu-cell.border-bottom { border-bottom: 3px solid #f59e0b; }
.calcu-cell.border-left { border-left: 3px solid #f59e0b; }
.calcu-cell.border-right { border-right: 3px solid #f59e0b; }

.calcu-cell.selected {
  background: rgba(56, 189, 248, 0.25) !important;
  box-shadow: inset 0 0 0 2px #38bdf8;
}

.calcu-cell.conflict {
  background: rgba(239, 68, 68, 0.35) !important;
}

.calcu-cell.cage-done {
  background: rgba(16, 185, 129, 0.15);
}

.calcu-cage-label {
  position: absolute;
  top: 3px;
  left: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  line-height: 1;
}

.calcu-cell-val {
  font-size: 28px;
  font-weight: 900;
  color: #f8fafc;
}

.calcu-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 14px 4px 4px 4px;
  box-sizing: border-box;
}

.calcu-note-num {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
}

/* --- KEYPAD & CONTROLS --- */
.calcu-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.calcu-keypad {
  display: flex;
  gap: 8px;
}

.calcu-num-btn {
  width: 48px;
  height: 48px;
  font-size: 20px;
  font-weight: 800;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1e293b;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.15s;
}

.calcu-num-btn:hover {
  background: #334155;
  transform: translateY(-2px);
  border-color: #f59e0b;
}

.calcu-ctrl-btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1e293b;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}

.calcu-ctrl-btn.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #0f172a;
  border-color: #38bdf8;
}

.calcu-lvl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.calcu-lvl-btn:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.lvl-size-badge {
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
}

.lvl-title {
  font-size: 12px;
  font-weight: 700;
  margin: 2px 0;
}

.lvl-tier {
  font-size: 10px;
  color: #94a3b8;
}
