/**
 * Sticker Book page (page-templates/page-sticker-book.php) and the
 * Episode Stickers admin previews. Sticker art itself comes from
 * components/patron-stickers.css.
 */

/* Full width: let the page run edge to edge like an open album. */
body.page-template-page-sticker-book .site-inner {
    max-width: none;
    padding: 0;
}
body.page-template-page-sticker-book .content {
    width: 100%;
}

.sticker-book-page {
    min-height: 100vh;
    padding: 140px 5vw 90px; /* clears the 88px fixed nav */
    color: #e0e0e0;
    position: relative;
    /* sticker backing paper: dark sheet with a faint dot grid */
    background:
        radial-gradient(circle, rgba(77, 164, 75, .16) 1.5px, transparent 2px) 0 0 / 28px 28px,
        #1a1a1a;
    clip-path: polygon(
        0% 0%, 100% 0%,
        98% 5%, 99% 10%, 97% 15%, 100% 20%, 98% 25%, 99% 30%, 97% 35%, 100% 40%, 98% 45%, 99% 50%, 97% 55%, 100% 60%, 98% 65%, 99% 70%, 97% 75%, 100% 80%, 98% 85%, 99% 90%, 97% 95%,
        100% 100%, 0% 100%,
        2% 95%, 1% 90%, 3% 85%, 0% 80%, 2% 75%, 1% 70%, 3% 65%, 0% 60%, 2% 55%, 1% 50%, 3% 45%, 0% 40%, 2% 35%, 1% 30%, 3% 25%, 0% 20%, 2% 15%, 1% 10%, 3% 5%
    );
}
.sticker-book-page::before,
.sticker-book-page::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 20px;
    background: #4da44b;
    z-index: 1;
}
.sticker-book-page::before {
    top: 0;
    clip-path: polygon(0% 0%, 10% 80%, 20% 60%, 30% 90%, 40% 50%, 50% 85%, 60% 40%, 70% 75%, 80% 55%, 90% 80%, 100% 0%, 100% 0%, 0% 0%);
}
.sticker-book-page::after {
    bottom: 0;
    clip-path: polygon(0% 100%, 10% 20%, 20% 40%, 30% 10%, 40% 50%, 50% 15%, 60% 60%, 70% 25%, 80% 45%, 90% 20%, 100% 100%, 100% 100%, 0% 100%);
}
.sticker-book-page > * {
    position: relative;
    z-index: 2;
}

/* header */
.sticker-book__head {
    max-width: 900px;
    margin: 0 auto 10px;
    text-align: center;
}
.sticker-book__title {
    margin: 0 0 6px;
    font-family: 'Luckiest Guy', 'Bangers', sans-serif;
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 1;
    letter-spacing: .03em;
    color: #ffc107;
    -webkit-text-stroke: 3px #111;
    paint-order: stroke fill;
    text-shadow: 6px 6px 0 #4da44b;
    transform: rotate(-2deg);
}
.sticker-book__intro,
.sticker-book__login,
.sticker-book__empty {
    color: #b0b0b0;
    font-size: 1.15rem;
}
.sticker-book__empty {
    text-align: center;
}
.sticker-book__login a:not(.eps-redeem__btn) {
    color: #4da44b;
}

.sticker-book__notice {
    display: inline-block;
    padding: 12px 18px;
    border-left: 5px solid;
    background: #2d2d2d;
}
.sticker-book__notice--ok  { border-color: #4da44b; }
.sticker-book__notice--err { border-color: #e53935; }

/* collected meter */
.sticker-book__progress {
    max-width: 420px;
    margin: 18px auto 0;
}
.sticker-book__count {
    display: block;
    margin-bottom: 6px;
    color: #b0b0b0;
}
.sticker-book__count strong {
    color: #4da44b;
    font-size: 1.4em;
}
.sticker-book__meter {
    appearance: none;
    display: block;
    width: 100%;
    height: 14px;
    border: 0;
    background: #2d2d2d;
}
.sticker-book__meter::-webkit-progress-bar { background: #2d2d2d; }
.sticker-book__meter::-webkit-progress-value { background: #4da44b; }
.sticker-book__meter::-moz-progress-bar { background: #4da44b; }

/* redeem form: a torn-off coupon */
.eps-redeem {
    display: inline-block;
    margin: 22px 0 4px;
    padding: 18px 22px;
    border: 3px dashed #ffc107;
    background: #232323;
    transform: rotate(1deg);
}
.eps-redeem__label {
    display: block;
    margin-bottom: 8px;
    font-family: 'Luckiest Guy', 'Bangers', sans-serif;
    font-size: 1.3rem;
    letter-spacing: .04em;
    color: #ffc107;
}
.eps-redeem__note {
    margin: 8px 0 0;
    font-size: .85rem;
    font-style: italic;
    color: #9a9a9a;
}
.eps-redeem__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.eps-redeem__input {
    flex: 1 1 220px;
    max-width: 360px;
    padding: 12px 14px;
    background: #111;
    color: #fff;
    border: 2px solid #4da44b;
    font-size: 1.3rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    text-align: center;
}
.eps-redeem__btn {
    display: inline-block;
    padding: 12px 22px;
    background: #4da44b;
    color: #111;
    border: 0;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s;
}
.eps-redeem__btn:hover,
.eps-redeem__btn:focus {
    background: #ffc107;
    color: #111;
    transform: rotate(-3deg) scale(1.05);
}

/* the album: stickers slapped straight onto the page, each at its own angle */
.sticker-book__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 70px 40px;
    margin: 50px 0 0;
    padding: 0;
    list-style: none;
}
.sticker-book__slot {
    --tilt: -4deg;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}
.sticker-book__slot:nth-child(4n+2) { --tilt: 3deg; }
.sticker-book__slot:nth-child(4n+3) { --tilt: -2deg; }
.sticker-book__slot:nth-child(4n+4) { --tilt: 5deg; }
.sticker-book__art {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    transform: rotate(var(--tilt));
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .6));
    transition: transform .2s ease-out;
}
.sticker-book__slot.is-owned .sticker-book__art:hover {
    transform: rotate(0deg) scale(1.08);
}
/* not found yet: a dark silhouette in a dashed "goes here" outline */
.sticker-book__slot.is-locked .sticker-book__art {
    padding: 14px;
    outline: 3px dashed rgba(77, 164, 75, .45);
    outline-offset: 4px;
}
.sticker-book__slot.is-locked .sticker-book__art > * {
    filter: brightness(0) opacity(.55);
}
.sticker-book__when {
    font-size: .85rem;
    color: #8a8a8a;
}
.sticker-book__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}
.sticker-book__link {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.sticker-book__link:hover,
.sticker-book__link:focus {
    color: #4da44b;
}
.sticker-book__link--yt {
    color: #ff6b6b;
}

/* just redeemed: slap it on */
.sticker-book__slot.is-new .sticker-book__art {
    animation: eps-slap .55s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes eps-slap {
    0%   { transform: rotate(-25deg) scale(2.4); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: rotate(var(--tilt)) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .sticker-book__slot.is-new .sticker-book__art { animation: none; }
}

/* The renderer sets the die-cut size inline for game pages; tiles here are
   narrower, so size it down the way .ranking-sticker-zone does. */
/* Episode stickers are locked (.sticker-lock, components/patron-stickers.css):
   each place only picks a scale, so the shape never changes. */
.sticker-book__art .sticker-lock          { --sticker-scale: .9; }
.eps-admin-preview .sticker-lock          { --sticker-scale: .55; }
.eps-admin-preview--live .sticker-lock    { --sticker-scale: .85; }
.home-sticker-callout__sticker .sticker-lock { --sticker-scale: .8; }
.eps-admin-preview {
    width: 280px;
}
/* the sticker's white die-cut needs a dark page behind it to read */
.eps-admin-preview--live {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 220px;
    padding: 30px 20px;
    background: #1a1a1a;
}
.eps-admin-preview__err {
    color: #ffc107;
}
/* maker: fields on the left, the preview stays in view on the right */
.eps-maker {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}
.eps-maker .form-table {
    flex: 1 1 520px;
    margin-top: 0;
}
.eps-maker__preview {
    flex: 1 1 380px;
    position: sticky;
    top: 40px;
}
.eps-maker__preview-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

/* Homepage strip (wakasm_eps_render_home_callout). The arrow and label sit
   in the flow here instead of the component's absolute placement. */
.home-sticker-callout {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}
.home-sticker-callout__link {
    text-decoration: none;
}
.home-sticker-callout .wakasm-sticker-callout {
    gap: 6px;
}
.home-sticker-callout__sticker {
    transform: rotate(-4deg);
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .6));
    transition: transform .2s ease-out;
}
.home-sticker-callout__link:hover .home-sticker-callout__sticker,
.home-sticker-callout__link:focus .home-sticker-callout__sticker {
    transform: rotate(0deg) scale(1.06);
}
.home-sticker-callout .wakasm-sticker-callout__arrow,
.home-sticker-callout .wakasm-sticker-callout__label {
    position: static;
}
.home-sticker-callout .wakasm-sticker-callout__arrow {
    flex: none;
    margin-top: 40px;
}
.home-sticker-callout .wakasm-sticker-callout__label {
    font-size: 30px;
    white-space: normal;
    max-width: 300px;
}
.home-sticker-callout .wakasm-sticker-callout__label em {
    color: #4da44b;
    font-size: 22px;
}

@media (max-width: 850px) {
    .home-sticker-callout .wakasm-sticker-callout {
        flex-direction: column;
    }
    .home-sticker-callout .wakasm-sticker-callout__arrow {
        display: none;
    }
    .home-sticker-callout .wakasm-sticker-callout__label {
        text-align: center;
    }
}

@media (max-width: 600px) {
    .home-sticker-callout__sticker .sticker-lock,
    .sticker-book__art .sticker-lock {
        --sticker-scale: .55;
    }
    .sticker-book-page {
        padding: 50px 16px 70px;
    }
    .sticker-book__grid {
        grid-template-columns: 1fr;
    }
    .eps-redeem {
        display: block;
        transform: none;
    }
}
