:root {
  --bg: #050505;
  --panel: #030303;
  --panel-edge: rgba(255, 255, 255, 0.06);
  --text-primary: #f5f3ef;
  --text-secondary: rgba(245, 243, 239, 0.76);
  --accent: #ff5b1f;
  --shadow: rgba(0, 0, 0, 0.45);
  --light-core: #ff0000;
  --light-core-bright: #ff3a2f;
  --light-border: rgba(255, 120, 120, 0.4);
  --light-glow: rgba(255, 0, 0, 0.72);
}

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

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

body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 91, 31, 0.08), transparent 24%),
    linear-gradient(180deg, #0a0a0a 0%, var(--bg) 42%, #020202 100%);
  color: var(--text-primary);
  font-family: "Barlow", sans-serif;
}

.app__bottom-line {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  height: 10px;
  background: linear-gradient(180deg, #ff971f 0%, var(--accent) 100%);
  box-shadow: 0 0 18px rgba(255, 91, 31, 0.22);
  pointer-events: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app {
  min-height: 100vh;
  width: 100%;
  border: 0;
  padding: 1.25rem 2rem 2rem;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.app:focus-visible {
  outline: 2px solid rgba(255, 91, 31, 0.85);
  outline-offset: -10px;
}

.app__logo {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(180px, 42vw);
  height: auto;
  pointer-events: none;
}

.app__content {
  width: min(100%, 920px);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1.4rem;
  text-align: center;
}

.light-panel {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.8rem);
}

.light-panel__mast {
  width: 0.42rem;
  height: clamp(8rem, 18vw, 11rem);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff971f 0%, #ff5b1f 100%);
  box-shadow: 0 0 18px rgba(255, 91, 31, 0.35);
}

.light-panel__mast--right {
  order: 3;
}

.light-panel__housing {
  width: 100%;
  padding: clamp(1.35rem, 3vw, 2.15rem) clamp(1.4rem, 4vw, 2.6rem);
  display: flex;
  justify-content: center;
  gap: clamp(0.9rem, 3vw, 2rem);
  border-radius: 0.3rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
    linear-gradient(180deg, #090909 0%, var(--panel) 100%);
  box-shadow:
    inset 0 0 0 1px var(--panel-edge),
    inset 0 -22px 40px rgba(255, 255, 255, 0.02),
    0 30px 60px rgba(0, 0, 0, 0.45);
}

.light-column {
  display: grid;
  gap: clamp(0.7rem, 1.4vw, 0.95rem);
  justify-items: center;
}

.start-light {
  width: clamp(3.25rem, 7vw, 4.3rem);
  aspect-ratio: 1;
  position: relative;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.14), transparent 26%),
    radial-gradient(circle at 50% 50%, rgba(255, 58, 47, 0.18), rgba(45, 0, 0, 0.92) 72%);
  border: 0.18rem solid rgba(120, 0, 0, 0.75);
  box-shadow:
    inset 0 0 0 0.18rem rgba(255, 255, 255, 0.08),
    inset 0 -0.45rem 0.9rem rgba(0, 0, 0, 0.55),
    0 0.3rem 0.7rem rgba(0, 0, 0, 0.5);
}

.start-light::before,
.start-light::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.start-light::before {
  inset: 12%;
  border: 0.14rem solid rgba(255, 255, 255, 0.08);
  opacity: 0.85;
}

.start-light::after {
  inset: -18%;
  opacity: 0.2;
  filter: blur(12px);
  background: radial-gradient(circle, rgba(255, 0, 0, 0.22) 0%, transparent 66%);
}

.start-light.is-on {
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 240, 240, 0.85), transparent 18%),
    radial-gradient(circle at 50% 50%, var(--light-core-bright) 0%, var(--light-core) 58%, #c40000 100%);
  border-color: var(--light-border);
  box-shadow:
    inset 0 0 0 0.2rem rgba(255, 255, 255, 0.16),
    inset 0 -0.4rem 0.8rem rgba(120, 0, 0, 0.32),
    0 0 16px rgba(255, 0, 0, 0.95),
    0 0 34px rgba(255, 0, 0, 0.65),
    0 0 52px rgba(255, 0, 0, 0.45),
    0 0.3rem 0.7rem rgba(0, 0, 0, 0.48);
  transform: scale(1.015);
  animation: light-on-main 140ms ease both;
}

.start-light.is-on::before {
  border-color: rgba(255, 255, 255, 0.18);
  animation: light-on-ring 140ms ease both;
}

.start-light.is-on::after {
  opacity: 1;
  background: radial-gradient(circle, var(--light-glow) 0%, rgba(255, 0, 0, 0.34) 42%, transparent 72%);
  animation: light-on-glow 140ms ease both;
}

@keyframes light-on-main {
  from {
    background:
      radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.14), transparent 26%),
      radial-gradient(circle at 50% 50%, rgba(255, 58, 47, 0.18), rgba(45, 0, 0, 0.92) 72%);
    border-color: rgba(120, 0, 0, 0.75);
    box-shadow:
      inset 0 0 0 0.18rem rgba(255, 255, 255, 0.08),
      inset 0 -0.45rem 0.9rem rgba(0, 0, 0, 0.55),
      0 0.3rem 0.7rem rgba(0, 0, 0, 0.5);
    transform: scale(1);
  }

  to {
    background:
      radial-gradient(circle at 35% 32%, rgba(255, 240, 240, 0.85), transparent 18%),
      radial-gradient(circle at 50% 50%, var(--light-core-bright) 0%, var(--light-core) 58%, #c40000 100%);
    border-color: var(--light-border);
    box-shadow:
      inset 0 0 0 0.2rem rgba(255, 255, 255, 0.16),
      inset 0 -0.4rem 0.8rem rgba(120, 0, 0, 0.32),
      0 0 16px rgba(255, 0, 0, 0.95),
      0 0 34px rgba(255, 0, 0, 0.65),
      0 0 52px rgba(255, 0, 0, 0.45),
      0 0.3rem 0.7rem rgba(0, 0, 0, 0.48);
    transform: scale(1.015);
  }
}

@keyframes light-on-ring {
  from {
    border-color: rgba(255, 255, 255, 0.08);
  }

  to {
    border-color: rgba(255, 255, 255, 0.18);
  }
}

@keyframes light-on-glow {
  from {
    opacity: 0.2;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.22) 0%, transparent 66%);
  }

  to {
    opacity: 1;
    background: radial-gradient(circle, var(--light-glow) 0%, rgba(255, 0, 0, 0.34) 42%, transparent 72%);
  }
}

.app__instruction {
  margin: 0;
  max-width: 36rem;
  color: var(--text-secondary);
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.7;
  text-transform: uppercase;
}

.app__instruction-shell {
  min-height: calc(1.7em * 4);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.app__timer-shell {
  width: 6.4ch;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
}

.app__timer {
  margin: 0;
  font-family: "Roboto Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(5.2rem, 17vw, 10rem);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: 0;
  color: var(--text-primary);
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.08),
    0 18px 42px var(--shadow);
}

.app__best {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .app {
    padding: 1rem 1.5rem 1.5rem;
  }

  .app__content {
    gap: 1rem;
  }

  .app__logo {
    top: 1rem;
    width: min(144px, 46vw);
  }

  .light-panel {
    width: 100%;
    gap: 0.7rem;
  }

  .light-panel__mast {
    width: 0.3rem;
  }

  .light-panel__housing {
    gap: 0.7rem;
    padding: 1rem 0.85rem;
  }

  .app__instruction {
    max-width: min(92vw, 24rem);
    font-size: clamp(0.72rem, 2.8vw, 0.92rem);
    letter-spacing: 0.08em;
    line-height: 1.55;
    text-wrap: balance;
  }

  .app__instruction-shell {
    min-height: calc(1.55em * 3);
  }
}
