/* =========================
   Base (scoped for sidebar safety)
========================= */
.dq10calamity-app {
  --dq-bg: #f5f7fb;
  --dq-card: rgba(255, 255, 255, 0.92);
  --dq-border: rgba(14, 30, 62, 0.08);
  --dq-text: #122033;
  --dq-sub: #5f6f86;
  --dq-blue: #2f6df6;
  --dq-blue-dark: #2257ca;
  --dq-red: #ef4b4b;
  --dq-red-dark: #c43737;
  --dq-green: #15a36f;
  --dq-shadow: 0 20px 40px rgba(17, 31, 57, 0.08);
  --dq-shadow-soft: 0 10px 24px rgba(17, 31, 57, 0.06);
  --dq-radius-xl: 22px;
  --dq-radius-lg: 16px;
  --dq-radius-md: 12px;
  --dq-check-off: #d6deea;
  --dq-check-on: #2f6df6;
  --dq-check-glow: rgba(47, 109, 246, 0.18);

  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47,109,246,0.10), transparent 26%),
    radial-gradient(circle at bottom right, rgba(21,163,111,0.08), transparent 24%),
    var(--dq-bg);
  color: var(--dq-text);
  box-sizing: border-box;
  padding: 20px;
  font-family:
    "Inter",
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
}

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

.dq10calamity-shell {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.dq10calamity-header {
  margin-bottom: 16px;
}

.dq10calamity-header h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.dq10calamity-header p {
  margin: 0;
  color: var(--dq-sub);
  font-size: 14px;
}

/* =========================
   Grid
========================= */
.dq10calamity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.dq10calamity-card {
  background: var(--dq-card);
  border: 1px solid var(--dq-border);
  border-radius: var(--dq-radius-xl);
  box-shadow: var(--dq-shadow);
  padding: 18px;
  backdrop-filter: blur(12px);
}

.dq10calamity-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dq10calamity-card-head h2 {
  margin: 0 0 4px;
  font-size: 21px;
  line-height: 1.3;
}

.dq10calamity-sub {
  margin: 0;
  color: var(--dq-sub);
  font-size: 13px;
}

.dq10calamity-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(47, 109, 246, 0.08);
  color: var(--dq-blue-dark);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

/* =========================
   Timer Display
========================= */
.dq10calamity-display-wrap {
  margin-bottom: 14px;
}

.dq10calamity-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 108px;
  border-radius: 18px;
  border: 1px solid rgba(17, 31, 57, 0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(243,246,252,0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), var(--dq-shadow-soft);
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* =========================
   Buttons
========================= */
.dq10calamity-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 14px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--dq-shadow-soft);
}

.dq10calamity-btn {
  appearance: none;
  border: none;
  min-height: 48px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
  color: #fff;
}

.dq10calamity-btn:hover {
  filter: brightness(1.04);
}

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

.dq10calamity-btn-start {
  background: linear-gradient(180deg, #3e7cff, #2f6df6);
}

.dq10calamity-btn-stop {
  background: linear-gradient(180deg, #ff6262, #ef4b4b);
}

/* =========================
   Audio Controls
========================= */
.dq10calamity-audio-panel {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(244, 247, 252, 0.92);
  border: 1px solid rgba(17, 31, 57, 0.06);
  margin-bottom: 16px;
}

.dq10calamity-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}

.dq10calamity-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--dq-blue);
}

.dq10calamity-volume {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.dq10calamity-volume span,
.dq10calamity-volume strong {
  font-size: 14px;
}

.dq10calamity-volume input[type="range"] {
  width: 100%;
  accent-color: var(--dq-blue);
}

/* =========================
   Safe Blocks
========================= */
.dq10calamity-safe-block,
.dq10calamity-grand-safe-wrap {
  margin-top: 4px;
}

.dq10calamity-safe-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--dq-sub);
  letter-spacing: 0.03em;
}

.dq10calamity-safe-list {
  list-style: none;
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(17, 31, 57, 0.07);
  box-shadow: var(--dq-shadow-soft);
}

.dq10calamity-safe-list li {
  display: grid;
  grid-template-columns: 24px 26px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border-radius: 10px;
  padding: 4px 6px;
  transition: background 0.18s ease, transform 0.18s ease;
}

.dq10calamity-safe-list li + li {
  margin-top: 4px;
}

.dq10calamity-safe-list li.is-active {
  background: rgba(47, 109, 246, 0.06);
}

.dq10calamity-check {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--dq-check-off);
  box-shadow: inset 0 0 0 1px rgba(17, 31, 57, 0.08);
  position: relative;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dq10calamity-safe-list li.is-active .dq10calamity-check {
  background: var(--dq-check-on);
  box-shadow:
    0 0 0 6px var(--dq-check-glow),
    inset 0 0 0 1px rgba(255,255,255,0.15);
  transform: scale(1.02);
}

.dq10calamity-safe-list li.is-active .dq10calamity-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.dq10calamity-safe-num {
  font-weight: 800;
  color: var(--dq-blue-dark);
  font-variant-numeric: tabular-nums;
}

.dq10calamity-safe-text {
  font-size: 14px;
  line-height: 1.35;
}

.dq10calamity-safe-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(17, 31, 57, 0.08);
  background: rgba(255,255,255,0.85);
  box-shadow: var(--dq-shadow-soft);
}

.dq10calamity-safe-box {
  padding: 12px;
}

.dq10calamity-safe-box + .dq10calamity-safe-box {
  border-left: 1px solid rgba(17, 31, 57, 0.08);
}

/* =========================
   Responsive
========================= */
@media (max-width: 980px) {
  .dq10calamity-shell {
    width: 100%;
  }

  .dq10calamity-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .dq10calamity-grid > .dq10calamity-card {
    flex: 1 1 0;
    min-width: 0;
  }

  .dq10calamity-card {
    padding: 14px;
    border-radius: 16px;
  }

  .dq10calamity-card-head h2 {
    font-size: 17px;
  }

  .dq10calamity-sub {
    font-size: 12px;
  }

  .dq10calamity-badge {
    min-height: 28px;
    font-size: 11px;
    padding: 0 8px;
  }

  .dq10calamity-display {
    min-height: 80px;
    font-size: clamp(30px, 6vw, 44px);
  }

  .dq10calamity-btn {
    min-height: 42px;
    font-size: 13px;
  }

  .dq10calamity-safe-title {
    font-size: 12px;
  }

  .dq10calamity-safe-list {
    padding: 8px;
  }

  .dq10calamity-safe-list li {
    grid-template-columns: 18px 20px 1fr;
    gap: 6px;
    min-height: 32px;
    padding: 3px 4px;
  }

  .dq10calamity-safe-num {
    font-size: 12px;
  }

  .dq10calamity-safe-text {
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .dq10calamity-app {
    padding: 12px;
    overflow-x: hidden;
  }

  .dq10calamity-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dq10calamity-card {
    padding: 10px;
    border-radius: 14px;
  }

  .dq10calamity-card-head {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 8px;
  }

  .dq10calamity-card-head h2 {
    font-size: 15px;
  }

  .dq10calamity-badge {
    width: fit-content;
  }

  .dq10calamity-display {
    min-height: 70px;
    font-size: clamp(24px, 8vw, 34px);
  }

  .dq10calamity-audio-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 10px;
  }

  .dq10calamity-toggle {
    font-size: 12px;
  }

  .dq10calamity-volume span,
  .dq10calamity-volume strong {
    font-size: 12px;
  }

  .dq10calamity-safe-duo {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .dq10calamity-safe-box + .dq10calamity-safe-box {
    border-left: 1px solid rgba(17, 31, 57, 0.08);
    border-top: none;
  }

  .dq10calamity-safe-list li {
    min-height: 28px;
  }
}
