:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg2: #0d1728;
  --panel: rgba(10, 18, 34, 0.82);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef4ff;
  --muted: #9fb0c9;
  --accent: #44d7b6;
  --accent2: #7c9cff;
  --warn: #f5a524;
  --danger: #ff6b6b;
  --good: #00d084;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(68, 215, 182, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(124, 156, 255, 0.16), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  font-family: "Inter", "Noto Sans SC", sans-serif;
}

body { padding: 32px; }

.shell { max-width: 1240px; margin: 0 auto; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero { padding: 28px; margin-bottom: 24px; }
.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  margin: 0 0 14px;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.8rem, 6vw, 5rem); line-height: 0.95; margin-bottom: 16px; }
.lead { max-width: 60rem; font-size: 1.06rem; line-height: 1.8; color: #d3def0; margin: 0; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
  margin-bottom: 24px;
}

.main-panel, .side-panel, .results-panel { padding: 22px; }
.panel-head { margin-bottom: 18px; }
.panel-head p, .hint, .note, .metric span { color: var(--muted); }
.panel-head p { margin: 8px 0 0; }

.input-block { display: grid; gap: 12px; }
.text-input {
  width: 100%;
  resize: vertical;
  min-height: 180px;
  padding: 16px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  outline: none;
  line-height: 1.7;
  font: inherit;
}
.text-input:focus { border-color: rgba(124, 156, 255, 0.65); }

.prompt-samples, .text-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.button {
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.98rem;
}
.button.secondary {
  background: linear-gradient(135deg, var(--accent2), #9dd9ff);
  color: #06101c;
}
.button.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.button:hover { filter: brightness(1.05); }

.side-panel { display: flex; flex-direction: column; justify-content: space-between; }
.note, .hint { font-size: 0.92rem; line-height: 1.7; }

.results-panel { display: grid; gap: 18px; }
.result-top {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.metric strong { display: block; margin-top: 8px; font-size: 1.4rem; }
.progress-bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.3s ease; }
.level-list { display: grid; gap: 10px; }
.level-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 60px;
  gap: 12px;
  align-items: center;
}
.level-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.level-fill { display: block; height: 100%; border-radius: inherit; }
.commentary-box {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.commentary-box p { margin: 10px 0 0; line-height: 1.8; white-space: pre-wrap; }

@media (max-width: 920px) {
  body { padding: 18px; }
  .layout, .result-top { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr 1fr; }
}
