:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1a1e26;
  --panel-soft: #222834;
  --text: #f4f0e8;
  --muted: #a7adba;
  --line: #343b49;
  --accent: #74d2a8;
  --accent-strong: #34b889;
  --warn: #e9b872;
  --danger: #f08282;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: center;
  padding: 28px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  max-width: 720px;
  font-size: clamp(2.2rem, 6vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.ony-face {
  min-height: 220px;
  border-radius: 8px;
  border: 1px solid rgba(116, 210, 168, 0.28);
  background: #0f1516;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
}

.eyes {
  display: flex;
  gap: 34px;
  align-items: center;
  margin-top: 8px;
}

.eyes span {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 30px rgba(116, 210, 168, 0.4);
  transform: scaleY(var(--eye-scale, 1));
  transition: transform 180ms ease, background 180ms ease;
}

.ony-face.completed .eyes span {
  background: #f4d06f;
}

.ony-face.abandoned .eyes span {
  background: var(--danger);
}

#ony-bar {
  margin: 18px 0 6px;
  min-height: 29px;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0;
}

#ony-mood {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

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

.quest-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111722;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(116, 210, 168, 0.14);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button,
.ghost-button,
.filter,
.tiny-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-soft);
  min-height: 40px;
  padding: 0 14px;
  font-weight: 750;
}

.primary-button {
  border-color: transparent;
  background: var(--accent-strong);
  color: #07100d;
}

.ghost-button,
.tiny-button {
  min-height: 34px;
  color: var(--muted);
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  min-height: 34px;
  color: var(--muted);
}

.filter.active {
  background: var(--accent);
  color: #07100d;
  border-color: transparent;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.83rem;
}

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

.stat-card {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141a23;
  padding: 12px;
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.stat-card span {
  font-size: 2rem;
  font-weight: 850;
}

.quest-panel,
.log-panel {
  margin-top: 18px;
}

.quest-list,
.log-list {
  display: grid;
  gap: 10px;
}

.quest-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141a23;
  padding: 14px;
}

.quest-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.quest-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.quest-meta,
.quest-description,
.log-entry {
  color: var(--muted);
  font-size: 0.9rem;
}

.quest-description {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.progress-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #0f131b;
  overflow: hidden;
}

.progress-fill {
  width: var(--progress);
  height: 100%;
  background: var(--accent);
}

.quest-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.inline-progress {
  width: 92px;
  min-height: 34px;
  padding: 6px 8px;
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

@media (max-width: 840px) {
  .hero-panel,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    padding: 22px;
  }

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

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

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

  .quest-top,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress-line {
    grid-template-columns: 1fr;
  }
}
