@font-face {
  font-family: "Mallory";
  src: url("../fonts/Mallory-Book.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mallory";
  src: url("../fonts/Mallory-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mallory";
  src: url("../fonts/Mallory-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mallory MP";
  src: url("../fonts/MalloryMP-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #191817;
  --muted: #6b625a;
  --paper: #fff9ed;
  --panel: #fffdf7;
  --accent: #f24822;
  --accent-dark: #831f11;
  --gold: #ffcf4c;
  --mint: #bcebd3;
  --blue: #0a496f;
  --line: #2a2520;
  --shadow: 12px 12px 0 #191817;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 207, 76, 0.58) 0 12%, transparent 13%),
    radial-gradient(circle at 88% 12%, rgba(188, 235, 211, 0.8) 0 11%, transparent 12%),
    linear-gradient(135deg, #fff7df 0%, #ffe3cd 48%, #fbd4b7 100%);
  font-family: "Mallory", "Avenir Next", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

.caller-app {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) 0 48px;
}

.hero {
  margin-bottom: 22px;
}

.hero-grid {
  display: grid;
  gap: 20px;
}

.hero-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 680px) auto;
  justify-content: space-between;
  gap: 28px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-family: "Mallory MP", "Mallory", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: none;
  margin-bottom: 14px;
  font-size: clamp(48px, 9vw, 126px);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.065em;
}

h2 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.subhead {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.25;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-width: 260px;
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.scoreboard div {
  padding: 18px;
  text-align: center;
}

.scoreboard div + div {
  border-left: 2px solid var(--line);
}

.scoreboard strong {
  display: block;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.85;
  letter-spacing: -0.08em;
}

.scoreboard span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: "Mallory MP", "Mallory", sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stage-card,
.panel {
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stage-card {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  margin-bottom: 28px;
  padding: clamp(22px, 4vw, 42px);
}

.stage-card::before {
  content: "";
  position: absolute;
  inset: auto -8% -38% auto;
  width: min(420px, 58vw);
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: repeating-conic-gradient(from 8deg, var(--gold) 0 12deg, var(--mint) 12deg 24deg, #fff 24deg 36deg, var(--accent) 36deg 48deg);
  opacity: 0.36;
}

.stage-label {
  position: relative;
  margin-bottom: 16px;
  color: var(--blue);
  font-family: "Mallory MP", "Mallory", sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.current-call {
  position: relative;
  display: grid;
  min-height: 138px;
  place-items: center start;
  font-size: clamp(42px, 9vw, 118px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.07em;
  overflow-wrap: anywhere;
}

.current-call.is-new {
  animation: pop-in 280ms cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.round-status {
  position: relative;
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.stage-actions,
.setup-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

button {
  border: 2px solid var(--line);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover:not(:disabled) {
  transform: translate(-2px, -2px);
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary-action,
.start-button,
.secondary-action {
  min-height: 48px;
  padding: 0 22px;
  font-weight: 700;
}

.primary-action,
.start-button {
  background: var(--accent);
  color: #fffdf7;
  box-shadow: 5px 5px 0 var(--line);
}

.secondary-action {
  background: #fff;
  box-shadow: 4px 4px 0 var(--line);
}

.text-button {
  align-self: start;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button:hover:not(:disabled) {
  transform: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1.05fr);
  gap: 28px;
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.value-field {
  display: grid;
  gap: 10px;
}

.value-field span,
.check-row {
  color: var(--muted);
  line-height: 1.35;
}

textarea {
  width: 100%;
  min-height: 292px;
  resize: vertical;
  border: 2px solid var(--line);
  border-radius: 0;
  padding: 16px;
  background: #fff;
  color: var(--ink);
  line-height: 1.35;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: start;
  margin-top: 14px;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.history-panel {
  min-height: 420px;
}

.history-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: calls;
}

.history-list li {
  counter-increment: calls;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  border: 2px solid var(--line);
  padding: 14px;
  background: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.history-list li::before {
  content: counter(calls);
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: var(--gold);
  color: var(--line);
  font-family: "Mallory MP", "Mallory", sans-serif;
  font-size: 11px;
  letter-spacing: -0.02em;
}

.empty-state {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.25;
}

.empty-state[hidden] {
  display: none;
}

@keyframes pop-in {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 860px) {
  .hero-meta-row,
  .workspace {
    grid-template-columns: 1fr;
  }

  .scoreboard {
    width: min(100%, 360px);
    min-width: 0;
  }

  .stage-card,
  .panel,
  .scoreboard {
    box-shadow: 8px 8px 0 var(--line);
  }
}

@media (max-width: 560px) {
  .caller-app {
    width: min(1180px, calc(100% - 22px));
    padding-top: 18px;
  }

  h1 {
    font-size: clamp(42px, 17vw, 76px);
  }

  .subhead,
  .round-status,
  .empty-state {
    font-size: 16px;
  }

  .current-call {
    min-height: 120px;
    font-size: clamp(38px, 16vw, 72px);
  }

  .stage-actions,
  .setup-actions {
    display: grid;
  }

  .primary-action,
  .start-button,
  .secondary-action {
    width: 100%;
  }
}
