:root {
  color-scheme: light;
  --bg-top: #fff4dc;
  --bg-bottom: #f3b46c;
  --panel: rgba(38, 19, 22, 0.9);
  --panel-soft: rgba(255, 248, 235, 0.86);
  --text: #fff9ef;
  --text-dark: #2f1718;
  --muted: #6f5655;
  --accent: #ffd166;
  --danger: #d62828;
  --danger-dark: #911b1b;
  --shadow: 0 20px 50px rgba(51, 23, 20, 0.25);
  --focus: 0 0 0 4px rgba(255, 209, 102, 0.35);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text-dark);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%) 0 0 / 22px 22px,
    linear-gradient(315deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%) 0 0 / 22px 22px;
  opacity: 0.5;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 10px 10px 16px;
}

.hero-card {
  width: min(100%, 560px);
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(50, 21, 22, 0.96), rgba(27, 13, 15, 0.96));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -80px auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.22), transparent 65%);
  transform: rotate(12deg);
}

.hero-top {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}

.bomb-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffcb77, #e58f3d);
  box-shadow: inset 0 -8px 18px rgba(108, 43, 17, 0.18);
}

.bomb-mark svg {
  width: 40px;
  height: 40px;
  fill: #301416;
  stroke: #301416;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bomb-mark .spark {
  fill: #ffd166;
  stroke: none;
}

h1,
h2,
legend {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  line-height: 1;
}

.status-card,
.panel {
  margin-top: 12px;
  background: rgba(255, 248, 235, 0.86);
  color: var(--text-dark);
  border-radius: 18px;
  padding: 12px;
}

.status-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.status-text {
  margin: 6px 0 0;
  font-size: clamp(1.2rem, 5vw, 1.55rem);
  font-weight: 700;
}

.error-text {
  margin: 10px 0 0;
  color: var(--danger-dark);
  font-weight: 700;
}

.countdown {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 209, 102, 0.14);
  text-align: center;
  font-size: clamp(1.2rem, 7vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.settings-grid {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 2px solid rgba(48, 23, 24, 0.12);
  padding: 8px 10px;
  font: inherit;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.85);
}

.toggles {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.toggle {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  font-weight: 700;
}

.toggle input {
  width: 24px;
  height: 24px;
  margin: 0;
}

.actions,
.test-actions {
  display: grid;
  gap: 12px;
}

.actions {
  margin-top: 12px;
}

.button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-start {
  color: #231414;
  background: linear-gradient(180deg, #ffd166, #ffb347);
  box-shadow: 0 12px 22px rgba(255, 179, 71, 0.28);
}

.button-explosion {
  color: #fff6f2;
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  box-shadow: 0 12px 24px rgba(185, 28, 28, 0.28);
}

.button-stop {
  color: #fff9ef;
  background: linear-gradient(180deg, #475569, #27303d);
}

.button-secondary {
  color: var(--text-dark);
  background: linear-gradient(180deg, #fff1d3, #f5d193);
}

.tests h2 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.install-help {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(48, 23, 24, 0.12);
}

.install-help p {
  margin: 8px 0 0;
  line-height: 1.35;
  font-size: 0.95rem;
}

input:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

@media (min-width: 720px) {
  .test-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
