:root {
  --ink: #161b2d;
  --paper: #fffdf7;
  --surface: #ffffff;
  --surface-soft: #fff7e8;
  --coral: #ff6b53;
  --coral-dark: #ae311f;
  --sky: #38b6ff;
  --sky-soft: #cae6ff;
  --mint: #2ec4b6;
  --mint-soft: #daf7ef;
  --gold: #ffb703;
  --gold-soft: #ffdea9;
  --lavender: #e7e1ff;
  --muted: #59413d;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 5% 8%, rgba(56, 182, 255, 0.12), transparent 22rem),
    radial-gradient(circle at 93% 19%, rgba(255, 183, 3, 0.15), transparent 18rem),
    var(--paper);
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 2px solid var(--ink);
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 4px 0 var(--ink);
  backdrop-filter: blur(10px);
}

.topbar__inner {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: min(100%, 1080px);
  min-height: 66px;
  margin: 0 auto;
  padding: 9px 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: var(--gold-soft);
  box-shadow: 0 2px 0 var(--ink);
  font-size: 22px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1,
.brand-copy p {
  margin: 0;
}

.brand-copy h1 {
  overflow: hidden;
  font-size: clamp(15px, 4.6vw, 20px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.class-pill,
.season-chip,
.week-chip,
.game-count,
.future-status,
.student-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.class-pill {
  min-height: 34px;
  padding: 0 9px;
  background: var(--gold-soft);
  box-shadow: 0 2px 0 var(--ink);
  font-size: 10px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 20px 14px 48px;
}

.mobile-banner {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #f4f2ff;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 11px;
}

.mobile-banner strong {
  min-width: 0;
  flex: 1;
}

.season-chip {
  min-height: 26px;
  padding: 0 8px;
  border-width: 1px;
  background: var(--sky-soft);
  font-size: 9px;
}

.weekly {
  display: grid;
  gap: 12px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.hero-ribbon,
.week-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.hero-ribbon {
  background: var(--coral);
  color: white;
  letter-spacing: 0.04em;
}

.week-chip {
  background: var(--gold-soft);
}

.tactile-card {
  border: 2px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
}

.featured-card {
  display: grid;
  gap: 18px;
  padding: 12px;
  border-radius: 27px;
  background: var(--surface);
}

.cover-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: linear-gradient(145deg, var(--sky-soft), var(--mint-soft));
}

.featured-cover {
  width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--ink);
}

.cover-shell > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-shell::after {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(transparent, rgba(22, 27, 45, 0.34));
  content: "";
  pointer-events: none;
}

.cover-fallback {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 14px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 183, 3, 0.75), transparent 20%),
    linear-gradient(135deg, #a8e6d5, #9cd8ff 53%, #ffd3ca);
  text-align: center;
}

.cover-fallback span {
  font-size: 36px;
}

.cover-fallback strong {
  font-size: 14px;
}

.cover-shell.has-cover-error > img {
  visibility: hidden;
}

.cover-shell.has-cover-error .cover-fallback {
  z-index: 0;
}

.cover-fallback--hero span {
  font-size: 64px;
}

.cover-fallback--hero strong {
  font-size: 22px;
}

.floating-chips {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.floating-chips span {
  padding: 5px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 2px 0 var(--ink);
  font-size: 9px;
  font-weight: 800;
}

.featured-copy {
  display: grid;
  min-width: 0;
  gap: 11px;
}

.featured-kicker,
.game-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.subject-chip,
.ready-chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 8px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
}

.subject-chip--matematik {
  background: var(--sky-soft);
}

.subject-chip--turkce {
  background: #ffe7a8;
}

.subject-chip--fen {
  background: var(--mint-soft);
}

.subject-chip--hayat-bilgisi,
.subject-chip--diger {
  background: var(--lavender);
}

.student-chip {
  min-height: 27px;
  padding: 0 8px;
  border-width: 1.5px;
  background: #f4f2ff;
  font-size: 9px;
}

.featured-copy h2 {
  margin: 0;
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.featured-description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.learning-box {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1.5px solid rgba(22, 27, 45, 0.5);
  border-radius: 12px;
  background: #f7f5ff;
  font-size: 10px;
}

.learning-box strong {
  font-size: 11px;
}

.tactile {
  border: 2px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.tactile:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.primary-play {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  gap: 10px;
  border-radius: 16px;
  background: var(--coral);
  color: white;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
}

.safe-note {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.games-section {
  display: grid;
  gap: 13px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 2px solid rgba(22, 27, 45, 0.18);
}

.section-heading > div {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.section-emoji {
  font-size: 23px;
}

.game-count {
  min-height: 28px;
  padding: 0 8px;
  background: #ececff;
  font-size: 8px;
}

.subject-filters {
  display: flex;
  gap: 6px;
  padding: 3px 0 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.subject-filters::-webkit-scrollbar {
  display: none;
}

.filter-button {
  min-height: 42px;
  padding: 0 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 0 var(--ink);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.filter-button.is-active {
  background: var(--sky-soft);
}

.games-grid {
  display: grid;
  gap: 13px;
}

.game-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 11px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: white;
  box-shadow: 0 5px 0 var(--ink);
}

.game-card[hidden] {
  display: none;
}

.game-card__cover {
  width: 82px;
  height: 82px;
  border-radius: 14px;
  box-shadow: 0 2px 0 var(--ink);
}

.game-card__body {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.game-card__body h3,
.game-card__body p {
  margin: 0;
}

.game-card__body h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.game-card__body p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ready-chip {
  border: 0;
  padding: 0;
  color: #168267;
  font-size: 8px;
}

.mini-play {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.future-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 104px;
  padding: 12px;
  border: 2px dashed rgba(22, 27, 45, 0.62);
  border-radius: 18px;
  background: rgba(236, 236, 255, 0.52);
}

.future-lock {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px dashed rgba(22, 27, 45, 0.45);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 25px;
}

.future-card strong,
.future-card p {
  margin: 0;
}

.future-card strong {
  display: block;
  font-size: 15px;
}

.future-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
}

.future-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--coral-dark);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.future-status {
  grid-column: 2;
  justify-self: start;
  min-height: 24px;
  padding: 0 7px;
  border-width: 1px;
  background: white;
  font-size: 8px;
}

.teacher-note {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 15px;
  border-radius: 21px;
  background: var(--gold-soft);
}

.teacher-avatar {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 0 var(--ink);
}

.teacher-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.teacher-label {
  color: #725000;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.teacher-note h2,
.teacher-note p {
  margin: 0;
}

.teacher-note h2 {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.teacher-note p {
  margin-top: 5px;
  color: #5e4100;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
}

.trust-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: 17px;
  background: #e9e5ff;
  box-shadow: 0 4px 0 var(--ink);
}

.trust-card > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: white;
  font-size: 22px;
}

.trust-card strong,
.trust-card p {
  margin: 0;
}

.trust-card strong {
  font-size: 13px;
}

.trust-card p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.empty-hero,
.loading-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 22px;
  background: white;
}

.empty-hero h2,
.empty-hero p,
.loading-card p {
  margin: 0;
}

.empty-orbit {
  font-size: 56px;
}

.loading-card {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  border: 2px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}

.loading-card p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.loading-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--coral);
  animation: bob 900ms ease-in-out infinite alternate;
}

.site-footer {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 16px;
  border-top: 2px solid var(--ink);
  background: #f4f2ff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

@keyframes bob {
  to {
    transform: translateY(-5px);
  }
}

@media (min-width: 700px) {
  .app-shell {
    padding-inline: 30px;
  }

  .mobile-banner {
    display: none;
  }

  .featured-card {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    align-items: stretch;
    padding: 20px;
  }

  .featured-cover {
    min-height: 360px;
  }

  .featured-copy {
    align-content: center;
  }

  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-note {
    grid-template-columns: 76px minmax(0, 1fr);
    padding: 20px;
  }

  .teacher-avatar {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 350px) {
  .topbar__inner {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 7px;
    padding-inline: 9px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 19px;
  }

  .class-pill {
    padding-inline: 7px;
    font-size: 9px;
  }

  .app-shell {
    padding-inline: 10px;
  }

  .featured-card {
    padding: 10px;
  }

  .featured-copy h2 {
    font-size: 29px;
  }

  .game-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 9px;
    padding: 9px;
  }

  .game-card__cover {
    width: 72px;
    height: 72px;
  }

  .game-card__meta {
    gap: 3px;
  }

  .subject-chip {
    min-height: 24px;
    font-size: 8px;
  }

  .teacher-note {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .teacher-avatar {
    width: 52px;
    height: 52px;
    font-size: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
