/* ============================================================
   Oz Chess Kids — Coach's Cabin theme
   Sand cream + deep forest green + warm gold + coral accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Manrope:wght@300..800&family=Caveat:wght@500;700&display=swap');

:root {
    --parchment: #f5ecd4;
    --parchment-deep: #ebe0bb;
    --parchment-shadow: #ddcd97;
    --ink: #1d3d2a;
    --ink-soft: #355a3c;
    --wine: #d65d3a;
    --wine-deep: #ad4827;
    --gold: #d4a93a;
    --gold-deep: #a47d20;
    --sage: #7d9670;
    --coral: #ee6c4d;
    --cream: #fbf5e3;
    --char: #14181a;

    --shadow-soft: 0 6px 24px rgba(29, 61, 42, 0.10);
    --shadow-card: 0 14px 40px -12px rgba(29, 61, 42, 0.22);
    --shadow-deep: 0 28px 60px -18px rgba(29, 61, 42, 0.36);

    --radius-sm: 8px;
    --radius: 18px;
    --radius-lg: 32px;

    --max: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Manrope', system-ui, sans-serif;
    background: var(--parchment);
    color: var(--ink);
    line-height: 1.55;
    font-size: 17px;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 20% 0%, rgba(201, 161, 74, 0.08), transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(139, 30, 63, 0.06), transparent 55%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 0 0.05  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------------- Typography ---------------- */
h1, h2, h3, h4 {
    font-family: 'DM Serif Display', 'Times New Roman', serif;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.05;
    letter-spacing: -0.02em;
    
}

h1 { font-size: clamp(2.6rem, 6.5vw, 5.4rem); }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { font-size: clamp(1.4rem, 2vw, 1.8rem); }
h4 { font-size: 1.15rem; letter-spacing: 0; }

.scribble {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    color: var(--wine);
    letter-spacing: 0.02em;
}

.eyebrow {
    font-family: 'Manrope', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold-deep);
    display: inline-flex;
    align-items: center;
    gap: 14px;
}
.eyebrow::before, .eyebrow::after {
    content: "";
    width: 32px;
    height: 1px;
    background: var(--gold);
}
.eyebrow.left::before, .eyebrow.right::after { display: inline-block; }
.eyebrow.left::after, .eyebrow.right::before { display: none; }

a { color: inherit; }

/* ---------------- Reusable ---------------- */
.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    white-space: nowrap;
}
.btn-primary {
    background: var(--ink);
    color: var(--cream);
    box-shadow: 0 8px 22px -6px rgba(27,36,64,0.55);
}
.btn-primary:hover {
    background: var(--wine);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -8px rgba(139,30,63,0.55);
}
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--ink);
}
.btn-ghost:hover {
    background: var(--ink);
    color: var(--cream);
    transform: translateY(-2px);
}
.btn-gold {
    background: var(--gold);
    color: var(--ink);
}
.btn-gold:hover { background: var(--gold-deep); color: var(--cream); transform: translateY(-2px); }

.btn-arrow::after {
    content: "→";
    font-size: 1.1em;
    transition: transform 0.25s ease;
}
.btn:hover .btn-arrow::after { transform: translateX(4px); }

/* ---------------- Header ---------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(245, 235, 214, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(27,36,64,0.08);
}
.nav-wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--ink);
}
.brand-mark {
    width: 46px;
    height: 46px;
    background: var(--ink);
    border-radius: 12px;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.brand-mark::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 50%, rgba(201,161,74,0.4) 50%);
}
.brand-mark svg { position: relative; z-index: 1; }
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}
.brand-text strong {
    font-family: 'DM Serif Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.brand-text small {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--gold-deep);
    margin-top: 4px;
}

.main-nav {
    display: flex;
    gap: 4px;
    align-items: center;
}
.main-nav a {
    text-decoration: none;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
}
.main-nav a:hover { background: rgba(27,36,64,0.06); }
.main-nav a.active { color: var(--wine); }
.main-nav a.active::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--wine);
    border-radius: 1px;
}

.nav-cta { display: flex; gap: 6px; align-items: center; }
.nav-portal-link {
    text-decoration: none;
    padding: 10px 16px;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 999px;
    color: var(--ink);
    transition: background 0.2s;
    white-space: nowrap;
}
.nav-portal-link:hover { background: rgba(27,36,64,0.06); }

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: var(--ink);
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--ink);
    margin: 5px 0;
    transition: transform 0.3s ease;
}

/* ---------------- HERO ---------------- */
.hero {
    position: relative;
    padding: 80px 0 60px;
    overflow: hidden;
}
.hero .container { position: relative; z-index: 2; }

/* Floating chess pieces in hero background */
.floating-pieces {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.float-piece {
    position: absolute;
    line-height: 1;
    user-select: none;
    will-change: transform;
    color: var(--ink);
    opacity: 0.22;
    filter: drop-shadow(0 4px 8px rgba(27,36,64,0.08));
}
.float-piece.p1  { top: 5%;   left: 2%;   font-size: clamp(5rem, 9vw, 10rem); color: var(--wine);      opacity: 0.28; animation: drift1 22s ease-in-out infinite; }
.float-piece.p2  { top: 14%;  left: 36%;  font-size: clamp(3rem, 5vw, 5.5rem); color: var(--ink);       opacity: 0.20; animation: drift2 18s ease-in-out infinite; }
.float-piece.p3  { bottom: 8%; left: 4%;  font-size: clamp(3.5rem, 5.5vw, 6rem); color: var(--gold-deep); opacity: 0.45; animation: drift3 16s ease-in-out infinite; }
.float-piece.p4  { top: 46%;  left: 40%;  font-size: clamp(4rem, 7vw, 8rem);   color: var(--wine);      opacity: 0.18; animation: drift4 24s ease-in-out infinite; }
.float-piece.p5  { bottom: 14%; right: 36%; font-size: clamp(3.5rem, 5.5vw, 6rem); color: var(--gold-deep); opacity: 0.40; animation: drift5 20s ease-in-out infinite; }
.float-piece.p6  { top: 26%;  right: 34%; font-size: clamp(3rem, 4.5vw, 5rem);  color: var(--ink);       opacity: 0.22; animation: drift6 19s ease-in-out infinite; }
.float-piece.p7  { top: 35%;  left: 18%;  font-size: clamp(2.8rem, 4vw, 4.5rem); color: var(--gold-deep); opacity: 0.32; animation: drift1 26s ease-in-out infinite reverse; }
.float-piece.p8  { bottom: 32%; left: 22%; font-size: clamp(3.2rem, 4.8vw, 5.5rem); color: var(--wine);  opacity: 0.22; animation: drift4 21s ease-in-out infinite reverse; }
.float-piece.p9  { top: 60%;  left: 8%;   font-size: clamp(2.4rem, 3.6vw, 3.8rem); color: var(--ink);    opacity: 0.25; animation: drift2 17s ease-in-out infinite reverse; }
.float-piece.p10 { bottom: 4%; left: 34%; font-size: clamp(2.6rem, 4vw, 4.2rem); color: var(--gold-deep); opacity: 0.38; animation: drift6 23s ease-in-out infinite; }
.float-piece.p11 { top: 8%;   left: 20%;  font-size: clamp(2.2rem, 3.2vw, 3.4rem); color: var(--ink);   opacity: 0.20; animation: drift5 18s ease-in-out infinite reverse; }
.float-piece.p12 { bottom: 38%; left: 1%; font-size: clamp(2.8rem, 4.4vw, 4.8rem); color: var(--wine);  opacity: 0.24; animation: drift3 19s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate(0,0) rotate(-8deg); } 50% { transform: translate(20px,-30px) rotate(-2deg); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) rotate(5deg); }  50% { transform: translate(-25px,25px) rotate(12deg); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) rotate(-15deg); } 33% { transform: translate(15px,-20px) rotate(-5deg); } 66% { transform: translate(-10px,-10px) rotate(-12deg); } }
@keyframes drift4 { 0%,100% { transform: translate(0,0) rotate(0deg); }  50% { transform: translate(30px,-40px) rotate(8deg); } }
@keyframes drift5 { 0%,100% { transform: translate(0,0) rotate(10deg); } 50% { transform: translate(-20px,30px) rotate(0deg); } }
@keyframes drift6 { 0%,100% { transform: translate(0,0) rotate(-5deg); } 50% { transform: translate(15px,25px) rotate(5deg); } }

@media (prefers-reduced-motion: reduce) {
    .float-piece { animation: none; }
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero-eyebrow { margin-bottom: 28px; }
.hero h1 {
    margin-bottom: 24px;
    font-weight: 500;
}
.hero h1 .ital {
    font-style: italic;
    font-weight: 400;
    color: var(--wine);
    position: relative;
    display: inline-block;
}
.hero h1 .ital::after {
    content: "";
    position: absolute;
    left: -2%;
    right: -2%;
    bottom: -6px;
    height: 14px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'><path d='M2 8 Q 50 2 100 8 T 198 6' stroke='%23c9a14a' stroke-width='3' fill='none' stroke-linecap='round'/></svg>") no-repeat center / 100% 100%;
}
.hero p.lede {
    font-size: 1.18rem;
    color: var(--ink-soft);
    max-width: 540px;
    margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }
.hero-trust {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
}
.trust-item {
    display: flex;
    flex-direction: column;
    border-left: 2px solid var(--gold);
    padding-left: 14px;
}
.trust-item strong {
    font-family: 'DM Serif Display', serif;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
}
.trust-item span {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
    margin-top: 6px;
}

/* Hero imagery cluster */
.hero-visual {
    position: relative;
    aspect-ratio: 5/6;
    width: 100%;
}
.hero-frame {
    position: absolute;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    border: 6px solid var(--cream);
}
.hero-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero-frame.main {
    inset: 4% 6% 22% 0;
    transform: rotate(-2deg);
    z-index: 2;
}
.hero-frame.sub {
    width: 56%;
    aspect-ratio: 4/3;
    right: 0;
    bottom: 4%;
    transform: rotate(4deg);
    z-index: 3;
}
.hero-badge {
    position: absolute;
    z-index: 4;
    background: var(--ink);
    color: var(--cream);
    padding: 18px 22px;
    border-radius: 18px;
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.2;
    box-shadow: var(--shadow-card);
    transform: rotate(-6deg);
    max-width: 200px;
}
.hero-badge.tl { top: -2%; left: 30%; }
.hero-badge strong {
    display: block;
    font-style: normal;
    color: var(--gold);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* Decorative chess board pattern */
.checker-strip {
    height: 18px;
    background-image:
        linear-gradient(45deg, var(--ink) 25%, transparent 25%),
        linear-gradient(-45deg, var(--ink) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--ink) 75%),
        linear-gradient(-45deg, transparent 75%, var(--ink) 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    opacity: 0.85;
}

/* ---------------- Animated mini chess board ---------------- */
.board-demo {
    background: linear-gradient(180deg, var(--parchment), var(--parchment-deep));
    overflow: hidden;
}
.board-demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}
.board-demo-grid .eyebrow { margin-bottom: 22px; }
.board-demo-grid h2 { margin-bottom: 22px; }
.board-demo-grid h2 em { color: var(--wine); font-style: italic; }
.board-demo-grid p { color: var(--ink-soft); margin-bottom: 18px; font-size: 1.05rem; }
.board-demo-grid .pillar-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 26px 0 32px;
}
.board-demo-grid .mini-pillar {
    padding: 14px 16px;
    background: var(--cream);
    border-radius: 12px;
    border: 1px solid rgba(27,36,64,0.08);
}
.board-demo-grid .mini-pillar strong {
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem;
    display: block;
    color: var(--wine);
    line-height: 1;
}
.board-demo-grid .mini-pillar span {
    font-size: 0.8rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 6px;
    display: block;
}

.board-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}
.mini-board {
    width: min(440px, 100%);
    aspect-ratio: 1;
    position: relative;
    background: var(--cream);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    border: 10px solid var(--ink);
}
.mb-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
}
.sq { transition: background 0.4s ease; }
.sq-light { background: #f5ebd6; }
.sq-dark  { background: #c9a14a; }
.sq.last-move-from { background: rgba(139,30,63,0.25); }
.sq.last-move-to   { background: rgba(139,30,63,0.45); }
.mb-pieces {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.mb-piece {
    position: absolute;
    top: 0; left: 0;
    width: 12.5%;
    height: 12.5%;
    display: grid;
    place-items: center;
    font-size: clamp(1.6rem, 4.4vw, 2.6rem);
    line-height: 1;
    transition: transform 0.7s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.35s ease;
    will-change: transform;
}
.mb-piece.white { color: #fbf6e9; text-shadow: 0 0 1px var(--ink), 0 1px 0 rgba(0,0,0,0.45), 0 0 4px rgba(0,0,0,0.2); }
.mb-piece.black { color: var(--ink); text-shadow: 0 1px 0 rgba(255,255,255,0.35); }
.mb-piece.captured { opacity: 0; transform: var(--cap-transform, scale(0.4)) !important; }
.mb-piece.checkmated { animation: mate-pulse 1.1s ease-in-out 3; }

@keyframes mate-pulse {
    0%,100% { filter: drop-shadow(0 0 0 var(--wine)); }
    50%     { filter: drop-shadow(0 0 14px var(--wine)); }
}

.board-status {
    text-align: center;
    background: var(--ink);
    color: var(--cream);
    padding: 14px 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
    max-width: 100%;
}
.board-move-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gold);
    white-space: nowrap;
}
.board-move-no {
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gold);
    line-height: 1;
}
.board-move-text {
    font-size: 0.9rem;
    color: var(--cream);
    font-style: italic;
    font-family: 'DM Serif Display', serif;
}

@media (max-width: 880px) {
    .board-demo-grid { grid-template-columns: 1fr; gap: 50px; }
    .board-demo-grid .pillar-row { grid-template-columns: 1fr; }
    .board-stage { order: -1; }
}

/* ---------------- Marquee ---------------- */
.marquee {
    background: var(--ink);
    color: var(--cream);
    padding: 22px 0;
    overflow: hidden;
    border-top: 1px solid var(--gold);
    border-bottom: 1px solid var(--gold);
}
.marquee-track {
    display: flex;
    gap: 60px;
    animation: marquee 36s linear infinite;
    white-space: nowrap;
    width: max-content;
}
.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 1.4rem;
}
.marquee-item::after {
    content: "♚";
    color: var(--gold);
    font-style: normal;
    font-size: 1.1rem;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------------- Section base ---------------- */
section { position: relative; padding: 110px 0; }
.section-head {
    max-width: 760px;
    margin: 0 auto 64px;
    text-align: center;
}
.section-head .eyebrow { margin-bottom: 22px; }
.section-head h2 { margin-bottom: 18px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }

/* ---------------- Why us cards ---------------- */
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.why-card {
    background: var(--cream);
    padding: 36px 32px 32px;
    border-radius: var(--radius);
    border: 1px solid rgba(27,36,64,0.07);
    box-shadow: var(--shadow-soft);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.why-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-deep);
}
.why-num {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 4.5rem;
    line-height: 0.9;
    color: var(--gold);
    opacity: 0.85;
    margin-bottom: 18px;
    display: block;
}
.why-card h3 {
    margin-bottom: 12px;
    font-weight: 500;
}
.why-card p { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------------- Programs / Levels ---------------- */
.programs {
    background: var(--ink);
    color: var(--cream);
}
.programs .section-head h2,
.programs .section-head p { color: var(--cream); }
.programs .eyebrow { color: var(--gold); }
.programs .eyebrow::before, .programs .eyebrow::after { background: var(--gold); }

.levels {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.level {
    background: var(--ink-soft);
    padding: 30px 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(201,161,74,0.18);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}
.level:hover {
    transform: translateY(-8px);
    border-color: var(--gold);
}
.level-rank {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 12px;
}
.level h3 {
    color: var(--cream);
    font-size: 1.4rem;
    margin-bottom: 14px;
    font-weight: 500;
}
.level p {
    color: rgba(251,246,233,0.7);
    font-size: 0.9rem;
    flex: 1;
}
.level-piece {
    position: absolute;
    right: -10px;
    bottom: -20px;
    font-size: 6rem;
    color: var(--gold);
    opacity: 0.12;
    line-height: 1;
}

/* ---------------- Story / About blurb ---------------- */
.story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}
.story-images {
    position: relative;
    aspect-ratio: 1/1;
}
.story-images .frame {
    position: absolute;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 6px solid var(--cream);
}
.story-images .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-images .frame.a { inset: 0 30% 30% 0; transform: rotate(-3deg); z-index: 2; }
.story-images .frame.b { width: 65%; aspect-ratio: 4/3; right: 0; bottom: 0; transform: rotate(2deg); z-index: 3; }
.story-quote {
    position: absolute;
    z-index: 4;
    left: 30%;
    bottom: 8%;
    background: var(--gold);
    color: var(--ink);
    padding: 18px 22px;
    border-radius: 14px;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    line-height: 1.1;
    transform: rotate(-4deg);
    max-width: 220px;
    box-shadow: var(--shadow-card);
}

.story-content .eyebrow { margin-bottom: 22px; }
.story-content h2 { margin-bottom: 24px; }
.story-content h2 em { color: var(--wine); font-style: italic; }
.story-content p { color: var(--ink-soft); margin-bottom: 18px; font-size: 1.05rem; }
.story-content .pillars {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 32px 0;
}
.pillar {
    padding: 18px;
    border-left: 2px solid var(--gold);
    background: rgba(201,161,74,0.06);
    border-radius: 0 12px 12px 0;
}
.pillar strong {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 1.05rem;
    margin-bottom: 4px;
}
.pillar span { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------------- Locations ---------------- */
.locations {
    background:
        linear-gradient(180deg, transparent, rgba(27,36,64,0.04));
}
.locations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.loc {
    background: var(--cream);
    padding: 26px 26px 22px;
    border-radius: var(--radius);
    border: 1px solid rgba(27,36,64,0.08);
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
}
.loc::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    border: 2px solid var(--gold);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.loc:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.loc:hover::before { opacity: 1; }
.loc-name {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.loc-name span {
    font-family: 'Manrope', sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--gold-deep);
    font-weight: 600;
}
.loc-meta {
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin-bottom: 16px;
}
.loc-link {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 600;
    color: var(--wine);
    text-decoration: none;
}

/* ---------------- Google Reviews widget ---------------- */
.google-reviews {
    background:
        radial-gradient(circle at 90% 10%, rgba(201,161,74,0.08), transparent 50%),
        var(--parchment);
}
.gr-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: end;
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(27,36,64,0.1);
}
.gr-meta { max-width: 720px; }
.gr-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    flex-wrap: wrap;
}
.gr-google-mark {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--cream);
    border: 1.5px solid rgba(27,36,64,0.1);
    display: grid;
    place-items: center;
    font-family: 'DM Serif Display', serif;
    font-weight: 700;
    font-size: 1.2rem;
    background-image: linear-gradient(135deg, #4285F4 0%, #4285F4 25%, #DB4437 25%, #DB4437 50%, #F4B400 50%, #F4B400 75%, #0F9D58 75%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.gr-rating-num {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
}
.gr-stars {
    color: var(--gold);
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    line-height: 1;
}
.gr-stars-sm { font-size: 1rem; }
.gr-meta-text {
    font-size: 0.92rem;
    color: var(--ink-soft);
}
.gr-meta-text strong { color: var(--ink); font-weight: 600; }

.gr-head .btn { white-space: nowrap; }

.gr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}
.gr-card {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 28px 26px 22px;
    border: 1px solid rgba(27,36,64,0.08);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}
.gr-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}
.gr-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.gr-source {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(27,36,64,0.1);
    background: #fff;
    display: grid;
    place-items: center;
    font-family: 'DM Serif Display', serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #4285F4;
    flex-shrink: 0;
    title: "Posted on Google";
}
.gr-quote {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 1.0rem;
    line-height: 1.55;
    color: var(--ink);
    flex: 1;
    margin-bottom: 22px;
}
.gr-quote::before {
    content: "“";
    font-size: 2.4rem;
    line-height: 0;
    color: var(--gold);
    margin-right: 4px;
    vertical-align: -16px;
}
.gr-card-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(27,36,64,0.08);
}
.gr-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: 'DM Serif Display', serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--cream);
    flex-shrink: 0;
}
.gr-avatar.c0 { background: var(--ink); }
.gr-avatar.c1 { background: var(--wine); }
.gr-avatar.c2 { background: var(--sage); }
.gr-avatar.c3 { background: var(--gold-deep); }
.gr-avatar.c4 { background: var(--coral); }
.gr-name { display: block; font-size: 0.95rem; font-weight: 600; color: var(--ink); line-height: 1.1; }
.gr-meta-row { display: block; font-size: 0.78rem; color: var(--ink-soft); margin-top: 3px; }
.gr-meta-row .dot { color: var(--gold-deep); margin: 0 5px; }

@media (max-width: 720px) {
    .gr-head { grid-template-columns: 1fr; gap: 24px; align-items: start; }
    .gr-head .btn { justify-self: start; }
}

/* ---------------- Testimonials ---------------- */
.testimonials {
    position: relative;
}
.testi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.testi {
    background: var(--cream);
    padding: 32px 30px;
    border-radius: var(--radius);
    border: 1px solid rgba(27,36,64,0.08);
    box-shadow: var(--shadow-soft);
    position: relative;
    display: flex;
    flex-direction: column;
}
.testi::before {
    content: "“";
    font-family: 'DM Serif Display', serif;
    font-size: 5rem;
    line-height: 1;
    color: var(--gold);
    position: absolute;
    top: 6px;
    left: 18px;
    opacity: 0.5;
}
.testi p {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 1.08rem;
    line-height: 1.55;
    margin-top: 30px;
    margin-bottom: 24px;
    color: var(--ink);
    flex: 1;
}
.testi-by {
    display: flex;
    align-items: center;
    gap: 14px;
    border-top: 1px solid rgba(27,36,64,0.1);
    padding-top: 18px;
}
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--gold);
    display: grid;
    place-items: center;
    font-family: 'DM Serif Display', serif;
    font-weight: 600;
    font-size: 1rem;
}
.testi-by strong { display: block; font-size: 0.95rem; }
.testi-by span { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------------- Tournaments band ---------------- */
.tournaments-band {
    background: var(--wine);
    color: var(--cream);
    position: relative;
    overflow: hidden;
}
.tournaments-band::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><rect width='30' height='30' fill='rgba(255,255,255,0.04)'/><rect x='30' y='30' width='30' height='30' fill='rgba(255,255,255,0.04)'/></svg>");
    pointer-events: none;
    opacity: 0.6;
}
.tournaments-band .container { position: relative; z-index: 1; }
.tour-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}
.tour-grid h2 { color: var(--cream); margin-bottom: 22px; }
.tour-grid h2 em { color: var(--gold); font-style: italic; }
.tour-grid p { font-size: 1.1rem; opacity: 0.85; margin-bottom: 30px; }
.tour-list {
    background: rgba(0,0,0,0.18);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid rgba(201,161,74,0.3);
}
.tour-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border-bottom: 1px dashed rgba(201,161,74,0.25);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
    border-radius: 10px;
    position: relative;
}
.tour-row:last-child { border-bottom: none; }
a.tour-row:hover {
    background: rgba(201,161,74,0.08);
    border-bottom-color: var(--gold);
}
a.tour-row::after {
    content: "→";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    color: var(--gold);
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
a.tour-row:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
a.tour-row:hover .tour-tag { opacity: 0; transition: opacity 0.2s; }
.tour-date {
    font-family: 'DM Serif Display', serif;
    text-align: center;
    background: var(--gold);
    color: var(--ink);
    padding: 8px;
    border-radius: 10px;
}
.tour-date strong { display: block; font-size: 1.5rem; line-height: 1; }
.tour-date span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.16em; }
.tour-info strong { display: block; font-family: 'DM Serif Display', serif; font-size: 1.15rem; margin-bottom: 4px; }
.tour-info span { font-size: 0.88rem; opacity: 0.75; }
.tour-tag {
    background: rgba(201,161,74,0.2);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 600;
}

/* ---------------- Holiday camp ---------------- */
.holiday {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.holiday-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    aspect-ratio: 4/3;
    position: relative;
}
.holiday-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.holiday-tag {
    position: absolute;
    top: 18px;
    left: 18px;
    background: var(--gold);
    color: var(--ink);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
}
.holiday h2 em { color: var(--wine); font-style: italic; }
.holiday-list {
    list-style: none;
    margin: 26px 0 30px;
}
.holiday-list li {
    padding: 14px 0;
    border-bottom: 1px solid rgba(27,36,64,0.1);
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: baseline;
    gap: 14px;
    font-size: 1rem;
}
.holiday-list li::before {
    content: "♟";
    color: var(--gold-deep);
    font-size: 1.1rem;
}

/* ---------------- CTA ---------------- */
.cta-band {
    background: var(--ink);
    color: var(--cream);
    text-align: center;
    padding: 110px 0;
    position: relative;
    overflow: hidden;
}
.cta-band::before, .cta-band::after {
    content: "♚";
    position: absolute;
    font-size: 16rem;
    color: var(--gold);
    opacity: 0.05;
    line-height: 1;
}
.cta-band::before { left: -3%; top: -10%; transform: rotate(-15deg); }
.cta-band::after { right: -3%; bottom: -25%; transform: rotate(15deg); }
.cta-band .container { position: relative; z-index: 1; }
.cta-band .scribble { color: var(--gold); font-size: 1.4rem; margin-bottom: 12px; display: block; }
.cta-band h2 { color: var(--cream); margin-bottom: 22px; }
.cta-band h2 em { color: var(--gold); font-style: italic; }
.cta-band p { font-size: 1.15rem; opacity: 0.8; max-width: 560px; margin: 0 auto 36px; }
.cta-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ---------------- Footer ---------------- */
footer {
    background: var(--char);
    color: rgba(251,246,233,0.75);
    padding: 80px 0 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}
.footer-grid h4 {
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    margin-bottom: 18px;
}
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { text-decoration: none; opacity: 0.75; transition: opacity 0.2s, color 0.2s; }
.footer-grid a:hover { opacity: 1; color: var(--gold); }
.footer-brand p { margin-top: 18px; opacity: 0.7; font-size: 0.95rem; }
.footer-brand .brand-text strong { color: var(--cream); }
.footer-brand .brand-text small { color: var(--gold); }
.foot-bottom {
    border-top: 1px solid rgba(251,246,233,0.1);
    padding-top: 28px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.85rem;
    opacity: 0.65;
}
.foot-bottom a { color: var(--gold); text-decoration: none; }

/* ---------------- Inner page hero ---------------- */
.page-hero {
    padding: 80px 0 40px;
    text-align: center;
}
.page-hero .eyebrow { margin-bottom: 22px; }
.page-hero h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); margin-bottom: 22px; }
.page-hero h1 em { color: var(--wine); font-style: italic; }
.page-hero p {
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.15rem;
    color: var(--ink-soft);
}

/* Curriculum cards (programs page) */
.curriculum {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
.curric-row {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    gap: 30px;
    align-items: center;
    background: var(--cream);
    padding: 28px 32px;
    border-radius: var(--radius);
    border-left: 6px solid var(--gold);
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.curric-row:hover { transform: translateX(6px); box-shadow: var(--shadow-card); }
.curric-row .lvl-name {
    font-family: 'DM Serif Display', serif;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1;
}
.curric-row .lvl-name span {
    display: block;
    font-family: 'Caveat', cursive;
    color: var(--wine);
    font-size: 1.2rem;
    margin-bottom: 4px;
}
.curric-row p { color: var(--ink-soft); font-size: 0.98rem; }
.curric-row .arrow {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--cream);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    transition: background 0.2s;
}
.curric-row:hover .arrow { background: var(--wine); }

/* Contact form (used on multiple pages) */
.form-wrap {
    background: var(--cream);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(27,36,64,0.08);
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.form-field { display: flex; flex-direction: column; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 8px;
}
.form-field input,
.form-field select,
.form-field textarea {
    background: var(--parchment);
    border: 1.5px solid rgba(27,36,64,0.15);
    border-radius: 12px;
    padding: 14px 18px;
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    color: var(--ink);
    transition: border-color 0.2s, background 0.2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--ink);
    background: var(--cream);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-actions { margin-top: 24px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.form-note { font-size: 0.85rem; color: var(--ink-soft); }

/* ============================================================
   ROOKIE — chat assistant widget
   ============================================================ */
#rookie-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    font-family: 'Manrope', sans-serif;
}
#rookie-fab {
    background: var(--ink);
    color: var(--cream);
    border: none;
    padding: 12px 22px 12px 14px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 14px 36px -10px rgba(27,36,64,0.45), 0 4px 10px rgba(27,36,64,0.15);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}
#rookie-fab:hover {
    transform: translateY(-3px);
    background: var(--wine);
    box-shadow: 0 18px 44px -10px rgba(139,30,63,0.55), 0 4px 10px rgba(27,36,64,0.18);
}
#rookie-fab.hidden { display: none; }
.rookie-fab-icon {
    width: 38px;
    height: 38px;
    background: var(--gold);
    color: var(--ink);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    line-height: 1;
}
.rookie-fab-label { white-space: nowrap; }

#rookie-fab.rookie-pulse-hint {
    animation: rookie-ring 1.8s ease-out 3;
}
@keyframes rookie-ring {
    0%   { box-shadow: 0 14px 36px -10px rgba(27,36,64,0.45), 0 0 0 0 rgba(201,161,74,0.55); }
    70%  { box-shadow: 0 14px 36px -10px rgba(27,36,64,0.45), 0 0 0 18px rgba(201,161,74,0); }
    100% { box-shadow: 0 14px 36px -10px rgba(27,36,64,0.45), 0 0 0 0 rgba(201,161,74,0); }
}

#rookie-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: min(380px, calc(100vw - 36px));
    height: min(580px, calc(100vh - 80px));
    background: var(--cream);
    border-radius: 22px;
    box-shadow: 0 28px 70px -16px rgba(27,36,64,0.45), 0 8px 22px rgba(27,36,64,0.12);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
    overflow: hidden;
    border: 1px solid rgba(27,36,64,0.08);
}
#rookie-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.rookie-header {
    background: var(--ink);
    color: var(--cream);
    padding: 16px 16px 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(201,161,74,0.2);
}
.rookie-header-left { display: flex; align-items: center; gap: 12px; }
.rookie-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}
.rookie-header-left strong {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--cream);
}
.rookie-header-left span {
    display: block;
    font-size: 0.78rem;
    opacity: 0.7;
    margin-top: 3px;
    color: var(--cream);
}
.rookie-close {
    background: transparent;
    border: none;
    color: var(--cream);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}
.rookie-close:hover { background: rgba(255,255,255,0.1); }

.rookie-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background:
        radial-gradient(circle at 20% 10%, rgba(201,161,74,0.08), transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(139,30,63,0.04), transparent 50%),
        var(--cream);
    scrollbar-width: thin;
    scrollbar-color: rgba(27,36,64,0.2) transparent;
}
.rookie-messages::-webkit-scrollbar { width: 6px; }
.rookie-messages::-webkit-scrollbar-thumb { background: rgba(27,36,64,0.2); border-radius: 3px; }

.rookie-msg {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
    animation: rookie-fade-in 0.35s ease;
}
@keyframes rookie-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rookie-msg.user { align-items: flex-end; }
.rookie-msg.bot  { align-items: flex-start; }
.rookie-bubble {
    max-width: 86%;
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.45;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(27,36,64,0.06);
}
.rookie-msg.bot .rookie-bubble {
    background: var(--parchment);
    color: var(--ink);
    border-bottom-left-radius: 4px;
}
.rookie-msg.user .rookie-bubble {
    background: var(--ink);
    color: var(--cream);
    border-bottom-right-radius: 4px;
}
.rookie-typing { display: flex; gap: 4px; align-items: center; padding: 14px 16px; background: var(--parchment); }
.rookie-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-soft);
    opacity: 0.5;
    animation: rookie-bounce 1.4s ease-in-out infinite;
}
.rookie-typing span:nth-child(2) { animation-delay: 0.18s; }
.rookie-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes rookie-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.rookie-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.rookie-chip {
    background: var(--cream);
    border: 1px solid rgba(27,36,64,0.18);
    color: var(--ink);
    padding: 7px 14px;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.rookie-chip:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--cream);
}

.rookie-disclaimer {
    text-align: center;
    font-size: 0.72rem;
    color: var(--ink-soft);
    padding: 8px 16px;
    background: var(--cream);
    border-top: 1px solid rgba(27,36,64,0.06);
}

.rookie-input-wrap {
    border-top: 1px solid rgba(27,36,64,0.08);
    padding: 12px 14px;
    display: flex;
    gap: 8px;
    background: var(--cream);
    flex-shrink: 0;
}
.rookie-input {
    flex: 1;
    border: 1.5px solid rgba(27,36,64,0.15);
    background: var(--parchment);
    border-radius: 999px;
    padding: 10px 16px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.92rem;
    color: var(--ink);
    transition: border-color 0.2s, background 0.2s;
}
.rookie-input:focus {
    outline: none;
    border-color: var(--ink);
    background: var(--cream);
}
.rookie-send {
    background: var(--ink);
    color: var(--cream);
    border: none;
    padding: 10px 20px;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}
.rookie-send:hover { background: var(--wine); }

@media (max-width: 480px) {
    #rookie-root { bottom: 14px; right: 14px; left: 14px; }
    #rookie-fab { padding: 10px 16px 10px 12px; }
    .rookie-fab-label { display: none; }
    #rookie-panel { width: 100%; right: 0; left: 0; height: calc(100vh - 28px); border-radius: 18px; }
}

/* ---------------- Reveal animation ---------------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   PARENT PORTAL — Auth & Dashboard
   ============================================================ */

/* ----- Auth pages (signup/signin) — centered card layout ----- */
.auth-page {
    min-height: calc(100vh - 90px);
    padding: 60px 24px 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: "♚";
    position: absolute;
    bottom: -25%;
    right: -10%;
    font-size: 42rem;
    color: var(--ink);
    opacity: 0.045;
    line-height: 1;
    pointer-events: none;
    transform: rotate(-12deg);
    z-index: 0;
}
.auth-page::after {
    content: "♟";
    position: absolute;
    top: 8%;
    left: -4%;
    font-size: 18rem;
    color: var(--wine);
    opacity: 0.05;
    line-height: 1;
    pointer-events: none;
    transform: rotate(15deg);
    z-index: 0;
}
.auth-grid {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 56px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.auth-perks-panel { padding: 8px 0; }
.auth-perks-panel .scribble {
    color: var(--wine);
    font-size: 1.3rem;
    display: block;
    margin-bottom: 10px;
}
.auth-perks-panel h2 {
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    line-height: 1.05;
    margin-bottom: 22px;
}
.auth-perks-panel h2 em { color: var(--wine); font-style: italic; }
.auth-perks-panel > p {
    color: var(--ink-soft);
    font-size: 1.02rem;
    margin-bottom: 28px;
    max-width: 420px;
}
.auth-perks {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    margin: 0;
}
.auth-perks li {
    padding: 14px 16px 14px 46px;
    background: var(--cream);
    border-radius: 12px;
    border: 1px solid rgba(27,36,64,0.07);
    position: relative;
    font-size: 0.95rem;
    color: var(--ink);
    line-height: 1.45;
}
.auth-perks li::before {
    content: "♟";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-deep);
    font-size: 1.3rem;
}

.auth-card {
    background: var(--cream);
    border-radius: 24px;
    padding: 44px 40px;
    box-shadow: var(--shadow-deep);
    border: 1px solid rgba(27,36,64,0.08);
    width: 100%;
    max-width: 520px;
    justify-self: center;
}
.auth-card h1 {
    font-size: clamp(1.8rem, 2.6vw, 2.3rem);
    margin-bottom: 8px;
    line-height: 1.1;
}
.auth-card > p {
    color: var(--ink-soft);
    margin-bottom: 26px;
    font-size: 0.98rem;
}
.auth-card .form-grid { gap: 14px; }
.auth-card .form-field input,
.auth-card .form-field select {
    padding: 12px 16px;
    font-size: 0.95rem;
}
.auth-card .form-actions { margin-top: 22px; }
.auth-card .full-btn { width: 100%; justify-content: center; }
.auth-foot {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--ink-soft);
    text-align: center;
}
.auth-foot a { color: var(--wine); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

.demo-fill {
    background: var(--parchment);
    border: 1px dashed var(--gold);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 18px;
    font-size: 0.85rem;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.demo-fill button {
    background: var(--gold);
    color: var(--ink);
    border: none;
    padding: 8px 14px;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.demo-fill button:hover { background: var(--gold-deep); color: var(--cream); }

.error-msg {
    background: rgba(139,30,63,0.08);
    color: var(--wine-deep);
    border-left: 3px solid var(--wine);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

@media (max-width: 880px) {
    .auth-grid { grid-template-columns: 1fr; gap: 36px; max-width: 520px; }
    .auth-perks-panel { text-align: left; padding: 0; }
    .auth-perks-panel h2 { font-size: 1.7rem; }
    .auth-perks { gap: 10px; }
    .auth-perks li { padding: 12px 14px 12px 42px; font-size: 0.9rem; }
    .auth-card { padding: 32px 24px; border-radius: 18px; }
    .auth-page { padding: 40px 18px 60px; }
}

/* ----- Dashboard layout ----- */
.dash-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 90px);
    background: var(--parchment);
}
.dash-side {
    background: var(--ink);
    color: var(--cream);
    padding: 36px 28px;
    border-right: 1px solid rgba(201,161,74,0.18);
    position: sticky;
    top: 90px;
    height: calc(100vh - 90px);
    overflow-y: auto;
}
.dash-user {
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(251,246,233,0.1);
    margin-bottom: 24px;
}
.dash-user-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-family: 'DM Serif Display', serif;
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 14px;
}
.dash-user strong {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 1.15rem;
    color: var(--cream);
}
.dash-user span {
    display: block;
    font-size: 0.82rem;
    color: rgba(251,246,233,0.6);
    margin-top: 2px;
}
.dash-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dash-nav a {
    text-decoration: none;
    color: rgba(251,246,233,0.7);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.dash-nav a::before {
    content: "♟";
    color: var(--gold);
    opacity: 0.5;
    font-size: 0.9rem;
}
.dash-nav a:hover { background: rgba(251,246,233,0.06); color: var(--cream); }
.dash-nav a.active {
    background: var(--gold);
    color: var(--ink);
}
.dash-nav a.active::before { color: var(--ink); opacity: 1; }
.dash-nav .group-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(251,246,233,0.45);
    padding: 18px 14px 6px;
    font-weight: 600;
}

.dash-logout {
    margin-top: 30px;
    padding: 18px 0 0;
    border-top: 1px solid rgba(251,246,233,0.1);
}
.dash-logout a {
    color: rgba(251,246,233,0.5);
    font-size: 0.88rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 600;
}
.dash-logout a:hover { color: var(--gold); }

/* Dashboard main */
.dash-main { padding: 48px; }

.dash-greet { margin-bottom: 36px; }
.dash-greet .scribble { font-size: 1.2rem; display: block; margin-bottom: 4px; }
.dash-greet h1 {
    font-size: clamp(2rem, 3.4vw, 2.8rem);
    margin-bottom: 6px;
}
.dash-greet h1 em { color: var(--wine); font-style: italic; }
.dash-greet p { color: var(--ink-soft); }

/* Kid switcher cards */
.kid-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}
.kid-card {
    background: var(--cream);
    padding: 22px 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(27,36,64,0.08);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.kid-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.kid-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,161,74,0.2);
}
.kid-card-top {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}
.kid-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--gold);
    display: grid;
    place-items: center;
    font-family: 'DM Serif Display', serif;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.kid-card-top strong {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 1.2rem;
}
.kid-card-top span {
    font-size: 0.82rem;
    color: var(--ink-soft);
}
.kid-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-top: 14px;
    border-top: 1px dashed rgba(27,36,64,0.15);
}
.kid-stat {
    text-align: center;
}
.kid-stat strong {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 1.2rem;
    color: var(--ink);
    line-height: 1;
}
.kid-stat span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-soft);
    margin-top: 4px;
    display: block;
}

/* Dashboard cards */
.dash-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.dash-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
.dash-card {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid rgba(27,36,64,0.08);
    box-shadow: var(--shadow-soft);
}
.dash-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 22px;
}
.dash-card-head h3 {
    font-size: 1.15rem;
    font-weight: 500;
    margin: 0;
}
.dash-card-head a {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--wine);
    text-decoration: none;
    font-weight: 600;
}

/* ELO chart card */
.elo-current {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 24px;
}
.elo-current strong {
    font-family: 'DM Serif Display', serif;
    font-size: 3.2rem;
    line-height: 1;
    font-weight: 600;
}
.elo-delta {
    background: rgba(125,150,112,0.18);
    color: var(--sage);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}
.elo-current .label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
}
.elo-chart {
    width: 100%;
    height: 200px;
}

/* Class / event lists */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.timeline-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 12px;
    background: var(--parchment);
    transition: background 0.2s;
}
.timeline-row:hover { background: var(--parchment-deep); }
.timeline-date {
    text-align: center;
    background: var(--ink);
    color: var(--cream);
    padding: 8px 6px;
    border-radius: 8px;
}
.timeline-date strong {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 1.2rem;
    line-height: 1;
}
.timeline-date span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--gold);
}
.timeline-info strong { display: block; font-size: 0.98rem; }
.timeline-info span { font-size: 0.82rem; color: var(--ink-soft); }
.timeline-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    background: rgba(201,161,74,0.18);
    color: var(--gold-deep);
}
.timeline-tag.win { background: rgba(125,150,112,0.18); color: var(--sage); }
.timeline-tag.loss { background: rgba(139,30,63,0.12); color: var(--wine); }
.timeline-tag.draw { background: rgba(27,36,64,0.08); color: var(--ink-soft); }

/* Lesson progress */
.lesson-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.lesson-item { display: flex; flex-direction: column; gap: 6px; }
.lesson-item-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.92rem;
}
.lesson-item-head strong { font-weight: 500; }
.lesson-item-head span { color: var(--ink-soft); font-size: 0.82rem; }
.bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(27,36,64,0.08);
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--wine));
    border-radius: 999px;
}

/* Billing */
.bill-summary {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 22px;
    padding: 18px;
    background: var(--ink);
    color: var(--cream);
    border-radius: 12px;
}
.bill-summary .amt {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    line-height: 1;
    color: var(--gold);
}
.bill-summary .meta strong { display: block; font-size: 0.95rem; color: var(--cream); }
.bill-summary .meta span { font-size: 0.82rem; color: rgba(251,246,233,0.6); }
.bill-summary .pay-btn {
    margin-left: auto;
    background: var(--gold);
    color: var(--ink);
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
}
.invoice {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(27,36,64,0.12);
    font-size: 0.92rem;
    align-items: center;
}
.invoice:last-child { border-bottom: none; }
.invoice .desc strong { display: block; }
.invoice .desc span { font-size: 0.78rem; color: var(--ink-soft); }
.invoice .stat-paid {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sage);
    font-weight: 600;
}
.invoice .stat-due {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--wine);
    font-weight: 600;
}

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.quick-action {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    background: var(--parchment);
    border-radius: 12px;
    border: 1px solid rgba(27,36,64,0.08);
    text-decoration: none;
    color: var(--ink);
    transition: all 0.2s;
}
.quick-action:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    background: var(--cream);
}
.quick-action strong { font-family: 'DM Serif Display', serif; font-size: 1.05rem; font-weight: 500; }
.quick-action span { font-size: 0.82rem; color: var(--ink-soft); }

/* Coach notes */
.note-item {
    padding: 14px 0;
    border-bottom: 1px dashed rgba(27,36,64,0.12);
}
.note-item:last-child { border-bottom: none; }
.note-item .note-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.note-item .note-meta strong { color: var(--ink); font-weight: 600; }
.note-item p {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 0.96rem;
    line-height: 1.5;
    color: var(--ink);
}

/* Responsive dashboard */
@media (max-width: 980px) {
    .dash-wrap { grid-template-columns: 1fr; }
    .dash-side {
        position: relative;
        top: 0;
        height: auto;
        padding: 28px;
    }
    .dash-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 6px;
    }
    .dash-nav .group-label { display: none; }
    .dash-logout { display: none; }
    .dash-main { padding: 32px 24px; }
    .dash-grid, .dash-grid-3 { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-side { padding: 50px 32px; }
    .auth-form-wrap { padding: 50px 32px; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
    .hero-grid { gap: 40px; }
    .why-grid { grid-template-columns: repeat(2, 1fr); }
    .levels { grid-template-columns: repeat(2, 1fr); }
    .testi-grid { grid-template-columns: repeat(2, 1fr); }
    .locations-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

@media (max-width: 820px) {
    .nav-toggle { display: block; }
    .main-nav, .nav-cta {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--cream);
        padding: 24px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        border-top: 1px solid rgba(27,36,64,0.08);
        box-shadow: var(--shadow-card);
    }
    .nav-open .main-nav,
    .nav-open .nav-cta { display: flex; }
    .nav-open .nav-cta { padding-top: 0; }

    .hero { padding: 50px 0 40px; }
    .hero-grid { grid-template-columns: 1fr; gap: 50px; }
    .story { grid-template-columns: 1fr; gap: 60px; }
    .tour-grid { grid-template-columns: 1fr; gap: 40px; }
    .holiday { grid-template-columns: 1fr; gap: 40px; }
    section { padding: 80px 0; }

    .curric-row { grid-template-columns: 1fr; gap: 14px; text-align: left; }
    .curric-row .arrow { justify-self: start; }

    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .why-grid, .levels, .testi-grid, .locations-grid, .form-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-actions, .cta-actions { flex-direction: column; align-items: stretch; }
    .btn { justify-content: center; }
    .form-wrap { padding: 28px; }
    .marquee-item { font-size: 1.1rem; }
}

/* ============================================================
   STUDENT PORTAL — Interactive board, XP, lessons, achievements
   ============================================================ */

/* ===== Tournament-quality chess board ===== */
.cb-board {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border-radius: 4px;
    overflow: hidden;
    box-shadow:
        0 0 0 8px #2a1810,
        0 0 0 10px #d4a93a,
        0 22px 50px -16px rgba(20, 14, 8, 0.55),
        0 6px 18px -6px rgba(20, 14, 8, 0.35);
    margin: 0 auto;
    background: #f0d9b5;
    isolation: isolate;
}
.cb-sq {
    position: relative;
    transition: background-color 0.2s ease, box-shadow 0.18s ease;
    cursor: pointer;
}
/* Tournament wood-tone palette — light & medium wood */
.cb-light { background: #f0d9b5; }
.cb-dark  { background: #b58863; }

/* Coordinate labels in classic chess-set style */
.cb-coord {
    position: absolute;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(0.5rem, 1vw, 0.66rem);
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    text-transform: lowercase;
    letter-spacing: 0;
}
.cb-coord.cb-rank { top: 3px; left: 4px; }
.cb-coord.cb-file { bottom: 3px; right: 5px; }
.cb-light .cb-coord { color: rgba(110, 75, 35, 0.7); }
.cb-dark  .cb-coord { color: rgba(245, 220, 180, 0.85); }

/* Selection + last move + feedback */
.cb-sq.cb-selected {
    background-color: rgba(238, 108, 77, 0.55) !important;
}
.cb-sq.cb-last-from { background-color: rgba(212, 169, 58, 0.38) !important; }
.cb-sq.cb-last-to   { background-color: rgba(212, 169, 58, 0.58) !important; }
.cb-sq.cb-correct {
    background-color: rgba(116, 162, 90, 0.78) !important;
    animation: cb-pulse 0.55s ease-out;
}
.cb-sq.cb-wrong {
    background-color: rgba(208, 70, 50, 0.7) !important;
    animation: cb-shake 0.42s ease-in-out;
}
@keyframes cb-pulse {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(116, 162, 90, 0); }
    50% { box-shadow: inset 0 0 0 6px rgba(116, 162, 90, 0.55); }
}
@keyframes cb-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

/* Move hint dots (empty squares the selected piece can move to) */
.cb-sq.cb-move-hint::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28%;
    height: 28%;
    background: rgba(30, 50, 35, 0.32);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}
/* Capture hint — ring around the target piece */
.cb-sq.cb-move-capture {
    box-shadow: inset 0 0 0 4px rgba(208, 70, 50, 0.6);
}
.cb-sq.cb-move-capture .cb-coord { z-index: 2; }

/* Pieces layer */
.cb-pieces {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}
.cb-piece {
    position: absolute;
    top: 0;
    left: 0;
    width: 12.5%;
    height: 12.5%;
    display: grid;
    place-items: center;
    font-family: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols', system-ui, sans-serif;
    font-size: clamp(1.8rem, 5.2vw, 3.1rem);
    line-height: 1;
    transition: transform 0.42s cubic-bezier(0.4, 1.4, 0.55, 1), opacity 0.32s ease;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}
.cb-piece.cb-white {
    color: #fbf6e9;
    text-shadow:
        -1.6px -1.6px 0 #1a1108,
         1.6px -1.6px 0 #1a1108,
        -1.6px  1.6px 0 #1a1108,
         1.6px  1.6px 0 #1a1108,
         0 2px 4px rgba(20, 12, 6, 0.32);
}
.cb-piece.cb-black {
    color: #1a1108;
    text-shadow:
        0 1px 0 rgba(255, 250, 235, 0.35),
        0 2px 4px rgba(20, 12, 6, 0.3);
}
.cb-piece.cb-captured { opacity: 0; transform: scale(0.5) !important; }

/* Subtle paper-grain overlay on the board */
.cb-board::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 0 0.05  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    mix-blend-mode: overlay;
    opacity: 0.4;
    z-index: 4;
}

/* ===== Board overlays: arrows, pulses, celebration, XP popups ===== */

/* Arrow layer (SVG over the board) */
.cb-arrow-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6;
}
.cb-arrow-line {
    animation: cb-arrow-in 0.45s ease-out;
}
@keyframes cb-arrow-in {
    from { stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; }
    to   { stroke-dasharray: 100; stroke-dashoffset: 0; opacity: 0.78; }
}

/* Square pulse (for hints — gold; for opponent telegraphs — wine) */
.cb-sq.cb-pulse-gold {
    animation: cb-pulse-gold 0.75s ease-in-out 2;
}
.cb-sq.cb-pulse-wine {
    animation: cb-pulse-wine 0.75s ease-in-out 2;
}
@keyframes cb-pulse-gold {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(212, 169, 58, 0); }
    50% { box-shadow: inset 0 0 0 5px rgba(212, 169, 58, 0.85); }
}
@keyframes cb-pulse-wine {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(238, 108, 77, 0); }
    50% { box-shadow: inset 0 0 0 5px rgba(238, 108, 77, 0.85); }
}

/* Celebration overlay — covers the board, then fades */
.cb-celebrate {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    display: grid;
    place-items: center;
    overflow: hidden;
    animation: cb-celebrate-fade 2.6s ease-out forwards;
}
.cb-celebrate-burst {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%,
        rgba(116, 162, 90, 0.55) 0%,
        rgba(212, 169, 58, 0.25) 40%,
        rgba(29, 61, 42, 0) 70%);
    animation: cb-celebrate-burst 0.9s ease-out backwards;
}
@keyframes cb-celebrate-burst {
    0% { transform: scale(0.3); opacity: 0; }
    60% { opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}
.cb-celebrate-icon {
    position: relative;
    font-family: 'DM Serif Display', serif;
    font-size: clamp(4rem, 14vw, 7rem);
    color: #fbf6e9;
    text-shadow:
        0 0 24px rgba(212, 169, 58, 0.85),
        0 4px 12px rgba(20, 12, 6, 0.55),
        -2px -2px 0 #1a1108,
         2px -2px 0 #1a1108,
        -2px  2px 0 #1a1108,
         2px  2px 0 #1a1108;
    animation: cb-celebrate-pop 0.7s cubic-bezier(0.34, 1.65, 0.5, 1) backwards;
    line-height: 1;
}
.cb-celebrate-label {
    position: absolute;
    top: 68%;
    font-family: 'Caveat', cursive;
    font-size: clamp(1.4rem, 3.4vw, 1.9rem);
    color: var(--gold);
    text-shadow: 0 2px 6px rgba(20, 12, 6, 0.85);
    animation: cb-celebrate-label 0.7s 0.25s ease-out backwards;
}
@keyframes cb-celebrate-pop {
    0%   { transform: scale(0.3) rotate(-18deg); opacity: 0; }
    60%  { transform: scale(1.25) rotate(6deg);  opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes cb-celebrate-label {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes cb-celebrate-fade {
    0%, 65% { opacity: 1; }
    100% { opacity: 0; }
}

/* Sparkle particles flying outward */
.cb-spark {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 1.5rem;
    color: var(--gold);
    text-shadow: 0 0 8px rgba(212, 169, 58, 0.8);
    pointer-events: none;
    animation: cb-spark-fly 1.4s cubic-bezier(0.2, 0.7, 0.3, 1) var(--delay) backwards;
    will-change: transform, opacity;
}
@keyframes cb-spark-fly {
    0% {
        transform: translate(-50%, -50%) rotate(0);
        opacity: 0;
    }
    20% { opacity: 1; }
    100% {
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot));
        opacity: 0;
    }
}

/* Floating XP popup */
.cb-float {
    position: absolute;
    top: 50%;
    left: 50%;
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.8rem, 4.6vw, 2.6rem);
    font-weight: 700;
    color: var(--gold);
    text-shadow:
        0 0 16px rgba(212, 169, 58, 0.9),
        0 4px 8px rgba(20, 12, 6, 0.55),
        -2px -2px 0 #1a1108,
         2px -2px 0 #1a1108,
        -2px  2px 0 #1a1108,
         2px  2px 0 #1a1108;
    pointer-events: none;
    z-index: 11;
    animation: cb-float-rise 1.7s ease-out forwards;
}
.cb-float-wine { color: var(--coral); }
@keyframes cb-float-rise {
    0%   { transform: translate(-50%, -20%) scale(0.5); opacity: 0; }
    20%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    80%  { transform: translate(-50%, -110%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -140%) scale(0.95); opacity: 0; }
}

/* Board shake on wrong move */
.cb-board.cb-shake {
    animation: cb-board-shake 0.46s ease-in-out;
}
@keyframes cb-board-shake {
    0%, 100% { transform: translateX(0); }
    15%, 55%, 85% { transform: translateX(-6px); }
    30%, 70% { transform: translateX(6px); }
}

/* Lighter status when board is doing all the talking */
.puzzle-status.minimal {
    background: transparent;
    box-shadow: none;
    border: 1px dashed rgba(29,61,42,0.15);
    font-size: 0.9rem;
    min-height: 44px;
    padding: 10px 16px;
}

/* ----- Student dashboard ----- */
.student-shell {
    background: var(--parchment);
    min-height: calc(100vh - 90px);
    padding: 40px 0 80px;
}
.student-greet {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 36px;
}
.student-greet .student-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--gold);
    display: grid;
    place-items: center;
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    font-weight: 600;
    box-shadow: var(--shadow-card);
}
.student-greet h1 {
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
    line-height: 1.05;
    margin: 0;
}
.student-greet h1 em { color: var(--wine); font-style: italic; }
.student-greet .scribble {
    color: var(--wine);
    font-size: 1.1rem;
    margin-bottom: 2px;
    display: block;
}

/* Rank + XP card */
.rank-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 22px;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--ink), var(--ink-soft));
    color: var(--cream);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-bottom: 28px;
}
.rank-badge {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: var(--gold);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    line-height: 1;
    flex-shrink: 0;
}
.rank-meta strong {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 1.45rem;
    color: var(--cream);
    line-height: 1.1;
}
.rank-meta .rank-sub {
    color: var(--gold);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 6px;
    display: block;
}
.rank-xp-bar {
    height: 10px;
    background: rgba(212, 169, 58, 0.18);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
    width: 100%;
    max-width: 340px;
}
.rank-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--coral));
    border-radius: 999px;
    transition: width 0.6s ease;
}
.rank-xp-text {
    font-size: 0.82rem;
    color: rgba(251, 245, 227, 0.7);
    margin-top: 6px;
}
.rank-streak {
    text-align: center;
    padding: 14px 18px;
    background: rgba(212, 169, 58, 0.12);
    border-radius: 14px;
    border: 1px solid rgba(212, 169, 58, 0.35);
}
.rank-streak strong {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    color: var(--gold);
    line-height: 1;
}
.rank-streak span {
    font-size: 0.72rem;
    color: rgba(251, 245, 227, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-top: 6px;
    display: block;
}

/* Student stat tiles */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}
.stat-tile {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 22px 24px;
    border: 1px solid rgba(29, 61, 42, 0.08);
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.stat-tile .stat-glyph {
    font-size: 2rem;
    line-height: 1;
    color: var(--gold-deep);
    margin-bottom: 8px;
    display: block;
}
.stat-tile strong {
    font-family: 'DM Serif Display', serif;
    font-size: 1.8rem;
    color: var(--ink);
    line-height: 1;
    display: block;
}
.stat-tile span {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
    margin-top: 6px;
    display: block;
}

/* Section header (student pages) */
.student-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 40px 0 20px;
    gap: 20px;
}
.student-section-head h2 {
    font-size: 1.6rem;
    margin: 0;
}
.student-section-head .scribble {
    color: var(--wine);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 4px;
}
.student-section-head a {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--wine);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

/* Quick action / nav tiles */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 36px;
}
.action-tile {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 28px 26px;
    text-decoration: none;
    color: var(--ink);
    border: 1px solid rgba(29, 61, 42, 0.08);
    box-shadow: var(--shadow-soft);
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}
.action-tile::before {
    content: attr(data-glyph);
    position: absolute;
    right: -6px;
    bottom: -22px;
    font-size: 6.5rem;
    color: var(--gold);
    opacity: 0.15;
    line-height: 1;
}
.action-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: var(--gold);
}
.action-tile .at-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gold-deep);
    font-weight: 600;
}
.action-tile .at-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    line-height: 1.1;
}
.action-tile .at-desc {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

/* Achievement chips */
.achievement-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.achievement {
    background: var(--cream);
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid rgba(29, 61, 42, 0.08);
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-soft);
}
.achievement.locked {
    opacity: 0.42;
    filter: saturate(0.4);
}
.achievement .ach-glyph {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.achievement strong {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 1rem;
    color: var(--ink);
    line-height: 1.1;
}
.achievement span {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 2px;
}

/* Daily puzzle teaser */
.daily-puzzle {
    background: linear-gradient(135deg, var(--cream), var(--parchment-deep));
    border-radius: var(--radius-lg);
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    border: 1px solid rgba(29, 61, 42, 0.08);
    box-shadow: var(--shadow-card);
    margin-bottom: 36px;
}
.daily-puzzle .dp-board {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}
.daily-puzzle h3 {
    font-size: 1.7rem;
    margin-bottom: 8px;
}
.daily-puzzle h3 em { color: var(--wine); font-style: italic; }
.daily-puzzle p {
    color: var(--ink-soft);
    margin-bottom: 18px;
}
.daily-puzzle .scribble {
    color: var(--wine);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 6px;
}

/* ----- Puzzles page layout ----- */
.puzzle-shell {
    background: var(--parchment);
    min-height: calc(100vh - 90px);
    padding: 40px 0 80px;
}
.puzzle-page {
    display: grid;
    grid-template-columns: 240px 1fr 320px;
    gap: 28px;
    align-items: start;
}
.puzzle-cats {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid rgba(29, 61, 42, 0.08);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 100px;
}
.puzzle-cats h4 {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ink-soft);
    margin-bottom: 14px;
}
.puzzle-cat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    font-family: inherit;
    color: var(--ink);
    font-size: 0.95rem;
    width: 100%;
    margin-bottom: 4px;
    transition: background 0.15s;
    text-align: left;
}
.puzzle-cat:hover { background: var(--parchment); }
.puzzle-cat.active { background: var(--ink); color: var(--cream); }
.puzzle-cat .cat-count {
    font-size: 0.75rem;
    color: var(--ink-soft);
    background: rgba(29,61,42,0.08);
    padding: 2px 8px;
    border-radius: 999px;
}
.puzzle-cat.active .cat-count { background: rgba(212,169,58,0.25); color: var(--gold); }

.puzzle-stage {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid rgba(29, 61, 42, 0.08);
    box-shadow: var(--shadow-card);
}
.puzzle-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    gap: 18px;
    flex-wrap: wrap;
}
.puzzle-head h2 {
    font-size: 1.5rem;
    margin: 0;
}
.puzzle-head .puzzle-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.puzzle-tag {
    background: rgba(212, 169, 58, 0.18);
    color: var(--gold-deep);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 600;
}
.puzzle-tag.diff {
    background: rgba(238, 108, 77, 0.15);
    color: var(--wine-deep);
}
.puzzle-status {
    text-align: center;
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--parchment);
    border-radius: 12px;
    font-family: 'DM Serif Display', serif;
    font-size: 1.05rem;
    color: var(--ink-soft);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}
.puzzle-status.success {
    background: rgba(125, 150, 112, 0.25);
    color: var(--ink);
}
.puzzle-status.fail {
    background: rgba(238, 108, 77, 0.15);
    color: var(--wine-deep);
}
.puzzle-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.puzzle-actions .btn { padding: 12px 22px; font-size: 0.86rem; }

.puzzle-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 100px;
}
.side-card {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid rgba(29, 61, 42, 0.08);
    box-shadow: var(--shadow-soft);
}
.side-card h4 {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gold-deep);
    margin-bottom: 12px;
}
.side-card p { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.5; }

/* ----- Lessons page ----- */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.lesson-card {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 26px;
    border: 1px solid rgba(29, 61, 42, 0.08);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: var(--gold);
}
.lesson-card.complete {
    background: linear-gradient(135deg, var(--cream), var(--parchment-deep));
}
.lesson-card.complete::after {
    content: "Read";
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--sage);
    color: var(--cream);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
}
.lesson-card { position: relative; }
.lesson-card .lc-mini-board {
    width: 100%;
    aspect-ratio: 1;
    max-width: 220px;
    margin: 0 auto;
}
.lesson-card h3 {
    font-size: 1.3rem;
    margin: 0;
}
.lesson-card .lc-tagline {
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    color: var(--wine);
    line-height: 1.1;
}
.lesson-card .lc-body {
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* Lesson detail modal-ish */
.lesson-detail {
    background: var(--cream);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-deep);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: center;
    margin-bottom: 30px;
}
.lesson-detail .ld-board {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}
.lesson-detail h2 {
    font-size: 1.9rem;
    margin-bottom: 4px;
}
.lesson-detail .ld-tagline {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--wine);
    margin-bottom: 18px;
    display: block;
}
.lesson-detail p {
    color: var(--ink-soft);
    margin-bottom: 18px;
    font-size: 1rem;
    line-height: 1.55;
}
.lesson-detail ul {
    list-style: none;
    padding: 0;
}
.lesson-detail li {
    padding: 10px 0 10px 24px;
    border-bottom: 1px dashed rgba(29,61,42,0.12);
    position: relative;
    font-size: 0.94rem;
}
.lesson-detail li::before {
    content: "♟";
    position: absolute;
    left: 0;
    top: 10px;
    color: var(--gold-deep);
}
.lesson-detail li:last-child { border-bottom: none; }

/* Responsive */
@media (max-width: 980px) {
    .puzzle-page { grid-template-columns: 1fr; }
    .puzzle-cats, .puzzle-side { position: relative; top: 0; }
    .daily-puzzle { grid-template-columns: 1fr; }
    .lesson-detail { grid-template-columns: 1fr; }
    .rank-card { grid-template-columns: 1fr; text-align: center; }
    .rank-card .rank-badge { margin: 0 auto; }
}
