:root {
  --bg: #05060a;
  --bg-elevated: #111827;
  --bg-elevated-soft: #0b1120;
  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --accent-strong: #22c55e;
  --danger: #f97373;
  --text: #e5e7eb;
  --text-soft: #9ca3af;
  --border-soft: rgba(148, 163, 184, 0.4);
  --border-strong: rgba(148, 163, 184, 0.7);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0b1120, #020617 55%, #000 100%);
  color: var(--text);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 14px 32px;
}

.app-header {
  text-align: center;
  margin-bottom: 20px;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 2.2vw, 2.3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f9fafb;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}

.app-header p {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 0.9fr);
  gap: 18px;
}

.card-section {
  background: radial-gradient(circle at top left, #020617, #020617 40%, #000);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  padding: 14px 14px 18px;
  position: relative;
  overflow: hidden;
}

.card-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.18), transparent 50%),
    radial-gradient(circle at 90% 100%, rgba(74, 222, 128, 0.16), transparent 52%);
  mix-blend-mode: screen;
  opacity: 0.9;
  pointer-events: none;
}

.card-section > * {
  position: relative;
  z-index: 1;
}

.card-header {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr 1.1fr;
  gap: 10px;
  margin-bottom: 14px;
  align-items: flex-end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-soft);
}

input,
select,
textarea {
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 7px 9px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, transform 0.08s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.45),
    0 18px 35px rgba(15, 23, 42, 0.95);
  background: rgba(15, 23, 42, 0.96);
  transform: translateY(-1px);
}

input[type="number"] {
  text-align: right;
  max-width: 72px;
}

.attributes {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.82)
  );
  border-radius: var(--radius-md);
  padding: 8px 10px 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  margin-bottom: 12px;
}

.attributes h2,
.skills h2,
.notes h2,
.panel h2 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.attributes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.attr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.attr-item label {
  font-size: 0.75rem;
  white-space: nowrap;
  flex: 1;
}

.derived {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.derived-item {
  flex: 1;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: radial-gradient(circle at top left, #0b1120, #020617);
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.8rem;
}

.derived-item span:last-child {
  font-weight: 600;
  color: #f9fafb;
}

.skills {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-md);
  padding: 8px 10px 10px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  margin-bottom: 12px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.skill-row {
  display: grid;
  grid-template-columns: 1.1fr 0.6fr 0.6fr;
  gap: 4px;
  align-items: center;
}

.skill-row label {
  font-size: 0.78rem;
}

.skill-row input[type="number"] {
  font-size: 0.86rem;
  max-width: 60px;
}

.notes {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-md);
  padding: 8px 10px 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.9)
  );
  border-radius: var(--radius-lg);
  padding: 12px 14px 14px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-row label {
  font-size: 0.8rem;
}

.panel-row select {
  flex: 1;
}

.btn {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: radial-gradient(circle at top, #020617, #020617 60%, #020617);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, box-shadow 0.15s ease,
    transform 0.08s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn.primary {
  background: radial-gradient(circle at top, #22d3ee, #0ea5e9);
  border-color: rgba(56, 189, 248, 0.95);
  color: #020617;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4),
    0 18px 40px rgba(8, 47, 73, 0.9);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.95);
  background: radial-gradient(circle at top, #020617, #020617 45%, #020617);
}

.btn.primary:hover {
  background: radial-gradient(circle at top, #38bdf8, #22c55e);
  box-shadow: 0 20px 45px rgba(8, 47, 73, 0.98);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.9);
}

.panel-help ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.panel-help li + li {
  margin-top: 3px;
}

.app-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-soft);
}

@media (max-width: 960px) {
  .app-main {
    grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr);
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .app {
    padding: 16px 10px 26px;
  }

  .app-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sidebar {
    order: -1;
  }

  .card-header {
    grid-template-columns: 1fr 0.7fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .app-header h1 {
    font-size: 1.4rem;
  }

  .card-header {
    grid-template-columns: 1fr;
  }

  .attributes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 8px;
  }

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

  .skill-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .skill-row label {
    margin-bottom: 2px;
  }

  .btn {
    font-size: 0.82rem;
    padding: 8px 8px;
  }
}

