:root {
  --ink: #172033;
  --muted: #667085;
  --paper: #fbfaf6;
  --card: rgba(255, 255, 255, 0.94);
  --line: rgba(23, 32, 51, 0.09);
  --shadow: 0 18px 50px rgba(28, 36, 53, 0.10);
  --shadow-hover: 0 24px 65px rgba(28, 36, 53, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(39, 95, 171, 0.07), transparent 28rem),
    radial-gradient(circle at 85% 18%, rgba(255, 194, 46, 0.08), transparent 26rem),
    var(--paper);
  min-height: 100vh;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

.site-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 24px);
  margin: 0 auto;
}
.brand-lockup .controller {
  width: clamp(84px, 11vw, 145px);
  flex: 0 0 auto;
}
.brand-lockup .wordmark {
  width: clamp(230px, 40vw, 520px);
}

.home-hero {
  padding: clamp(44px, 7vw, 88px) 0 28px;
  text-align: center;
}
.home-hero h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.home-hero p {
  max-width: 640px;
  margin: 22px auto 0;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.6;
  color: var(--muted);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 24px 0 60px;
}
.game-card {
  min-height: 300px;
  padding: 30px 24px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  overflow: hidden;
  position: relative;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .48;
  pointer-events: none;
}
.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(23, 32, 51, .16);
}
.game-card img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}
.game-card span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #536075;
}
.game-card.chicky::before { background: linear-gradient(145deg, rgba(255,214,0,.15), transparent 56%); }
.game-card.pengu::before { background: linear-gradient(145deg, rgba(219,171,91,.17), transparent 56%); }
.game-card.cozy::before { background: linear-gradient(145deg, rgba(204,34,47,.11), transparent 56%); }
.game-card.solitaire::before { background: linear-gradient(145deg, rgba(14,130,62,.13), transparent 56%); }

.about {
  max-width: 820px;
  margin: 0 auto;
  padding: 10px 0 64px;
  text-align: center;
}
.about h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 12px; }
.about p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 17px; }

.site-footer {
  text-align: center;
  padding: 24px 16px 36px;
  color: #8b94a5;
  font-size: 14px;
}

.game-page {
  --accent: #234f88;
  --accent-dark: #173b6a;
  --tint: rgba(35, 79, 136, .08);
}
.game-page.chicky {
  --accent: #e0a400;
  --accent-dark: #a96900;
  --tint: rgba(245, 190, 0, .10);
}
.game-page.pengu {
  --accent: #b97931;
  --accent-dark: #7d451a;
  --tint: rgba(185, 121, 49, .09);
}
.game-page.cozy {
  --accent: #bf2834;
  --accent-dark: #851923;
  --tint: rgba(191, 40, 52, .08);
}
.game-page.solitaire {
  --accent: #0b8c43;
  --accent-dark: #075428;
  --tint: rgba(11, 140, 67, .09);
}

.game-header {
  padding: 30px 0 14px;
  text-align: center;
}
.brand-home {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  border-radius: 14px;
}
.game-header .brand-lockup { justify-content: center; }
.game-header .controller { width: clamp(62px, 8vw, 105px); }
.game-header .wordmark { width: clamp(190px, 31vw, 390px); }
.brand-home-label {
  margin-top: 5px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .08em;
}
.brand-home:hover .brand-home-label,
.brand-home:focus-visible .brand-home-label { text-decoration: underline; }
.brand-home:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent);
  outline-offset: 5px;
}

.game-main {
  padding: 20px 0 70px;
}
.game-panel {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 54px);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.game-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}
.game-logo {
  width: min(100%, 560px);
  max-height: 260px;
  object-fit: contain;
  margin: 4px auto 22px;
}
.app-icon {
  width: clamp(150px, 28vw, 230px);
  aspect-ratio: 1;
  object-fit: contain;
  margin: 6px auto 28px;
  filter: drop-shadow(0 14px 22px rgba(20, 28, 43, .15));
}
.game-panel .intro {
  max-width: 610px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
}
.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 13px 21px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 750;
  font-size: 16px;
  transition: transform .18s ease, filter .18s ease;
}
.button:hover { transform: translateY(-2px); filter: brightness(.98); }
.button.primary { background: var(--accent); color: #fff; }
.button.secondary { background: var(--tint); color: var(--accent-dark); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.button.disabled { background: #eceef2; color: #70798a; cursor: default; }

.back-home {
  display: inline-block;
  margin-top: 28px;
  text-decoration: none;
  color: #747f92;
  font-size: 15px;
}
.back-home:hover { text-decoration: underline; }

.support-line {
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 15px;
}
.support-line a { color: var(--accent-dark); font-weight: 700; }

@media (max-width: 820px) {
  .games-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 230px; }
  .game-card img { max-height: 150px; }
}

@media (max-width: 520px) {
  .site-shell { width: min(100% - 24px, 1180px); }
  .home-hero { padding-top: 34px; }
  .brand-lockup { gap: 8px; }
  .brand-lockup .controller { width: 74px; }
  .brand-lockup .wordmark { width: min(72vw, 300px); }
  .game-panel { border-radius: 22px; padding: 30px 18px; }
  .actions { flex-direction: column; }
  .button { width: 100%; }
}
