:root {
  --ink: #1d2440;
  --muted: #667085;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --line: rgba(72, 78, 116, 0.15);
  --blue: #33b7ff;
  --purple: #8f7bff;
  --pink: #ff6fb1;
  --green: #35c995;
  --gold: #ffd166;
  --coral: #ff8a70;
  --shadow: 0 28px 80px rgba(42, 45, 100, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    "Avenir Next", Avenir, "Nunito Sans", "Trebuchet MS", Verdana, ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.92), transparent 21%),
    radial-gradient(circle at 82% 10%, rgba(255, 209, 102, 0.45), transparent 26%),
    radial-gradient(circle at 70% 78%, rgba(53, 201, 149, 0.38), transparent 29%),
    linear-gradient(135deg, #bfe8ff 0%, #d6cbff 48%, #ffd9ec 100%);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
}

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

button {
  display: inline-grid;
  place-items: center;
  text-align: center;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 445px) minmax(0, 1fr);
  gap: 22px;
  width: min(1280px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.tracker-panel,
.result-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tracker-panel {
  position: relative;
  overflow: hidden;
  align-self: start;
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.68)),
    var(--panel);
}

.tracker-panel::after {
  position: absolute;
  right: -78px;
  bottom: -92px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 40%, rgba(255, 255, 255, 0.86), transparent 18%),
    conic-gradient(from 20deg, var(--blue), var(--green), var(--gold), var(--pink), var(--purple), var(--blue));
  content: "";
  filter: saturate(1.08);
  opacity: 0.72;
}

.kingdom-orbit {
  position: absolute;
  inset: 18px 18px auto auto;
  display: grid;
  grid-template-columns: repeat(3, 18px);
  gap: 7px;
}

.kingdom-orbit span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.8);
}

.kingdom-orbit span:nth-child(1) {
  background: var(--gold);
}

.kingdom-orbit span:nth-child(2) {
  background: var(--green);
}

.kingdom-orbit span:nth-child(3) {
  background: var(--pink);
}

.intro {
  margin-bottom: 24px;
}

.eyebrow,
.card-label,
.suggestion-label {
  margin: 0;
  color: #5b57a8;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 6px;
  max-width: 12ch;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 0.92;
  color: transparent;
  background: linear-gradient(135deg, #24315f 0%, #6656df 45%, #e6539e 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

h2 {
  font-size: 1.45rem;
}

.intro-copy {
  max-width: 32rem;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.entry-form {
  display: grid;
  gap: 17px;
  position: relative;
  z-index: 1;
}

.field {
  display: grid;
  gap: 8px;
  color: #30364d;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(76, 82, 128, 0.16);
  border-radius: 20px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

input,
textarea {
  padding: 15px 16px;
}

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

.compact-field textarea {
  min-height: 92px;
}

select {
  min-height: 44px;
  padding: 10px 12px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(111, 115, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(111, 115, 255, 0.14);
}

.suggestion-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(96, 109, 255, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 248, 221, 0.95), rgba(235, 245, 255, 0.92)),
    white;
  box-shadow: 0 16px 36px rgba(77, 72, 146, 0.12);
}

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

.suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button,
.clear-button {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 850;
}

.ghost-button {
  min-height: 44px;
  padding: 0 18px;
  background: linear-gradient(135deg, #27315d, #5c4fce);
  color: white;
}

.submit-button {
  min-height: 58px;
  border: 0;
  border-radius: 22px;
  cursor: pointer;
  color: white;
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 35%),
    linear-gradient(135deg, #4d6dff 0%, #8e5cff 48%, #ff5fa8 100%);
  box-shadow: 0 14px 34px rgba(111, 94, 230, 0.34);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(111, 94, 230, 0.4);
}

.submit-button:active {
  transform: translateY(0);
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: #b42318;
  font-weight: 750;
}

.form-message.success {
  color: #087443;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 18px;
  align-content: start;
}

.side-tabs {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 10px;
  align-self: start;
  padding: 12px;
  border: 1px solid rgba(72, 78, 116, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 20px 50px rgba(42, 45, 100, 0.16);
  backdrop-filter: blur(18px);
}

.tab-button {
  min-height: 54px;
  width: 100%;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  color: #44506f;
  font-weight: 850;
  text-align: center;
  background: transparent;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.tab-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.72);
}

.tab-button.active {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent),
    linear-gradient(135deg, #4a6cff, #7658e8 48%, #d950a0);
  box-shadow: 0 12px 24px rgba(88, 92, 220, 0.26);
}

.dashboard {
  min-width: 0;
}

.tab-panel {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tab-panel.active {
  display: grid;
}

.tab-panel[data-panel="scores"],
.tab-panel[data-panel="growth"],
.tab-panel[data-panel="entries"] {
  grid-template-columns: 1fr;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.result-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), transparent 42%);
}

.primary-result {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 148px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 209, 102, 0.52), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 244, 255, 0.88)),
    var(--panel-solid);
}

.primary-result > *,
.result-card > * {
  position: relative;
  z-index: 1;
}

.badge {
  flex: 0 0 auto;
  max-width: 130px;
  padding: 10px 12px;
  border-radius: 999px;
  color: #5c4200;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
  background: linear-gradient(135deg, #ffe891, #ffc857);
  box-shadow: 0 10px 28px rgba(255, 200, 87, 0.34);
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
}

.skill-pill {
  padding: 9px 12px;
  border-radius: 999px;
  color: #30364d;
  font-weight: 850;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.24)),
    rgba(106, 183, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(76, 82, 128, 0.08);
}

.reflection-card {
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 111, 177, 0.24), transparent 30%),
    rgba(255, 255, 255, 0.82);
}

.learning-summary {
  margin: 14px 0 0;
  color: #3a415b;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.5;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.card-header span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.score-bars {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.score-row {
  display: grid;
  gap: 6px;
}

.score-meta {
  display: flex;
  justify-content: space-between;
  color: #30364d;
  font-size: 0.92rem;
  font-weight: 850;
}

.score-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(78, 89, 140, 0.12);
  box-shadow: inset 0 1px 4px rgba(36, 49, 95, 0.12);
}

.score-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--purple), var(--pink));
  transition: width 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.growth-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 168px;
  padding-top: 16px;
}

.chart-column {
  display: grid;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.chart-bar {
  min-height: 8px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--gold), var(--green), var(--blue));
  box-shadow: 0 8px 18px rgba(51, 183, 255, 0.25);
  transition: height 500ms ease;
}

.chart-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clear-button {
  padding: 8px 12px;
  color: #5b57a8;
  background: rgba(91, 87, 168, 0.1);
}

.history-card {
  grid-column: 1 / -1;
}

.history-list {
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.log-table {
  display: grid;
  min-width: 760px;
  overflow: hidden;
  border: 1px solid rgba(115, 103, 218, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 243, 255, 0.82)),
    white;
  box-shadow: 0 16px 42px rgba(65, 70, 140, 0.14);
}

.log-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(270px, 1.55fr) 88px 90px 98px;
  gap: 0;
  align-items: stretch;
  border-top: 1px solid rgba(115, 103, 218, 0.12);
}

.log-row:first-child {
  border-top: 0;
}

.log-head {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    linear-gradient(135deg, #2f3c78, #6957d8 52%, #bb4fa0);
}

.log-head > div {
  min-height: 46px;
  color: white;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.log-row > div {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 74px;
  padding: 13px 14px;
  border-left: 1px solid rgba(115, 103, 218, 0.1);
}

.log-row > div:first-child {
  border-left: 0;
}

.log-row:not(.log-head):nth-child(odd) {
  background: rgba(238, 246, 255, 0.52);
}

.log-row:not(.log-head):nth-child(even) {
  background: rgba(252, 246, 255, 0.62);
}

.log-game {
  color: #26335c;
  font-weight: 900;
}

.log-chip {
  width: max-content;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #665000;
  font-size: 0.72rem;
  font-weight: 900;
  background: rgba(255, 209, 102, 0.42);
}

.log-reflection {
  color: #4c5573;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.log-learning {
  display: block;
  margin-top: 5px;
  color: #28365f;
  font-size: 0.82rem;
  font-weight: 850;
}

.log-score {
  color: #5b50c7;
  font-size: 1rem;
  font-weight: 950;
}

.log-date {
  color: #68708a;
  font-weight: 850;
}

.log-actions {
  justify-items: start;
}

.remove-button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  cursor: pointer;
  color: #8b1e4f;
  font-size: 0.82rem;
  font-weight: 900;
  background: rgba(255, 111, 177, 0.14);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.remove-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 111, 177, 0.24);
}

.history-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.72fr) minmax(0, 1.3fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.history-game {
  font-weight: 900;
}

.history-action {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-learning {
  display: block;
  margin-top: 4px;
  color: #3f4764;
  font-size: 0.86rem;
  font-weight: 800;
}

.history-score {
  color: #5b57a8;
  font-weight: 950;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-workspace {
    grid-template-columns: 1fr;
  }

  .side-tabs {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tab-button {
    text-align: center;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .tab-panel,
  .tab-panel.active {
    grid-template-columns: 1fr;
  }
}

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

  .log-table {
    min-width: 680px;
  }
}

@media (max-width: 520px) {
  .tracker-panel,
  .result-card {
    border-radius: 18px;
    padding: 16px;
  }

  .suggestion-actions,
  .history-item {
    grid-template-columns: 1fr;
  }

  .history-action {
    white-space: normal;
  }
}
