:root {
  --bg: #0b1020;
  --panel: rgba(14, 20, 34, 0.8);
  --panel-soft: #121d33;
  --card: #17243d;
  --primary: #7c5cff;
  --primary-strong: #9b7bff;
  --secondary: #27d6a2;
  --warning: #ffb94d;
  --danger: #ff5d7d;
  --text: #edeeff;
  --muted: #9aa8c7;
  --line: rgba(154, 168, 199, 0.2);
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at top, rgba(124, 92, 255, 0.22), transparent 35%),
    linear-gradient(135deg, #0b1020 0%, #11192a 30%, #0b1020 100%);
  color: var(--text);
}

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

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

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

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-size: 0.72rem;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 3vw + 0.8rem, 3.2rem);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: linear-gradient(180deg, rgba(23, 36, 61, 0.95), rgba(16, 24, 39, 0.95));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
}

.summary-card span {
  display: block;
  margin-bottom: 12px;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-card strong {
  font-size: clamp(1.5rem, 1vw + 1rem, 2.2rem);
}

.summary-card.accent {
  border-color: rgba(124, 92, 255, 0.4);
}

.summary-card.success {
  border-color: rgba(39, 214, 162, 0.4);
}

.summary-card.warning {
  border-color: rgba(255, 185, 77, 0.4);
}

.summary-card.danger {
  border-color: rgba(255, 93, 125, 0.4);
}

.main-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 0.8fr;
  gap: 20px;
}

.panel,
.panel-box {
  background: rgba(17, 25, 42, 0.86);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.form-panel,
.list-panel,
.sidebar-panel {
  min-width: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

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

.filter-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}

.filter-btn.active {
  background: rgba(124, 92, 255, 0.18);
  border-color: rgba(124, 92, 255, 0.5);
  color: #d9d2ff;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

label.full-width {
  grid-column: 1 / -1;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(124, 92, 255, 0.2);
  border-color: rgba(124, 92, 255, 0.7);
}

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

.primary-btn,
.secondary-btn,
.chip-btn,
.delete-btn {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.15s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.chip-btn:hover,
.delete-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  margin-top: 18px;
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: white;
  padding: 13px 16px;
}

.secondary-btn {
  padding: 10px 14px;
  background: rgba(124, 92, 255, 0.12);
  color: #e2dcff;
}

.game-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-card {
  background: linear-gradient(180deg, rgba(23, 36, 61, 0.96), rgba(17, 25, 42, 0.96));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.game-card.in-progress {
  border-color: rgba(255, 185, 77, 0.35);
}

.game-card.completed {
  border-color: rgba(39, 214, 162, 0.35);
}

.game-card.backlog {
  border-color: rgba(255, 93, 125, 0.28);
}

.game-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}


.game-header h3 {
  margin: 0;
  font-size: 1.35rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill.backlog {
  background: rgba(255, 93, 125, 0.12);
  color: #ffb1c2;
}

.status-pill.in-progress {
  background: rgba(255, 185, 77, 0.12);
  color: #ffdca2;
}

.status-pill.completed {
  background: rgba(39, 214, 162, 0.12);
  color: #b4f5df;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.progress-shell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.objectives {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.objective {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

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

.objective-main span {
  color: var(--text);
  font-size: 0.9rem;
}

.objective-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.objective-progress input {
  width: 64px;
  padding: 8px 10px;
  text-align: center;
}

.objective-progress .fraction-divider {
  color: var(--muted);
  font-weight: 700;
}

.objective.done .objective-main span {
  text-decoration: line-through;
  color: var(--muted);
}

.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.chip-btn {
  background: rgba(124, 92, 255, 0.15);
  color: #e3ddff;
  padding: 10px 12px;
}

.delete-btn {
  background: rgba(255, 93, 125, 0.12);
  color: #ffc7d4;
  width: 46px;
  height: 42px;
}

.goal-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.new-goal-input {
  flex: 1;
}

.chip-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.goal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goal-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
}

.goal-list strong {
  display: block;
  margin-bottom: 2px;
}

.goal-list span {
  color: var(--muted);
  font-size: 0.74rem;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 540px) {
  .summary-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head,
  .game-header,
  .card-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-group {
    width: 100%;
  }
}
