/* =========================
   calamity timer scoped css
   左サイドバーに影響しにくいように .calamity-app 以下に限定
   ========================= */

.calamity-app {
  background: #ffffff;
  color: #1f2937;
  box-sizing: border-box;
  width: 100%;
  padding: 12px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans JP", sans-serif;
}

.calamity-app *,
.calamity-app *::before,
.calamity-app *::after {
  box-sizing: border-box;
}

.calamity-app__inner {
  max-width: 1120px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.ct-card {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  min-width: 0;
}

.ct-title {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.35;
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}

.ct-display-wrap {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 10px 10px 12px;
  background: #f8fbff;
  margin-bottom: 10px;
}

.ct-phase {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  min-height: 18px;
}

.ct-display {
  text-align: center;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  color: #0f172a;
  white-space: nowrap;
}

.ct-controls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.ct-btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 8px;
  min-height: 42px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.ct-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.ct-btn:active {
  transform: translateY(1px);
}

.ct-btn--start {
  background: #2563eb;
}

.ct-btn--stop {
  background: #dc2626;
}

.ct-btn--custom {
  background: #16a34a;
}

/* start */
.ct-btn--start:hover {
  background: #3b82f6;
}

/* stop */
.ct-btn--stop:hover {
  background: #ef4444;
}

/* custom */
.ct-btn--custom:hover {
  background: #22c55e;
}

.ct-audio-panel {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  margin-bottom: 10px;
}

.ct-audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.ct-audio-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.ct-volume {
  display: grid;
  grid-template-columns: 36px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #475569;
}

.ct-volume input[type="range"] {
  width: 100%;
  accent-color: #2563eb;
}

.ct-status {
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

.ct-subcard {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
}

.ct-subtitle {
  margin: 0 0 8px;
  font-size: 15px;
  text-align: center;
  color: #0f172a;
}

.safe-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
}

.safe-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #e5edf5;
  font-size: 14px;
  color: #334155;
}

.safe-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #93c5fd;
  background: transparent;
  display: inline-block;
}

.safe-item.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #0f172a;
  font-weight: 700;
}

.safe-item.is-active .safe-check {
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

/* スマホでは縦並び */
@media (max-width: 920px) {
  .calamity-app__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .calamity-app {
    padding: 10px;
  }

  .ct-card {
    padding: 10px;
    border-radius: 12px;
  }

  .ct-title {
    font-size: 17px;
    margin-bottom: 8px;
  }

  .ct-display-wrap {
    padding: 8px 8px 10px;
  }

  .ct-display {
    font-size: clamp(32px, 10vw, 46px);
  }

  .ct-controls {
    grid-template-columns: repeat(2, 1fr);
  }

  .ct-audio-panel {
    grid-template-columns: 1fr;
  }

  .ct-volume {
    grid-template-columns: 36px 1fr 42px;
  }
}