/**
 * 지뢰찾기 전용 스타일 (minesweeper.css)
 */

.minesweeper-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
}

/* 상단 레트로 계기판 */
.minesweeper-panel {
  background: #c0c0c0;
  border: 3px solid;
  border-color: #808080 #fff #fff #808080;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 520px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}

.digital-counter {
  background: black;
  color: #ef4444;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  padding: 2px 8px;
  border: 2px inset #808080;
  letter-spacing: 2px;
  min-width: 65px;
  text-align: center;
}

.btn-face {
  font-size: 26px;
  width: 44px;
  height: 44px;
  background: #e2e8f0;
  border: 3px solid;
  border-color: #fff #808080 #808080 #fff;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

.btn-face:active {
  border-color: #808080 #fff #fff #808080;
}

/* 모바일 툴바 (파기/깃발 모드 토글) */
.mobile-tool-bar {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 520px;
  margin-bottom: 12px;
}

.mode-toggle-btn {
  flex: 1;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.mode-toggle-btn.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

/* 격자 보드 프레임 */
.minesweeper-board-wrapper {
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  border-radius: var(--radius-md);
  background: #c0c0c0;
  border: 3px solid;
  border-color: #808080 #fff #fff #808080;
}

.minesweeper-board {
  display: grid;
  user-select: none;
  background: #bdbdbd;
}

/* 개별 셀 */
.ms-cell {
  width: clamp(24px, 4.5vw, 32px);
  height: clamp(24px, 4.5vw, 32px);
  display: grid;
  place-items: center;
  font-size: clamp(14px, 2.8vw, 18px);
  font-weight: 800;
  font-family: var(--font-mono);
  background: #c0c0c0;
  border: 3px solid;
  border-color: #fff #7b7b7b #7b7b7b #fff;
  cursor: pointer;
  box-sizing: border-box;
}

.ms-cell:active:not(.opened):not(.flagged) {
  border: 1px solid #7b7b7b;
  border-color: #7b7b7b;
}

/* 열린 셀 */
.ms-cell.opened {
  border: 1px solid #7b7b7b;
  background: #d4d4d8;
  cursor: default;
}

/* 깃발 & 지뢰 */
.ms-cell.flagged {
  color: #dc2626;
}

.ms-cell.mine {
  background: #fee2e2;
}

.ms-cell.mine-exploded {
  background: #ef4444 !important;
  color: white;
}

/* 숫자 색상 (1~8) */
.ms-cell[data-num="1"] { color: #2563eb; }
.ms-cell[data-num="2"] { color: #16a34a; }
.ms-cell[data-num="3"] { color: #dc2626; }
.ms-cell[data-num="4"] { color: #9333ea; }
.ms-cell[data-num="5"] { color: #b45309; }
.ms-cell[data-num="6"] { color: #0d9488; }
.ms-cell[data-num="7"] { color: #1e293b; }
.ms-cell[data-num="8"] { color: #64748b; }
