/* Dale Jr. fan page.
   Retro mode (default): a late-90s fan shrine on a camo background.
   Modern mode: a calm editorial page that follows the site's light/dark tokens. */

/* ==========================================================
   Shared layout (both looks)
   ========================================================== */
.dale-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    box-sizing: border-box;
}
.dale-page h2 small,
.dale-page .true-facts h2 small {
    font-size: 0.65em;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.8;
}
.dale-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
}
.dale-title { margin: 0; line-height: 1.05; }
.subtitle { font-style: italic; margin: 8px 0 0; }
.nowrap { white-space: nowrap; }

.fact-list { padding-left: 1.3rem; }
.fact-list li { margin-bottom: 0.6rem; }

.glossary dt { font-weight: bold; margin-top: 12px; }
.glossary dd { margin: 2px 0 0 1.2rem; }

.checklist { list-style: none; padding: 0; }
.checklist li { margin: 6px 0; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checklist input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: #c8102e; }
.checklist label:has(input:checked) { text-decoration: line-through; opacity: 0.7; }
.checklist-status { font-weight: bold; min-height: 1.5em; }

.entries { list-style: none; padding: 0; }
.entries li { margin: 0 0 14px; }
.entries p { margin: 0; }
.entries cite { font-size: 0.85em; }
.guestbook-msg { min-height: 1.5em; }

.fact-o-matic { margin: 28px 0; }
.fom-screen { min-height: 3.2em; }
.fom-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.dale-button { font: inherit; cursor: pointer; }

.webring {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 16px;
    margin: 28px 0 0;
    text-align: center;
}
.disclaimer { margin-top: 28px; font-size: 0.82rem; font-style: italic; }

/* ==========================================================
   Retro mode: the shrine
   ========================================================== */
body.dale.retro-mode {
    /* Camo in the lime green, white, red, dark green and black of the 88 car (one 240px tile that wraps seamlessly) */
    background-color: #46c93a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22240%22 height=%22240%22 viewBox=%220 0 240 240%22%3E%3Crect width=%22240%22 height=%22240%22 fill=%22%2346c93a%22/%3E%3Cpath fill=%22%23f4f6f2%22 d=%22M-10 20c30-18 60 6 82-4s40 22 18 40-58 2-74 18-40-8-34-26 0-20 8-28zM230 20c30-18 60 6 82-4s40 22 18 40-58 2-74 18-40-8-34-26 0-20 8-28zM150 120c24-10 52 8 70 0s30 30 6 44-44-4-64 10-34-14-26-30-4-18 14-24z%22/%3E%3Cpath fill=%22%230e5f2c%22 d=%22M60 70c22-14 40 10 62 4s30 26 10 36-30 0-50 14-44-6-40-24 6-22 18-30zM-20 150c20-12 44 2 58 16s-6 36-30 34-38-12-46-26 8-16 18-24zM220 150c20-12 44 2 58 16s-6 36-30 34-38-12-46-26 8-16 18-24zM150 10c16-8 34 4 40 16s-12 24-28 20-30-4-30-18 6-12 18-18z%22/%3E%3Cpath fill=%22%23111111%22 d=%22M100 150c14-8 30 2 36 12s-6 28-24 26-28 14-40 4 0-20 6-28 10-8 22-14zM180 70c10-6 24 0 28 10s-10 18-22 16-20-6-18-14 4-8 12-12zM20 100c10-6 22 2 24 10s-10 16-20 14-16-4-14-12 2-8 10-12zM40 210c12-8 30 0 34 10s-6 30-22 26-28-6-26-18 2-12 14-18zM40-30c12-8 30 0 34 10s-6 30-22 26-28-6-26-18 2-12 14-18z%22/%3E%3Cpath fill=%22%23d42a2f%22 d=%22M110 210c18-10 40 0 46 14s-14 22-32 20-30-6-30-18 4-10 16-16zM110-30c18-10 40 0 46 14s-14 22-32 20-30-6-30-18 4-10 16-16zM190 100c10-4 20 4 20 12s-10 12-18 10-12-4-12-10 2-8 10-12z%22/%3E%3C/svg%3E");
    font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive, sans-serif;
}
body.dale.retro-mode footer { background: #1b1b12; color: #f4e9c8; }

/* Scrolling marquee, built from CSS since <marquee> is long gone */
.retro-mode .marquee {
    overflow: hidden;
    background: #000;
    color: #ffde00;
    font-family: "Courier New", monospace;
    font-weight: bold;
    border-top: 2px solid #c8102e;
    border-bottom: 2px solid #c8102e;
    white-space: nowrap;
}
.retro-mode .marquee-track {
    display: inline-flex;
    animation: dale-marquee 40s linear infinite;
}
.retro-mode .marquee-track span { padding: 6px 0; padding-right: 2em; }
@keyframes dale-marquee { to { transform: translateX(-50%); } }

/* The page sits on a sheet of plywood-colored paper nailed to the camo */
.retro-mode .dale-page {
    background: #f6ecd0;
    color: #1b1b12;
    margin: 24px auto;
    width: calc(100% - 32px);
    border: 6px ridge #8b5a2b;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
    padding: 24px 24px 32px;
}
.retro-mode .dale-page a { color: #0000ee; }
.retro-mode .dale-page a:visited { color: #551a8b; }

/* Stock-car door number */
.retro-mode .door-number {
    flex: none;
    padding: 0;
    font: inherit;
    width: 128px;
    height: 128px;
    border-radius: 18px;
    background: #fff;
    border: 5px solid #c8102e;
    box-shadow: 0 0 0 4px #0b2a6b, 4px 6px 0 4px rgba(0, 0, 0, 0.35);
    display: grid;
    place-items: center;
    transform: rotate(-4deg);
}
.retro-mode .door-number span {
    font-family: Impact, "Arial Black", sans-serif;
    font-size: 84px;
    font-style: italic;
    line-height: 1;
    color: #c8102e;
    -webkit-text-stroke: 3px #0b2a6b;
    letter-spacing: -2px;
}

.retro-mode .dale-title {
    font-family: Impact, "Arial Black", sans-serif;
    font-size: clamp(34px, 7vw, 60px);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #fff36b 0%, #ffb300 35%, #ff5a00 65%, #c8102e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 1.5px #2a0a00;
    filter: drop-shadow(3px 3px 0 #000);
}
.retro-mode .subtitle { color: #6b3a12; font-weight: bold; }

/* Checkered flag divider */
.retro-mode .checker {
    height: 20px;
    margin: 18px 0;
    background: repeating-conic-gradient(#000 0 25%, #fff 0 50%) 0 0 / 20px 20px;
    border: 2px solid #000;
}

.retro-mode .dale-page h2 {
    font-family: Impact, "Arial Black", sans-serif;
    font-weight: normal;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(90deg, #c8102e, #0b2a6b);
    padding: 6px 12px;
    margin: 36px 0 12px;
    box-shadow: 3px 3px 0 #000;
    transform: skew(-6deg);
}
.retro-mode .lede::first-letter {
    float: left;
    font-family: Impact, "Arial Black", sans-serif;
    font-size: 3.2em;
    line-height: 0.85;
    padding: 4px 8px 0 0;
    color: #c8102e;
}

.retro-mode .fact-list { list-style: none; padding-left: 0; }
.retro-mode .fact-list li { position: relative; padding-left: 30px; }
.retro-mode .fact-list li::before {
    content: "🏁";
    position: absolute;
    left: 0;
    top: 0;
}

/* The one box that tells the truth gets a notarized look */
.retro-mode .true-facts {
    background: #fff;
    border: 3px double #0b2a6b;
    padding: 12px 18px;
    margin: 24px 0;
    font-family: Georgia, "Times New Roman", serif;
}
.retro-mode .true-facts h2 {
    background: none;
    box-shadow: none;
    transform: none;
    color: #0b2a6b;
    padding: 0;
    margin: 4px 0;
    font-size: 1.4rem;
}
.true-facts-note { margin: 0 0 6px; font-style: italic; font-size: 0.9em; }

.retro-mode .fact-o-matic {
    background: #222;
    color: #eee;
    border: 4px outset #888;
    border-radius: 6px;
    padding: 14px 18px 16px;
    font-family: "Courier New", monospace;
}
.retro-mode .fact-o-matic h3 {
    margin: 0;
    font-family: Impact, "Arial Black", sans-serif;
    font-weight: normal;
    font-size: 1.6rem;
    letter-spacing: 2px;
    color: #ffde00;
}
.retro-mode .fom-sub,
.retro-mode .fom-note { font-size: 0.8em; color: #aaa; margin: 4px 0 12px; }
.retro-mode .fom-note { margin: 10px 0 0; }
.retro-mode .fom-screen {
    background: #061a06;
    color: #39ff88;
    border: 3px inset #555;
    padding: 10px 12px;
    margin: 0 0 12px;
    text-shadow: 0 0 6px rgba(57, 255, 136, 0.6);
}
.retro-mode .dale-button {
    background: #c0c0c0;
    color: #000;
    border: 3px outset #fff;
    padding: 6px 16px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}
.retro-mode .dale-button:active { border-style: inset; }
.retro-mode .dale-button.rev { background: #c8102e; color: #fff; border-color: #ff6b6b; }

.retro-mode .glossary dt {
    font-family: Impact, "Arial Black", sans-serif;
    font-weight: normal;
    font-size: 1.15rem;
    color: #0b2a6b;
}

.retro-mode .checklist {
    background: #fffbea;
    background-image: repeating-linear-gradient(#fffbea 0 27px, #a9c4e8 27px 28px);
    border-left: 3px solid #e88;
    padding: 6px 12px 6px 18px;
}

.retro-mode .graveyard {
    background: #2e3a1f;
    color: #e6ecd4;
    padding: 12px 18px;
    border: 4px solid #1a2212;
}
.retro-mode .construction {
    margin: 12px 0 4px;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    color: #000;
    background: repeating-linear-gradient(-45deg, #ffde00 0 16px, #111 16px 32px);
}
.retro-mode .construction span {
    display: inline-block;
    background: #ffde00;
    border: 2px solid #111;
    padding: 4px 10px;
}

.retro-mode .legacy {
    border-left: 6px solid #c8102e;
    padding-left: 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
}

.retro-mode .guestbook .entries li {
    background: #fff;
    border: 2px dashed #8b5a2b;
    padding: 8px 12px;
}
.retro-mode .guestbook cite { color: #6b3a12; }

.retro-mode .badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 32px 0 16px;
}
.retro-mode .badge {
    display: inline-block;
    width: 108px;
    padding: 6px 4px;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
    border: 2px outset #ddd;
    background: #000;
    color: #fff;
}
.retro-mode .badge small { font-weight: normal; }
.retro-mode .b-hot { background: linear-gradient(#ff5a00, #c8102e); }
.retro-mode .b-mamaw { background: linear-gradient(#5aa02c, #2e6a12); }
.retro-mode .b-chair { background: linear-gradient(#3d6fd1, #0b2a6b); }
.retro-mode .b-made { background: linear-gradient(#8b5a2b, #4a2a10); }

.retro-mode .counter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}
.retro-mode .odometer {
    font-family: "Courier New", monospace;
    font-weight: bold;
    font-size: 1.2em;
    letter-spacing: 3px;
    background: #000;
    color: #ff3b30;
    padding: 2px 8px;
    border: 2px inset #666;
}
.retro-mode .webring {
    background: #000;
    color: #ffde00;
    padding: 8px;
    border: 2px solid #ffde00;
    font-weight: bold;
}
.retro-mode .webring a,
.retro-mode .webring a:visited { color: #7fd4ff; }
.retro-mode .disclaimer { color: #5a4a30; }

/* Revving shakes the door number */
.retro-mode.revving .door-number { animation: dale-shake 0.08s linear infinite; }
@keyframes dale-shake {
    0% { transform: rotate(-4deg) translate(0, 0); }
    25% { transform: rotate(-5deg) translate(1px, -1px); }
    50% { transform: rotate(-3deg) translate(-1px, 1px); }
    75% { transform: rotate(-4deg) translate(1px, 1px); }
}

.retro-mode .door-number:hover { transform: rotate(-4deg) scale(1.06); }
.retro-mode .door-number:focus-visible { outline: 4px dashed #ffde00; outline-offset: 6px; }

/* The 88 surprise: a photo that spins out of the door number and takes over the screen */
.surprise {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.6s;
    cursor: zoom-out;
}
.surprise.open { background: rgba(0, 0, 0, 0.85); }
.surprise img {
    display: block;
    width: min(100vw, 100vh * 896 / 1200);
    height: auto;
    max-height: 100vh;
    box-shadow: 0 0 0 6px #fff, 0 0 0 12px #46c93a, 0 0 0 16px #d42a2f, 0 20px 60px rgba(0, 0, 0, 0.6);
    will-change: transform;
}
.surprise.wiggle img { animation: dale-wiggle 0.9s ease-in-out infinite; }
@keyframes dale-wiggle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    20% { transform: rotate(-3deg) scale(1.02); }
    40% { transform: rotate(2.5deg) scale(0.99); }
    60% { transform: rotate(-1.5deg) scale(1.015); }
    80% { transform: rotate(1deg) scale(1); }
}

@media screen and (max-width: 600px) {
    .retro-mode .dale-page { width: calc(100% - 16px); padding: 16px 14px 24px; border-width: 4px; }
    .retro-mode .door-number { width: 84px; height: 84px; border-radius: 12px; }
    .retro-mode .door-number span { font-size: 54px; -webkit-text-stroke-width: 2px; }
    .dale-hero { gap: 14px; }
}

/* Reduced motion: the global rule stops the marquee, so let its text wrap instead */
@media (prefers-reduced-motion: reduce) {
    .retro-mode .marquee { white-space: normal; text-align: center; }
    .retro-mode .marquee-track span + span { display: none; }
}

/* ==========================================================
   Modern mode: calm and editorial
   ========================================================== */
body.dale:not(.retro-mode) .shrine-only { display: none; }
body.dale:not(.retro-mode) .dale-page {
    max-width: 680px;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
    padding-top: 48px;
}
body.dale:not(.retro-mode) .dale-title {
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
body.dale:not(.retro-mode) .subtitle { color: var(--muted); margin-bottom: 2rem; }
body.dale:not(.retro-mode) .dale-page h2 {
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
    padding-bottom: 0.4rem;
    margin-top: 2.5rem;
}
body.dale:not(.retro-mode) .true-facts,
body.dale:not(.retro-mode) .fact-o-matic,
body.dale:not(.retro-mode) .graveyard {
    background: var(--surface);
    border-radius: 8px;
    padding: 4px 20px 12px;
    margin: 24px 0;
}
body.dale:not(.retro-mode) .true-facts h2 { border: 0; margin-top: 1rem; }
body.dale:not(.retro-mode) .fact-o-matic h3 { margin-top: 16px; }
body.dale:not(.retro-mode) .fom-sub,
body.dale:not(.retro-mode) .fom-note,
body.dale:not(.retro-mode) .true-facts-note,
body.dale:not(.retro-mode) .entries cite,
body.dale:not(.retro-mode) .disclaimer { color: var(--muted); }
body.dale:not(.retro-mode) .fom-screen { font-size: 1.1rem; font-style: italic; }
body.dale:not(.retro-mode) .dale-button {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 8px 16px;
    font-family: Arial, Helvetica, sans-serif;
}
body.dale:not(.retro-mode) .dale-button:hover { background: var(--accent-dark); }
body.dale:not(.retro-mode) .legacy {
    border-left: 3px solid var(--muted);
    padding-left: 1.2rem;
    font-size: 1.05rem;
}
body.dale:not(.retro-mode) .entries li {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
}
body.dale:not(.retro-mode) .disclaimer {
    border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
    padding-top: 1rem;
}

/* ==========================================================
   Cartoon Dale cursor, this page only (both looks).
   The click point is the tip of his boot. 64px, with a 128px version for sharp screens.
   ========================================================== */
body.dale,
body.dale * {
    cursor: url("/dale/cursor-64.png") 2 47, auto;
    cursor: -webkit-image-set(url("/dale/cursor-64.png") 1x, url("/dale/cursor-128.png") 2x) 2 47, auto;
    cursor: image-set(url("/dale/cursor-64.png") 1x, url("/dale/cursor-128.png") 2x) 2 47, auto;
}
/* Keep the normal text cursor where you type */
body.dale input[type="text"],
body.dale textarea { cursor: text; }
