:root{
  color-scheme:light;
  --sky:#7ecaf2;
  --sky-deep:#4e9dce;
  --cream:#fff9e9;
  --paper:#fffef8;
  --ink:#29435d;
  --muted:#62778a;
  --coral:#ff9cab;
  --gold:#ffc83d;
  --gold-deep:#d99922;
  --mint:#9edaa8;
  --lavender:#c8b7f2;
  --line:#c8d8df;
  --surface:#fffef8;
  --surface-soft:#f4fbff;
  --danger:#c4424d;
  --success:#347d52;
  --shadow:0 18px 0 rgba(73,108,129,.10),0 24px 55px rgba(52,85,105,.14);
}

html[data-theme="dark"]{
  color-scheme:dark;
  --cream:#0d1a2a;
  --paper:#15263a;
  --ink:#f5f1e5;
  --muted:#b5c3cf;
  --line:#38506a;
  --surface:#15263a;
  --surface-soft:#1b3048;
  --sky:#295878;
  --sky-deep:#8acff4;
  --shadow:0 18px 0 rgba(0,0,0,.14),0 24px 55px rgba(0,0,0,.28);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  color:var(--ink);
  background:
    radial-gradient(circle at 12px 12px,rgba(255,200,61,.13) 0 3px,transparent 4px) 0 0/32px 32px,
    var(--cream);
  font-family:"Trebuchet MS","Segoe UI",system-ui,sans-serif;
  line-height:1.55;
}
button,input{font:inherit}
a{color:inherit}
img{max-width:100%}
:focus-visible{outline:3px solid var(--sky-deep);outline-offset:3px}

.site-header,.auth-top{
  width:min(1180px,calc(100% - 32px));
  margin:16px auto 0;
  min-height:70px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:10px 14px;
  border:3px solid rgba(255,255,255,.92);
  border-radius:22px 28px 24px 26px;
  background:color-mix(in srgb,var(--surface) 90%,transparent);
  box-shadow:0 5px 0 rgba(57,117,166,.20);
  backdrop-filter:blur(12px);
  position:relative;
  z-index:5;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  min-width:0;
}
.brand img{
  width:50px;
  height:50px;
  border-radius:16px;
  border:3px solid #fff;
  box-shadow:0 4px 0 rgba(57,117,166,.25);
}
.brand span{display:grid;line-height:1.1}
.brand strong{font-family:Georgia,serif;font-size:19px}
.brand small{margin-top:4px;color:var(--muted);font-weight:800;font-size:11px}
.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}

.button,.theme-button{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 16px;
  border:2px solid var(--line);
  border-radius:14px 18px 15px 17px;
  background:var(--surface);
  color:var(--ink);
  font-weight:900;
  text-decoration:none;
  cursor:pointer;
  box-shadow:0 4px 0 color-mix(in srgb,var(--line) 70%,transparent);
  transition:transform .16s ease,box-shadow .16s ease;
}
.button:hover,.theme-button:hover{transform:translateY(-2px)}
.button:active,.theme-button:active{transform:translateY(1px);box-shadow:0 1px 0 color-mix(in srgb,var(--line) 70%,transparent)}
.button.primary{
  border-color:var(--gold-deep);
  background:linear-gradient(180deg,#ffe071,var(--gold));
  color:#594319;
  box-shadow:0 5px 0 var(--gold-deep);
}
.button.large{min-height:52px;padding:13px 20px;font-size:15px}
.button.compact{min-height:42px;padding:8px 14px}
.button.full{width:100%}
.theme-button{white-space:nowrap}

.hero{
  width:min(1220px,calc(100% - 28px));
  min-height:min(680px,76vh);
  margin:16px auto 0;
  display:flex;
  align-items:center;
  padding:clamp(28px,6vw,78px);
  border:4px solid #fff;
  border-radius:36px 28px 42px 30px;
  background:
    linear-gradient(90deg,rgba(255,254,248,.98) 0%,rgba(255,254,248,.94) 30%,rgba(255,254,248,.18) 60%,rgba(255,254,248,0) 100%),
    url("../images/pwa-hero-storybook.png") center/cover no-repeat;
  box-shadow:var(--shadow);
  overflow:hidden;
}
html[data-theme="dark"] .hero{
  background:
    linear-gradient(90deg,rgba(13,26,42,.98) 0%,rgba(13,26,42,.93) 31%,rgba(13,26,42,.22) 62%,rgba(13,26,42,0) 100%),
    url("../images/pwa-hero-storybook.png") center/cover no-repeat;
}
.hero-content{max-width:560px}
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin-bottom:12px;
  color:#bb6833;
  font-size:12px;
  font-weight:1000;
  letter-spacing:.1em;
}
.eyebrow::before{content:"★";color:var(--gold-deep)}
h1,h2,h3{font-family:Georgia,"Times New Roman",serif;text-wrap:balance}
.hero h1{
  margin:0;
  font-size:clamp(38px,6vw,72px);
  line-height:.97;
  letter-spacing:-.045em;
}
.hero p{max-width:520px;margin:20px 0;color:var(--muted);font-size:clamp(16px,2vw,19px);font-weight:700}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}
.trust-row{display:flex;gap:14px;flex-wrap:wrap;margin-top:22px;font-size:12px;font-weight:900;color:var(--muted)}

.section-shell{width:min(1120px,calc(100% - 32px));margin:70px auto 0}
.intro-section{display:grid;grid-template-columns:1.1fr .9fr;gap:40px;align-items:end}
.intro-section h2,.access-banner h2{margin:0;font-size:clamp(30px,4.6vw,52px);line-height:1.04}
.intro-section>p{margin:0;color:var(--muted);font-size:17px;font-weight:700}
.game-showcase{display:grid;grid-template-columns:repeat(2,1fr);gap:18px;margin-top:30px}
.showcase-card{
  min-height:210px;
  display:flex;
  align-items:center;
  gap:22px;
  padding:24px;
  border:3px solid rgba(255,255,255,.9);
  border-radius:28px 22px 30px 24px;
  box-shadow:0 8px 0 rgba(81,116,136,.14);
}
.showcase-card.coral{background:color-mix(in srgb,var(--coral) 28%,var(--surface))}
.showcase-card.blue{background:color-mix(in srgb,var(--sky) 28%,var(--surface))}
.showcase-card.mint{background:color-mix(in srgb,var(--mint) 32%,var(--surface))}
.showcase-card.lavender{background:color-mix(in srgb,var(--lavender) 30%,var(--surface))}
.showcase-icon{
  width:86px;height:86px;flex:0 0 86px;
  display:grid;place-items:center;
  border:3px solid #fff;border-radius:28px 23px 26px 22px;
  background:rgba(255,255,255,.72);
  font-size:42px;
  box-shadow:0 6px 0 rgba(70,108,130,.16);
  transform:rotate(-3deg);
}
.showcase-card small{font-weight:1000;color:var(--muted);letter-spacing:.06em}
.showcase-card h3{margin:4px 0;font-size:26px}
.showcase-card p{margin:0;color:var(--muted);font-weight:700}
.access-banner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:28px;
  margin-bottom:70px;
  padding:clamp(28px,5vw,54px);
  border:4px solid #fff;
  border-radius:32px 26px 36px 28px;
  background:
    radial-gradient(circle at 92% 20%,rgba(255,255,255,.7) 0 7px,transparent 8px),
    color-mix(in srgb,var(--sky) 24%,var(--surface));
  box-shadow:var(--shadow);
}
.access-banner>div{max-width:720px}
.access-banner p{margin:12px 0 0;color:var(--muted);font-weight:700}
.site-footer{
  width:min(1120px,calc(100% - 32px));
  margin:28px auto 20px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.auth-page{
  background:
    radial-gradient(circle at 14% 20%,rgba(255,156,171,.23),transparent 25rem),
    radial-gradient(circle at 84% 8%,rgba(126,202,242,.27),transparent 28rem),
    var(--cream);
}
.auth-shell{
  width:min(1080px,calc(100% - 32px));
  min-height:calc(100vh - 190px);
  margin:22px auto;
  display:grid;
  grid-template-columns:1.1fr .9fr;
  align-items:stretch;
  border:4px solid #fff;
  border-radius:34px 26px 38px 28px;
  overflow:hidden;
  background:var(--surface);
  box-shadow:var(--shadow);
}
.auth-shell.single{grid-template-columns:minmax(0,560px);justify-content:center;min-height:auto;max-width:660px}
.auth-illustration{
  min-height:580px;
  background:url("../images/pwa-hero-storybook.png") 65% center/cover no-repeat;
}
.auth-card{align-self:center;padding:clamp(28px,6vw,64px)}
.auth-card h1{margin:0;font-size:clamp(32px,4.5vw,48px);line-height:1.05}
.auth-card>p{margin:12px 0 22px;color:var(--muted);font-weight:700}
.form-stack{display:grid;gap:16px}
.form-stack label{display:grid;gap:7px}
.form-stack label>span{font-size:13px;font-weight:900}
.form-stack input{
  width:100%;
  min-height:50px;
  padding:11px 13px;
  border:2px solid var(--line);
  border-radius:14px;
  background:var(--surface-soft);
  color:var(--ink);
  outline:none;
}
.form-stack input:focus{border-color:var(--sky-deep);box-shadow:0 0 0 4px color-mix(in srgb,var(--sky) 22%,transparent)}
.password-field{position:relative}
.password-field input{padding-right:48px}
.password-field button{
  position:absolute;right:6px;top:6px;width:38px;height:38px;
  border:0;background:transparent;cursor:pointer;border-radius:10px;
}
.notice{margin:16px 0;padding:12px 14px;border:2px solid var(--line);border-radius:14px;font-weight:800;font-size:13px}
.notice.error{border-color:color-mix(in srgb,var(--danger) 45%,var(--line));background:color-mix(in srgb,var(--danger) 9%,var(--surface));color:var(--danger)}
.notice.success{border-color:color-mix(in srgb,var(--success) 48%,var(--line));background:color-mix(in srgb,var(--success) 9%,var(--surface));color:var(--success)}
.auth-links{display:grid;gap:8px;margin-top:20px;text-align:center;font-size:13px;font-weight:800}
.auth-links a{color:var(--sky-deep)}

.dashboard-main{width:min(1120px,calc(100% - 32px));margin:22px auto 60px}
.welcome-card{
  min-height:270px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:clamp(26px,5vw,48px);
  border:4px solid #fff;
  border-radius:32px 25px 36px 28px;
  background:
    radial-gradient(circle at 16px 16px,rgba(255,200,61,.18) 0 3px,transparent 4px) 0 0/34px 34px,
    color-mix(in srgb,var(--sky) 28%,var(--surface));
  box-shadow:var(--shadow);
}
.welcome-card>div{max-width:720px}
.welcome-card h1{margin:0;font-size:clamp(34px,5vw,58px);line-height:1.02}
.welcome-card p{color:var(--muted);font-weight:700}
.welcome-card>img{width:min(210px,24vw);border-radius:30px;transform:rotate(3deg);box-shadow:0 9px 0 rgba(72,108,129,.18)}
.dashboard-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:20px;margin-top:28px}
.game-card{
  min-height:270px;
  display:grid;
  grid-template-columns:42% 58%;
  overflow:hidden;
  border:4px solid #fff;
  border-radius:30px 23px 34px 26px;
  text-decoration:none;
  background:var(--surface);
  box-shadow:0 9px 0 rgba(70,106,126,.14),0 22px 42px rgba(56,88,107,.10);
  transition:transform .18s ease;
}
.game-card:hover{transform:translateY(-4px) rotate(-.3deg)}
.game-art{min-height:270px;background:color-mix(in srgb,var(--sky) 25%,var(--surface));overflow:hidden}
.game-art img{width:100%;height:100%;display:block;object-fit:cover}
.game-art.wide img{object-position:68% center}
.game-copy{align-self:center;padding:22px}
.game-copy>span{font-size:10px;font-weight:1000;letter-spacing:.08em;color:var(--muted)}
.game-copy h2{margin:5px 0;font-size:clamp(24px,3vw,34px)}
.game-copy p{margin:0 0 16px;color:var(--muted);font-size:13px;font-weight:700}
.game-copy strong{color:#a8612e;font-size:13px}
.letter-art{
  min-height:270px;
  display:grid;grid-template-columns:repeat(3,56px);place-content:center;gap:10px;
  background:color-mix(in srgb,var(--mint) 32%,var(--surface));
}
.letter-art b{
  width:56px;height:56px;display:grid;place-items:center;
  border:3px solid #fff;border-radius:16px 13px 17px 14px;
  background:var(--sky);color:#fff;font-size:23px;
  box-shadow:0 5px 0 rgba(50,104,137,.28);
}
.letter-art b:nth-child(2n){background:var(--coral)}.letter-art b:nth-child(3n){background:var(--gold);color:#594319}

@media(max-width:820px){
  .hero{
    min-height:760px;
    align-items:flex-start;
    padding:28px;
    background:
      linear-gradient(180deg,rgba(255,254,248,.98) 0%,rgba(255,254,248,.93) 42%,rgba(255,254,248,.05) 68%,transparent 100%),
      url("../images/pwa-hero-storybook.png") 60% bottom/auto 62% no-repeat,
      var(--sky);
  }
  html[data-theme="dark"] .hero{
    background:
      linear-gradient(180deg,rgba(13,26,42,.98) 0%,rgba(13,26,42,.93) 42%,rgba(13,26,42,.08) 68%,transparent 100%),
      url("../images/pwa-hero-storybook.png") 60% bottom/auto 62% no-repeat,
      var(--sky);
  }
  .hero-content{max-width:100%}
  .intro-section,.game-showcase,.dashboard-grid{grid-template-columns:1fr}
  .access-banner{align-items:flex-start;flex-direction:column}
  .auth-shell{grid-template-columns:1fr}
  .auth-illustration{min-height:280px;background-position:60% 45%}
  .game-card{min-height:240px}
  .game-art,.letter-art{min-height:240px}
}

@media(max-width:560px){
  .site-header,.auth-top{width:calc(100% - 20px);margin-top:10px}
  .brand small{display:none}
  .brand strong{font-size:16px}
  .brand img{width:42px;height:42px}
  .theme-button [data-theme-label]{display:none}
  .hero{width:calc(100% - 16px);min-height:690px;margin-top:10px;padding:22px;border-radius:26px 20px 30px 22px}
  .hero h1{font-size:42px}
  .section-shell,.dashboard-main{width:calc(100% - 20px)}
  .section-shell{margin-top:50px}
  .showcase-card{align-items:flex-start;flex-direction:column}
  .site-footer{width:calc(100% - 20px);flex-direction:column}
  .auth-shell{width:calc(100% - 20px)}
  .auth-illustration{min-height:220px}
  .auth-card{padding:26px 20px}
  .welcome-card{align-items:flex-start}
  .welcome-card>img{display:none}
  .game-card{grid-template-columns:1fr}
  .game-art,.letter-art{min-height:190px}
  .game-copy{padding:20px}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}
}

