:root {
    color-scheme: light;
    font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif;
    color: #1e293b;
    background: #fef08a;
    background-image: radial-gradient(#fde047 2px, transparent 2px), radial-gradient(#fde047 2px, transparent 2px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
}

body { margin: 0; }
main { max-width: 64rem; margin: auto; padding: clamp(1rem, 5vw, 3rem); }
h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0; letter-spacing: -.04em; line-height: 1.1; }
h2 { font-size: 1.1rem; margin: 0; }
a { color: inherit; }
main > h1 { margin-top: 1rem; }

.hub-home { min-height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; gap: 1.75rem; }
.hub-header, .card, .editor {
    box-sizing: border-box;
    border: 3px solid #1e293b;
    border-radius: 1.5rem;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 6px 6px 0 #1e293b;
}
.hub-header { display: flex; align-items: center; gap: 1.25rem; padding: clamp(1.25rem, 4vw, 2.5rem); background: #fffdf0; }
.hub-header p { margin: .3rem 0 0; }
.mascot, .card-icon {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    flex-shrink: 0;
    border: 2px solid #1e293b;
    border-radius: .9rem;
    background: #f9a8d4;
    box-shadow: 3px 3px 0 #1e293b;
    font-size: 1.65rem;
}
.mascot { transform: rotate(-5deg); }
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: 1.25rem;
    padding: 0;
    margin: 0;
    list-style: none;
}
.card { display: flex; flex-direction: column; gap: .5rem; height: 100%; text-decoration: none; background: var(--card-color, #fff); }
.card-clicker { --card-color: #f3e8ff; }
.card-pomodoro { --card-color: #e0f2fe; }
.card-photo { --card-color: #ffe4e6; }
.card-starphoto { --card-color: #fef3c7; }
.card-stickrworld { --card-color: #d1fae5; }
.card-art {
    position: relative;
    display: grid;
    place-items: center;
    height: 8rem;
    overflow: hidden;
    border: 2px solid #1e293b;
    border-radius: .9rem;
    background: repeating-linear-gradient(-45deg, #fff8 0 12px, transparent 12px 24px);
}
.card-art img { display: block; width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.card-clicker .card-art img[src^="/clicker/"],
.card-pomodoro .card-art img[src^="/pomodoro/"] { object-fit: contain; padding: .6rem; box-sizing: border-box; image-rendering: pixelated; }
.card-icon { position: absolute; left: .5rem; bottom: .5rem; background: #fff; }
.card strong { font-size: 1.35rem; }
.card-description { color: #475569; overflow-wrap: anywhere; }
.card strong { overflow-wrap: anywhere; }
.card-action { align-self: start; margin-top: auto; padding: .4rem .8rem; border: 2px solid; border-radius: .65rem; background: #fff; font-weight: 700; }
.card:hover .card-action, .card:focus-visible .card-action { background: #1e293b; color: #fff; border-color: #1e293b; }
.hub-footer { margin-top: auto; padding-top: .5rem; text-align: center; }

.hub-footer a, button {
    display: inline-block;
    padding: .5rem 1rem;
    border: 2px solid #1e293b;
    border-radius: .75rem;
    background: #fff;
    color: inherit;
    box-shadow: 3px 3px 0 #1e293b;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}
.hub-footer a:hover, button:hover { background: #fbcfe8; }
.editor { display: grid; gap: .8rem; align-content: start; }
.editor label { display: grid; gap: .3rem; }
.editor .check { display: flex; align-items: center; }
input:not([type="checkbox"]), .editor textarea { box-sizing: border-box; width: 100%; padding: .5rem; border: 1px solid #64748b; border-radius: .35rem; font: inherit; }
button { justify-self: start; cursor: pointer; }
:focus-visible { outline: 3px solid #7e22ce; outline-offset: 4px; }

@media (prefers-reduced-motion: no-preference) {
    .card, .hub-footer a { transition: transform .2s ease, box-shadow .2s ease; }
    .card:hover, .hub-footer a:hover { transform: translateY(-3px); box-shadow: 7px 8px 0 #1e293b; }
}

.editor textarea { resize: vertical; }
.editor-image { width: 100%; height: 8rem; object-fit: contain; }
.page-image { display: block; max-width: 100%; max-height: 34rem; object-fit: contain; }
.page-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.bobo-landing { position: relative; z-index: 1; }
.hub-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.main-site-link {
    padding: .5rem .85rem;
    border: 2px solid #1e293b;
    border-radius: .75rem;
    background: #fffdf0;
    box-shadow: 3px 3px 0 #1e293b;
    font-weight: 700;
    text-decoration: none;
}
.main-site-link:hover { background: #fbcfe8; }
.hub-sound { white-space: nowrap; }
.hub-sound[hidden] { display: none; }
.hub-sound[aria-pressed="true"] { background: #f9a8d4; }

.falling-stars {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.falling-stars span {
    position: absolute;
    top: -1rem;
    left: var(--start);
    width: var(--size, 1rem);
    height: var(--size, 1rem);
    animation: falling-star var(--duration) linear var(--delay) infinite;
}
.falling-stars span::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #9857bc;
    clip-path: polygon(50% 0%, 62% 34%, 100% 36%, 71% 59%, 80% 96%, 50% 74%, 20% 96%, 29% 59%, 0% 36%, 38% 34%);
}
.falling-stars span::after {
    content: "";
    position: absolute;
    bottom: 75%;
    left: calc(50% - 1px);
    width: 2px;
    height: var(--trail, 2.5rem);
    background: linear-gradient(transparent, #b277c27a);
    transform: rotate(var(--trail-angle, -7deg));
    transform-origin: bottom;
}
.falling-stars span:nth-child(1) { --start: 1%; --duration: 24s; --delay: -5s; }
.falling-stars span:nth-child(2) { --start: 15%; --duration: 31s; --delay: -23s; --size: .55rem; --trail: 1.7rem; }
.falling-stars span:nth-child(3) { --start: 26%; --duration: 20s; --delay: -13s; }
.falling-stars span:nth-child(4) { --start: 39%; --duration: 28s; --delay: -3s; --size: .65rem; }
.falling-stars span:nth-child(5) { --start: 48%; --duration: 23s; --delay: -19s; --trail: 3.2rem; }
.falling-stars span:nth-child(6) { --start: 59%; --duration: 33s; --delay: -17s; --size: .6rem; }
.falling-stars span:nth-child(7) { --start: 69%; --duration: 19s; --delay: -8s; --trail: 3rem; }
.falling-stars span:nth-child(8) { --start: 79%; --duration: 29s; --delay: -25s; --size: .55rem; }
.falling-stars span:nth-child(9) { --start: 94%; --drift: -6vw; --trail-angle: 5deg; --duration: 25s; --delay: -11s; }

@keyframes falling-star {
    0% { transform: translate(0, -3rem); opacity: 0; }
    10%, 82% { opacity: .9; }
    100% { transform: translate(var(--drift, 10vw), calc(100vh + 5rem)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .falling-stars { display: none; }
}