:root {
  color-scheme: light;
  --ink: #203233;
  --muted: #5d6866;
  --paper: #fffaf0;
  --soft: #f7f2df;
  --teal: #2f7a7b;
  --coral: #df6f5c;
  --sun: #f1bd48;
  --leaf: #6c9855;
  --line: rgba(32, 50, 51, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

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

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

.kicker {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 7vw, 4.25rem);
  line-height: 0.95;
}

.icon-button,
.close-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.welcome-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 20px;
  align-items: center;
  min-height: 210px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.welcome-copy h2 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 4vw, 3rem);
}

.welcome-copy p {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.mascot {
  position: relative;
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: inset -18px -22px 0 rgba(32, 50, 51, 0.08);
}

.mascot span {
  position: absolute;
  top: 52px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
}

.mascot span:first-child {
  left: 44px;
}

.mascot span:last-child {
  right: 44px;
}

.ad-band {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  margin: 18px 0 30px;
  border: 1px dashed rgba(47, 122, 123, 0.45);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.7);
  color: var(--muted);
}

.ad-band span {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(47, 122, 123, 0.12);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.games-section {
  margin-top: 10px;
}

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

.section-title h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.section-title p {
  margin-bottom: 2px;
  color: var(--muted);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.game-card {
  min-height: 258px;
  padding: 0 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.game-card:hover,
.game-card:focus-visible {
  outline: 3px solid rgba(47, 122, 123, 0.22);
}

.game-thumb {
  position: relative;
  display: flex;
  align-items: end;
  width: 100%;
  aspect-ratio: 16 / 8;
  min-height: 128px;
  margin-bottom: 13px;
  padding: 13px;
  background:
    linear-gradient(180deg, rgba(32, 50, 51, 0.02), rgba(32, 50, 51, 0.7)),
    var(--cover),
    linear-gradient(135deg, var(--accent, var(--teal)), rgba(255, 250, 240, 0.55));
  background-position: center;
  background-size: cover;
  color: #fff;
}

.game-thumb span {
  position: relative;
  z-index: 1;
  max-width: 100%;
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.game-card h3 {
  margin: 0 15px 6px;
  font-size: 1.12rem;
}

.game-card p {
  margin: 0 15px 12px;
  color: var(--muted);
  line-height: 1.35;
}

.age-label {
  display: inline-flex;
  align-items: center;
  margin-left: 15px;
  min-height: 26px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(108, 152, 85, 0.14);
  color: #3c6934;
  font-size: 0.82rem;
  font-weight: 700;
}

.game-dialog {
  width: min(1060px, calc(100% - 20px));
  height: min(760px, calc(100dvh - 20px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.game-dialog::backdrop {
  background: rgba(32, 50, 51, 0.55);
}

.game-frame-top {
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 16px;
  border-bottom: 1px solid var(--line);
}

.game-dialog iframe {
  width: 100%;
  height: calc(100% - 52px);
  border: 0;
  background: #fff;
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 22px, 1120px);
    padding-top: 14px;
  }

  .welcome-band {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 20px;
  }

  .mascot {
    width: 104px;
  }

  .mascot span {
    top: 36px;
    width: 13px;
    height: 13px;
  }

  .mascot span:first-child {
    left: 30px;
  }

  .mascot span:last-child {
    right: 30px;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }
}
