:root {
  --aw-bg: #0d1114;
  --aw-bg-elevated: #151d22;
  --aw-bg-soft: #1d272d;
  --aw-panel: rgba(15, 21, 25, 0.94);
  --aw-panel-strong: rgba(20, 27, 32, 0.98);
  --aw-line: rgba(154, 182, 170, 0.16);
  --aw-line-strong: rgba(186, 219, 205, 0.28);
  --aw-text: #edf4ef;
  --aw-text-dim: #adc0b7;
  --aw-text-muted: #81968d;
  --aw-accent: #90c9a5;
  --aw-accent-strong: #b6e7c7;
  --aw-accent-ink: #092414;
  --aw-danger: #f38d8d;
  --aw-warn: #f0cb86;
  --aw-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --aw-radius: 20px;
  --aw-radius-sm: 12px;
  --aw-content-width: 1200px;
  --aw-font: "Inter", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(100, 166, 126, 0.14), transparent 35%),
    linear-gradient(180deg, #0d1114 0%, #0a0d10 100%);
  color: var(--aw-text);
  font-family: var(--aw-font);
}

body {
  padding: 24px;
}

a {
  color: var(--aw-accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

.aw-page {
  display: grid;
  gap: 24px;
}

.aw-shell {
  width: min(100%, var(--aw-content-width));
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.aw-shell-login {
  min-height: calc(100vh - 48px);
  align-items: center;
}

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

.aw-grid-2 {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

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

.aw-panel,
.aw-card,
.aw-section,
.aw-hero {
  border: 1px solid var(--aw-line);
  background: var(--aw-panel);
  border-radius: var(--aw-radius);
  box-shadow: var(--aw-shadow);
}

.aw-hero,
.aw-panel,
.aw-card,
.aw-section {
  padding: 24px;
}

.aw-hero {
  display: grid;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(140, 201, 165, 0.08), transparent 55%),
    var(--aw-panel-strong);
}

.aw-brand {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: baseline;
}

.aw-brand-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--aw-text-muted);
}

.aw-brand-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.aw-brand-subtitle {
  font-size: 17px;
  color: var(--aw-text-dim);
  line-height: 1.5;
  max-width: 62ch;
}

.aw-badge-row,
.aw-topbar-actions,
.aw-inline-actions,
.aw-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.aw-badge,
.aw-pill,
.aw-chip,
.aw-clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--aw-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--aw-text-dim);
  font-size: 13px;
}

.aw-pill-strong,
.aw-badge-strong {
  border-color: rgba(146, 205, 170, 0.36);
  color: var(--aw-accent-strong);
}

.aw-topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}

.aw-topbar-meta {
  display: grid;
  gap: 4px;
}

.aw-topbar-title {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.aw-topbar-copy {
  color: var(--aw-text-dim);
  line-height: 1.5;
  max-width: 70ch;
}

.aw-status {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--aw-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--aw-text-dim);
  line-height: 1.45;
}

.aw-status-success {
  border-color: rgba(126, 203, 156, 0.28);
  color: #d7f3e1;
}

.aw-status-warn {
  border-color: rgba(240, 203, 134, 0.28);
  color: #ffe8bf;
}

.aw-status-danger {
  border-color: rgba(243, 141, 141, 0.28);
  color: #ffd0d0;
}

.aw-form {
  display: grid;
  gap: 16px;
}

.aw-field,
.aw-field-stack {
  display: grid;
  gap: 8px;
}

.aw-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.aw-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--aw-text-dim);
}

.aw-help {
  font-size: 13px;
  color: var(--aw-text-muted);
  line-height: 1.5;
}

.aw-input,
.aw-select,
.aw-textarea {
  width: 100%;
  border: 1px solid var(--aw-line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  color: var(--aw-text);
  padding: 12px 14px;
  outline: none;
}

.aw-input:focus,
.aw-select:focus,
.aw-textarea:focus {
  border-color: rgba(144, 201, 165, 0.45);
  box-shadow: 0 0 0 3px rgba(144, 201, 165, 0.16);
}

.aw-textarea {
  min-height: 104px;
  resize: vertical;
}

.aw-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(146, 205, 170, 0.28);
  background: linear-gradient(180deg, rgba(146, 205, 170, 0.22), rgba(95, 150, 120, 0.18));
  color: var(--aw-text);
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.aw-button:hover {
  transform: translateY(-1px);
  border-color: rgba(182, 231, 199, 0.45);
  text-decoration: none;
}

.aw-button-secondary {
  border-color: var(--aw-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--aw-text-dim);
}

.aw-button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--aw-accent-strong);
}

.aw-button-danger {
  border-color: rgba(243, 141, 141, 0.32);
  background: rgba(134, 32, 32, 0.18);
  color: #ffd7d7;
}

.aw-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.aw-section-title,
.aw-card-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.aw-card-copy,
.aw-section-copy {
  color: var(--aw-text-dim);
  line-height: 1.55;
}

.aw-rule-list,
.aw-detail-list,
.aw-log,
.aw-list {
  display: grid;
  gap: 10px;
}

.aw-rule,
.aw-detail,
.aw-log-entry,
.aw-list-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--aw-line);
  background: rgba(255, 255, 255, 0.03);
}

.aw-rule strong,
.aw-detail strong {
  color: var(--aw-text);
}

.aw-rule small,
.aw-detail small,
.aw-log-entry small {
  color: var(--aw-text-muted);
}

.aw-character-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.aw-character-card {
  display: grid;
  gap: 14px;
}

.aw-character-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.aw-character-name {
  font-size: 22px;
  font-weight: 800;
}

.aw-character-subtitle {
  color: var(--aw-text-muted);
  font-size: 14px;
}

.aw-kv-grid,
.aw-stat-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.aw-stat,
.aw-kv {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--aw-line);
  background: rgba(255, 255, 255, 0.025);
}

.aw-stat-label,
.aw-kv-label {
  color: var(--aw-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.aw-stat-value,
.aw-kv-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
}

.aw-skill-table,
.aw-perk-grid,
.aw-checklist,
.aw-module-layout {
  display: grid;
  gap: 12px;
}

.aw-skill-row,
.aw-perk-row,
.aw-module-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--aw-line);
  background: rgba(255, 255, 255, 0.03);
}

.aw-skill-row {
  grid-template-columns: minmax(0, 1.6fr) minmax(100px, 0.6fr) minmax(100px, 0.6fr);
  align-items: center;
}

.aw-skill-name,
.aw-perk-name {
  font-weight: 700;
}

.aw-skill-summary,
.aw-perk-summary {
  color: var(--aw-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.aw-question-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--aw-line);
  background: rgba(255, 255, 255, 0.025);
}

.aw-chip {
  cursor: default;
}

.aw-chip-button {
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.aw-chip-button:hover {
  border-color: rgba(182, 231, 199, 0.34);
  background: rgba(182, 231, 199, 0.08);
}

.aw-chip-button.is-active {
  border-color: rgba(182, 231, 199, 0.42);
  background: rgba(182, 231, 199, 0.12);
  color: var(--aw-text);
}

.aw-checkbox-list,
.aw-radio-list {
  display: grid;
  gap: 10px;
}

.aw-choice {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--aw-line);
  background: rgba(255, 255, 255, 0.025);
}

.aw-choice input {
  margin-top: 3px;
}

.aw-choice-copy {
  display: grid;
  gap: 4px;
}

.aw-choice-title {
  font-weight: 700;
}

.aw-choice-meta {
  color: var(--aw-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.aw-module-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  align-items: start;
}

.aw-scene-header {
  display: grid;
  gap: 8px;
}

.aw-scene-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.aw-verb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.aw-log {
  max-height: 320px;
  overflow: auto;
}

.aw-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed var(--aw-line-strong);
  color: var(--aw-text-muted);
  text-align: center;
}

.aw-footer-note {
  color: var(--aw-text-muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

.aw-hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .aw-grid-2,
  .aw-module-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

  .aw-field-grid,
  .aw-skill-row {
    grid-template-columns: 1fr;
  }

  .aw-hero,
  .aw-panel,
  .aw-card,
  .aw-section {
    padding: 18px;
  }

  .aw-topbar {
    align-items: start;
  }
}
