/* ============================================================
   GAMES.CSS — игры и перерыв (кубик)
   ============================================================ */

/* ---------- сетка игр ---------- */
.gm-grid {
  display:grid; gap:10px;
  grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
}
.gm-card {
  display:flex; flex-direction:column; align-items:center; gap:6px;
  padding:14px 10px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  text-align:center;
  text-decoration:none;
  color:var(--text);
  cursor:default;
}
.gm-card .gm-emoji { font-size:30px; }
.gm-card b { font-size:13px; }
.gm-tag {
  font-size:10px; color:var(--muted);
  padding:2px 8px; border-radius:999px;
  background:var(--surface2);
}
.gm-stats { font-size:10px; color:var(--muted); }
.gm-card.pickable { cursor:pointer; transition:transform .15s; }
.gm-card.pickable:hover { transform:translateY(-2px); }
.gm-card.pickable.active {
  border-color:var(--accent);
  background:var(--accent-soft);
}
.gm-card.soon { opacity:.55; }

/* ============================================================
   ПЕРЕРЫВ — КУБИК ФОРТУНЫ
   ============================================================ */

/* раскладка: кубик слева, кнопки и история справа */
.break-body {
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
}
.break-side { flex:1; min-width:180px; }

/* кубик */
.dice-container {
  width:96px; height:96px; flex:none;
  perspective:400px;
}
.dice {
  width:100%; height:100%;
  background:#fff;
  color:#333;
  font-size:46px; font-weight:700;
  line-height:94px;
  text-align:center;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:0 4px 12px rgba(74,55,40,.15), inset 0 -3px 0 rgba(0,0,0,.06);
  user-select:none;
  transition:transform .5s cubic-bezier(.34,1.56,.64,1);
}
.dice.rolling { animation:dice-shake .4s ease-in-out infinite; }
@keyframes dice-shake {
  0%, 100% { transform:rotate(0) scale(1); }
  25%      { transform:rotate(-10deg) scale(.96); }
  75%      { transform:rotate(10deg) scale(.96); }
}
.dice.win { background:var(--accent-soft); }

/* кнопка броска */
.break-roll { width:auto; }

/* сообщение и история */
.break-msg { margin:6px 0 0; font-size:12px; }
.hist-list {
  margin-top:8px;
  display:flex; flex-wrap:wrap; gap:6px;
}
.hist-item {
  padding:4px 10px;
  background:var(--surface2);
  border-radius:8px;
  font-size:13px; font-weight:700;
}

/* легенда режимов */
.break-legend {
  display:flex; flex-direction:column; gap:4px;
  margin-top:10px; font-size:12px; color:var(--muted);
}
.break-legend b { color:var(--accent); }

/* кнопки действий */
.break-actions {
  display:flex; gap:8px; flex-wrap:wrap;
  margin-top:6px;
}

/* в секции «Перерыв» — покомфортнее */
#p-secBreak .dice-root { padding:4px 2px; }
#p-secBreak .dice-container { width:110px; height:110px; }
#p-secBreak .dice { font-size:52px; line-height:108px; }

@media (max-width:560px) {
  .break-body { flex-direction:column; text-align:center; }
  .break-side { width:100%; }
}
/* ---------- панель задания под таймером ---------- */
.bk-taskbar {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  padding:10px 16px;
  border-left:4px solid var(--accent);
}
.bk-task-label { flex:1; font-size:14px; font-weight:700; }
.bk-task-label.bk-done-text { text-decoration:line-through; opacity:.6; }
.bk-taskbar .bk-done { margin:0; background:transparent; }
.bk-taskbar .bk-done .tname { font-size:13px; }

/* ---------- часы перерыва ---------- */
.bk-clock { color:var(--accent-soft); color:#8a6d3b; }

/* ---------- модалка кубика ---------- */
.bk-modal { max-width:460px; }
.bk-modal-body {
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
  margin:10px 0;
}
.bk-modal-side { flex:1; min-width:160px; }
#bkModalMins { margin-top:4px; font-weight:700; color:var(--accent); }
#bkModalStart:disabled { opacity:.5; cursor:not-allowed; }
/* ---------- всплывающие окна (модалки) ---------- */
.overlay {
  display:none; position:fixed; inset:0;
  background:rgba(74,55,40,.35); z-index:2000;
  align-items:center; justify-content:center;
}
.overlay.open { display:flex; }
.modal {
  background:#fff; border-radius:16px;
  padding:18px; max-width:420px; width:92%;
  box-shadow:0 8px 30px rgba(74,55,40,.25);
  max-height:90vh; overflow:auto;
}
.m-btns { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }

/* распорка в шапке категорий (тоже могла потеряться) */
.flex-sp { flex:1; }
/* кнопка «свернуть» в фулскрине */
.fs-exit { display:none; }
#timerMain:fullscreen .fs-exit,
#tmCandleView:fullscreen .fs-exit,
#tmBreakView:fullscreen .fs-exit {
  display:inline-block; position:absolute; top:12px; right:12px; z-index:10;
}

/* переключатель Таймер/Секундомер */
.tm-submodes { display:flex; gap:4px; }
.tm-submodes .btn { padding:5px 10px; font-size:12px; }
.tm-submodes .btn.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* список будильников */
#alList b { color:var(--accent); }
