:root {
  --color-background: #0b0b11;
  --color-surface: #141421;
  --color-surface-alt: #1c1c2e;
  --color-text: #f5f5f7;
  --color-muted: #a4a4b8;
  --color-primary: #fd4c04;
  --color-accent: #ffca05;
  --color-border: rgba(255, 255, 255, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.35);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family);
}

body {
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.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;
}

textarea,
input,
button {
  border: none;
  outline: none;
}

.app-shell {
  width: min(1100px, 92vw);
  margin: 40px auto 64px;
  display: grid;
  gap: 28px;
}

.app-header {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 28px;
  background: linear-gradient(
    145deg,
    rgba(20, 20, 33, 0.9),
    rgba(12, 12, 22, 0.9)
  );
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.app-header__logo {
  flex-shrink: 0;
}

.app-header__logo img {
  width: clamp(96px, 15vw, 160px);
  height: auto;
  display: block;
}

.app-header__text h1 {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  margin: 0 0 8px;
  letter-spacing: 0.015em;
}

.app-header__text p {
  margin: 0;
  color: var(--color-muted);
  max-width: 46ch;
  line-height: 1.6;
}

.grid-layout {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  padding: clamp(22px, 3vw, 32px);
  display: grid;
  gap: 20px;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 18px;
  align-items: center;
}

.panel-header__text h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.panel-header__text p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.5;
}

.panel-header__caption {
  margin: 0 0 18px;
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.counter-pill {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(253, 76, 4, 0.08);
  border: 1px solid rgba(255, 202, 5, 0.24);
  font-size: 0.85rem;
  color: var(--color-accent);
  flex-wrap: wrap;
}

.counter-pill span:first-of-type {
  color: var(--color-text);
  font-weight: 600;
}

.counter-pill__icon {
  width: 22px;
  height: 22px;
  color: var(--color-accent);
  flex-shrink: 0;
}

textarea {
  resize: vertical;
  min-height: 180px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  line-height: 1.6;
  transition: border-color 0.2s ease;
}

textarea:focus {
  border-color: rgba(255, 202, 5, 0.45);
}

.form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.form-field__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-field__icon {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.form-field--textarea textarea {
  min-height: 200px;
}

input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 1.05rem;
  transition: border-color 0.2s ease;
}

input[type="number"]:focus {
  border-color: rgba(253, 76, 4, 0.55);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  background: linear-gradient(
    135deg,
    rgba(253, 76, 4, 0.9),
    rgba(255, 202, 5, 0.95)
  );
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 24px rgba(253, 76, 4, 0.35);
}

.button-primary:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  background: linear-gradient(
    135deg,
    rgba(88, 88, 104, 0.85),
    rgba(122, 122, 138, 0.85)
  );
  color: rgba(255, 255, 255, 0.7);
}

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

.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--color-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

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

.button-ghost:not(:disabled):hover {
  color: var(--color-accent);
  border-color: rgba(255, 202, 5, 0.4);
}

.button-icon {
  width: 20px;
  height: 20px;
  color: currentColor;
  flex-shrink: 0;
}

.feedback {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.92rem;
  background: rgba(253, 76, 4, 0.12);
  color: #ffb4b4;
  border: 1px solid rgba(253, 76, 4, 0.35);
}

.feedback--success {
  background: rgba(255, 202, 5, 0.12);
  color: #fff6b8;
  border-color: rgba(255, 202, 5, 0.35);
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
}

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

@media (max-width: 720px) {
  .app-header {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .app-header__text {
    text-align: center;
  }

  .app-header__text p {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100%, 94vw);
    margin: 32px auto 56px;
  }

  .panel {
    padding: 20px;
  }

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

  .counter-pill {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }

  .counter-pill span {
    font-size: 0.8rem;
  }

  textarea,
  input[type="text"] {
    font-size: 1rem;
    padding: 12px;
  }
}

.results-current h3,
.results-history h3 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.team-card {
  background: var(--color-surface-alt);
  border: 1px solid rgba(255, 202, 5, 0.15);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-inner);
  display: grid;
  gap: 14px;
}

.team-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--color-accent);
  letter-spacing: 0.02em;
}

.team-card ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.team-card li {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 0.95rem;
}

.history-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-card {
  border-radius: var(--radius-md);
  background: transparent;
  padding: 12px 14px;
  border: 1px solid transparent;
  display: grid;
  gap: 4px;
  transition: border-color 0.18s ease, background-color 0.18s ease;
  text-align: left;
  color: var(--color-muted);
}

.history-card span:first-child {
  color: var(--color-text);
  font-weight: 600;
}

.history-card:hover {
  cursor: pointer;
  border-color: rgba(255, 202, 5, 0.38);
  background: rgba(253, 76, 4, 0.08);
}

.empty-state {
  padding: 32px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-muted);
  font-size: 0.95rem;
}

.footer-note {
  margin-top: 12px;
  font-size: 0.78rem;
  color: rgba(164, 164, 184, 0.55);
  text-align: center;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: rgba(253, 76, 4, 0.5);
  border-radius: 999px;
}
