:root {
  color-scheme: dark;
  --ink: #151a22;
  --paper: #f7f0df;
  --mint: #8ee6c8;
  --coral: #ff7c68;
  --gold: #f5c65b;
  --blue: #86b7ff;
  --plum: #33294a;
  --shadow: 0 24px 70px rgba(6, 10, 18, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--paper);
  background:
    linear-gradient(118deg, rgba(142, 230, 200, 0.18) 0 14%, transparent 14% 100%),
    linear-gradient(154deg, transparent 0 58%, rgba(255, 124, 104, 0.18) 58% 71%, transparent 71% 100%),
    linear-gradient(135deg, #17202d 0%, #241d31 46%, #191e28 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1080px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0;
  display: grid;
  align-content: center;
  gap: clamp(22px, 4vw, 42px);
}

.hero {
  display: grid;
  gap: 10px;
}

.eyebrow {
  margin: 0;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0;
  color: #fff8e8;
  font-size: clamp(3rem, 10vw, 7.8rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.excuse-panel,
.controls {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(247, 240, 223, 0.1);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.excuse-panel {
  min-height: 360px;
  padding: clamp(22px, 4vw, 38px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tier,
.meter,
.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(21, 26, 34, 0.42);
}

.tier,
.meter {
  min-height: 36px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  color: #fff8e8;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.meter {
  color: var(--gold);
}

.excuse {
  align-self: center;
  margin: 0;
  color: #fff8e8;
  font-size: clamp(1.8rem, 4.2vw, 4rem);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: 0;
  text-wrap: balance;
}

.ghost-button,
.generate-button {
  min-height: 50px;
  border-radius: 0;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.ghost-button {
  justify-self: start;
  min-width: 96px;
  color: #fff8e8;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.controls {
  min-height: 360px;
  padding: clamp(22px, 3vw, 32px);
  display: grid;
  align-content: end;
  gap: 18px;
}

.slider-label,
.scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.slider-label {
  color: #fff8e8;
  font-size: 1rem;
  font-weight: 800;
}

#rangeText {
  color: var(--mint);
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  height: 34px;
  margin: 0;
  accent-color: var(--coral);
  cursor: pointer;
}

.scale {
  color: rgba(247, 240, 223, 0.68);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.generate-button {
  width: 100%;
  border: 0;
  padding: 0 18px;
  color: #161920;
  background: linear-gradient(135deg, var(--mint), var(--gold) 54%, var(--coral));
  box-shadow: 0 16px 32px rgba(255, 124, 104, 0.22);
  font-weight: 900;
}

.generate-button:hover,
.generate-button:focus-visible {
  transform: translateY(-2px);
}

.pop {
  animation: pop 260ms ease;
}

@keyframes pop {
  0% {
    transform: translateY(8px) scale(0.985);
    opacity: 0.35;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 560px);
    align-content: start;
  }

  h1 {
    max-width: 8ch;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .excuse-panel,
  .controls {
    min-height: auto;
  }

  .excuse-panel {
    min-height: 300px;
  }
}
