:root {
  --paper: #fff7e9;
  --paper-light: #fffcf7;
  --ink: #20304b;
  --ink-soft: #52617a;
  --sage: #2f9574;
  --sage-light: #bdebd9;
  --rust: #f05d5e;
  --gold: #f2b84b;
  --violet: #7667d8;
  --sky: #75d5f3;
  --lavender: #d8cdfb;
  --line: rgba(32, 48, 75, 0.14);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 11% 23%, rgba(255, 210, 103, 0.28), transparent 25%),
    radial-gradient(circle at 88% 18%, rgba(117, 213, 243, 0.26), transparent 26%),
    radial-gradient(circle at 50% 80%, rgba(216, 205, 251, 0.24), transparent 32%),
    var(--paper);
  font-family: "DM Sans", Arial, sans-serif;
}

body.home-page {
  background-color: #fff0d4;
  background-image:
    radial-gradient(circle at 10% 67%, rgba(255, 125, 91, 0.47), transparent 27%),
    radial-gradient(circle at 88% 72%, rgba(255, 190, 61, 0.52), transparent 29%),
    radial-gradient(circle at 48% 94%, rgba(231, 104, 159, 0.32), transparent 33%),
    linear-gradient(180deg, rgba(255, 250, 239, 0.16) 0, rgba(255, 250, 239, 0.42) 330px, rgba(255, 242, 214, 0.9) 720px, #ffe5b7 1050px, #fff1d8 100%),
    url("assets/draftyverse-fantasy-field-v5.webp");
  /* Keep the dragon's face below the pale navigation strip at every width. */
  background-position: center, center, center, center top, center 92px;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% auto;
  background-attachment: scroll;
}

.home-page .site-header {
  border-bottom-color: rgba(62, 70, 100, 0.2);
  background: rgba(255, 252, 244, 0.5);
  box-shadow: 0 10px 30px rgba(37, 61, 74, 0.08);
  backdrop-filter: blur(12px);
}

.home-page .color-shapes { opacity: 0.16; }

.home-page .edition {
  color: #5144a0;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.9);
}

.home-page .welcome > h1,
.home-page .welcome > .intro,
.home-page .welcome > .eyebrow {
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.95);
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.music-toggle {
  position: fixed;
  z-index: 55;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px 0 11px;
  border: 1px solid rgba(91, 76, 177, 0.22);
  border-radius: 999px;
  color: #5549a8;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 10px 28px rgba(53, 46, 103, 0.16);
  backdrop-filter: blur(12px);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.music-toggle:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(53, 46, 103, 0.21); }
.music-toggle:focus-visible { outline: 3px solid rgba(118, 103, 216, 0.35); outline-offset: 3px; }
.music-note { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: white; background: linear-gradient(145deg, #7667d8, #9a6edb); font-size: 13px; }
.music-toggle i { width: 7px; height: 7px; border-radius: 50%; background: #44a983; box-shadow: 0 0 0 4px rgba(68, 169, 131, 0.14); animation: musicPulse 2.5s ease-in-out infinite; }
.music-toggle[aria-pressed="false"] { color: #777286; opacity: 0.82; }
.music-toggle[aria-pressed="false"] .music-note { background: #918c9d; }
.music-toggle[aria-pressed="false"] i { background: #aaa5b2; box-shadow: none; animation: none; }
.music-toggle:disabled { opacity: 0.48; cursor: not-allowed; }

@keyframes musicPulse { 50% { transform: scale(1.35); box-shadow: 0 0 0 6px rgba(68, 169, 131, 0.08); } }

.page-grain {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0.19;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}

.color-shapes {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  display: block;
  border-radius: 999px;
  filter: blur(1px);
  opacity: 0.7;
  animation: drift 8s ease-in-out infinite alternate;
}

.shape-one {
  top: 152px;
  left: -42px;
  width: 108px;
  height: 108px;
  background: #ffbd73;
}

.shape-two {
  top: 225px;
  right: -55px;
  width: 132px;
  height: 132px;
  background: #a9e8e1;
  animation-delay: -2s;
}

.shape-three {
  top: 58%;
  left: 5%;
  width: 19px;
  height: 19px;
  background: var(--violet);
  box-shadow: 25px 17px 0 -7px var(--rust), -8px 34px 0 -5px var(--gold);
  animation-delay: -4s;
}

.shape-four {
  right: 7%;
  bottom: 15%;
  width: 24px;
  height: 24px;
  border: 6px solid var(--rust);
  background: transparent;
  animation-delay: -1s;
}

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 100px;
  margin: 0 42px;
  border-bottom: 1px solid rgba(118, 103, 216, 0.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font: 600 25px/1 "Newsreader", Georgia, serif;
  letter-spacing: -0.02em;
}

.brand-logo {
  display: block;
  width: 132px;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 15px;
  box-shadow: 0 10px 24px rgba(31, 38, 89, 0.18);
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 31px;
  height: 35px;
  color: var(--paper-light);
}

.brand-mark i {
  position: absolute;
  top: 2px;
  width: 17px;
  height: 29px;
  border-radius: 2px 2px 7px 2px;
  background: linear-gradient(145deg, var(--violet), #5145ad);
  box-shadow: 0 5px 13px rgba(82, 70, 171, 0.22);
}

.brand-mark i:first-child { left: 0; transform: skewY(9deg); }
.brand-mark i:nth-child(2) { right: 0; transform: skewY(-9deg); }
.brand-mark b { z-index: 1; margin-top: -2px; font: 500 12px/1 Georgia, serif; }

.edition {
  margin: 0;
  color: var(--violet);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.header-flourish {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 112px;
  min-height: 46px;
  padding: 12px 20px;
  border: 1px solid rgba(240, 93, 94, 0.25);
  border-radius: 999px;
  color: #d7454b;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 7px 18px rgba(240, 93, 94, 0.09);
  font: inherit;
}

.header-flourish span {
  width: auto;
  height: auto;
  background: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.header-flourish i { font-style: normal; font-size: 13px; }

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.auth-button {
  min-height: 46px;
  padding: 0 19px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #7466d9, #9a6edb);
  box-shadow: 0 8px 20px rgba(93, 75, 185, 0.23);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 11px 25px rgba(93, 75, 185, 0.29);
}

.auth-button:focus-visible {
  outline: 3px solid rgba(118, 103, 216, 0.3);
  outline-offset: 3px;
}

.auth-button[hidden] { display: none; }

.account-wrap {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 5px 13px 5px 6px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #7466d9, #9a6edb);
  box-shadow: 0 8px 20px rgba(93, 75, 185, 0.23);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #6251bd;
  background: #fff8ea;
  font: 600 14px/1 "Newsreader", Georgia, serif;
}

.user-button i {
  margin-left: 2px;
  font-style: normal;
  font-size: 13px;
}

.user-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 9px);
  right: 0;
  width: 220px;
  padding: 16px;
  border: 1px solid rgba(32, 48, 75, 0.13);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 252, 247, 0.97);
  box-shadow: 0 18px 45px rgba(57, 53, 93, 0.18);
}

.user-menu small,
.user-menu strong {
  display: block;
}

.user-menu small {
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.user-menu strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu button {
  width: 100%;
  min-height: 38px;
  margin-top: 14px;
  border: 1px solid rgba(240, 93, 94, 0.23);
  border-radius: 9px;
  color: #d7454b;
  background: #fff4ef;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.user-menu .sync-menu-button {
  margin-top: 14px;
  border-color: rgba(118, 103, 216, 0.24);
  color: #6354be;
  background: #f3efff;
}

.user-menu .sync-menu-button + #signOutButton { margin-top: 7px; }

.auth-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(32, 48, 75, 0.36);
  backdrop-filter: blur(11px);
  animation: modalFade 220ms ease both;
}

.guest-warning-overlay {
  position: fixed;
  z-index: 105;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(34, 38, 70, .44);
  backdrop-filter: blur(13px);
  animation: modalFade 180ms ease both;
}

.guest-warning-dialog {
  position: relative;
  width: min(500px, 100%);
  padding: 37px 40px 34px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 27px;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(117,213,243,.34), transparent 34%),
    radial-gradient(circle at 0 100%, rgba(242,184,75,.29), transparent 32%),
    linear-gradient(145deg, #fffdf8, #f8f2ff);
  box-shadow: 0 30px 90px rgba(31,36,69,.32);
  text-align: center;
  animation: modalRise 300ms cubic-bezier(.2,.8,.2,1) both;
}

.guest-warning-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(32,48,75,.13);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255,255,255,.7);
  font-size: 21px;
  cursor: pointer;
}

.guest-warning-icon { display: grid; place-items: center; width: 55px; height: 55px; margin: 0 auto 18px; border-radius: 18px; color: #fff; background: linear-gradient(145deg, #f06a6f, #f2a052); box-shadow: 0 12px 25px rgba(229,100,95,.25); font-size: 23px; transform: rotate(-4deg); }
.guest-warning-kicker { display: block; margin-bottom: 10px; color: #7566d2; font-size: 8px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.guest-warning-dialog h2 { margin: 0; font: 500 43px/.96 "Newsreader", Georgia, serif; letter-spacing: -.035em; }
.guest-warning-dialog h2 em { color: #7162ce; font-weight: 500; }
.guest-warning-dialog > p { margin: 13px 0 20px; color: var(--ink-soft); font: 500 15px/1.45 "Newsreader", Georgia, serif; }

.guest-saving-note { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 15px; border: 1px solid rgba(225,82,92,.16); border-radius: 14px; background: rgba(255,239,231,.75); text-align: left; }
.guest-saving-note > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; background: #e45c66; font-size: 15px; font-weight: 800; }
.guest-saving-note p { margin: 0; color: #6a5961; font-size: 10px; line-height: 1.55; }
.guest-saving-note strong { display: block; margin-bottom: 2px; color: #b4414b; font-size: 11px; }
.guest-warning-actions { display: grid; gap: 9px; margin-top: 21px; }
.guest-warning-actions button { min-height: 48px; border-radius: 12px; font-size: 10px; font-weight: 800; cursor: pointer; }
.guest-sign-in { border: 0; color: #fff; background: linear-gradient(135deg, #6c5ed1, #946bd8); box-shadow: 0 10px 22px rgba(93,75,185,.22); }
.guest-continue { border: 1px solid rgba(60,64,95,.14); color: #66647a; background: rgba(255,255,255,.7); }
.guest-sign-in:hover { background: linear-gradient(135deg, #5f51c4, #8760cb); }
.guest-continue:hover { color: #4f4b6c; background: #fff; }
.guest-warning-close:focus-visible,
.guest-warning-actions button:focus-visible { outline: 3px solid rgba(118,103,216,.3); outline-offset: 3px; }

.auth-dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 34px 38px 29px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(117, 213, 243, 0.28), transparent 31%),
    radial-gradient(circle at 0 100%, rgba(255, 189, 115, 0.3), transparent 31%),
    #fffaf2;
  box-shadow: 0 28px 80px rgba(31, 36, 69, 0.28);
  animation: modalRise 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.auth-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(32, 48, 75, 0.13);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.66);
  font-size: 21px;
  cursor: pointer;
}

.auth-brand {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}

.auth-logo {
  display: block;
  width: 150px;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  box-shadow: 0 9px 22px rgba(38, 39, 90, 0.16);
}

.auth-brand .brand-mark {
  width: 27px;
  height: 31px;
}

.auth-brand .brand-mark i {
  width: 15px;
  height: 26px;
}

.auth-dialog h2 {
  margin: 0;
  font: 500 40px/1 "Newsreader", Georgia, serif;
  letter-spacing: -0.035em;
}

.auth-intro {
  margin: 8px 0 22px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(118, 103, 216, 0.09);
}

.auth-tabs button {
  min-height: 39px;
  border: 0;
  border-radius: 9px;
  color: #6e6b83;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tabs button.active {
  color: #6354be;
  background: white;
  box-shadow: 0 4px 13px rgba(82, 70, 171, 0.12);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 19px;
}

.auth-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  height: 47px;
  padding: 0 14px;
  border: 1px solid rgba(32, 48, 75, 0.16);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  font: 500 13px/1 "DM Sans", Arial, sans-serif;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.auth-field input:focus {
  border-color: rgba(118, 103, 216, 0.72);
  box-shadow: 0 0 0 3px rgba(118, 103, 216, 0.11);
}

.auth-field input::placeholder {
  color: #a8a9b3;
}

.auth-field .password-input-wrap {
  position: relative;
  display: block;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.password-input-wrap input { padding-right: 66px; }

.password-input-wrap button {
  position: absolute;
  top: 50%;
  right: 7px;
  min-width: 49px;
  min-height: 33px;
  padding: 0 9px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: #6251bd;
  background: #f0ecff;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.password-input-wrap button:focus-visible {
  outline: 2px solid rgba(118, 103, 216, 0.5);
  outline-offset: 1px;
}

.auth-message {
  min-height: 18px;
  margin: -2px 0 -3px;
  color: #d7454b;
  font-size: 10px;
  line-height: 1.5;
}

.auth-message.success { color: #278264; }

.auth-submit {
  height: 49px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: linear-gradient(135deg, #6c5ed1, #936bd7);
  box-shadow: 0 10px 24px rgba(93, 75, 185, 0.22);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.sync-overlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(35, 31, 58, 0.6);
  backdrop-filter: blur(11px);
  animation: modalFade 180ms ease both;
}

.sync-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 44px);
  padding: 38px 40px 34px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 25px;
  background: linear-gradient(145deg, #fffdf8, #f2efff);
  box-shadow: 0 28px 80px rgba(30, 25, 60, 0.32);
}

.sync-close {
  position: absolute;
  top: 15px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #615c72;
  background: white;
  font-size: 22px;
  cursor: pointer;
}

.sync-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, #75d5f3, #7667d8);
  box-shadow: 0 12px 28px rgba(87, 87, 184, 0.24);
  font-size: 25px;
  font-weight: 800;
}

.sync-kicker {
  color: #df5963;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sync-dialog h2 {
  margin: 8px 0 10px;
  font: 600 43px/0.98 "Newsreader", Georgia, serif;
  letter-spacing: -0.035em;
}

.sync-dialog h2 em { color: #6d5ccc; font-weight: 500; }

.sync-dialog > p {
  margin: 0 0 19px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.sync-link-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sync-link-field textarea {
  width: 100%;
  min-height: 76px;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid rgba(32, 48, 75, 0.16);
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  font: 500 10px/1.5 "DM Sans", Arial, sans-serif;
}

.sync-link-field textarea:focus {
  border-color: rgba(118, 103, 216, 0.72);
  box-shadow: 0 0 0 3px rgba(118, 103, 216, 0.11);
}

.sync-message { min-height: 18px; margin: 8px 0 !important; color: #278264 !important; font-weight: 700; }
.sync-message.error { color: #d7454b !important; }
.sync-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sync-actions button { min-height: 47px; padding: 0 14px; border-radius: 11px; font-size: 10px; font-weight: 800; cursor: pointer; }
.sync-copy { border: 0; color: white; background: linear-gradient(135deg, #6c5ed1, #936bd7); }
.sync-import { border: 1px solid rgba(118, 103, 216, 0.24); color: #6251bd; background: white; }
.sync-privacy { display: block; margin-top: 13px; color: #817b8d; font-size: 9px; line-height: 1.55; }

@media(max-width:620px) {
  .sync-overlay { padding: 10px; }
  .sync-dialog { max-height: calc(100vh - 20px); padding: 32px 20px 24px; border-radius: 21px; }
  .sync-dialog h2 { font-size: 35px; }
  .sync-actions { grid-template-columns: 1fr; }
}

.auth-submit:disabled {
  opacity: 0.62;
  cursor: wait;
}

.auth-note {
  margin: 18px 0 0;
  color: #77758a;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.auth-note span { color: var(--rust); }

body.modal-open { overflow: hidden; }

main { position: relative; z-index: 2; }

.welcome {
  width: min(1030px, calc(100% - 116px));
  margin: 0 auto;
  padding: clamp(50px, 7vh, 78px) 0 64px;
  text-align: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #e14d52;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}

.eyebrow-line { width: 34px; height: 1px; background: currentColor; opacity: 0.55; }

h1 {
  max-width: 800px;
  margin: 18px auto 17px;
  color: var(--ink);
  font: 500 clamp(48px, 6.5vw, 78px) / 0.93 "Newsreader", Georgia, serif;
  letter-spacing: -0.055em;
}

h1 em { color: var(--sage); font-weight: 400; }

.intro {
  max-width: 530px;
  margin: 0 auto;
  color: var(--ink-soft);
  font: 400 15px/1.65 "DM Sans", Arial, sans-serif;
}

.welcome-message {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 820px;
  min-height: 60px;
  margin: 22px auto -11px;
  padding: 14px 25px;
  border: 1px solid rgba(118, 103, 216, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(77, 72, 130, 0.06);
}

.welcome-message p {
  margin: 0;
  color: #645ca4;
  font: 500 17px/1.5 "Newsreader", Georgia, serif;
  letter-spacing: 0.015em;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 42px;
}

.path-card {
  position: relative;
  display: grid;
  grid-template-columns: 43% 57%;
  grid-template-rows: 1fr auto;
  min-height: 295px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(32, 48, 75, 0.12);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 45px rgba(73, 78, 112, 0.1);
  cursor: pointer;
  text-align: left;
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 320ms ease, border-color 320ms ease;
}

.path-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-radius: 17px;
}

.path-card:hover {
  transform: translateY(-7px);
  border-color: rgba(118, 103, 216, 0.3);
  box-shadow: 0 24px 58px rgba(77, 72, 130, 0.18);
}

.path-card:focus-visible { outline: 3px solid rgba(118, 103, 216, 0.35); outline-offset: 4px; }
.path-card:active { transform: translateY(-3px); }

.card-number {
  position: absolute;
  z-index: 4;
  top: 17px;
  right: 18px;
  color: rgba(32, 48, 75, 0.48);
  font: 500 11px/1 "Newsreader", Georgia, serif;
  letter-spacing: 0.12em;
}

.card-art {
  position: relative;
  display: block;
  min-height: 238px;
  overflow: hidden;
  border-right: 1px solid rgba(24, 40, 39, 0.09);
  background: linear-gradient(145deg, #baf1df, #9fdfe8);
  transition: transform 180ms ease-out;
}

.card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.75) 0 3px, transparent 4px),
    repeating-linear-gradient(116deg, transparent 0 17px, rgba(49, 78, 93, 0.04) 18px 19px);
}

.paper {
  position: absolute;
  display: block;
  width: 114px;
  height: 146px;
  border-radius: 2px;
  background: #fbf7ed;
  box-shadow: 0 14px 25px rgba(24, 40, 39, 0.16);
}

.paper-back { left: 54px; top: 51px; background: #7fcdb5; transform: rotate(8deg); }
.paper-front { z-index: 2; left: 42px; top: 42px; padding: 38px 18px; transform: rotate(-5deg); }
.paper-front b { display: block; height: 2px; margin-bottom: 12px; background: #b6beb4; }
.paper-front b:nth-child(2) { width: 72%; }
.paper-front b:nth-child(3) { width: 88%; }
.paper-front b:nth-child(4) { width: 52%; }

.pen {
  position: absolute;
  z-index: 4;
  left: 125px;
  top: 67px;
  width: 9px;
  height: 138px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1a2c2a, #5a6d68 47%, #142422 50%);
  box-shadow: 2px 6px 10px rgba(24, 40, 39, 0.18);
  transform: rotate(28deg);
}

.pen::before {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 0;
  border-top: 17px solid var(--gold);
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
}

.ink-dot { position: absolute; z-index: 1; display: block; border-radius: 50%; background: #ff7466; opacity: 0.9; }
.ink-one { right: 25px; bottom: 28px; width: 7px; height: 7px; }
.ink-two { right: 44px; bottom: 48px; width: 3px; height: 3px; }
.art-lessons { background: linear-gradient(145deg, #ffd7a9, #e2d1fb); }

.book {
  position: absolute;
  z-index: 2;
  top: 69px;
  width: 83px;
  height: 117px;
  padding: 28px 12px;
  border: 1px solid rgba(59, 49, 39, 0.12);
  background: #faf3e7;
  box-shadow: 0 16px 26px rgba(64, 49, 38, 0.13);
}

.book-left { left: 24px; border-radius: 5px 1px 8px 3px; transform: skewY(5deg); }
.book-right { left: 107px; border-radius: 1px 5px 3px 8px; transform: skewY(-5deg); }
.book b { display: block; height: 1px; margin-bottom: 14px; background: rgba(69, 73, 64, 0.27); }
.book b:nth-child(2) { width: 75%; }
.book b:nth-child(3) { width: 88%; }

.book-spine {
  position: absolute;
  z-index: 4;
  top: 66px;
  left: 104px;
  width: 7px;
  height: 127px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(74, 56, 41, 0.23), transparent);
}

.lesson-spark {
  position: absolute;
  z-index: 5;
  top: 41px;
  left: 104px;
  color: #f05d5e;
  font-style: normal;
  font-size: 25px;
  text-shadow: 0 9px 20px rgba(164, 74, 49, 0.3);
  animation: breathe 3s ease-in-out infinite;
}

.card-copy { align-self: center; padding: 41px 36px 31px; }
.card-copy small, .card-copy strong, .card-copy > span { display: block; }

.card-copy small {
  margin-bottom: 11px;
  color: #d84955;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.card-copy strong {
  margin-bottom: 11px;
  font: 500 46px/1 "Newsreader", Georgia, serif;
  letter-spacing: -0.035em;
}

.card-copy > span { max-width: 220px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.55; }

.card-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 57px;
  padding: 0 19px 0 23px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-footer b {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(24, 40, 39, 0.25);
  border-radius: 50%;
  font-size: 14px;
  transition: color 250ms ease, background 250ms ease, transform 250ms ease;
}

.path-card:hover .card-footer b { color: var(--paper-light); background: var(--ink); transform: rotate(45deg); }

.path-write .card-footer b {
  color: #13795e;
  border-color: rgba(47, 149, 116, 0.35);
  background: rgba(189, 235, 217, 0.55);
}

.path-lessons .card-footer b {
  color: #9d3f48;
  border-color: rgba(240, 93, 94, 0.3);
  background: rgba(255, 215, 169, 0.58);
}

.coming-soon {
  margin: 22px 0 0;
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid rgba(118, 103, 216, 0.16);
  border-radius: 999px;
  color: #6558bd;
  background: rgba(255, 255, 255, 0.45);
  font: 500 10px/1.4 "DM Sans", Arial, sans-serif;
  letter-spacing: 0.08em;
}

.coming-soon span { margin-right: 7px; color: var(--rust); }

/* Writing studio */
.write-view {
  width: 100%;
  padding: 24px 22px 45px;
}

.wooden-desk {
  position: relative;
  width: min(1400px, 100%);
  min-height: calc(100vh - 135px);
  margin: 0 auto;
  padding: 19px;
  overflow: hidden;
  border: 1px solid rgba(65, 31, 15, 0.5);
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.055), transparent 16%, rgba(45,18,8,.08) 43%, transparent 70%, rgba(255,255,255,.035)),
    repeating-linear-gradient(0deg, #8e542f 0 76px, #7a4326 77px 79px, #955c36 80px 154px, #6e3b22 155px 158px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.14),
    inset 0 -20px 50px rgba(48, 21, 10, 0.18),
    0 22px 55px rgba(54, 35, 26, 0.2);
}

.wooden-desk::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.26;
  background:
    repeating-radial-gradient(ellipse at 18% 28%, transparent 0 16px, rgba(50, 21, 10, 0.2) 17px 18px, transparent 19px 31px),
    repeating-linear-gradient(91deg, transparent 0 55px, rgba(47, 21, 11, 0.11) 57px, transparent 59px 101px);
  mix-blend-mode: multiply;
}

.desk-toolbar {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 62px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  color: #fff9ed;
  background: rgba(70, 33, 18, 0.44);
  box-shadow: 0 8px 24px rgba(44, 20, 10, 0.16);
  backdrop-filter: blur(8px);
}

.desk-home {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 999px;
  color: #fff9ed;
  background: rgba(255, 255, 255, 0.1);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.desk-home:hover { background: rgba(255, 255, 255, 0.17); }
.desk-home:focus-visible,
.draft-title:focus-visible,
.draft-body:focus-visible { outline: 3px solid rgba(255, 234, 184, 0.5); outline-offset: 3px; }

.desk-heading { text-align: center; }
.desk-heading span,
.desk-heading strong { display: block; }
.desk-heading span { margin-bottom: 3px; color: #ffdba3; font-size: 8px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.desk-heading strong { font: 500 19px/1.1 "Newsreader", Georgia, serif; }

.draft-save-status {
  justify-self: end;
  color: rgba(255, 249, 237, 0.78);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.draft-save-status::before { content: "●"; margin-right: 7px; color: #91e2b5; font-size: 7px; }
.draft-save-status.saving::before { color: #ffd16e; }

.desk-scene {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: start center;
  min-height: 900px;
  padding: 34px 65px 45px;
}

.writing-paper {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  width: min(880px, calc(100% - 120px));
  min-height: 860px;
  padding: 54px 73px 34px;
  color: #242c3b;
  background:
    linear-gradient(90deg, rgba(218, 79, 80, 0.09) 0 1px, transparent 1px) 55px 0 / 1px 100% no-repeat,
    linear-gradient(#fffefb, #fffdf8);
  box-shadow:
    0 2px 2px rgba(51, 23, 12, 0.24),
    0 16px 33px rgba(51, 23, 12, 0.25),
    0 45px 80px rgba(48, 21, 10, 0.2);
  transform: rotate(-0.25deg);
}

.writing-paper::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px -8px -8px 7px;
  background: #f3eee2;
  box-shadow: 0 10px 25px rgba(49, 24, 13, 0.15);
  transform: rotate(0.45deg);
}

.paper-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #9a958b;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.draft-title {
  width: 100%;
  margin-top: 43px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #202c42;
  background: transparent;
  font: 500 clamp(42px, 5.5vw, 64px)/1 "Newsreader", Georgia, serif;
  letter-spacing: -0.04em;
}

.draft-title::placeholder { color: #a9a69f; opacity: 0.72; }

.title-rule {
  width: 68px;
  height: 3px;
  margin: 21px 0 30px;
  border-radius: 999px;
  background: var(--rust);
}

.draft-body {
  flex: 1;
  width: 100%;
  min-height: 610px;
  padding: 0;
  resize: none;
  overflow: hidden;
  border: 0;
  outline: 0;
  color: #30394a;
  background: transparent;
  font: 400 18px/1.85 "Newsreader", Georgia, serif;
}

.draft-body::placeholder { color: #aaa79f; opacity: 0.75; }

.paper-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(45, 50, 62, 0.12);
  color: #96928a;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.paper-footer span:nth-child(2) { text-align: center; }
.paper-footer span:last-child { text-align: right; color: var(--violet); }

.coffee-ring {
  position: absolute;
  z-index: 1;
  top: 75px;
  right: 3.5%;
  width: 112px;
  height: 112px;
  border: 10px solid rgba(61, 27, 13, 0.22);
  border-right-color: rgba(61, 27, 13, 0.1);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 227, 182, 0.07);
  transform: rotate(23deg);
}

.desk-pencil {
  position: absolute;
  z-index: 4;
  left: calc(50% + 465px);
  bottom: 110px;
  width: 12px;
  height: 230px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(90deg, #e2a02f 0 28%, #f5c75d 29% 70%, #cf8a21 71%);
  box-shadow: 5px 8px 12px rgba(51, 23, 12, 0.2);
  transform: rotate(15deg);
}

.desk-pencil::before {
  content: "";
  position: absolute;
  top: -25px;
  left: 0;
  border-right: 6px solid transparent;
  border-bottom: 28px solid #ead0a8;
  border-left: 6px solid transparent;
}

.desk-pencil::after {
  content: "";
  position: absolute;
  top: -27px;
  left: 4px;
  border-right: 2px solid transparent;
  border-bottom: 9px solid #30343b;
  border-left: 2px solid transparent;
}

.paperclip {
  position: absolute;
  z-index: 5;
  top: 52px;
  left: calc(50% - 425px);
  width: 24px;
  height: 66px;
  border: 4px solid rgba(75, 75, 76, 0.62);
  border-radius: 15px;
  transform: rotate(-9deg);
}

.paperclip::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 5px;
  width: 7px;
  height: 42px;
  border: 3px solid rgba(75, 75, 76, 0.5);
  border-radius: 8px;
}

.write-page .color-shapes { opacity: 0; }
.write-page .margin-note { display: none; }

/* Lessons */
.lessons-view {
  width: min(1120px, calc(100% - 116px));
  margin: 0 auto;
  padding: 36px 0 82px;
}

.lessons-hero {
  position: relative;
  padding: 46px 40px 53px;
  overflow: hidden;
  border: 1px solid rgba(118, 103, 216, 0.16);
  border-radius: 26px;
  background:
    radial-gradient(circle at 8% 92%, rgba(242, 184, 75, 0.25), transparent 27%),
    radial-gradient(circle at 92% 15%, rgba(117, 213, 243, 0.32), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(246, 239, 255, 0.82));
  box-shadow: 0 22px 60px rgba(73, 78, 112, 0.11);
  text-align: center;
}

.lessons-hero::before,
.lessons-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.lessons-hero::before {
  top: 41px;
  left: 8%;
  width: 24px;
  height: 24px;
  border: 6px solid rgba(240, 93, 94, 0.72);
}

.lessons-hero::after {
  right: 10%;
  bottom: 38px;
  width: 15px;
  height: 15px;
  background: var(--gold);
  box-shadow: 22px -13px 0 -5px var(--violet);
}

.back-home {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(32, 48, 75, 0.12);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.back-home:hover { color: var(--violet); border-color: rgba(118, 103, 216, 0.35); }
.back-home:focus-visible,
.lesson-choice:focus-visible,
.learned-button:focus-visible,
.checklist-item input:focus-visible + .custom-check,
#resetChecklist:focus-visible { outline: 3px solid rgba(118, 103, 216, 0.3); outline-offset: 3px; }

.lesson-kicker {
  display: flex;
  justify-content: center;
  gap: 10px;
  color: #d74950;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lesson-kicker span { color: var(--gold); }

.lessons-hero h1 {
  margin-top: 20px;
  font-size: clamp(48px, 6.2vw, 76px);
}

.lessons-hero > p {
  max-width: 590px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

.learning-section,
.story-test {
  margin-top: 27px;
  padding: 35px;
  border: 1px solid rgba(32, 48, 75, 0.12);
  border-radius: 23px;
  background: rgba(255, 252, 247, 0.82);
  box-shadow: 0 17px 48px rgba(73, 78, 112, 0.08);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 25px;
}

.section-number {
  display: block;
  margin-bottom: 7px;
  color: var(--rust);
  font: 600 10px/1 "DM Sans", Arial, sans-serif;
  letter-spacing: 0.18em;
}

.section-heading h2 {
  margin: 0 0 6px;
  font: 500 clamp(31px, 4vw, 43px)/1 "Newsreader", Georgia, serif;
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.lesson-progress {
  flex: 0 0 175px;
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-track {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(118, 103, 216, 0.12);
}

.progress-track i,
.test-progress-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), #aa75d6);
  transition: width 350ms ease;
}

.library-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.continue-lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 315px;
  min-height: 58px;
  padding: 9px 18px 9px 10px;
  border: 1px solid rgba(118, 103, 216, 0.18);
  border-radius: 14px;
  color: var(--ink);
  background: linear-gradient(120deg, rgba(216, 205, 251, 0.52), rgba(255, 255, 255, 0.8));
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.continue-lesson:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(93, 75, 185, 0.11);
}

.continue-lesson:focus-visible,
.group-jump select:focus-visible {
  outline: 3px solid rgba(118, 103, 216, 0.3);
  outline-offset: 3px;
}

.continue-icon {
  display: grid;
  place-items: center;
  flex: 0 0 39px;
  width: 39px;
  height: 39px;
  border-radius: 11px;
  color: white;
  background: linear-gradient(135deg, var(--violet), #9c70d8);
  font-size: 16px;
  transform: rotate(45deg);
}

.continue-lesson small,
.continue-lesson strong { display: block; }
.continue-lesson small { margin-bottom: 3px; color: var(--violet); font-size: 8px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.continue-lesson strong { max-width: 310px; overflow: hidden; font: 600 16px/1.2 "Newsreader", Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }

.group-jump {
  display: flex;
  flex: 1 1 320px;
  flex-direction: column;
  justify-content: center;
  max-width: 430px;
  min-height: 58px;
  padding: 8px 13px;
  border: 1px solid rgba(32, 48, 75, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.group-jump > span {
  display: block;
  margin: 0 0 3px 3px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.group-jump select {
  width: 100%;
  padding: 2px 26px 2px 2px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: 600 13px/1.3 "DM Sans", Arial, sans-serif;
  cursor: pointer;
}

.lesson-workspace {
  display: grid;
  grid-template-columns: minmax(235px, 0.82fr) minmax(0, 1.65fr);
  gap: 17px;
  align-items: stretch;
}

.lesson-navigation {
  overflow: hidden;
  border: 1px solid rgba(32, 48, 75, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
}

.lesson-group-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 17px 17px 13px;
  border-bottom: 1px solid rgba(32, 48, 75, 0.08);
  background: rgba(255, 255, 255, 0.46);
}

.lesson-group-heading span {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  color: var(--rust);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lesson-group-heading strong {
  overflow: hidden;
  font: 600 17px/1.2 "Newsreader", Georgia, serif;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}

.lesson-group-heading small {
  align-self: center;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
}

.lesson-list {
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: 558px;
  padding: 9px 8px 10px;
  overflow-y: auto;
  scrollbar-color: rgba(118, 103, 216, 0.3) transparent;
  scrollbar-width: thin;
}

.lesson-choice {
  display: grid;
  grid-template-columns: 31px 1fr 21px;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.lesson-choice:hover { background: rgba(118, 103, 216, 0.07); transform: translateX(2px); }

.lesson-choice.active {
  border-color: rgba(118, 103, 216, 0.2);
  background: linear-gradient(120deg, rgba(216, 205, 251, 0.48), rgba(255, 255, 255, 0.75));
}

.choice-number {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  color: #6658bd;
  background: rgba(216, 205, 251, 0.6);
  font-size: 9px;
  font-weight: 700;
}

.lesson-choice:nth-child(3n + 2) .choice-number { color: #c3484c; background: rgba(255, 205, 178, 0.58); }
.lesson-choice:nth-child(3n) .choice-number { color: #25775e; background: rgba(189, 235, 217, 0.7); }

.choice-title {
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-check {
  color: rgba(32, 48, 75, 0.25);
  font-size: 14px;
  text-align: center;
}

.lesson-choice.learned .choice-check { color: var(--sage); }

.lesson-detail {
  position: relative;
  min-height: 510px;
  padding: 35px 37px;
  overflow: hidden;
  border-radius: 18px;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(117, 213, 243, 0.25), transparent 31%),
    linear-gradient(145deg, #fffaf1, #fffdf9);
  box-shadow: inset 0 0 0 1px rgba(32, 48, 75, 0.09);
}

.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: var(--rust);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.detail-status {
  padding: 7px 10px;
  border-radius: 999px;
  color: #7365c7;
  background: rgba(216, 205, 251, 0.42);
  letter-spacing: 0.07em;
}

.detail-status.complete { color: #23775d; background: rgba(189, 235, 217, 0.62); }

.lesson-detail h3 {
  margin: 24px 0 10px;
  font: 500 clamp(34px, 4.5vw, 53px)/0.98 "Newsreader", Georgia, serif;
  letter-spacing: -0.04em;
}

.lesson-summary {
  max-width: 650px;
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.lesson-note {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  margin-top: 11px;
  padding: 17px 18px;
  border-radius: 13px;
}

.example-note { background: rgba(242, 184, 75, 0.14); }
.try-note { background: rgba(189, 235, 217, 0.35); }

.note-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  color: #bd7e16;
  background: rgba(255, 255, 255, 0.8);
}

.try-note .note-icon { color: var(--sage); }
.lesson-note strong { display: block; margin: 1px 0 4px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.lesson-note p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }

.practice-box {
  margin-top: 15px;
  padding: 18px;
  border: 1px solid rgba(47, 149, 116, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.practice-box label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

.practice-box label span {
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.practice-box label small {
  color: var(--ink-soft);
  font-size: 8px;
}

.practice-box textarea {
  display: block;
  width: 100%;
  min-height: 118px;
  padding: 14px 15px;
  resize: vertical;
  border: 1px solid rgba(32, 48, 75, 0.14);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, rgba(118, 103, 216, 0.08) 28px),
    rgba(255, 253, 248, 0.92);
  font: 500 12px/1.75 "DM Sans", Arial, sans-serif;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.practice-box textarea:focus {
  border-color: rgba(118, 103, 216, 0.58);
  box-shadow: 0 0 0 3px rgba(118, 103, 216, 0.1);
}

.practice-box textarea::placeholder { color: #9c9eaa; }

.practice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 10px;
}

.practice-actions > span {
  color: #89899a;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.practice-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--sage), #55b58f);
  box-shadow: 0 8px 18px rgba(47, 149, 116, 0.18);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.practice-actions button:hover { transform: translateY(-1px); }
.practice-actions button:focus-visible { outline: 3px solid rgba(47, 149, 116, 0.25); outline-offset: 3px; }
.practice-actions button:disabled { opacity: 0.68; cursor: wait; transform: none; }

.practice-feedback {
  position: relative;
  margin-top: 13px;
  padding: 13px 14px 13px 42px;
  border-radius: 11px;
  font-size: 11px;
  line-height: 1.55;
}

.practice-feedback > strong {
  display: block;
  margin-bottom: 5px;
  font: 600 16px/1.25 "Newsreader", Georgia, serif;
}

.practice-feedback ul {
  margin: 0;
  padding-left: 16px;
}

.practice-feedback li + li { margin-top: 4px; }

.practice-feedback::before {
  position: absolute;
  top: 12px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.practice-feedback.success {
  color: #206a53;
  background: rgba(189, 235, 217, 0.52);
}

.practice-feedback.success::before { content: "✓"; background: var(--sage); }

.practice-feedback.needs-work {
  color: #9d4147;
  background: rgba(255, 218, 194, 0.5);
}

.practice-feedback.needs-work::before { content: "!"; background: var(--rust); }

.learned-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  margin-top: 24px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #7163d4, #9670d5);
  box-shadow: 0 9px 21px rgba(93, 75, 185, 0.2);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.learned-button.complete { color: #26745c; background: #d7f3e7; box-shadow: none; }

.story-test {
  background:
    radial-gradient(circle at 0 0, rgba(255, 206, 159, 0.2), transparent 24%),
    rgba(255, 252, 247, 0.84);
}

.test-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.test-progress strong {
  margin-bottom: 2px;
  color: var(--sage);
  font: 500 31px/1 "Newsreader", Georgia, serif;
  letter-spacing: -0.02em;
}

.test-progress-bar {
  height: 9px;
  margin: -4px 0 24px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 149, 116, 0.1);
}

.test-progress-bar i { background: linear-gradient(90deg, var(--sage), #68c8a5, var(--gold)); }

.story-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checklist-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  min-height: 105px;
  padding: 16px;
  border: 1px solid rgba(32, 48, 75, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.67);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.checklist-item:hover { transform: translateY(-2px); border-color: rgba(47, 149, 116, 0.3); }
.checklist-item.checked { border-color: rgba(47, 149, 116, 0.23); background: rgba(224, 246, 237, 0.65); }
.checklist-item input { position: absolute; opacity: 0; pointer-events: none; }

.custom-check {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 2px solid rgba(32, 48, 75, 0.24);
  border-radius: 8px;
  color: transparent;
  background: white;
  font-size: 14px;
  font-weight: 700;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.checklist-item.checked .custom-check { color: white; border-color: var(--sage); background: var(--sage); }
.checklist-copy strong { display: block; margin: 2px 0 5px; font: 600 17px/1.1 "Newsreader", Georgia, serif; }
.checklist-copy span { display: block; color: var(--ink-soft); font-size: 10.5px; line-height: 1.5; }

.test-finish {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.test-finish p { margin: 0; color: var(--sage); font: 500 19px/1.3 "Newsreader", Georgia, serif; }
#resetChecklist { border: 0; color: #d2494e; background: transparent; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }

.margin-note {
  position: fixed;
  z-index: 1;
  top: 51%;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(24, 40, 39, 0.42);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  writing-mode: vertical-rl;
}

.margin-note i { width: 1px; height: 18px; background: var(--line); }
.note-left { left: 27px; transform: translateY(-50%) rotate(180deg); }
.note-right { right: 27px; transform: translateY(-50%); }

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  margin: 0 42px;
  border-top: 1px solid var(--line);
  color: rgba(24, 40, 39, 0.48);
  font: 500 8px/1 "DM Sans", Arial, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

footer > span:last-child { justify-self: end; }

.footer-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: white;
  border-color: transparent;
  background: linear-gradient(145deg, var(--rust), #f39b58);
  box-shadow: 0 4px 10px rgba(240, 93, 94, 0.22);
  font: 600 9px/1 "Newsreader", Georgia, serif;
  letter-spacing: 0.04em;
}

.reveal { opacity: 0; transform: translateY(14px); animation: reveal 700ms cubic-bezier(0.2, 0.75, 0.2, 1) forwards; }
.reveal-one { animation-delay: 80ms; }
.reveal-two { animation-delay: 150ms; }
.reveal-three { animation-delay: 230ms; }
.reveal-four { animation-delay: 330ms; }
.reveal-five { animation-delay: 480ms; }

@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { transform: translateY(-5px) scale(1.1); } }
@keyframes drift { to { transform: translate3d(0, 10px, 0) rotate(5deg); } }
@keyframes modalFade { from { opacity: 0; } }
@keyframes modalRise { from { opacity: 0; transform: translateY(18px) scale(0.97); } }

@media (max-width: 900px) {
  .site-header { margin: 0 24px; }
  .welcome { width: min(700px, calc(100% - 48px)); }
  .path-card { grid-template-columns: 1fr; }
  .card-art { min-height: 200px; border-right: 0; border-bottom: 1px solid rgba(24, 40, 39, 0.09); }
  .paper-back { left: calc(50% - 51px); top: 34px; }
  .paper-front { left: calc(50% - 68px); top: 26px; }
  .pen { left: calc(50% + 34px); top: 48px; }
  .book-left { left: calc(50% - 83px); top: 48px; }
  .book-right { left: 50%; top: 48px; }
  .book-spine { left: calc(50% - 3px); top: 45px; }
  .lesson-spark { left: calc(50% - 4px); top: 22px; }
  .card-copy { min-height: 190px; padding: 30px 27px; }
  .margin-note { display: none; }
  .write-view { padding: 20px 16px 36px; }
  .desk-toolbar { grid-template-columns: 1fr auto; }
  .desk-heading { display: none; }
  .desk-scene { min-height: 850px; padding: 29px 23px 40px; }
  .writing-paper { width: min(760px, calc(100% - 44px)); min-height: 820px; padding: 48px 55px 30px; }
  .draft-body { min-height: 585px; }
  .coffee-ring { right: -30px; }
  .desk-pencil { left: auto; right: 20px; bottom: 80px; opacity: 0.7; }
  .paperclip { left: calc(50% - 340px); }
  .lessons-view { width: min(760px, calc(100% - 48px)); }
  .lesson-workspace { grid-template-columns: 1fr; }
  .lesson-navigation { padding-bottom: 2px; }
  .lesson-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; padding: 0; }
  .lesson-group-heading { margin-bottom: 8px; }
  .story-checklist { grid-template-columns: 1fr; }
  footer { margin: 0 24px; }
}

@media (max-width: 620px) {
  body.home-page { background-position: center, center, center, center top, center 74px; }

  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .site-header { grid-template-columns: 70px minmax(0, 1fr); gap: 6px; min-height: 72px; margin: 0 10px; }
  .brand { font-size: 22px; }
  .brand-logo { width: 70px; border-radius: 9px; }
  .edition { display: none; }
  .header-actions { min-width: 0; gap: 4px; }
  .header-flourish { min-width: 58px; min-height: 42px; padding: 9px 8px; gap: 5px; }
  .header-flourish span { width: auto; font-size: 10px; }
  .header-flourish i { font-size: 10px; }
  .auth-button { min-width: 0; min-height: 42px; padding: 0 8px; font-size: 7.5px; letter-spacing: 0.025em; }
  .user-button { min-height: 42px; padding: 4px 10px 4px 5px; font-size: 9px; }
  .user-avatar { width: 32px; height: 32px; }
  .music-toggle { left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); min-height: 39px; padding: 0 11px 0 8px; }
  .music-note { width: 23px; height: 23px; }
  .auth-overlay { padding: 14px; }
  .auth-dialog { padding: 28px 22px 23px; border-radius: 20px; }
  .auth-dialog h2 { font-size: 34px; }
  .guest-warning-overlay { padding: 13px; }
  .guest-warning-dialog { padding: 31px 21px 25px; border-radius: 21px; }
  .guest-warning-dialog h2 { font-size: 37px; }
  .welcome { width: calc(100% - 32px); padding: 44px 0 48px; }
  h1 { max-width: 100%; font-size: clamp(38px, 11vw, 50px); line-height: 0.96; }
  .intro { max-width: 360px; font-size: 13px; }
  .welcome-message {
    width: calc(100% - 20px);
    margin-top: 18px;
    margin-bottom: -8px;
    padding: 12px 16px;
  }
  .welcome-message p { font-size: 15px; }
  .path-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 34px; }
  .path-card { grid-template-columns: 41% 59%; min-height: 214px; }
  .card-art { min-height: 166px; border-right: 1px solid rgba(24, 40, 39, 0.09); border-bottom: 0; }
  .paper { width: 78px; height: 105px; }
  .paper-back { left: calc(50% - 25px); top: 35px; }
  .paper-front { left: calc(50% - 45px); top: 29px; padding: 28px 13px; }
  .paper-front b { margin-bottom: 8px; }
  .pen { left: calc(50% + 23px); top: 45px; width: 7px; height: 95px; }
  .pen::before { bottom: -11px; border-top-width: 13px; border-right-width: 4px; border-left-width: 4px; }
  .book { top: 47px; width: 61px; height: 88px; padding: 20px 9px; }
  .book-left { left: calc(50% - 61px); }
  .book-right { left: 50%; }
  .book-spine { top: 44px; left: calc(50% - 3px); height: 96px; }
  .lesson-spark { top: 20px; }
  .card-copy { min-height: 166px; padding: 34px 19px 24px; }
  .card-copy small { margin-bottom: 8px; font-size: 9px; }
  .card-copy strong { margin-bottom: 7px; font-size: 35px; }
  .card-copy > span { font-size: 11.5px; line-height: 1.5; }
  .card-footer { height: 48px; font-size: 8px; }
  .write-view { padding: 12px 0 28px; }
  .wooden-desk { min-height: calc(100vh - 84px); padding: 10px 0 20px; border-right: 0; border-left: 0; border-radius: 0; }
  .desk-toolbar { min-height: 52px; margin: 0 10px; padding: 6px 9px; border-radius: 12px; }
  .desk-home { min-height: 37px; padding: 0 12px; }
  .draft-save-status { font-size: 7px; }
  .desk-scene { min-height: 760px; padding: 22px 13px 30px; }
  .writing-paper { width: calc(100% - 18px); min-height: 730px; padding: 35px 28px 24px; transform: none; }
  .writing-paper::before { inset: 5px -4px -6px 4px; }
  .paper-top { font-size: 6px; }
  .draft-title { margin-top: 32px; font-size: 39px; }
  .title-rule { margin: 17px 0 24px; }
  .draft-body { min-height: 505px; font-size: 17px; line-height: 1.75; }
  .paper-footer { grid-template-columns: 1fr auto; }
  .paper-footer span:nth-child(2) { display: none; }
  .coffee-ring { top: 28px; right: -42px; width: 91px; height: 91px; }
  .desk-pencil { display: none; }
  .paperclip { top: 37px; left: 15px; width: 19px; height: 53px; }
  .lessons-view { width: calc(100% - 28px); padding: 18px 0 48px; }
  .lessons-hero { padding: 69px 20px 37px; border-radius: 20px; }
  .lessons-hero::before { top: auto; bottom: 26px; left: 7%; width: 17px; height: 17px; border-width: 4px; }
  .lessons-hero::after { right: 8%; bottom: 24px; }
  .lessons-hero h1 { margin: 18px auto 14px; font-size: clamp(40px, 12vw, 57px); }
  .lessons-hero > p { font-size: 12px; }
  .back-home { top: 17px; left: 16px; }
  .lesson-kicker { font-size: 9px; }
  .learning-section, .story-test { margin-top: 16px; padding: 22px 16px; border-radius: 18px; }
  .section-heading { align-items: flex-start; gap: 18px; margin-bottom: 19px; }
  .section-heading h2 { font-size: 30px; }
  .section-heading p { font-size: 10px; }
  .lesson-progress { flex-basis: 102px; font-size: 8px; }
  .library-toolbar { display: grid; grid-template-columns: 1fr; }
  .continue-lesson, .group-jump { width: 100%; max-width: none; min-width: 0; }
  .continue-lesson strong { max-width: calc(100vw - 125px); }
  .group-jump { flex-basis: auto; }
  .lesson-navigation { margin: 0; }
  .lesson-group-heading { margin: 0; padding: 14px 14px 11px; }
  .lesson-list { display: flex; gap: 7px; margin: 0; padding: 9px 9px 10px; overflow-x: auto; }
  .lesson-choice { flex: 0 0 154px; grid-template-columns: 28px 1fr 17px; min-height: 48px; padding: 7px; }
  .choice-title { font-size: 9px; }
  .lesson-detail { min-height: 0; padding: 26px 20px; }
  .detail-topline { font-size: 8px; }
  .lesson-detail h3 { margin-top: 21px; font-size: 37px; }
  .lesson-summary { margin-bottom: 21px; font-size: 12px; }
  .lesson-note { grid-template-columns: 33px 1fr; padding: 14px; }
  .note-icon { width: 31px; height: 31px; }
  .lesson-note p { font-size: 10.5px; }
  .practice-box { padding: 14px; }
  .practice-box label { display: block; }
  .practice-box label small { display: block; margin-top: 3px; }
  .practice-box textarea { min-height: 135px; font-size: 11px; }
  .practice-actions button { min-height: 42px; }
  .test-heading { align-items: flex-start; }
  .test-progress strong { font-size: 25px; }
  .test-progress span { font-size: 7px; text-align: right; }
  .checklist-item { min-height: 0; padding: 14px; }
  .checklist-copy strong { font-size: 16px; }
  .checklist-copy span { font-size: 10px; }
  .test-finish { align-items: flex-start; }
  .test-finish p { font-size: 16px; }
  footer { grid-template-columns: 1fr auto; min-height: 62px; margin: 0 18px; }
  footer > span:first-child { max-width: 180px; line-height: 1.5; }
  footer > span:last-child { display: none; }
}

@media (max-width: 400px) {
  .path-card { grid-template-columns: 38% 62%; }
  .card-copy { padding-left: 15px; padding-right: 12px; }
  .card-copy > span { font-size: 9px; }
}

@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;
  }
}

/* Colorful multi-page writing studio */
.document-library {
  position: relative;
  width: min(1260px, 100%);
  min-height: calc(100vh - 135px);
  margin: 0 auto;
  padding: 22px 42px 70px;
  overflow: hidden;
  border: 1px solid rgba(103, 88, 178, 0.17);
  border-radius: 30px;
  background:
    radial-gradient(circle at 89% 10%, rgba(117, 213, 243, .34), transparent 23%),
    radial-gradient(circle at 8% 85%, rgba(242, 184, 75, .28), transparent 26%),
    radial-gradient(circle at 82% 82%, rgba(216, 205, 251, .42), transparent 25%),
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,249,239,.72));
  box-shadow: 0 24px 70px rgba(74, 67, 117, .14), inset 0 1px 0 rgba(255,255,255,.9);
}

.library-glow { position: absolute; inset: 0; pointer-events: none; }
.library-glow i { position: absolute; font-style: normal; }
.library-glow i:nth-child(1) { top: 128px; right: 7%; color: #7869d9; font-size: 28px; transform: rotate(15deg); }
.library-glow i:nth-child(2) { top: 290px; left: 3%; color: #e77c85; font-size: 29px; }
.library-glow i:nth-child(3) { right: 4%; bottom: 145px; color: #52b990; font-size: 19px; }
.library-glow i:nth-child(4) { left: 7%; bottom: 60px; color: #e6aa35; font-size: 20px; }

.document-library-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(45, 51, 80, .1);
}
.document-library-topbar > span { color: #777389; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.document-library-topbar > span i { margin-right: 6px; color: #48b88b; font-size: 7px; }
.document-library-topbar > span.guest-mode { color: #b04e58; }
.document-library-topbar > span.guest-mode i { color: #e05a65; }
.library-home { min-height: 38px; padding: 0 14px; border: 1px solid rgba(68, 62, 112, .13); border-radius: 999px; color: #4d506c; background: rgba(255,255,255,.65); font-size: 9px; font-weight: 800; cursor: pointer; }
.library-home:hover { color: #6556c8; border-color: rgba(101,86,200,.25); background: #fff; }

.document-library-heading {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 50px;
  align-items: center;
  padding: 62px 45px 53px;
}
.library-kicker { display: block; margin-bottom: 13px; color: #d74f65; font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.document-library-heading h1 { margin: 0; font-size: clamp(51px, 6vw, 78px); line-height: .91; letter-spacing: -.045em; }
.document-library-heading h1 em { color: #7163d1; font-weight: 500; }
.document-library-heading p { max-width: 540px; margin: 23px 0 0; color: var(--ink-soft); font: 500 17px/1.55 "Newsreader", Georgia, serif; }

.new-document-button {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 13px;
  align-items: center;
  min-width: 220px;
  padding: 20px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #ef6d72, #f19d56);
  box-shadow: 0 16px 32px rgba(224, 87, 91, .25);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.new-document-button:hover { transform: translateY(-3px) rotate(-.3deg); box-shadow: 0 21px 38px rgba(224, 87, 91, .3); }
.new-document-button > span { grid-row: 1 / 3; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: rgba(255,255,255,.18); font-size: 29px; }
.new-document-button strong { align-self: end; font: 600 22px/1 "Newsreader", Georgia, serif; }
.new-document-button small { align-self: start; color: rgba(255,255,255,.78); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.recent-documents-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  padding: 0 4px 15px;
  border-bottom: 1px solid rgba(45, 51, 80, .1);
}
.recent-documents-heading > div { display: flex; align-items: baseline; gap: 12px; }
.recent-documents-heading > div span { font: 600 26px/1 "Newsreader", Georgia, serif; }
.recent-documents-heading strong { color: #7b7688; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.recent-documents-heading > span { color: #858192; font-size: 9px; }

.document-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 22px;
}
.document-card { position: relative; min-width: 0; border: 1px solid hsla(var(--card-hue), 48%, 44%, .15); border-radius: 19px; background: rgba(255,255,255,.82); box-shadow: 0 10px 28px rgba(66,58,98,.09); transition: transform 150ms ease, box-shadow 150ms ease; }
.document-card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(66,58,98,.14); }
.document-open { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px; width: 100%; min-height: 190px; padding: 21px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.document-paper { position: relative; display: block; width: 88px; height: 124px; padding: 23px 16px; border: 1px solid hsla(var(--card-hue), 43%, 48%, .16); background: linear-gradient(145deg, #fff, hsl(var(--card-hue) 70% 97%)); box-shadow: 0 8px 17px hsla(var(--card-hue), 30%, 35%, .12); transform: rotate(-1.5deg); }
.document-paper i { display: block; height: 2px; margin-bottom: 11px; border-radius: 2px; background: hsla(var(--card-hue), 35%, 45%, .2); }
.document-paper i:nth-child(2) { width: 80%; }
.document-paper i:nth-child(3) { width: 55%; }
.document-paper b { position: absolute; right: 7px; bottom: 7px; display: grid; place-items: center; min-width: 23px; height: 23px; padding: 0 5px; border-radius: 999px; color: #fff; background: hsl(var(--card-hue) 52% 58%); font-size: 8px; }
.document-card-copy { display: flex; flex-direction: column; min-width: 0; padding: 8px 16px 3px 0; }
.document-card-copy strong { overflow: hidden; margin-bottom: 10px; color: #292f48; font: 600 23px/1.08 "Newsreader", Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.document-preview { display: -webkit-box; overflow: hidden; color: #6c6b7d; font: 400 11px/1.55 "Newsreader", Georgia, serif; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.document-card-copy small { margin-top: auto; color: #9691a0; font-size: 7px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.document-delete { position: absolute; z-index: 3; top: 10px; right: 10px; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; color: #9b96a6; background: rgba(245,242,249,.92); font-size: 17px; cursor: pointer; opacity: .15; transition: opacity 120ms ease, color 120ms ease, background 120ms ease; }
.document-card:hover .document-delete,
.document-delete:focus-visible { opacity: 1; }
.document-delete:hover { color: #fff; background: #e35f69; }

.empty-library { position: relative; z-index: 2; max-width: 570px; margin: 48px auto 0; padding: 50px 30px; border: 1px dashed rgba(105,91,191,.28); border-radius: 24px; background: rgba(255,255,255,.53); text-align: center; }
.empty-library > span { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 19px; color: #fff; background: linear-gradient(145deg, #7768d9, #a777dd); font-size: 27px; transform: rotate(-4deg); }
.empty-library h2 { margin: 0 0 8px; font: 600 31px/1.1 "Newsreader", Georgia, serif; }
.empty-library p { margin: 0 auto 20px; color: #696a7f; font-size: 11px; line-height: 1.6; }
.empty-library button { min-height: 43px; padding: 0 18px; border: 0; border-radius: 999px; color: #fff; background: #6f61cf; font-size: 10px; font-weight: 800; cursor: pointer; }

.library-home:focus-visible,
.new-document-button:focus-visible,
.document-open:focus-visible,
.document-delete:focus-visible,
.empty-library button:focus-visible { outline: 3px solid rgba(117,103,216,.3); outline-offset: 3px; }

.write-page {
  background:
    radial-gradient(circle at 9% 20%, rgba(255, 193, 92, 0.7), transparent 25%),
    radial-gradient(circle at 90% 18%, rgba(110, 221, 226, 0.62), transparent 28%),
    radial-gradient(circle at 78% 74%, rgba(230, 151, 229, 0.47), transparent 29%),
    radial-gradient(circle at 17% 78%, rgba(142, 226, 169, 0.55), transparent 28%),
    linear-gradient(145deg, #fff2c9 0%, #e9f9ff 40%, #f4e8ff 72%, #fff0e7 100%);
  background-attachment: fixed;
}

.write-page .color-shapes { opacity: 0.82; }
.write-page .site-header { background: rgba(255, 252, 247, 0.68); backdrop-filter: blur(15px); }

.write-view {
  width: 100%;
  padding: 18px 20px 70px;
}

.writing-studio {
  position: relative;
  width: min(1480px, 100%);
  min-height: calc(100vh - 125px);
  margin: 0 auto;
  padding: 18px 18px 70px;
  overflow: clip;
  border: 1px solid rgba(103, 88, 178, 0.18);
  border-radius: 28px;
  background:
    radial-gradient(circle at 3% 14%, rgba(255,255,255,.85), transparent 18%),
    linear-gradient(135deg, rgba(255,255,255,.56), rgba(255,255,255,.22));
  box-shadow: 0 24px 70px rgba(91, 79, 145, 0.16), inset 0 1px 0 rgba(255,255,255,.8);
}

.studio-sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.studio-sparkles i { position: absolute; color: rgba(117, 103, 216, .35); font-style: normal; }
.studio-sparkles i:nth-child(1) { top: 150px; left: 4%; font-size: 28px; color: #ef777b; }
.studio-sparkles i:nth-child(2) { top: 300px; right: 5%; font-size: 18px; color: #57bfa1; }
.studio-sparkles i:nth-child(3) { top: 560px; left: 3%; font-size: 31px; color: #d799dc; }
.studio-sparkles i:nth-child(4) { top: 830px; right: 4%; font-size: 24px; color: #f0b541; }
.studio-sparkles i:nth-child(5) { top: 1080px; left: 5%; font-size: 15px; color: #5dbed8; }

.editor-toolbar {
  position: sticky;
  z-index: 30;
  top: 10px;
  border: 1px solid rgba(78, 72, 139, 0.16);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 35px rgba(78, 68, 125, 0.16);
  backdrop-filter: blur(18px);
}

.editor-topline {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 66px;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(43, 52, 83, 0.1);
}

.editor-home,
.add-page-button,
.download-button,
.tool-button {
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.editor-home {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #7768d9, #a06fe2);
  box-shadow: 0 7px 18px rgba(118, 103, 216, .25);
  font-size: 11px;
  font-weight: 700;
}

.editor-home:hover,
.download-button:hover,
.add-page-button:hover { transform: translateY(-1px); }

.document-name { display: grid; gap: 2px; min-width: 0; }
.document-name span,
.tool-select > span { color: #7b7890; font-size: 7px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.document-name input { min-width: 0; padding: 2px 4px; border: 0; outline: 0; color: var(--ink); background: transparent; font: 600 21px/1.25 "Newsreader", Georgia, serif; }
.document-name input::placeholder { color: #aaa7b8; }

.editor-status { display: grid; justify-items: end; gap: 3px; color: #67647a; }
.editor-status strong { font-size: 10px; }
.draft-save-status { color: #777286; font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.draft-save-status::before { content: "●"; margin-right: 6px; color: #46bb8b; }
.draft-save-status.saving::before { color: #eaae3f; }

.format-bar {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 69px;
  padding: 9px 13px 11px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tool-group { display: flex; align-items: center; gap: 4px; padding-bottom: 1px; }
.tool-divider { align-self: stretch; width: 1px; min-width: 1px; margin: 4px 2px; background: rgba(38, 47, 75, .12); }
.tool-button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: #393b58; background: #f5f2fb; font-size: 21px; }
.tool-button:hover { color: #6555c7; background: #ece7fb; }
.tool-button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.text-tool { font: 18px/1 Georgia, serif; }

.tool-select { display: grid; flex: 0 0 auto; gap: 3px; }
.tool-select select {
  height: 39px;
  min-width: 126px;
  padding: 0 31px 0 11px;
  border: 1px solid rgba(50, 56, 88, .13);
  border-radius: 10px;
  color: #353950;
  background: #fbfaff;
  font: 600 11px/1 "DM Sans", Arial, sans-serif;
}
.tool-select.compact select { min-width: 70px; }
.paper-select select { min-width: 95px; }

.add-page-button {
  flex: 0 0 auto;
  height: 39px;
  padding: 0 13px;
  border: 1px solid rgba(54, 151, 120, .2);
  border-radius: 10px;
  color: #277c62;
  background: #eaf9f3;
  font-size: 10px;
  font-weight: 800;
}

.download-tools { display: flex; align-items: end; gap: 6px; margin-left: auto; }
.download-select select { min-width: 158px; }
.download-button { height: 39px; padding: 0 16px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #ef6e70, #f39b58); box-shadow: 0 7px 15px rgba(239, 110, 112, .2); font-size: 10px; font-weight: 800; }

.editor-home:focus-visible,
.tool-button:focus-visible,
.add-page-button:focus-visible,
.download-button:focus-visible,
.tool-select select:focus-visible,
.document-name input:focus-visible { outline: 3px solid rgba(117, 103, 216, .3); outline-offset: 2px; }

.studio-welcome { position: relative; z-index: 2; margin: 26px auto 21px; color: #515273; text-align: center; font: 500 15px/1.5 "Newsreader", Georgia, serif; }
.studio-welcome span { margin: 0 7px; color: #e05d76; }

.pages-canvas {
  --writing-font: Georgia, serif;
  --writing-size: 18px;
  --page-width: 816px;
  --page-ratio: 8.5 / 11;
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 30px;
  padding: 0 80px 25px;
}
.pages-canvas[data-paper-size="a4"] { --page-width: 794px; --page-ratio: 210 / 297; }
.pages-canvas[data-paper-size="a5"] { --page-width: 559px; --page-ratio: 148 / 210; }

.manuscript-page {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(var(--page-width), calc(100vw - 84px));
  aspect-ratio: var(--page-ratio);
  min-height: 0;
  padding: clamp(30px, 6.3vw, 64px) clamp(28px, 7vw, 74px) clamp(25px, 4vw, 44px);
  color: #283249;
  background: linear-gradient(145deg, #fff 0%, #fffefa 100%);
  box-shadow: 0 2px 2px rgba(55, 43, 94, .12), 0 20px 55px rgba(64, 52, 104, .19);
}
.manuscript-page::before { content: ""; position: absolute; inset: 0; pointer-events: none; border: 1px solid rgba(66, 58, 102, .08); box-shadow: inset 0 0 45px rgba(255, 240, 207, .15); }
.manuscript-meta,
.manuscript-footer { display: flex; flex: 0 0 auto; justify-content: space-between; gap: 15px; color: #9692a1; font: 700 8px/1.2 "DM Sans", Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.manuscript-meta { padding-bottom: clamp(22px, 4vw, 42px); }
.manuscript-footer { padding-top: 15px; border-top: 1px solid rgba(49, 54, 79, .1); }
.manuscript-footer span:first-child { color: #7566d5; }

.page-editor {
  flex: 1 1 auto;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  outline: 0;
  color: #2d3548;
  caret-color: #e15268;
  font-family: var(--writing-font);
  font-size: var(--writing-size);
  font-weight: 400;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.page-editor:empty::before { content: attr(data-placeholder); color: #aaa7af; pointer-events: none; }
.page-editor p { margin: 0 0 .85em; }
.page-editor div { min-height: 1.7em; }
.page-editor:focus { text-shadow: 0 0 0 transparent; }
.page-editor::selection,
.page-editor *::selection { color: #263047; background: #dcd5ff; }

@media (max-width: 980px) {
  .document-library { padding: 18px 24px 55px; }
  .document-library-heading { padding: 48px 18px 43px; }
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .write-view { padding: 12px 10px 55px; }
  .writing-studio { padding: 11px 10px 50px; border-radius: 20px; }
  .editor-toolbar { top: 6px; }
  .editor-topline { grid-template-columns: auto 1fr; }
  .editor-status { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-between; justify-items: stretch; }
  .format-bar { align-items: end; }
  .pages-canvas { padding-right: 20px; padding-left: 20px; }
}

@media (max-width: 620px) {
  .document-library { min-height: calc(100vh - 80px); padding: 10px 13px 42px; border-right: 0; border-left: 0; border-radius: 0; }
  .document-library-topbar { min-height: 45px; }
  .document-library-heading { grid-template-columns: 1fr; gap: 28px; padding: 40px 5px 38px; }
  .document-library-heading h1 { font-size: clamp(48px, 14vw, 66px); }
  .document-library-heading p { font-size: 15px; }
  .new-document-button { width: 100%; min-width: 0; }
  .recent-documents-heading { align-items: start; }
  .recent-documents-heading > span { max-width: 135px; text-align: right; }
  .document-grid { grid-template-columns: 1fr; gap: 12px; }
  .document-open { min-height: 166px; }
  .document-delete { opacity: .65; }
  .write-view { padding: 5px 0 38px; }
  .writing-studio { padding: 7px 0 38px; border-right: 0; border-left: 0; border-radius: 0; }
  .editor-toolbar { top: 3px; margin: 0 7px; border-radius: 15px; }
  .editor-topline { gap: 8px; min-height: 58px; padding: 7px 9px; }
  .editor-home { min-height: 39px; padding: 0 12px; }
  .document-name input { font-size: 17px; }
  .editor-status { font-size: 8px; }
  .format-bar { min-height: 62px; gap: 6px; padding: 7px 9px 9px; }
  .tool-button { width: 38px; height: 38px; }
  .tool-select select { height: 37px; min-width: 112px; }
  .tool-select.compact select { min-width: 64px; }
  .paper-select select { min-width: 82px; }
  .add-page-button, .download-button { height: 37px; }
  .studio-welcome { margin: 19px 20px 16px; font-size: 13px; }
  .pages-canvas { gap: 18px; padding: 0 8px 18px; }
  .manuscript-page { width: calc(100vw - 18px); padding: 28px 27px 23px; }
  .manuscript-meta { padding-bottom: 22px; font-size: 6px; }
  .manuscript-footer { font-size: 6px; }
  .page-editor { font-size: max(14px, calc(var(--writing-size) * .82)); line-height: 1.55; }
}

@media print {
  body.write-page { background: #fff !important; }
  .write-page .site-header,
  .write-page .editor-toolbar,
  .write-page .studio-welcome,
  .write-page .studio-sparkles,
  .write-page .document-library,
  .write-page footer { display: none !important; }
  .write-view,
  .writing-studio,
  .pages-canvas { width: 100%; margin: 0; padding: 0; border: 0; background: #fff; box-shadow: none; }
  .pages-canvas { display: block; }
  .manuscript-page { width: 100%; min-height: 100vh; margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
}

/* Adventure path */
.path-adventure {
  grid-column: 1 / -1;
  grid-template-columns: 34% 66%;
  min-height: 260px;
}

.path-adventure .card-art {
  min-height: 205px;
  background:
    radial-gradient(circle at 22% 24%, rgba(255,255,255,.85) 0 4px, transparent 5px),
    linear-gradient(145deg, #9bdcff, #c8b7ff 58%, #ffb8bf);
}

.path-adventure .card-copy > span { max-width: 420px; }
.path-adventure .card-footer b { color: #5946bf; border-color: rgba(118, 103, 216, .35); background: rgba(216, 205, 251, .58); }

.adventure-map {
  position: absolute;
  z-index: 2;
  top: 35px;
  left: calc(50% - 88px);
  width: 176px;
  height: 137px;
  border: 1px solid rgba(93, 72, 50, .16);
  border-radius: 7px 3px 8px 4px;
  background: #fff2c8;
  box-shadow: 0 17px 31px rgba(67, 54, 92, .19);
  transform: rotate(-5deg);
}

.adventure-map::before,
.adventure-map::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 33%;
  width: 1px;
  background: rgba(112, 83, 55, .16);
  box-shadow: 58px 0 0 rgba(112, 83, 55, .16);
}

.adventure-map b { position: absolute; border: 2px solid rgba(72, 147, 129, .45); border-radius: 50%; }
.adventure-map b:first-child { top: 19px; left: 19px; width: 34px; height: 24px; transform: rotate(-18deg); }
.adventure-map b:nth-child(2) { right: 24px; bottom: 18px; width: 44px; height: 29px; transform: rotate(11deg); }
.adventure-map b:nth-child(3) { top: 67px; left: 69px; width: 15px; height: 15px; border-color: #ef6e70; }

.adventure-path {
  position: absolute;
  z-index: 3;
  top: 67px;
  left: calc(50% - 65px);
  width: 125px;
  height: 62px;
  border: 3px dashed #d78e4e;
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 0 0 80% 0;
  transform: rotate(-7deg);
}

.adventure-compass {
  position: absolute;
  z-index: 5;
  top: 101px;
  left: calc(50% + 49px);
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 6px double rgba(255,255,255,.86);
  border-radius: 50%;
  color: white;
  background: #6554c7;
  box-shadow: 0 12px 22px rgba(68, 52, 150, .28);
  font-style: normal;
  font-size: 22px;
}

.adventure-star { position: absolute; z-index: 5; top: 23px; left: calc(50% + 57px); color: #fff1a4; font-style: normal; font-size: 24px; transform: rotate(14deg); }

/* Whole-book story review */
.ai-review-button {
  flex: 0 0 auto;
  height: 39px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, #6958ce, #ba6ed7);
  box-shadow: 0 7px 16px rgba(104, 79, 192, .23);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.ai-review-button:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(104, 79, 192, .3); }
.ai-review-button:disabled { opacity: .68; cursor: wait; transform: none; }
.ai-review-button:focus-visible,
.book-review-topline button:focus-visible { outline: 3px solid rgba(117, 103, 216, .3); outline-offset: 2px; }

.book-review-panel {
  position: relative;
  z-index: 4;
  width: min(1050px, calc(100% - 40px));
  margin: 24px auto 0;
  overflow: hidden;
  border: 1px solid rgba(100, 79, 190, .2);
  border-radius: 22px;
  background: rgba(255,255,255,.91);
  box-shadow: 0 20px 48px rgba(67, 55, 124, .15);
}

.book-review-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid rgba(58, 52, 96, .1);
  background: linear-gradient(90deg, rgba(238,233,255,.8), rgba(255,244,227,.55));
}

.book-review-topline > div { display: flex; align-items: center; gap: 11px; }
.book-review-topline > div > span:last-child { display: grid; gap: 2px; }
.book-review-topline small { color: #7a6ad1; font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.book-review-topline strong { color: #343352; font: 600 20px/1.1 "Newsreader", Georgia, serif; }
.review-spark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: white; background: linear-gradient(145deg, #6c59ce, #b56ed9); box-shadow: 0 7px 17px rgba(96, 75, 180, .25); }
.book-review-topline button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #67627a; background: rgba(255,255,255,.72); font-size: 22px; cursor: pointer; }

.review-loading { padding: 46px 25px 50px; text-align: center; }
.review-loading strong { display: block; margin-top: 16px; color: #373653; font: 600 29px/1.15 "Newsreader", Georgia, serif; }
.review-loading p { margin: 8px 0 0; color: #747187; font-size: 12px; }
.review-orbit { position: relative; display: block; width: 54px; height: 54px; margin: auto; border: 3px solid #ded7fa; border-top-color: #6e5bd0; border-radius: 50%; animation: reviewSpin .75s linear infinite; }
.review-orbit i { position: absolute; top: 0; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: #ef7479; box-shadow: 0 0 0 4px rgba(239,116,121,.15); }

.review-results { padding: 27px; }
.review-summary { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 3px 3px 25px; }
.review-summary h3 { margin: 7px 0 5px; color: #2e304b; font: 600 34px/1.05 "Newsreader", Georgia, serif; }
.review-summary p { max-width: 700px; margin: 0; color: #66647a; font-size: 12px; line-height: 1.6; }
.review-complete { color: #248263; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.story-pulse { display: grid; justify-items: center; gap: 5px; }
.story-pulse > span { display: grid; place-items: center; width: 83px; height: 83px; border-radius: 50%; background: conic-gradient(#6d5bd0 var(--pulse), #e8e4f6 0); }
.story-pulse > span::before { content: ""; grid-area: 1 / 1; width: 65px; height: 65px; border-radius: 50%; background: white; }
.story-pulse b { z-index: 1; grid-area: 1 / 1; color: #5546b3; font: 600 28px/1 "Newsreader", Georgia, serif; }
.story-pulse small { color: #7a7589; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.review-columns { display: grid; grid-template-columns: .9fr 1.25fr; gap: 18px; }
.review-columns section { padding: 20px; border-radius: 16px; }
.review-columns h4 { margin: 0 0 14px; color: #3a3955; font: 600 20px/1.1 "Newsreader", Georgia, serif; }
.review-strengths { background: #eefaf5; }
.review-strengths ul { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.review-strengths li { display: grid; grid-template-columns: 25px 1fr; gap: 9px; }
.review-strengths li > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #fff; background: #46ae88; font-size: 11px; }
.review-strengths strong,
.review-priorities strong { color: #36364e; font-size: 11px; }
.review-strengths p,
.review-priorities p { margin: 4px 0 0; color: #69677a; font-size: 10.5px; line-height: 1.55; }
.review-priorities { background: #fff5ec; }
.review-priorities article { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid rgba(86,65,48,.1); }
.review-priorities article:first-of-type { padding-top: 0; border-top: 0; }
.review-priorities article > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #b04f58; background: #ffe0d1; font-size: 9px; font-weight: 800; }

.review-next-step { display: grid; grid-template-columns: 38px 1fr; gap: 12px; margin-top: 18px; padding: 15px 17px; border: 1px dashed rgba(105,88,190,.28); border-radius: 14px; background: #faf8ff; }
.review-next-step > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #6454c1; background: #ece7ff; }
.review-next-step strong { color: #47435f; font-size: 10px; }
.review-next-step p { margin: 3px 0 0; color: #706d80; font-size: 10.5px; line-height: 1.55; }
.review-too-short { padding: 30px 20px 38px; text-align: center; }
.review-too-short > span { color: #755fca; font-size: 28px; }
.review-too-short h3 { margin: 8px 0 4px; font: 600 28px/1.15 "Newsreader", Georgia, serif; }
.review-too-short p { margin: 0; color: #706d80; font-size: 12px; }

/* Story adventure page */
.adventure-page {
  background:
    radial-gradient(circle at 12% 19%, rgba(255, 211, 108, .42), transparent 23%),
    radial-gradient(circle at 87% 26%, rgba(134, 218, 245, .43), transparent 28%),
    radial-gradient(circle at 55% 84%, rgba(202, 183, 255, .42), transparent 32%),
    #fff8ea;
}

.adventure-view { width: min(1120px, calc(100% - 72px)); margin: 0 auto; padding: 36px 0 82px; }
.adventure-shell { position: relative; padding: 77px 55px 51px; overflow: hidden; border: 1px solid rgba(92,75,174,.17); border-radius: 30px; background: linear-gradient(145deg, rgba(255,255,255,.91), rgba(246,239,255,.77)); box-shadow: 0 24px 65px rgba(76,66,127,.13); }
.adventure-home { position: absolute; z-index: 3; top: 23px; left: 25px; min-height: 37px; padding: 0 14px; border: 1px solid rgba(40,45,73,.12); border-radius: 999px; color: #615c76; background: rgba(255,255,255,.72); font-size: 10px; font-weight: 800; cursor: pointer; }
.adventure-home:hover { color: #5e4bbd; border-color: rgba(94,75,189,.3); }
.adventure-sky { position: absolute; inset: 0; pointer-events: none; }
.adventure-sky i { position: absolute; color: #ef777b; font-style: normal; }
.adventure-sky i:first-child { top: 54px; right: 9%; font-size: 28px; }
.adventure-sky i:nth-child(2) { top: 160px; left: 5%; color: #f0b341; font-size: 18px; }
.adventure-sky i:nth-child(3) { right: 5%; bottom: 160px; color: #69c7c6; font-size: 17px; }
.adventure-sky i:nth-child(4) { left: 8%; bottom: 80px; color: #a26bd0; font-size: 20px; }
.adventure-heading { position: relative; z-index: 1; max-width: 690px; margin: 0 auto 31px; text-align: center; }
.adventure-heading > span { color: #d6535b; font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.adventure-heading h1 { margin: 14px 0 13px; font-size: clamp(48px, 6.2vw, 73px); }
.adventure-heading p { max-width: 550px; margin: 0 auto; color: #656278; font-size: 13px; line-height: 1.65; }
.adventure-quest { position: relative; z-index: 1; width: min(800px, 100%); margin: 0 auto; padding: 32px 38px 36px; border: 1px solid rgba(63,57,99,.13); border-radius: 20px; background: #fffdf8; box-shadow: 0 18px 43px rgba(76,66,127,.11); }
.quest-ribbon { display: flex; align-items: center; justify-content: space-between; gap: 15px; color: #6c5ac8; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.quest-ribbon b { padding: 7px 10px; border-radius: 999px; color: #b34851; background: #ffe7d8; }
.adventure-quest h2 { margin: 20px 0 11px; color: #2c304a; font: 600 clamp(34px, 4.7vw, 52px)/1.05 "Newsreader", Georgia, serif; letter-spacing: -.025em; }
.quest-opening { max-width: 670px; margin: 0 0 25px; color: #56566c; font: 500 17px/1.6 "Newsreader", Georgia, serif; }
.quest-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.quest-details > div { display: grid; grid-template-columns: 31px 1fr; grid-template-rows: auto 1fr; column-gap: 9px; padding: 15px; border-radius: 13px; background: #f3f0ff; }
.quest-details > div:nth-child(2) { background: #fff0e6; }
.quest-details > div:nth-child(3) { background: #eaf9f5; }
.quest-details > div > span { grid-row: 1 / 3; display: grid; place-items: center; align-self: start; width: 29px; height: 29px; border-radius: 50%; color: white; background: #7667d8; font-weight: 800; }
.quest-details > div:nth-child(2) > span { background: #ef777b; }
.quest-details > div:nth-child(3) > span { background: #49a987; }
.quest-details small { color: #7c778d; font-size: 7px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.quest-details strong { margin-top: 4px; color: #47465c; font-size: 10.5px; line-height: 1.45; }
.adventure-actions { position: relative; z-index: 1; display: flex; justify-content: center; gap: 11px; margin-top: 22px; }
.adventure-actions button { min-height: 46px; padding: 0 20px; border-radius: 999px; font-size: 10px; font-weight: 800; cursor: pointer; }
.new-adventure { border: 1px solid rgba(92,75,174,.22); color: #6554bf; background: rgba(255,255,255,.8); }
.adventure-to-write { border: 0; color: white; background: linear-gradient(135deg, #6c59cf, #9c68d6); box-shadow: 0 10px 22px rgba(92,69,180,.25); }
.adventure-actions button:hover { transform: translateY(-2px); }
.adventure-home:focus-visible,
.adventure-actions button:focus-visible { outline: 3px solid rgba(117,103,216,.3); outline-offset: 3px; }

@keyframes reviewSpin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .path-adventure { grid-template-columns: 1fr; }
  .path-adventure .card-art { min-height: 200px; }
  .review-columns { grid-template-columns: 1fr; }
  .adventure-view { width: min(760px, calc(100% - 48px)); }
  .adventure-shell { padding-right: 30px; padding-left: 30px; }
  .quest-details { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .path-adventure { grid-column: auto; grid-template-columns: 41% 59%; min-height: 214px; }
  .path-adventure .card-art { min-height: 166px; }
  .adventure-map { top: 35px; left: calc(50% - 56px); width: 112px; height: 94px; }
  .adventure-map::after { box-shadow: 37px 0 0 rgba(112,83,55,.16); }
  .adventure-map b:first-child { top: 12px; left: 11px; width: 24px; height: 17px; }
  .adventure-map b:nth-child(2) { right: 13px; bottom: 12px; width: 29px; height: 20px; }
  .adventure-map b:nth-child(3) { top: 46px; left: 44px; width: 11px; height: 11px; }
  .adventure-path { top: 58px; left: calc(50% - 40px); width: 78px; height: 42px; border-width: 2px; }
  .adventure-compass { top: 86px; left: calc(50% + 25px); width: 41px; height: 41px; border-width: 4px; font-size: 15px; }
  .adventure-star { top: 20px; left: calc(50% + 34px); font-size: 18px; }
  .ai-review-button { height: 37px; }
  .book-review-panel { width: calc(100% - 14px); margin-top: 14px; border-radius: 17px; }
  .review-results { padding: 18px 14px; }
  .review-summary { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .review-summary h3 { font-size: 29px; }
  .review-columns section { padding: 17px; }
  .adventure-view { width: calc(100% - 28px); padding: 18px 0 48px; }
  .adventure-shell { padding: 72px 14px 30px; border-radius: 21px; }
  .adventure-home { top: 17px; left: 16px; }
  .adventure-heading h1 { font-size: clamp(42px, 13vw, 57px); }
  .adventure-heading p { font-size: 11.5px; }
  .adventure-quest { padding: 25px 18px; }
  .quest-opening { font-size: 15px; }
  .adventure-actions { display: grid; }
  .adventure-actions button { width: 100%; }
}

@media print {
  .write-page .book-review-panel { display: none !important; }
}

/* Puzzle rewards and avatar system */
.puzzle-nav-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(93, 77, 183, .2);
  border-radius: 999px;
  color: #5d4eba;
  background: rgba(255,255,255,.72);
  box-shadow: 0 7px 18px rgba(78,62,157,.09);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
}
.puzzle-nav-button i { color: #e0626c; font-style: normal; }
.puzzle-nav-button small { padding: 4px 6px; border-radius: 999px; color: white; background: #7667d8; font-size: 7px; letter-spacing: 0; }
.puzzle-nav-button:hover { transform: translateY(-2px); }

.home-avatar-button {
  display: grid;
  justify-items: center;
  width: fit-content;
  margin: -25px auto 8px;
  padding: 0 16px 7px;
  border: 0;
  color: #675f80;
  background: transparent;
  cursor: pointer;
}
.home-avatar-button > span:last-child { margin-top: 3px; padding: 6px 11px; border: 1px solid rgba(92,75,174,.14); border-radius: 999px; background: rgba(255,255,255,.65); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; transition: transform 180ms ease, color 180ms ease; }
.home-avatar-button:hover > span:last-child { color: #5949b6; transform: translateY(-2px); }

.avatar-stage { --avatar-scale: 1; position: relative; display: inline-block; width: 104px; height: 132px; overflow: visible; }
.avatar-stage-home { --avatar-scale: .88; width: 115px; height: 122px; }
.avatar-stage-card { --avatar-scale: .92; width: 115px; height: 128px; }
.avatar-stage-large { --avatar-scale: 1.35; width: 158px; height: 180px; }
.avatar-figure { position: absolute; left: 50%; bottom: 0; display: block; width: 76px; height: 118px; filter: drop-shadow(0 8px 8px rgba(50,42,82,.13)); transform: translateX(-50%) scale(var(--avatar-scale)); transform-origin: center bottom; }
.avatar-aura-mark { position: absolute; z-index: 0; top: -1px; left: -17px; width: 110px; height: 120px; color: var(--aura-accent); background: radial-gradient(ellipse at center, color-mix(in srgb,var(--aura-accent) 22%,transparent) 0 37%,transparent 66%); filter: drop-shadow(0 0 7px color-mix(in srgb,var(--aura-color) 75%,transparent)); font-style: normal; animation: avatarGlow 2.3s ease-in-out infinite; }
.avatar-aura-mark::before { content:""; position:absolute; inset:0; border-radius:48%; background:conic-gradient(from -20deg,transparent 0 5%,var(--aura-color) 7% 18%,var(--aura-accent) 22% 29%,transparent 32% 38%,var(--aura-color) 42% 57%,var(--aura-accent) 61% 72%,transparent 76% 82%,var(--aura-color) 86% 97%,transparent); -webkit-mask:radial-gradient(ellipse,transparent 0 51%,#000 53% 66%,transparent 69%); mask:radial-gradient(ellipse,transparent 0 51%,#000 53% 66%,transparent 69%); }
.avatar-aura-mark b { position:absolute; width:18px; height:32px; border-radius:70% 30% 65% 35%; background:linear-gradient(160deg,var(--aura-accent),var(--aura-color) 58%,transparent 60%); clip-path:polygon(48% 0,72% 33%,100% 48%,70% 100%,25% 88%,0 52%,30% 35%); animation:avatarFlame 1.25s ease-in-out infinite alternate; }
.avatar-aura-mark b:first-child { top:0; left:15px; transform:rotate(-25deg); }
.avatar-aura-mark b:nth-child(2) { top:3px; right:13px; transform:rotate(31deg); animation-delay:-.5s; }
.avatar-aura-mark b:nth-child(3) { bottom:1px; left:8px; transform:rotate(205deg); animation-delay:-.8s; }
.avatar-aura-mark b:nth-child(4) { right:5px; bottom:5px; transform:rotate(155deg); animation-delay:-.2s; }
.avatar-aura-mark em { position:absolute; top:11px; right:8px; display:grid; place-items:center; width:22px; height:22px; border-radius:50%; color:var(--aura-accent); background:color-mix(in srgb,var(--aura-color) 70%,transparent); box-shadow:0 0 11px var(--aura-accent); font-style:normal; font-size:11px; }
.avatar-figure[data-has-aura="false"] .avatar-aura-mark { display: none; }
.avatar-hair-back { position:absolute; z-index:3; top:18px; left:8px; width:60px; height:57px; border-radius:46% 46% 36% 36%; background:linear-gradient(135deg,var(--hair-accent),var(--hair-color) 42% 78%,color-mix(in srgb,var(--hair-color) 70%,#181528)); box-shadow:inset -5px -5px 0 color-mix(in srgb,var(--hair-color) 72%,#181528); }
.avatar-figure[data-has-hair="false"] :is(.avatar-hair-back,.avatar-hair-front) { display:none; }
.avatar-head { position: absolute; z-index: 5; top: 25px; left: 14px; width: 48px; height: 43px; border: 2px solid color-mix(in srgb,var(--skin-shadow) 35%,transparent); border-radius: 48% 48% 43% 43%; background: linear-gradient(145deg,color-mix(in srgb,var(--skin-color) 85%,white),var(--skin-color)); box-shadow: inset -4px -5px 0 color-mix(in srgb,var(--skin-shadow) 18%,transparent); }
.avatar-hair-front { position:absolute; z-index:2; top:-5px; left:-3px; width:51px; height:20px; border-radius:55% 55% 35% 20%; background:linear-gradient(155deg,var(--hair-accent),var(--hair-color) 58%); clip-path:polygon(0 0,100% 0,93% 45%,78% 28%,65% 75%,49% 34%,32% 81%,17% 38%,5% 66%); }
.avatar-figure[data-hair-style="1"] .avatar-hair-front { height:23px; border-radius:50%; background:radial-gradient(circle at 13% 40%,var(--hair-accent) 0 15%,transparent 17%),radial-gradient(circle at 32% 22%,var(--hair-color) 0 18%,transparent 20%),radial-gradient(circle at 52% 25%,var(--hair-accent) 0 19%,transparent 21%),radial-gradient(circle at 73% 30%,var(--hair-color) 0 18%,transparent 20%),radial-gradient(circle at 90% 44%,var(--hair-accent) 0 15%,transparent 17%); clip-path:none; }
.avatar-figure[data-hair-style="2"] .avatar-hair-back { height:72px; border-radius:45% 45% 18px 18px; clip-path:polygon(0 0,100% 0,88% 78%,72% 55%,63% 100%,48% 61%,35% 100%,25% 57%,10% 82%); }
.avatar-figure[data-hair-style="3"] .avatar-hair-front { top:-9px; left:5px; width:47px; height:27px; clip-path:polygon(0 52%,25% 8%,100% 0,74% 100%,57% 44%,35% 91%); }
.avatar-figure[data-hair-style="4"] .avatar-hair-back { top:10px; left:5px; width:66px; height:44px; border-radius:50%; background:radial-gradient(circle at 18% 48%,var(--hair-color) 0 21%,transparent 23%),radial-gradient(circle at 40% 28%,var(--hair-accent) 0 25%,transparent 27%),radial-gradient(circle at 68% 28%,var(--hair-color) 0 27%,transparent 29%),radial-gradient(circle at 88% 52%,var(--hair-accent) 0 22%,transparent 24%); box-shadow:none; }
.avatar-figure[data-hair-style="5"] .avatar-hair-back { left:5px; width:66px; height:82px; border-radius:45% 45% 44% 44%; }
.avatar-figure[data-hair-style="6"] .avatar-hair-back { height:76px; border-radius:42% 42% 20% 20%; background:repeating-linear-gradient(100deg,var(--hair-color) 0 5px,var(--hair-accent) 6px 8px); clip-path:polygon(2% 0,98% 0,91% 100%,78% 71%,67% 100%,55% 72%,44% 100%,31% 70%,16% 100%); }
.avatar-figure[data-hair-style="7"] .avatar-hair-back { top:18px; left:6px; width:64px; height:62px; border-radius:48% 48% 42% 42%; }
.avatar-eye { position: absolute; z-index:3; top: 15px; width: 6px; height: 7px; border-radius: 50%; background: var(--eye-color); }
.avatar-eye::after { content:""; position:absolute; top:1px; left:1px; width:2px; height:2px; border-radius:50%; background:white; }
.avatar-eye-left { left: 11px; }
.avatar-eye-right { right: 11px; }
.avatar-figure[data-eye-style="1"] .avatar-eye { width: 8px; height: 5px; border-radius: 55% 55% 35% 35%; transform: rotate(-5deg); }
.avatar-figure[data-eye-style="2"] .avatar-eye { width: 8px; height: 8px; border: 2px solid var(--eye-color); background: var(--clothes-accent); box-shadow: 0 0 7px var(--eye-color); }
.avatar-figure[data-eye-style="3"] .avatar-eye { top: 16px; height: 3px; border-radius: 4px; }
.avatar-figure[data-eye-style="4"] .avatar-eye { width: 7px; height: 9px; border-radius: 50% 50% 40% 40%; }
.avatar-nose { position:absolute; z-index:3; left:22px; top:24px; width:4px; height:3px; border-radius:50%; background:color-mix(in srgb,var(--skin-shadow) 65%,#7c4650); }
.avatar-smile { position: absolute; z-index:3; left: 19px; bottom: 6px; width: 10px; height: 5px; border-bottom: 2px solid color-mix(in srgb,var(--skin-shadow) 60%,#8f4850); border-radius: 0 0 8px 8px; }
.avatar-body { position: absolute; z-index: 4; top: 66px; left: 9px; display: grid; place-items: center; width: 58px; height: 37px; overflow: hidden; border: 2px solid rgba(47,43,73,.14); border-radius: 15px 15px 9px 9px; color: var(--clothes-accent); background: linear-gradient(145deg,color-mix(in srgb,var(--clothes-color) 82%,white),var(--clothes-color)); font-style: normal; box-shadow: inset 0 -7px 0 color-mix(in srgb,var(--clothes-accent) 25%,transparent),0 5px 7px rgba(37,32,65,.1); }
.avatar-body::before { content:""; position:absolute; top:-3px; left:17px; width:20px; height:10px; border:3px solid var(--clothes-accent); border-top:0; border-radius:0 0 50% 50%; }
.avatar-body::after { content:""; position:absolute; left:4px; right:4px; bottom:6px; height:3px; border-radius:3px; background:color-mix(in srgb,var(--clothes-accent) 78%,transparent); }
.avatar-body i { position:relative; z-index:2; font-style: normal; font-size: 14px; filter:drop-shadow(0 1px 1px rgba(0,0,0,.12)); }
.avatar-figure[data-clothes-style="1"] .avatar-body { background: repeating-linear-gradient(105deg, var(--clothes-color) 0 9px, color-mix(in srgb,var(--clothes-accent) 70%,var(--clothes-color)) 10px 13px); }
.avatar-figure[data-clothes-style="2"] .avatar-body { border-radius: 20px 20px 8px 8px; background:linear-gradient(135deg,var(--clothes-accent),var(--clothes-color) 32% 68%,var(--clothes-accent)); }
.avatar-figure[data-clothes-style="3"] .avatar-body { height:42px; background: linear-gradient(145deg, var(--clothes-accent), var(--clothes-color) 55%); clip-path:polygon(13% 0,87% 0,100% 100%,0 100%); }
.avatar-figure[data-clothes-style="4"] .avatar-body { border-bottom: 9px solid var(--clothes-accent); background:radial-gradient(circle at 50% 42%,color-mix(in srgb,var(--clothes-accent) 62%,transparent) 0 12%,transparent 13%),var(--clothes-color); }
.avatar-arm { position: absolute; z-index: 3; top: 69px; width: 11px; height: 35px; border: 2px solid color-mix(in srgb,var(--skin-shadow) 30%,transparent); border-radius: 7px; background: linear-gradient(var(--skin-color),var(--skin-shadow)); }
.avatar-arm-left { left: 2px; transform: rotate(7deg); }
.avatar-arm-right { right: 2px; transform: rotate(-7deg); }
.avatar-leg { position: absolute; z-index: 3; top: 98px; width: 23px; height: 20px; border: 2px solid rgba(47,43,73,.13); border-radius: 3px 3px 8px 8px; background: linear-gradient(150deg,var(--clothes-color),color-mix(in srgb,var(--clothes-color) 64%,#20243b)); box-shadow:inset 0 -5px 0 var(--clothes-accent); }
.avatar-leg-left { left: 12px; transform:rotate(1deg); }
.avatar-leg-right { right: 12px; transform:rotate(-1deg); }
.avatar-hat-piece { position: absolute; z-index: 8; top: 8px; left: 9px; display: grid; place-items: center; width: 58px; height: 24px; border: 2px solid rgba(53,43,72,.16); border-radius: 55% 55% 12px 12px; color: var(--hat-accent); background: linear-gradient(145deg,color-mix(in srgb,var(--hat-color) 78%,white),var(--hat-color)); box-shadow: 0 5px 0 color-mix(in srgb, var(--hat-color) 65%, #2b2840),0 8px 12px rgba(40,32,68,.16); font-style: normal; font-size: 13px; }
.avatar-figure[data-has-hat="false"] .avatar-hat-piece { display: none; }
.avatar-figure[data-hat-style="1"] .avatar-hat-piece { top: 0; left: 18px; width: 40px; height: 34px; border-radius: 50% 50% 8px 8px; clip-path:polygon(50% 0,100% 100%,0 100%); }
.avatar-figure[data-hat-style="2"] .avatar-hat-piece { top: 12px; left: 3px; width: 70px; height: 13px; border-radius: 50%; }
.avatar-figure[data-hat-style="3"] .avatar-hat-piece { top: -2px; left: 15px; width: 46px; height: 35px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.avatar-figure[data-hat-style="4"] .avatar-hat-piece { top: 8px; left: 12px; width: 52px; height: 19px; border-radius: 5px 13px 5px 13px; transform: rotate(-5deg); }
.avatar-extra { position: absolute; z-index: 9; right: -13px; bottom: 19px; display: grid; place-items: center; width: 32px; height: 32px; border: 3px solid white; border-radius: 48% 52% 46% 54%; color: var(--extra-color); background: radial-gradient(circle at 35% 28%,white,var(--extra-accent) 38% 65%,color-mix(in srgb,var(--extra-color) 38%,var(--extra-accent))); box-shadow: 0 7px 14px rgba(47,43,73,.22),0 0 0 3px color-mix(in srgb,var(--extra-color) 22%,transparent); font-style: normal; font-size: 15px; animation:avatarCompanion 2.8s ease-in-out infinite; }
.avatar-extra:empty { display: none; }

.user-avatar.user-avatar-character { --avatar-scale: .27; position: relative; display: block; overflow: hidden; color: inherit; background: linear-gradient(145deg,#fff8ea,#e8e2ff); }
.user-avatar.user-avatar-character .avatar-figure { bottom: -1px; }

.puzzles-page { background: radial-gradient(circle at 15% 15%, rgba(255,203,111,.35), transparent 26%), radial-gradient(circle at 88% 26%, rgba(116,214,222,.32), transparent 29%), radial-gradient(circle at 45% 84%, rgba(195,171,255,.34), transparent 34%), #fff8eb; }
.puzzles-view { width: min(1220px, calc(100% - 72px)); margin: 0 auto; padding: 34px 0 85px; }
.puzzles-shell { position: relative; }
.puzzles-home { min-height: 38px; padding: 0 14px; border: 1px solid rgba(45,47,73,.13); border-radius: 999px; color: #625d76; background: rgba(255,255,255,.7); font-size: 10px; font-weight: 800; cursor: pointer; }
.puzzles-hero { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; margin-top: 22px; padding: 38px 46px; overflow: hidden; border: 1px solid rgba(95,77,180,.16); border-radius: 27px; background: linear-gradient(135deg,rgba(255,255,255,.9),rgba(244,239,255,.8)); box-shadow: 0 22px 58px rgba(72,62,122,.11); }
.puzzles-kicker { color: #df5963; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.puzzles-hero h1 { margin: 12px 0 12px; font-size: clamp(49px,6vw,73px); }
.puzzles-hero p { max-width: 590px; margin: 0; color: #646278; font-size: 13px; line-height: 1.65; }
.puzzle-avatar-card { display: grid; grid-template-columns: auto 145px; align-items: center; padding: 10px 16px 10px 8px; border: 1px solid rgba(94,76,178,.17); border-radius: 20px; color: #4e4867; background: rgba(255,255,255,.75); box-shadow: 0 13px 29px rgba(72,62,122,.1); text-align: left; cursor: pointer; }
.puzzle-avatar-card > span:last-child { display: grid; gap: 4px; }
.puzzle-avatar-card small { color: #7b6ed1; font-size: 8px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.puzzle-avatar-card strong { font: 600 19px/1.1 "Newsreader",Georgia,serif; }
.puzzle-avatar-card i { color: #df5963; font-style: normal; }
.puzzle-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 19px; }
.puzzle-stats > div { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 11px; padding: 17px 20px; border: 1px solid rgba(50,51,75,.11); border-radius: 16px; background: rgba(255,255,255,.77); }
.puzzle-stats span { grid-row:1/3; display:grid;place-items:center;width:38px;height:38px;border-radius:12px;color:white;background:#7667d8; }
.puzzle-stats > div:nth-child(2) span { background:#47a984; }.puzzle-stats > div:nth-child(3) span{background:#e56d72}
.puzzle-stats strong { color:#35354f;font:600 22px/1 "Newsreader",Georgia,serif; }.puzzle-stats small{color:#7a7589;font-size:8px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.current-puzzle-section { display:grid;grid-template-columns:.8fr 1.2fr;gap:30px;align-items:center;margin-top:24px;padding:35px 42px;border:1px solid rgba(91,75,172,.16);border-radius:24px;background:linear-gradient(125deg,#342f62,#5a4894);box-shadow:0 22px 50px rgba(55,44,105,.2); }
.current-puzzle-copy > span { color:#d7cffc;font-size:9px;font-weight:800;letter-spacing:.16em;text-transform:uppercase; }.current-puzzle-copy h2{margin:10px 0 9px;color:white;font:600 clamp(33px,4vw,48px)/1.03 "Newsreader",Georgia,serif}.current-puzzle-copy p{max-width:430px;margin:0 0 19px;color:#ded9ef;font-size:11px;line-height:1.6}
.current-piece-meter{width:100%;height:8px;overflow:hidden;border-radius:999px;background:rgba(255,255,255,.16)}.current-piece-meter i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#ffcb61,#fa8292);transition:width .5s ease}.current-puzzle-copy>strong{display:block;margin-top:7px;color:#f0ecff;font-size:9px}.current-puzzle-copy button{min-height:43px;margin-top:18px;padding:0 17px;border:0;border-radius:999px;color:#443a76;background:white;font-size:9px;font-weight:800;cursor:pointer}
.featured-puzzle{display:grid;grid-template-columns:minmax(220px,300px) 1fr;gap:22px;align-items:center;padding:17px;border-radius:19px;background:rgba(255,255,255,.1)}.featured-puzzle>div:last-child{display:grid;gap:5px}.featured-puzzle small{color:#d9d2f4;font-size:8px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.featured-puzzle strong{color:white;font:600 28px/1.05 "Newsreader",Georgia,serif}.featured-puzzle>div:last-child span{color:#dcd6ee;font-size:10px}
.puzzle-picture{--avatar-scale:.8;position:relative;min-height:154px;overflow:hidden;border:1px solid rgba(255,255,255,.5);border-radius:15px;background:radial-gradient(circle at 50% 40%,var(--reward-accent),transparent 48%),linear-gradient(145deg,color-mix(in srgb,var(--reward-color) 24%,white),color-mix(in srgb,var(--reward-accent) 40%,white));}.puzzle-picture-featured{--avatar-scale:1.05;min-height:230px}.puzzle-reward-avatar{position:absolute;inset:10px 0 5px;width:auto;height:auto}.puzzle-reward-icon{position:absolute;right:12px;top:9px;color:var(--reward-color);font-size:19px}.puzzle-piece-grid{position:absolute;inset:0;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr)}.puzzle-mask{display:grid;place-items:center;border:1px solid rgba(255,255,255,.65);color:white;background:linear-gradient(145deg,color-mix(in srgb,var(--reward-color) 86%,#272342),color-mix(in srgb,var(--reward-color) 58%,#201d38));font-style:normal;transition:opacity .3s ease}.puzzle-mask.revealed{opacity:0}.puzzle-mask b{font-size:11px;opacity:.58}
.puzzle-collection{margin-top:26px;padding:31px;border:1px solid rgba(48,50,76,.11);border-radius:23px;background:rgba(255,255,255,.74);box-shadow:0 17px 45px rgba(72,62,122,.07)}.puzzle-collection-heading{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:22px}.puzzle-collection-heading>div:first-child>span{color:#df5963;font-size:8px;font-weight:800;letter-spacing:.17em;text-transform:uppercase}.puzzle-collection-heading h2{margin:6px 0 0;font:600 34px/1 "Newsreader",Georgia,serif}.puzzle-filters{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.puzzle-filters button{min-height:34px;padding:0 11px;border:1px solid rgba(65,62,95,.12);border-radius:999px;color:#706b80;background:#f8f5fc;font-size:8px;font-weight:800;cursor:pointer}.puzzle-filters button.active{color:white;border-color:#6f5ed0;background:#6f5ed0}
.puzzle-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}.puzzle-card{overflow:hidden;border:1px solid rgba(49,51,76,.11);border-radius:16px;background:#fff;box-shadow:0 8px 20px rgba(67,60,103,.07)}.puzzle-card .puzzle-picture{min-height:145px;border:0;border-radius:0}.puzzle-card-copy{display:grid;gap:3px;padding:13px 14px 15px}.puzzle-card-copy>span{color:#8a8395;font-size:7px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.puzzle-card-copy strong{overflow:hidden;color:#3a3950;font:600 16px/1.15 "Newsreader",Georgia,serif;text-overflow:ellipsis;white-space:nowrap}.puzzle-card-copy small{color:#777286;font-size:8px}.puzzle-complete .puzzle-card-copy small{color:#278060}.puzzle-locked{filter:saturate(.72)}

.avatar-overlay{position:fixed;z-index:65;inset:0;display:grid;place-items:center;padding:24px;background:rgba(35,31,58,.58);backdrop-filter:blur(9px)}.avatar-dialog{position:relative;width:min(920px,100%);max-height:calc(100vh - 48px);padding:30px;overflow:auto;border:1px solid rgba(255,255,255,.6);border-radius:26px;background:linear-gradient(145deg,#fffdf8,#f4efff);box-shadow:0 30px 90px rgba(30,25,60,.3)}.avatar-close{position:absolute;z-index:2;top:16px;right:17px;display:grid;place-items:center;width:38px;height:38px;border:0;border-radius:50%;color:#615c72;background:white;font-size:23px;cursor:pointer}.avatar-dialog-heading{display:grid;grid-template-columns:155px 1fr;gap:23px;align-items:center;padding:5px 34px 20px 8px}.avatar-dialog-heading>div>span{color:#df5963;font-size:9px;font-weight:800;letter-spacing:.16em;text-transform:uppercase}.avatar-dialog-heading h2{margin:8px 0 7px;font:600 42px/1 "Newsreader",Georgia,serif}.avatar-dialog-heading p{margin:0;color:#706c80;font-size:11px}.avatar-category-tabs{display:flex;gap:7px;padding:9px;border:1px solid rgba(65,60,99,.1);border-radius:15px;background:rgba(255,255,255,.7)}.avatar-category-tabs button{display:flex;align-items:center;justify-content:center;gap:7px;flex:1;min-height:42px;border:0;border-radius:10px;color:#6d687e;background:transparent;font-size:9px;font-weight:800;cursor:pointer}.avatar-category-tabs button small{padding:3px 5px;border-radius:999px;background:#ece8f4;font-size:7px}.avatar-category-tabs button.active{color:white;background:#6f5ed0}.avatar-category-tabs button.active small{background:rgba(255,255,255,.18)}
.avatar-inventory{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:14px}.avatar-item{display:grid;justify-items:center;gap:6px;min-height:142px;padding:15px 8px;border:1px solid rgba(49,50,76,.11);border-radius:16px;color:#444158;background:linear-gradient(150deg,#fff,#fbf9ff);box-shadow:0 7px 16px rgba(61,52,98,.06);cursor:pointer;transition:transform 150ms ease,box-shadow 150ms ease,border-color 150ms ease}.avatar-item:not(:disabled):hover{transform:translateY(-3px);box-shadow:0 13px 24px rgba(61,52,98,.12)}.avatar-item-icon{position:relative;display:grid;place-items:center;width:58px;height:58px;overflow:hidden;border:1px solid color-mix(in srgb,var(--item-color) 20%,transparent);border-radius:19px;color:var(--item-color);background:radial-gradient(circle at 35% 25%,white,color-mix(in srgb,var(--item-accent) 50%,white) 48%,color-mix(in srgb,var(--item-color) 18%,white));box-shadow:inset 0 0 0 3px rgba(255,255,255,.55),0 7px 15px color-mix(in srgb,var(--item-color) 17%,transparent);font-size:25px}.avatar-item-icon i{position:relative;z-index:2;font-style:normal}.avatar-item-skin .avatar-item-icon{border-radius:50%;background:radial-gradient(circle at 34% 28%,color-mix(in srgb,var(--item-color) 82%,white),var(--item-color) 62%,var(--item-accent));}.avatar-item-skin .avatar-item-icon i{opacity:0}.avatar-item-hair .avatar-item-icon::before{content:"";position:absolute;top:10px;width:39px;height:42px;border-radius:50% 50% 42% 42%;background:linear-gradient(145deg,var(--item-accent),var(--item-color));clip-path:polygon(0 0,100% 0,92% 74%,76% 54%,65% 100%,49% 59%,35% 100%,23% 55%,7% 81%)}.avatar-item-hair:first-child .avatar-item-icon::before{display:none}.avatar-item-auras .avatar-item-icon{overflow:visible;background:radial-gradient(circle,color-mix(in srgb,var(--item-accent) 75%,white),transparent 68%)}.avatar-item-auras .avatar-item-icon::before,.avatar-item-auras .avatar-item-icon::after{content:"";position:absolute;width:26px;height:43px;background:linear-gradient(var(--item-accent),var(--item-color));clip-path:polygon(50% 0,75% 34%,100% 49%,73% 100%,24% 86%,0 52%,28% 36%);filter:drop-shadow(0 0 6px var(--item-color))}.avatar-item-auras .avatar-item-icon::before{left:0;bottom:2px;transform:rotate(-28deg)}.avatar-item-auras .avatar-item-icon::after{right:0;top:0;transform:rotate(31deg)}.avatar-item-clothes .avatar-item-icon::before{content:"";position:absolute;inset:12px 10px 7px;border-radius:11px 11px 5px 5px;background:linear-gradient(145deg,var(--item-accent),var(--item-color) 45%);clip-path:polygon(24% 0,76% 0,100% 26%,83% 42%,80% 100%,20% 100%,17% 42%,0 26%)}.avatar-item-hats .avatar-item-icon::before{content:"";position:absolute;top:10px;left:9px;width:40px;height:30px;border-radius:50% 50% 7px 7px;background:linear-gradient(145deg,var(--item-accent),var(--item-color));box-shadow:0 8px 0 color-mix(in srgb,var(--item-color) 70%,#29243f)}.avatar-item-accessories .avatar-item-icon::after{content:"✦";position:absolute;top:4px;right:6px;color:var(--item-accent);font-size:12px}.avatar-item strong{font:600 15px/1.15 "Newsreader",Georgia,serif}.avatar-item small{color:#827d8f;font-size:7.5px}.avatar-item.locked{opacity:.52;cursor:not-allowed;filter:saturate(.35)}.avatar-item.equipped{border-color:#6f5ed0;background:linear-gradient(150deg,#fff,#f0edff);box-shadow:0 0 0 3px rgba(111,94,208,.13),0 12px 25px rgba(75,60,151,.12)}.avatar-item.equipped small{color:#3f8c70;font-weight:800}.avatar-dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:17px;padding-top:16px;border-top:1px solid rgba(54,53,82,.1);color:#716d80;font-size:9px}.avatar-dialog-footer button{min-height:36px;padding:0 13px;border:1px solid rgba(73,66,112,.14);border-radius:999px;color:#5d53a7;background:white;font-size:8px;font-weight:800;cursor:pointer}

.review-reward{display:grid;grid-template-columns:39px 1fr auto;gap:12px;align-items:center;margin-top:18px;padding:15px 16px;border:1px solid rgba(105,88,190,.22);border-radius:14px;background:linear-gradient(90deg,#f1edff,#fff7e9)}.review-reward>span{display:grid;place-items:center;width:36px;height:36px;border-radius:12px;color:white;background:#735fd0}.review-reward strong{color:#403b5b;font-size:11px}.review-reward p{margin:3px 0 0;color:#716c81;font-size:10px;line-height:1.5}.review-reward button{min-height:34px;padding:0 11px;border:0;border-radius:999px;color:white;background:#6e5bca;font-size:8px;font-weight:800;cursor:pointer}.review-reward-earned{border-color:rgba(55,157,119,.3);background:linear-gradient(90deg,#e9faf3,#fff8e8)}.review-reward-earned>span{background:#3ea47e}
.reward-toast{position:fixed;z-index:80;right:24px;bottom:24px;display:grid;grid-template-columns:46px 1fr 28px;gap:12px;align-items:center;width:min(430px,calc(100% - 32px));padding:16px;border:1px solid rgba(255,255,255,.62);border-radius:18px;color:white;background:linear-gradient(135deg,#433777,#7357be);box-shadow:0 24px 55px rgba(40,30,85,.34);animation:toastIn .4s ease}.reward-toast>span{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;color:#684fb7;background:#fff3bf;font-size:20px}.reward-toast strong{font:600 18px/1.1 "Newsreader",Georgia,serif}.reward-toast p{margin:3px 0 0;color:#e5def5;font-size:9px;line-height:1.45}.reward-toast button{border:0;color:white;background:transparent;font-size:21px;cursor:pointer}
@keyframes avatarGlow{50%{transform:scale(1.04) rotate(1deg);filter:drop-shadow(0 0 12px color-mix(in srgb,var(--aura-color) 90%,transparent))}}@keyframes avatarFlame{to{scale:.82 1.13;filter:brightness(1.2)}}@keyframes avatarCompanion{50%{transform:translateY(-4px) rotate(4deg)}}@keyframes toastIn{from{opacity:0;transform:translateY(18px)}}

@media(max-width:980px){.puzzles-view{width:min(800px,calc(100% - 40px))}.puzzles-hero{grid-template-columns:1fr}.puzzle-avatar-card{justify-self:start}.current-puzzle-section{grid-template-columns:1fr}.puzzle-grid{grid-template-columns:repeat(3,1fr)}.avatar-inventory{grid-template-columns:repeat(3,1fr)}}
@media(max-width:620px){.puzzle-nav-button{min-height:42px;padding:0 7px}.puzzle-nav-button span{display:none}.puzzle-nav-button small{font-size:6px}.home-avatar-button{margin-top:-12px}.puzzles-view{width:calc(100% - 24px);padding:17px 0 48px}.puzzles-hero{gap:20px;padding:28px 18px}.puzzles-hero h1{font-size:43px}.puzzle-avatar-card{grid-template-columns:86px 1fr;width:100%}.avatar-stage-card{--avatar-scale:.7;width:80px;height:93px}.puzzle-stats{grid-template-columns:1fr}.current-puzzle-section{padding:24px 17px}.featured-puzzle{grid-template-columns:1fr}.puzzle-picture-featured{min-height:210px}.puzzle-collection{padding:21px 13px}.puzzle-collection-heading{display:grid}.puzzle-filters{justify-content:flex-start}.puzzle-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.puzzle-card .puzzle-picture{--avatar-scale:.65;min-height:125px}.puzzle-card-copy{padding:11px}.puzzle-card-copy strong{font-size:13px}.avatar-overlay{padding:10px}.avatar-dialog{max-height:calc(100vh - 20px);padding:22px 14px}.avatar-dialog-heading{grid-template-columns:100px 1fr;gap:10px;padding-right:32px}.avatar-stage-large{--avatar-scale:.9;width:95px;height:118px}.avatar-dialog-heading h2{font-size:31px}.avatar-category-tabs{overflow-x:auto}.avatar-category-tabs button{flex:0 0 77px}.avatar-inventory{grid-template-columns:repeat(2,1fr)}.review-reward{grid-template-columns:36px 1fr}.review-reward button{grid-column:1/-1}.reward-toast{right:16px;bottom:16px}.site-header{grid-template-columns:70px minmax(0,1fr)}.header-actions{min-width:0;justify-self:end}.header-flourish{min-width:58px}.auth-button{max-width:102px;padding:0 7px;white-space:normal;line-height:1.1}#userName{display:none}}

/* Levels, XP, and the recommended welcome tour */
.home-xp-card {
  width: min(330px, calc(100% - 28px));
  margin: 0 auto 21px;
  padding: 11px 14px 10px;
  border: 1px solid rgba(93, 76, 180, .17);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 24px rgba(71,63,119,.08);
  text-align: left;
}
.xp-card-topline { display:flex;align-items:center;justify-content:space-between;gap:15px;color:#4d4865;font-size:9px;font-weight:800;letter-spacing:.07em;text-transform:uppercase; }
.xp-card-topline strong { color:#5e4db9;font-size:10px; }
.xp-progress-track { height:8px;margin:8px 0 7px;overflow:hidden;border-radius:999px;background:#e5e0f2;box-shadow:inset 0 1px 2px rgba(56,48,94,.12); }
.xp-progress-track i { display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#725fd0,#ec7184,#f2bc4e);box-shadow:0 0 12px rgba(223,94,117,.28);transition:width .45s ease; }
.home-xp-card small { display:block;color:#797487;font-size:7.5px;font-weight:700;line-height:1.4;text-align:center; }

.explore-overlay { position:fixed;z-index:75;inset:0;display:grid;place-items:center;padding:22px;background:rgba(35,31,58,.59);backdrop-filter:blur(10px); }
.explore-dialog { position:relative;width:min(610px,100%);padding:43px 44px 35px;overflow:hidden;border:1px solid rgba(255,255,255,.68);border-radius:27px;background:radial-gradient(circle at 86% 12%,rgba(126,215,234,.24),transparent 27%),radial-gradient(circle at 12% 88%,rgba(255,198,96,.26),transparent 28%),linear-gradient(145deg,#fffdf8,#f3edff);box-shadow:0 30px 90px rgba(28,23,58,.34);text-align:center;animation:modalRise .35s ease; }
.explore-dialog::before,.explore-dialog::after { content:"";position:absolute;pointer-events:none; }
.explore-dialog::before { top:86px;left:48px;width:15px;height:15px;border:4px solid #ef777b;border-radius:50%; }
.explore-dialog::after { right:45px;bottom:99px;width:10px;height:10px;border-radius:50%;background:#f2b84b;box-shadow:19px -13px 0 -3px #7667d8; }
.explore-close { position:absolute;z-index:2;top:16px;right:17px;display:grid;place-items:center;width:38px;height:38px;border:0;border-radius:50%;color:#625d73;background:rgba(255,255,255,.83);font-size:22px;cursor:pointer; }
.explore-recommended { display:inline-flex;align-items:center;min-height:26px;padding:0 11px;border-radius:999px;color:#fff;background:linear-gradient(135deg,#3fa27e,#62bea1);font-size:8px;font-weight:800;letter-spacing:.12em;text-transform:uppercase; }
.explore-recommended::before { content:"★";margin-right:6px; }
.explore-icon { display:grid;place-items:center;width:69px;height:69px;margin:18px auto 13px;border-radius:22px;color:white;background:linear-gradient(145deg,#7562d4,#b06ad6);box-shadow:0 13px 27px rgba(94,71,183,.25);font-size:28px;transform:rotate(-3deg); }
.explore-step-label { display:block;color:#dc5962;font-size:9px;font-weight:800;letter-spacing:.18em;text-transform:uppercase; }
.explore-dialog h2 { max-width:510px;margin:11px auto 12px;color:#2d324c;font:600 clamp(38px,5vw,53px)/.98 "Newsreader",Georgia,serif;letter-spacing:-.035em; }
.explore-dialog h2 em { color:#349779;font-weight:400; }
.explore-dialog>p { max-width:475px;min-height:44px;margin:0 auto;color:#696579;font-size:12px;line-height:1.65; }
.explore-dots { display:flex;justify-content:center;gap:6px;margin:20px 0 18px; }
.explore-dots i { width:7px;height:7px;border-radius:50%;background:#d6d0e7;transition:width .2s ease,background .2s ease; }
.explore-dots i.active { width:24px;border-radius:999px;background:#7160ce; }
.explore-actions { display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center; }
.explore-actions button { min-height:43px;padding:0 15px;border-radius:999px;font-size:9px;font-weight:800;cursor:pointer; }
.explore-skip { justify-self:start;border:0;color:#777285;background:transparent; }
.explore-back { border:1px solid rgba(76,68,117,.15);color:#655aab;background:white; }
.explore-next { min-width:145px;border:0;color:white;background:linear-gradient(135deg,#6d59ce,#9b66d3);box-shadow:0 9px 19px rgba(94,72,179,.24); }
.explore-close:focus-visible,.explore-actions button:focus-visible { outline:3px solid rgba(117,103,216,.3);outline-offset:3px; }

@media(max-width:620px){.home-xp-card{margin-top:-2px;margin-bottom:17px}.explore-overlay{padding:11px}.explore-dialog{padding:38px 20px 25px;border-radius:21px}.explore-dialog::before{left:22px}.explore-dialog::after{right:22px}.explore-icon{width:61px;height:61px;margin-top:15px}.explore-dialog h2{font-size:38px}.explore-dialog>p{font-size:11px}.explore-actions{grid-template-columns:1fr 1fr}.explore-skip{grid-column:1/-1;grid-row:2;justify-self:center}.explore-next{min-width:0}.explore-back[hidden]+.explore-next{grid-column:1/-1}}

/* Creature teachers, streaks, weekly XP, and a roomier non-writing interface */
.teacher-top-dock:empty { display: none; }
.creature-teacher {
  position: relative;
  z-index: 9;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  width: min(980px, calc(100% - 48px));
  min-height: 132px;
  margin: 22px auto 0;
  padding: 14px 22px 14px 15px;
  border: 1px solid rgba(88, 72, 169, .2);
  border-radius: 25px;
  background: linear-gradient(125deg, rgba(255,255,255,.91), rgba(255,246,218,.88) 52%, rgba(235,229,255,.9));
  box-shadow: 0 18px 45px rgba(60, 52, 111, .14);
  backdrop-filter: blur(13px);
}
.creature-teacher[hidden] { display: none !important; }
.teacher-portrait {
  display: block;
  width: 104px;
  height: 104px;
  border: 4px solid rgba(255,255,255,.9);
  border-radius: 23px;
  background-image: url("assets/draftyverse-fantasy-field-v4.png");
  background-repeat: no-repeat;
  background-size: 960% 384%;
  box-shadow: 0 10px 24px rgba(53, 47, 98, .2);
}
.teacher-dragon { background-position: 42% 0%; }
.teacher-alicorn { background-position: 97% 31%; }
.teacher-jackalope { background-position: 15.5% 69%; }
.teacher-griffin { background-image: url("assets/draftyverse-gale-flying-face-v1.webp"); background-position: center; background-size: cover; }
.teacher-copy { display: grid; min-width: 0; gap: 4px; }
.teacher-copy small { color: #d95d67; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.teacher-copy strong { color: #34344f; font: 650 27px/1.05 "Newsreader", Georgia, serif; overflow-wrap: anywhere; }
.teacher-copy p { max-width: 650px; margin: 2px 0 0; color: #656176; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.teacher-turn { align-self: start; padding: 8px 12px; border-radius: 999px; color: #fff; background: linear-gradient(135deg,#6e5ccd,#9b65d4); font-size: 12px; font-weight: 900; white-space: nowrap; }

.home-xp-card { width: min(440px, calc(100% - 28px)); padding: 16px 19px 15px; border-radius: 18px; }
.xp-card-topline { font-size: 12px; }
.xp-card-topline strong { font-size: 14px; }
.xp-progress-track, .weekly-xp-track { height: 11px; }
.home-xp-card > small { font-size: 11px; }
.weekly-xp-row { display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:14px;color:#676078;font-size:12px;font-weight:900;letter-spacing:.06em;text-transform:uppercase; }
.weekly-xp-row strong { color:#368e78; }
.weekly-xp-track { overflow:hidden;margin-top:7px;border-radius:999px;background:#dcece6;box-shadow:inset 0 1px 2px rgba(35,94,77,.12); }
.weekly-xp-track i { display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#3aa780,#6fcbb0,#f0c55b);transition:width .45s ease; }
.home-momentum { display:grid;grid-template-columns:145px 145px minmax(330px,1fr) minmax(310px,1fr);gap:12px;width:min(1120px,calc(100% - 28px));margin:0 auto 27px;text-align:left; }
.streak-card { display:grid;grid-template-columns:38px 1fr;grid-template-rows:1fr 1fr;column-gap:10px;align-items:center;padding:14px;border:1px solid rgba(76,68,121,.14);border-radius:17px;background:rgba(255,255,255,.78);box-shadow:0 10px 24px rgba(64,55,108,.09); }
.streak-card > span { grid-row:1/3;display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#fff0bc;font-size:20px; }
.streak-card:nth-child(2) > span { background:#ffe0da; }
.streak-card strong { align-self:end;color:#433d63;font:700 24px/1 "Newsreader",Georgia,serif; }
.streak-card small { align-self:start;color:#777184;font-size:11px;font-weight:800; }
.weekly-leaderboard { padding:13px 15px;border:1px solid rgba(82,72,144,.16);border-radius:18px;background:rgba(255,255,255,.84);box-shadow:0 10px 26px rgba(64,55,108,.1); }
.leaderboard-heading { display:flex;align-items:center;gap:10px;margin-bottom:8px; }
.leaderboard-heading > span { display:grid;place-items:center;width:34px;height:34px;border-radius:11px;color:#fff;background:#725fd0; }
.leaderboard-heading div { display:grid; }
.leaderboard-heading small { color:#9a6b45;font-size:9px;font-weight:900;letter-spacing:.1em;text-transform:uppercase; }
.leaderboard-heading strong { color:#3d3955;font:650 17px/1.1 "Newsreader",Georgia,serif; }
.weekly-leaderboard ol { display:grid;gap:4px;margin:0;padding:0;list-style:none; }
.weekly-leaderboard li { display:grid;grid-template-columns:21px 25px 1fr auto;gap:6px;align-items:center;padding:5px 7px;border-radius:9px;color:#696477;font-size:11px; }
.weekly-leaderboard li b { color:#9a94a6;text-align:center; }
.weekly-leaderboard li span { text-align:center; }
.weekly-leaderboard li strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.weekly-leaderboard li em { color:#6456bd;font-style:normal;font-weight:900; }
.weekly-leaderboard .leaderboard-you { color:#393451;background:linear-gradient(90deg,#eeeaff,#fff7dc); }
.weekly-leaderboard .leaderboard-signin { opacity:.72; }
.teacher-home-dock { min-width: 0; }
.teacher-home-dock .creature-teacher { grid-template-columns:82px minmax(0,1fr);gap:13px;width:100%;min-height:100%;margin:0;padding:13px 15px;border-radius:18px; }
.teacher-home-dock .teacher-portrait { width:78px;height:78px;border-radius:18px; }
.teacher-home-dock .teacher-copy strong { font-size:21px; }
.teacher-home-dock .teacher-copy p { font-size:12px;line-height:1.42; }
.teacher-home-dock .teacher-copy small { font-size:9px; }
.teacher-home-dock .teacher-turn { grid-column:2;justify-self:start;align-self:auto;margin-top:-2px;padding:6px 10px;font-size:9px; }

body:not(.write-page) .site-header { min-height: 86px; padding-block: 13px; }
body:not(.write-page) :is(.home-button,.auth-button,.puzzle-nav-button,.user-button,.back-home,.adventure-home,.puzzles-home) { min-height: 48px; padding-inline: 17px; font-size: 13px; }
body:not(.write-page) small { font-size: max(11px, .78rem); }
body:not(.write-page) :is(.intro,.card-copy>span,.lessons-hero p,.section-heading p,.lesson-summary,.lesson-note p,.practice-box label small,.adventure-heading p,.quest-opening,.puzzles-hero p,.current-puzzle-copy p,.avatar-dialog-heading p,.explore-dialog>p) { font-size: 15px; line-height: 1.65; }
body:not(.write-page) :is(.lesson-choice,.continue-lesson,.learned-button,.new-adventure,.adventure-to-write,.current-puzzle-copy button,.puzzle-filters button,.avatar-category-tabs button,.avatar-dialog-footer button,.explore-actions button) { min-height: 46px; font-size: 12px; }
body:not(.write-page) .path-card { min-height: 410px; }
body:not(.write-page) .card-copy strong { font-size: 44px; }
body:not(.write-page) .card-copy small { font-size: 12px; }
body:not(.write-page) .lesson-detail { padding: 39px; }
body:not(.write-page) .lesson-detail h3 { font-size: clamp(39px,4vw,51px); }
body:not(.write-page) .practice-box textarea { min-height: 190px; font-size: 16px; }
body:not(.write-page) .quest-details strong { font-size: 15px; line-height: 1.55; }
body:not(.write-page) .puzzle-card-copy strong { font-size: 19px; }
body:not(.write-page) .avatar-item { min-height: 150px; }
body:not(.write-page) .avatar-item strong { font-size: 18px; }

@media (max-width: 820px) {
  .creature-teacher { grid-template-columns:88px minmax(0,1fr);width:calc(100% - 28px);min-height:112px;padding:12px; }
  .teacher-portrait { width:82px;height:82px; }
  .teacher-turn { grid-column:2;justify-self:start;align-self:auto;margin-top:-3px;font-size:10px; }
  .teacher-copy strong { font-size:22px; }.teacher-copy p{font-size:13px}
  .home-momentum { grid-template-columns:1fr 1fr; }
  .weekly-leaderboard { grid-column:1/-1; }
  .teacher-home-dock { grid-column:1/-1; }
  .teacher-home-dock .creature-teacher { grid-template-columns:88px minmax(0,1fr); }
}
@media (max-width: 520px) {
  .creature-teacher { grid-template-columns:72px minmax(0,1fr);gap:11px;margin-top:13px;border-radius:18px; }
  .teacher-portrait { width:68px;height:68px;border-radius:16px; }
  .teacher-copy small,.teacher-turn { font-size:9px; }.teacher-copy strong{font-size:19px}.teacher-copy p{font-size:12px;line-height:1.4}
  .home-momentum { grid-template-columns:1fr 1fr;width:calc(100% - 20px);gap:8px; }
  .streak-card { grid-template-columns:32px 1fr;padding:10px; }.streak-card>span{width:32px;height:32px;font-size:17px}.streak-card strong{font-size:20px}.streak-card small{font-size:9px!important}
  .weekly-leaderboard { padding:11px; }.weekly-leaderboard li{font-size:10px;grid-template-columns:18px 21px 1fr auto;padding-inline:4px}
  body:not(.write-page) .site-header { min-height:78px; }
  body:not(.write-page) :is(.home-button,.auth-button,.puzzle-nav-button,.user-button) { min-height:44px;padding-inline:9px;font-size:11px; }
  body:not(.write-page) .path-card { min-height:380px; }
  body:not(.write-page) .lesson-detail { padding:27px 18px; }
}

/* The 25-teacher writing studio */
.document-teacher { display:flex;align-items:center;gap:7px;min-height:25px;margin:-3px 0 8px;color:#5e5593;font-size:8px;font-weight:800; }
.document-teacher img { width:24px;height:24px;object-fit:cover;border:2px solid #fff;border-radius:8px;box-shadow:0 3px 8px rgba(67,54,106,.16); }
.document-more { position:absolute;z-index:5;top:10px;right:10px;display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:50%;color:#6d687d;background:rgba(247,244,251,.96);font-size:20px;font-weight:900;cursor:pointer;opacity:.55;transition:opacity .15s ease,background .15s ease; }
.document-card:hover .document-more,.document-more:focus-visible,.document-more[aria-expanded="true"] { opacity:1; }
.document-more:hover,.document-more[aria-expanded="true"] { color:#fff;background:#7160ce; }
.document-card-menu { position:absolute;z-index:8;top:48px;right:10px;display:grid;width:170px;padding:6px;border:1px solid rgba(66,57,109,.15);border-radius:13px;background:#fff;box-shadow:0 16px 35px rgba(47,39,83,.22); }
.document-card-menu[hidden] { display:none; }
.document-card-menu button { display:flex;align-items:center;gap:8px;min-height:38px;padding:0 10px;border:0;border-radius:9px;color:#514d67;background:transparent;font-size:9px;font-weight:800;text-align:left;cursor:pointer; }
.document-card-menu button:hover { color:#584aac;background:#f1edff; }
.document-card-menu .menu-delete:hover { color:#b9404d;background:#fff0f1; }
.document-card-menu button span { display:grid;place-items:center;width:20px;height:20px;border-radius:7px;background:#eee9ff; }
.document-card-menu .menu-delete span { background:#ffe6e8; }

.writing-teacher-panel { position:fixed;z-index:24;top:158px;right:24px;width:300px;padding:14px;border:1px solid rgba(77,64,143,.18);border-radius:21px;background:linear-gradient(145deg,rgba(255,255,255,.97),rgba(247,243,255,.96));box-shadow:0 18px 48px rgba(55,43,105,.22);backdrop-filter:blur(18px); }
.writing-teacher-heading { display:grid;grid-template-columns:68px 1fr auto;gap:10px;align-items:center; }
.writing-teacher-heading img { width:68px;height:68px;object-fit:cover;border:3px solid #fff;border-radius:18px;box-shadow:0 8px 18px rgba(64,51,105,.17); }
.writing-teacher-heading div { display:grid;gap:2px;min-width:0; }
.writing-teacher-heading small,.teacher-live-feedback small { color:#d45868;font-size:8px;font-weight:900;letter-spacing:.12em;text-transform:uppercase; }
.writing-teacher-heading strong { color:#34324d;font:650 19px/1.05 "Newsreader",Georgia,serif; }
.writing-teacher-heading button { align-self:start;min-height:28px;padding:0 8px;border:1px solid rgba(99,83,178,.16);border-radius:999px;color:#6555bd;background:#f2eeff;font-size:7px;font-weight:900;cursor:pointer; }
.writing-teacher-panel>p { margin:11px 2px 12px;color:#6f6a7c;font-size:10px;line-height:1.5; }
.teacher-live-score { display:flex;align-items:center;justify-content:space-between;color:#777183;font-size:8px;font-weight:800;text-transform:uppercase; }
.teacher-live-score strong { color:#3d987b;font-size:9px; }
.teacher-live-meter { height:7px;margin:6px 0 12px;overflow:hidden;border-radius:999px;background:#e7e2f0; }
.teacher-live-meter i { display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#61b99c,#efbd54,#e96f7a);transition:width .35s ease; }
.teacher-live-feedback { padding:11px;border-radius:14px;background:linear-gradient(135deg,#fff8df,#f2edff); }
.teacher-live-feedback p { margin:5px 0 0;color:#4e4b60;font:500 12px/1.5 "Newsreader",Georgia,serif; }
.writing-studio:not([hidden]) .pages-canvas { padding-right:350px; }
.review-teacher-note { display:grid;grid-template-columns:74px 1fr;gap:14px;align-items:center;margin:0 0 18px;padding:13px;border:1px solid rgba(61,151,120,.2);border-radius:16px;background:linear-gradient(100deg,#ecfaf4,#fff8df); }
.review-teacher-note img,.review-too-short-teacher { width:72px;height:72px;object-fit:cover;border:3px solid #fff;border-radius:18px; }
.review-teacher-note div { display:grid;gap:3px; }
.review-teacher-note small { color:#3b967a;font-size:8px;font-weight:900;letter-spacing:.12em;text-transform:uppercase; }
.review-teacher-note strong { color:#36334e;font:650 21px/1 "Newsreader",Georgia,serif; }
.review-teacher-note p { margin:3px 0 0;color:#676273;font-size:10px;line-height:1.5; }

.teacher-picker-overlay { position:fixed;z-index:95;inset:0;overflow:auto;padding:28px;background:rgba(32,27,57,.7);backdrop-filter:blur(12px); }
.teacher-picker-overlay[hidden] { display:none; }
.teacher-picker-dialog { position:relative;width:min(1440px,100%);margin:0 auto;padding:42px;border:1px solid rgba(255,255,255,.7);border-radius:30px;background:radial-gradient(circle at 10% 0,rgba(255,215,126,.28),transparent 22%),radial-gradient(circle at 95% 8%,rgba(118,213,211,.26),transparent 24%),linear-gradient(145deg,#fffdf8,#f4efff);box-shadow:0 36px 100px rgba(23,18,48,.38); }
.teacher-picker-close { position:absolute;z-index:3;top:18px;right:18px;display:grid;place-items:center;width:42px;height:42px;border:0;border-radius:50%;color:#625d73;background:#fff;font-size:24px;cursor:pointer;box-shadow:0 6px 18px rgba(49,41,82,.12); }
.teacher-picker-heading { max-width:760px;margin:0 auto 31px;text-align:center; }
.teacher-picker-kicker { color:#d75464;font-size:11px;font-weight:900;letter-spacing:.15em;text-transform:uppercase; }
.teacher-picker-heading h2 { margin:10px 0 12px;color:#30324b;font:650 clamp(44px,5vw,70px)/.93 "Newsreader",Georgia,serif;letter-spacing:-.04em; }
.teacher-picker-heading h2 em { color:#398f76;font-weight:450; }
.teacher-picker-heading p { max-width:650px;margin:0 auto;color:#6c6879;font-size:15px;line-height:1.65; }
.teacher-picker-grid { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px; }
.teacher-choice { position:relative;display:grid;grid-template-rows:auto auto 1fr;min-width:0;min-height:350px;padding:10px;border:2px solid rgba(71,60,124,.1);border-radius:20px;color:inherit;background:rgba(255,255,255,.76);box-shadow:0 8px 22px rgba(70,58,112,.08);text-align:left;cursor:pointer;transition:transform .15s ease,border-color .15s ease,background .15s ease,box-shadow .15s ease; }
.teacher-choice:hover { transform:translateY(-3px);border-color:rgba(102,84,192,.3);box-shadow:0 16px 30px rgba(70,58,112,.14); }
.teacher-choice.selected { border-color:#3da078;background:linear-gradient(150deg,#dff7e9,#f3fff8);box-shadow:0 0 0 4px rgba(61,160,120,.14),0 16px 32px rgba(49,127,97,.18); }
.teacher-choice>img { width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:14px;background:#fff; }
.teacher-choice-number { position:absolute;z-index:2;top:17px;left:17px;display:grid;place-items:center;min-width:30px;height:27px;padding:0 6px;border-radius:999px;color:#fff;background:rgba(55,45,91,.75);font-size:8px;font-weight:900;backdrop-filter:blur(6px); }
.teacher-choice-copy { display:grid;align-content:start;gap:4px;padding:12px 5px 6px; }
.teacher-choice-copy strong { overflow-wrap:anywhere;color:#34324b;font:650 22px/1.02 "Newsreader",Georgia,serif; }
.teacher-choice-copy small { color:#b2525e;font-size:8px;font-weight:900;letter-spacing:.1em;text-transform:uppercase; }
.teacher-choice-copy>span { margin-top:3px;color:#6d6879;font-size:10px;line-height:1.5; }
.teacher-choice>i { position:absolute;top:15px;right:15px;display:none;place-items:center;width:31px;height:31px;border:3px solid #fff;border-radius:50%;color:#fff;background:#3da078;font-style:normal;font-weight:900;box-shadow:0 5px 12px rgba(35,119,86,.24); }
.teacher-choice.selected>i { display:grid; }
.teacher-picker-footer { display:flex;align-items:center;justify-content:space-between;gap:24px;margin-top:30px;padding:23px 25px;border:1px solid rgba(74,64,128,.13);border-radius:19px;background:rgba(255,255,255,.78); }
.teacher-picker-footer div { display:grid;gap:4px; }
.teacher-picker-footer strong { color:#34324c;font:650 21px/1.1 "Newsreader",Georgia,serif; }
.teacher-picker-footer span { color:#777282;font-size:10px; }
.teacher-picker-footer button { min-height:50px;padding:0 23px;border:0;border-radius:999px;color:#fff;background:linear-gradient(135deg,#3d9d7b,#65bea0);box-shadow:0 10px 22px rgba(53,151,116,.24);font-size:11px;font-weight:900;cursor:pointer; }
.teacher-picker-footer button:disabled { color:#9893a2;background:#e8e5eb;box-shadow:none;cursor:not-allowed; }
.teacher-choice:focus-visible,.teacher-picker-close:focus-visible,.teacher-picker-footer button:focus-visible,.document-more:focus-visible,.document-card-menu button:focus-visible,.writing-teacher-heading button:focus-visible { outline:3px solid rgba(117,103,216,.34);outline-offset:3px; }

@media(max-width:1180px){.teacher-picker-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.writing-teacher-panel{width:252px;right:14px}.writing-studio:not([hidden]) .pages-canvas{padding-right:285px}.writing-teacher-heading{grid-template-columns:56px 1fr}.writing-teacher-heading img{width:56px;height:56px}.writing-teacher-heading button{grid-column:1/-1;justify-self:start}.writing-teacher-heading strong{font-size:17px}}
@media(max-width:900px){.teacher-picker-overlay{padding:12px}.teacher-picker-dialog{padding:36px 18px 25px;border-radius:23px}.teacher-picker-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.teacher-choice{min-height:0}.teacher-picker-footer{display:grid;padding:17px}.teacher-picker-footer button{width:100%}.writing-teacher-panel{position:sticky;top:150px;right:auto;width:min(410px,calc(100% - 16px));margin:12px 8px 0 auto}.writing-studio:not([hidden]) .pages-canvas{padding-right:20px}.writing-teacher-heading{grid-template-columns:58px 1fr auto}.writing-teacher-heading button{grid-column:auto}.writing-teacher-heading img{width:58px;height:58px}}
@media(max-width:520px){.teacher-picker-heading h2{font-size:42px}.teacher-picker-heading p{font-size:12px}.teacher-picker-grid{grid-template-columns:1fr}.teacher-choice{grid-template-columns:105px 1fr;grid-template-rows:auto;min-height:132px}.teacher-choice>img{grid-row:1;width:105px;height:105px}.teacher-choice-copy{grid-column:2;grid-row:1;padding:8px}.teacher-choice-number{top:15px;left:15px}.teacher-choice-copy strong{font-size:20px}.teacher-picker-footer strong{font-size:18px}.writing-teacher-panel{top:145px}.writing-teacher-panel>p{display:none}.teacher-live-feedback p{font-size:11px}}
