:root {
  color-scheme: light;
  --ink: #16212f;
  --muted: #657386;
  --paper: #fffaf1;
  --surface: #ffffff;
  --line: #dde4ed;
  --blue: #2467c9;
  --green: #1f9f75;
  --gold: #e0a42c;
  --coral: #e55b55;
  --violet: #6955d9;
  --shadow: 0 18px 45px rgba(31, 45, 61, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(224, 164, 44, 0.2), transparent 32rem),
    linear-gradient(135deg, #f7fbff 0%, #fffaf1 52%, #f1f8f4 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 20px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #17324d;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
  box-shadow: var(--shadow);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.55rem, 4vw, 2.5rem);
  line-height: 1.05;
}

.subtitle {
  color: var(--muted);
  margin-top: 4px;
}

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

.profile-card,
.panel,
.activity-card,
.reward-card {
  border: 1px solid rgba(221, 228, 237, 0.9);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.profile-card {
  min-height: 196px;
  border-radius: 8px;
  padding: 22px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  transition: transform 150ms ease, border-color 150ms ease;
}

.profile-card:hover,
.profile-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--blue);
  outline: none;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 900;
}

.julinka {
  background: linear-gradient(135deg, #e55b55, #e0a42c);
}

.ondrasek {
  background: linear-gradient(135deg, #2467c9, #1f9f75);
}

.profile-card h2 {
  font-size: 1.55rem;
  margin-bottom: 8px;
}

.profile-mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.profile-mini-row span {
  border-radius: 999px;
  background: #f1f5f9;
  color: #324256;
  font-size: 0.9rem;
  font-weight: 850;
  padding: 7px 10px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.panel {
  border-radius: 8px;
  padding: 18px;
}

.hero-panel {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(23, 50, 77, 0.96), rgba(36, 103, 201, 0.88)),
    #17324d;
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.switch-button,
.secondary-button,
.primary-button,
.small-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

.switch-button,
.secondary-button {
  background: #edf3f8;
  color: var(--ink);
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.danger-button {
  background: #fff0ef;
  color: #a6312c;
}

.level-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.level {
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  font-weight: 950;
  letter-spacing: 0;
}

.coins {
  padding: 10px 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 900;
}

.player-title {
  display: inline-flex;
  margin-top: 8px;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 900;
}

.xp-bar {
  width: 100%;
  height: 18px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  margin: 14px 0 8px;
}

.xp-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #e0a42c, #54d190);
  border-radius: inherit;
  transition: width 350ms ease;
}

.xp-text {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.quest-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.quest-strip.complete {
  background: rgba(84, 209, 144, 0.2);
}

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

.today-list {
  display: grid;
  gap: 12px;
}

.daily-bonus {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 14px;
  background: #fff6df;
  border: 1px solid #f0d28a;
}

.daily-bonus p {
  color: #6c5a2b;
  font-size: 0.95rem;
  margin-top: 3px;
}

.daily-bonus > span {
  flex: 0 0 auto;
  min-width: 68px;
  border-radius: 999px;
  background: #17324d;
  color: #fff;
  font-weight: 950;
  padding: 9px 12px;
  text-align: center;
}

.daily-bonus.claimed {
  background: #eef8f2;
  border-color: #bde8cf;
}

.activity-card {
  border-radius: 8px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.activity-card.is-done {
  border-color: #9eddbf;
  background: #f3fbf7;
}

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

.activity-heading,
.stat-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.activity-icon,
.badge-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #17324d;
  color: #fff;
  font-weight: 950;
}

.activity-icon.small,
.badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.activity-name {
  font-size: 1.15rem;
  font-weight: 900;
}

.activity-meta,
.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.activity-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.done-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e8f7f0;
  color: #0d6e50;
  font-weight: 900;
}

.note-box {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.note-box textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 12px;
}

.stats-list,
.badge-list,
.reward-list {
  display: grid;
  gap: 10px;
}

.stat-line,
.badge,
.reward-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.stat-line span:last-child,
.badge span:last-child {
  flex: 0 0 auto;
  font-weight: 900;
}

.badge.locked {
  opacity: 0.48;
}

.reward-card {
  background: var(--surface);
}

.reward-card button {
  min-width: 96px;
}

.week-table-wrap {
  overflow-x: auto;
}

.week-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.week-table th,
.week-table td {
  text-align: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
}

.week-table th:first-child,
.week-table td:first-child {
  text-align: left;
  font-weight: 900;
}

.cell-muted {
  color: #a7b0bd;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 28px));
  border-radius: 8px;
  padding: 16px 18px;
  background:
    linear-gradient(135deg, rgba(31, 159, 117, 0.24), transparent 55%),
    #17324d;
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
  animation: pop 220ms ease both;
}

.toast strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 2px;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .profile-header,
  .activity-top {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-grid,
  .layout {
    grid-template-columns: 1fr;
  }

  .profile-card {
    min-height: 168px;
  }

  .activity-actions button {
    flex: 1 1 180px;
  }

  .quest-strip,
  .daily-bonus {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-bonus > span {
    width: 100%;
  }
}
