/* ============================================================
   Mini-game: game button row in Round page
   ============================================================ */
.mini-game-btn-row {
  display: flex;
  gap: 8px;
  margin-top: -4px;
}

.mini-game-btn-row button {
  flex: 1;
  font-size: 13px;
  padding: 8px 4px;
  background: #2c3350;
  color: #a0aac4;
  border: 1.5px solid #3a4060;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mini-game-btn-row button:hover {
  background: #363d60;
  color: #d0d8f0;
  border-color: #4f5c85;
}

/* ============================================================
   게임 활성 toggle button
   ============================================================ */
.minigame-toggle-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid #3a4060;
  background: #2c3350;
  color: #a0aac4;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.minigame-toggle-btn.active {
  background: #2a4aad;
  color: #e8f0ff;
  border-color: #4f72e8;
}

/* ============================================================
   Mini-game modal overlay
   ============================================================ */
.minigame-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  padding: 12px;
}

.minigame-modal.hidden {
  display: none;
}

.minigame-modal-content {
  background: #1a1d27;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  overflow: visible;  /* allow picker popup to escape */
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  /* clip rounded corners on inner canvas/slots without using overflow:hidden */
  isolation: isolate;
}

/* inner clipping for rounded corners only on the visual background */
.minigame-modal-content::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
}

.minigame-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #2c3350;
  border-radius: 16px 16px 0 0;
  background: #1a1d27;
  z-index: 1;
}

.minigame-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #d0d8f0;
  flex-shrink: 0;
}

/* ── 코스 button (plinko only) ── */
.minigame-course-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #1a2e1a;
  color: #6ec88a;
  border: 1px solid #2a5a3a;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.minigame-course-btn:hover {
  background: #244830;
  color: #90e0a8;
}

/* ── 시작 button ── */
.minigame-start-btn {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  background: #2a4aad;
  color: #e8f0ff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.minigame-start-btn:hover:not(:disabled) {
  background: #3358c8;
}

.minigame-start-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* spacer between title+start and close btn */
.minigame-header-spacer {
  flex: 1;
}

.minigame-close-btn {
  background: transparent;
  border: none;
  color: #a0aac4;
  font-size: 17px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1;
  margin-left: auto;
}

.minigame-close-btn:hover {
  background: #2c3350;
  color: #e0e6f8;
}

/* ============================================================
   사다리타기: top / bottom slot rows
   ============================================================ */

/* lane-number row (above player names) */
.ladder-numbers-row {
  border-bottom: 1px solid #1e2236;
}

.ladder-slot-number {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 2px;
  text-align: center;
  color: #4a5880;
  border-left: 1px solid #1e2236;
  background: #10121e;
  user-select: none;
  pointer-events: none;
}

.ladder-slot-number:first-child {
  border-left: none;
}

.ladder-slots-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #1a1d27;
  padding: 0;
  gap: 0;
  /* slots are built by JS; each slot has equal flex:1 */
}

.ladder-slot-btn {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 2px;
  background: transparent;
  border: none;
  border-left: 1px solid #2c3350;
  color: #a0aac4;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.12s;
}

.ladder-slot-btn:first-child {
  border-left: none;
}

.ladder-slot-btn:hover:not(:disabled) {
  background: #252840;
}

.ladder-slot-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.ladder-slot-top {
  border-bottom: 1px solid #2c3350;
}

.ladder-slot-bottom {
  border-top: 1px solid #2c3350;
  font-size: 10px;
  color: #888;
}

/* ============================================================
   사다리타기: picker popup
   ============================================================ */
.ladder-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: transparent;
}

.ladder-picker-backdrop.hidden {
  display: none;
}

.ladder-picker-popup {
  position: fixed;
  z-index: 4100;
  background: #22253a;
  border: 1.5px solid #4a5070;
  border-radius: 8px;
  overflow-y: auto;
  max-height: 192px;
  min-width: 120px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.ladder-picker-popup.hidden {
  display: none;
}

.ladder-picker-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #2c3350;
  color: #c0c8e0;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.ladder-picker-item:last-child {
  border-bottom: none;
}

.ladder-picker-item:hover {
  background: #2a2d42;
  color: #e0e8ff;
}

.ladder-picker-item.active {
  background: #1e3170;
  color: #aac4ff;
  font-weight: 700;
}

/* ============================================================
   Canvas
   ============================================================ */
.minigame-canvas {
  display: block;
  width: 100%;
}

/* ============================================================
   Result panel
   ============================================================ */
.minigame-result-panel {
  padding: 10px 16px 0;
  font-size: 13px;
  color: #c0c8e0;
  line-height: 1.7;
  border-top: 1px solid #2c3350;
  background: #1a1d27;
}

.minigame-result-panel .result-line {
  padding: 2px 0;
}

.minigame-result-panel .result-court {
  font-weight: 700;
  color: #e0e8ff;
}

.minigame-result-panel .result-wait {
  color: #777;
}

/* ============================================================
   Action buttons
   ============================================================ */
.minigame-actions {
  display: none;
  gap: 8px;
  padding: 10px 14px 14px;
  background: #1a1d27;
  border-radius: 0 0 16px 16px;
}

.minigame-actions button {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: none;
}

.minigame-confirm-btn {
  background: #2a4aad;
  color: #e8f0ff;
}

.minigame-confirm-btn:hover {
  background: #3358c8;
}

.minigame-cancel-btn {
  background: #2c3350;
  color: #a0aac4;
}

.minigame-cancel-btn:hover {
  background: #363d60;
}
