:root {
  --bg: #f4efe7;
  --bg-accent: #e5d5bf;
  --surface: rgba(255, 252, 247, 0.84);
  --surface-strong: #fffaf3;
  --border: rgba(108, 88, 56, 0.14);
  --text: #231c14;
  --muted: #6a5b4d;
  --primary: #b44f2e;
  --primary-dark: #8d3b20;
  --secondary: #efe4d5;
  --success: #236b49;
  --shadow: 0 22px 60px rgba(48, 31, 14, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 30%),
    radial-gradient(circle at right center, rgba(180, 79, 46, 0.12), transparent 22%),
    linear-gradient(145deg, var(--bg) 0%, #f8f4ee 45%, var(--bg-accent) 100%);
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.workspace {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  padding: 2.5rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.input-panel h2,
.results-panel h2 {
  margin: 0;
  line-height: 1.1;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  max-width: 14ch;
}

.subtitle,
.panel-copy,
.feedback-message,
.empty-state,
.stat-label,
.current-speaker-label {
  color: var(--muted);
}

.subtitle {
  max-width: 48rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.input-panel,
.results-panel {
  padding: 1.5rem;
}

.panel-header,
.results-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-copy {
  margin: 0.4rem 0 0;
  line-height: 1.5;
}

.name-input {
  width: 100%;
  min-height: 320px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(108, 88, 56, 0.18);
  border-radius: var(--radius-lg);
  resize: vertical;
  background: var(--surface-strong);
  color: var(--text);
  line-height: 1.6;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.name-input::placeholder {
  color: rgba(106, 91, 77, 0.8);
}

.name-input:hover {
  border-color: rgba(180, 79, 46, 0.34);
}

.name-input:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(180, 79, 46, 0.25);
  outline-offset: 2px;
}

.name-input:focus-visible {
  border-color: rgba(180, 79, 46, 0.55);
  box-shadow: 0 0 0 6px rgba(180, 79, 46, 0.08);
}

.feedback-message {
  min-height: 1.5rem;
  margin: 0.85rem 0 0;
  font-size: 0.96rem;
}

.feedback-message.is-error {
  color: #9d2f2f;
}

.feedback-message.is-success {
  color: var(--success);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

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

.button-primary {
  background: linear-gradient(180deg, #cf6a46 0%, var(--primary) 100%);
  color: #fff9f3;
  box-shadow: 0 18px 30px rgba(180, 79, 46, 0.24);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #d5724d 0%, var(--primary-dark) 100%);
}

.button-secondary {
  background: var(--secondary);
  color: var(--text);
}

.button-secondary:hover:not(:disabled) {
  background: #e8d8c6;
}

.stats {
  display: flex;
  gap: 0.75rem;
}

.stat {
  min-width: 110px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(108, 88, 56, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.55);
}

.stat strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.6rem;
}

.current-speaker-card {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(180, 79, 46, 0.16);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 247, 236, 0.98), rgba(255, 241, 225, 0.98));
}

.current-speaker-card strong {
  font-size: 1.25rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px dashed rgba(106, 91, 77, 0.26);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.42);
  text-align: center;
  line-height: 1.7;
}

.order-list {
  display: none;
  margin: 1rem 0 0;
  padding: 0;
  list-style-position: inside;
}

.order-list.is-visible {
  display: grid;
  gap: 0.75rem;
}

.order-item {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(108, 88, 56, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.order-item.is-current {
  border-color: rgba(180, 79, 46, 0.45);
  background: #fff1e2;
  box-shadow: 0 10px 24px rgba(180, 79, 46, 0.12);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .hero,
  .input-panel,
  .results-panel {
    padding: 1.25rem;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 1rem, 1120px);
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .panel-header,
  .results-header {
    flex-direction: column;
  }

  .button-row {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .name-input {
    min-height: 260px;
  }
}
