/* ============================================================
   Content pages (how-to-play, for-teachers, for-teams, blog, 404):
   a note page on phones, an open notebook on desktop with the cover
   on the left and the article scrolling on the right.
   ============================================================ */
.page-container {
    position: relative;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--paper);
    background-image:
        linear-gradient(90deg, transparent 44px, var(--margin-line) 44px, var(--margin-line) 46px, transparent 46px),
        repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

/* --- Cover -------------------------------------------------------- */
.page-header { padding: 40px 24px 10px 60px; display: flex; flex-direction: column; gap: 10px; }
.eyebrow { font-family: var(--font-hand); font-weight: 700; font-size: 1.15rem; color: var(--ink-them); margin: 0; }
.page-header h1 { font-size: 2.5rem; line-height: 1; color: var(--ink-me); transform: rotate(-1.5deg); transform-origin: left bottom; }
.page-header .meta, .page-article .meta { font-size: 0.95rem; color: var(--ink-3); margin: 0; }
.lead { font-size: 1.15rem; line-height: 1.4; color: var(--ink-2); margin: 4px 0 6px; }
.cover-contents { margin: 6px 0 4px; }
.cover-contents .section-title { font-size: 1rem; margin-bottom: 4px; }
.cover-contents ol { list-style: none; display: flex; flex-direction: column; gap: 2px; padding: 0; }
.cover-contents a { font-family: var(--font-hand); font-weight: 700; font-size: 1.2rem; color: var(--ink-me); text-decoration: none; }
.cover-contents a:hover { text-decoration: underline wavy; }
.cta-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap);
    padding: 0 20px;
    border: 1.6px solid var(--ink);
    border-radius: var(--sketch-radius);
    background: var(--sticky-yellow);
    box-shadow: var(--shadow-key);
    font-family: var(--font-hand);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--ink);
    text-decoration: none;
    transition: transform var(--dur-fast) var(--ease-smooth), box-shadow var(--dur-fast) var(--ease-smooth);
}
.cta-btn:active { transform: translate(1.5px, 2px); box-shadow: none; }
.cover-home { font-size: 1rem; color: var(--ink-2); text-decoration: none; margin-top: 6px; }
.cover-home:hover { text-decoration: underline wavy; }

/* --- Article typography --------------------------------------------- */
.page-article { padding: 10px 24px 40px 60px; }
.content-section { margin: 0 0 30px; }
.content-section h2 { font-size: 1.75rem; color: var(--ink); margin-bottom: 10px; scroll-margin-top: 20px; }
.content-section h3 { font-size: 1.3rem; color: var(--ink); margin-bottom: 4px; }
.page-article p { font-size: 1.05rem; line-height: 1.5; color: var(--ink-2); margin-bottom: 10px; }
.page-article strong { color: var(--ink); }
.page-article a { color: var(--ink-me); }
.page-article ol, .page-article ul { padding-left: 24px; margin: 4px 0 12px; }
.page-article li { font-size: 1.05rem; line-height: 1.45; color: var(--ink-2); margin-bottom: 8px; }
.tips-list li { list-style: none; position: relative; padding-left: 4px; }
.tips-list li::before { content: '✎'; position: absolute; left: -22px; color: var(--ink-them); }

/* Feedback legend */
.color-examples { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 14px; }
.color-example { display: flex; align-items: center; gap: 14px; }
.color-tile {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1.5px dashed var(--pencil);
    border-radius: 3px;
    background: var(--paper-2);
    font-family: var(--font-hand);
    font-weight: 700;
    font-size: 1.7rem;
    color: var(--ink-me);
}
.color-tile.ring::after { content: ''; position: absolute; inset: 3px; border: 2.5px solid var(--pen-red); border-radius: var(--sketch-oval); transform: rotate(-4deg); }
.color-tile.highlight { background: linear-gradient(transparent 28%, var(--highlighter) 28%, var(--highlighter) 72%, transparent 72%), var(--paper-2); }
.color-tile.struck { color: var(--ink-3); }
.color-tile.struck::after { content: ''; position: absolute; left: 12%; right: 12%; top: 50%; height: 2.5px; background: var(--ink); transform: rotate(-8deg); }
.color-label { font-size: 1.05rem; color: var(--ink-2); }

/* Mode cards, step cards, use cases, highlights */
.mode-cards { display: grid; gap: 16px; margin: 12px 0; }
.mode-card { position: relative; padding: 14px 16px 16px; background: var(--sticky-yellow); box-shadow: var(--shadow-note); transform: rotate(-1deg); }
.mode-card:nth-child(2) { background: var(--sticky-pink); transform: rotate(0.8deg); }
.mode-card h3 { margin-bottom: 4px; }
.mode-card p { margin: 0; color: #3A3A3A; }
.highlight-box { position: relative; padding: 14px 18px; background: var(--sticky-blue); box-shadow: var(--shadow-note); transform: rotate(-0.8deg); margin: 14px 0 6px; }
.highlight-box p { margin: 0; color: #3A3A3A; }
.use-case-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.use-case-list li { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1.5px dashed var(--pencil); }
.use-case-list .icon { flex-shrink: 0; width: 34px; text-align: center; font-size: 1.3rem; }
.steps-grid { display: grid; gap: 14px; margin: 12px 0; counter-reset: step; }
.step-card { position: relative; padding: 14px 16px 12px 58px; background: var(--paper-2); box-shadow: var(--shadow-note); }
.step-card:nth-child(even) { transform: rotate(0.6deg); }
.step-card:nth-child(odd) { transform: rotate(-0.6deg); }
.step-number { position: absolute; left: 12px; top: 12px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 2.2px solid var(--pen-red); border-radius: var(--sketch-oval); font-family: var(--font-hand); font-weight: 700; font-size: 1.2rem; color: var(--pen-red); }
.step-card p { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 18px; }
.stat-card { text-align: center; padding: 10px 6px; border-bottom: 1.5px dashed var(--pencil); }
.stat-value { font-family: var(--font-hand); font-weight: 700; font-size: 1.8rem; color: var(--ink-me); }
.stat-label { font-size: 0.9rem; color: var(--ink-2); }

/* FAQ */
.faq-item { padding: 10px 0 12px; border-bottom: 1.5px dashed var(--pencil); }
.faq-item h3 { color: var(--ink-me); }
.faq-item p { margin: 0; }

/* Comparison table + game cards (blog) */
.comparison-table-wrapper { overflow-x: auto; margin: 12px 0 8px; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.comparison-table th { font-family: var(--font-hand); font-weight: 700; font-size: 1.15rem; text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--ink); color: var(--ink); white-space: nowrap; }
.comparison-table td { padding: 9px 10px; border-bottom: 1.5px dashed var(--pencil); color: var(--ink-2); vertical-align: top; }
.comparison-table tr:first-child td { font-weight: 600; }
.badge-check { color: var(--pen-red); font-weight: 700; }
.game-card { position: relative; padding: 16px 18px; margin: 0 0 16px; background: var(--paper-2); box-shadow: var(--shadow-note); transform: rotate(-0.5deg); }
.game-card:nth-child(even) { transform: rotate(0.6deg); }
.game-card.featured { background: var(--sticky-yellow); }
.game-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.game-card-rank { flex-shrink: 0; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 2.2px solid var(--pen-red); border-radius: var(--sketch-oval); font-family: var(--font-hand); font-weight: 700; font-size: 1.2rem; color: var(--pen-red); }
.game-card-title { font-family: var(--font-hand); font-weight: 700; font-size: 1.35rem; line-height: 1.1; color: var(--ink); }
.game-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.meta-tag { font-size: 0.85rem; padding: 2px 10px; border: 1.5px dashed var(--pencil); border-radius: var(--radius-pill); color: var(--ink-2); }
.game-card p { margin: 0 0 6px; }
.app-icon { flex-shrink: 0; border-radius: 22%; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); background: var(--paper); vertical-align: middle; }
td .app-icon { width: 28px; height: 28px; margin-right: 6px; }
.game-card-shot { margin: 4px 0 10px; }
.game-card-shot img { display: block; width: 100%; max-width: 260px; height: auto; border-radius: 14px; box-shadow: var(--shadow-note); transform: rotate(0.8deg); }
.game-card-shot figcaption { margin-top: 6px; font-size: 0.8rem; color: var(--ink-2); }
@media (min-width: 600px) {
    .game-card.has-shot { display: grid; grid-template-columns: 1fr 200px; grid-template-rows: auto auto 1fr; grid-template-areas: "head shot" "meta shot" "body shot"; column-gap: 18px; align-items: start; }
    .game-card.has-shot .game-card-header { grid-area: head; }
    .game-card.has-shot .game-card-meta { grid-area: meta; }
    .game-card.has-shot .game-card-shot { grid-area: shot; margin: 0; }
    .game-card.has-shot .game-card-shot img { max-width: 200px; }
    .game-card.has-shot > p { grid-area: body; }
}

/* Footer */
.footer-cta { margin-top: 10px; padding: 22px 20px 20px; text-align: center; background: var(--sticky-green); box-shadow: var(--shadow-note); transform: rotate(-0.6deg); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer-cta h2 { font-size: 1.8rem; }
.footer-cta .cta-btn { align-self: center; }
.footer-cta br { display: none; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.back-link { font-family: var(--font-hand); font-weight: 700; font-size: 1.15rem; color: var(--ink-me); text-decoration: none; }
.back-link:hover { text-decoration: underline wavy; }
.site-footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 22px; padding-top: 14px; border-top: 2px dashed var(--pencil); font-family: var(--font-hand); font-weight: 700; font-size: 1.1rem; }
.site-footer-nav a { color: var(--ink-me); text-decoration: none; }
.site-footer-nav a:hover { text-decoration: underline wavy; }

/* Blog index */
.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--paper-2); box-shadow: var(--shadow-note); text-decoration: none; color: var(--ink); transform: rotate(-0.4deg); }
.article-card:nth-child(even) { transform: rotate(0.5deg); }
.article-date { font-size: 0.9rem; color: var(--ink-3); }
.article-title { font-family: var(--font-hand); font-weight: 700; font-size: 1.4rem; line-height: 1.1; color: var(--ink-me); }
.article-desc { font-size: 1rem; color: var(--ink-2); line-height: 1.4; }

/* 404 */
.error-page .page-container { justify-content: center; align-items: center; text-align: center; padding: 40px 24px 40px 60px; gap: 10px; }
.error-code { font-family: var(--font-hand); font-weight: 700; font-size: 6rem; line-height: 1; color: var(--pen-red); transform: rotate(-4deg); }
.error-page h1 { color: var(--ink-me); }
.error-page p { max-width: 42ch; color: var(--ink-2); font-size: 1.05rem; }
.nav-links { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 10px; }
.link-secondary { font-family: var(--font-hand); font-weight: 700; font-size: 1.2rem; color: var(--ink-me); text-decoration: none; }

@media (min-width: 600px) {
    .mode-cards, .steps-grid { grid-template-columns: 1fr 1fr; }
    .color-examples { flex-direction: row; flex-wrap: wrap; gap: 12px 24px; }
}

/* --- Desktop: the open notebook ---------------------------------- */
@media (min-width: 1024px) {
    .page-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
        width: min(1180px, calc(100vw - 72px));
        max-width: none;
        height: var(--page-h);
        min-height: 0;
        margin: 0;
        border-radius: 6px;
        overflow: hidden;
        background-image: none;
        box-shadow: 8px 14px 34px rgba(0, 0, 0, 0.4);
        transform: rotate(-0.6deg);
    }
    .page-container::after {
        content: '';
        grid-column: 2;
        grid-row: 1;
        position: relative;
        z-index: 2;
        background:
            repeating-linear-gradient(180deg, transparent 0 14px, var(--ink) 14px 18px, transparent 18px 30px) 0 0 / 100% 100%,
            linear-gradient(90deg, transparent 12px, var(--paper) 12px, var(--paper) 24px, transparent 24px);
        opacity: 0.55;
        box-shadow: inset 6px 0 10px -8px rgba(0, 0, 0, 0.35), inset -6px 0 10px -8px rgba(0, 0, 0, 0.35);
    }
    .page-header {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 56px 36px 36px 64px;
        gap: 12px;
        background-image:
            linear-gradient(90deg, transparent 44px, var(--margin-line) 44px, var(--margin-line) 46px, transparent 46px),
            repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
    }
    .page-header h1 { font-size: 3rem; }
    .cover-contents { margin-top: 10px; }
    .cover-home { margin-top: auto; padding-top: 20px; }
    .page-article {
        grid-column: 3;
        grid-row: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 52px 52px 40px 48px;
        background-image: repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
        scroll-behavior: smooth;
    }
    .error-page .page-container { display: flex; width: 560px; height: auto; min-height: 560px; }
    .error-page .page-container::after { display: none; }
}
