:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --paper: #fffdf7;
    --paper-edge: #e8dfcf;
    --text: #172033;
    --muted: #667085;
    --line: #d8dee9;
    --accent: #1f7a8c;
    --accent-dark: #14515d;
    --danger: #b42318;
    --success: #067647;
}

@font-face {
    font-family: "Antonio";
    src: url("../uploads/fonts/Antonio-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--accent);
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button-link:hover {
    background: var(--accent-dark);
}

.button-link.muted {
    background: #e8eef5;
    color: var(--text);
}

.dashboard-action-button {
    width: 100%;
}

.dashboard-create-section {
    display: grid;
    align-content: start;
    gap: 12px;
}

.dashboard-action-button-green {
    background: var(--success);
}

.dashboard-action-button-green:hover {
    background: #045c38;
}

.dashboard-received-section {
    display: grid;
    gap: 14px;
}

.received-sticker-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.received-sticker-card {
    display: grid;
    flex: 0 0 118px;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.received-sticker-card img {
    display: block;
    width: 100%;
    aspect-ratio: 433 / 564;
    object-fit: contain;
}

.received-sticker-card strong,
.received-sticker-card span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.received-sticker-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.duplicates-page {
    display: grid;
    gap: 16px;
}

.duplicates-toolbar {
    display: grid;
    gap: 12px;
    margin: 0;
}

.duplicates-send-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.duplicates-send-row label,
.duplicates-filter {
    font-weight: 700;
}

.duplicates-send-row select {
    min-height: 40px;
    min-width: min(100%, 240px);
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.duplicates-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
}

.duplicates-filter input {
    flex: 0 0 auto;
}

.duplicates-select-page {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
    font-weight: 700;
}

.special-packs-page {
    display: grid;
    gap: 18px;
}

.special-packs-page .section-header p {
    margin-bottom: 0;
    color: var(--muted);
    font-weight: 700;
}

.special-riddle-list {
    display: grid;
    gap: 12px;
}

.special-riddle-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.special-riddle-row.is-open {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: center;
}

.special-riddle-question {
    color: var(--text);
    font-size: 16px;
}

.special-riddle-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.special-riddle-text label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.special-riddle-text strong,
.special-riddle-text span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.special-riddle-open-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: #dcfae6;
    color: var(--success);
    font-weight: 800;
}

.special-riddle-open-label span {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success);
    color: #ffffff;
    line-height: 1;
}

.special-riddle-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 800;
}

.duplicate-sticker-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.duplicate-sticker-card {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.duplicate-sticker-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
}

.duplicate-sticker-card img {
    display: block;
    width: 100%;
    aspect-ratio: 433 / 564;
    object-fit: contain;
}

.duplicate-sticker-card strong,
.duplicate-sticker-card span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duplicate-sticker-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.pagination a {
    display: grid;
    place-items: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    background: #e8eef5;
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}

.pagination a.is-active {
    background: var(--accent);
    color: #ffffff;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px clamp(16px, 5vw, 48px);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.auto-reveal-header {
    padding-top: 12px;
}

.header-reveal-zone {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
    height: 24px;
}

.auto-reveal-header .site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 21;
    transform: translateY(calc(-100% + 8px));
    transition: transform 180ms ease;
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.14);
}

.header-reveal-zone:hover + .site-header,
.auto-reveal-header .site-header:hover,
.auto-reveal-header .site-header:focus-within {
    transform: translateY(0);
}

.auto-reveal-header .container {
    margin-top: 0;
    margin-bottom: 8px;
}

.auto-reveal-header .album-show-layout {
    width: 100vw;
    margin-bottom: 8px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
}

.brand img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.site-header nav,
.site-header form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

.panel {
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.panel.narrow {
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.auth-brand-lockup {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin: 0 auto 18px;
    color: var(--text);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0;
    text-align: center;
}

.auth-brand-lockup img {
    display: block;
    width: 92px;
    height: 92px;
    object-fit: contain;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid.two {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.admin-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.admin-list span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.admin-create-form {
    max-width: 520px;
}

.admin-edit-form {
    display: grid;
    gap: 22px;
}

.admin-edit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.admin-edit-header h1 {
    margin-bottom: 4px;
}

.admin-form-grid,
.admin-upload-grid {
    display: grid;
    gap: 16px;
}

.admin-form-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    color: var(--text);
}

.checkbox-label input {
    width: auto;
}

.admin-upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-upload-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.image-upload-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px dashed var(--line);
    border-radius: 6px;
    background: transparent;
    object-fit: contain;
}

.image-upload-card img:not([src]),
.image-upload-card img[src=""] {
    background:
        linear-gradient(135deg, transparent 48%, rgba(31, 122, 140, 0.12) 49% 51%, transparent 52%),
        #ffffff;
}

.image-upload-card input[type="file"] {
    padding: 8px;
    background: #ffffff;
}

.card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stack {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
}

input[type="checkbox"] {
    width: auto;
    padding: 0;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.section-header,
.sticker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sticker-list {
    display: grid;
    gap: 12px;
}

.sticker-row {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.album-carousel {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
}

.album-carousel-stage {
    display: grid;
    justify-items: center;
    min-width: 0;
}

.album-carousel-item {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(100%, 420px);
}

.album-carousel-item[hidden] {
    display: none;
}

.album-cover-link {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.album-carousel-cover {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 825 / 870;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(23, 32, 51, 0.12);
    object-fit: cover;
}

.album-carousel-cover-placeholder {
    padding: 18px;
    color: var(--muted);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

.album-carousel-progress {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
}

.album-carousel-arrow {
    width: 44px;
    min-height: 64px;
    padding: 0;
    border-radius: 8px;
    background: #e8eef5;
    color: var(--text);
    font-size: 34px;
    line-height: 1;
}

.album-carousel-arrow:hover {
    background: var(--accent);
    color: #ffffff;
}

.newsstand-album {
    display: grid;
    gap: 16px;
}

.newsstand-album[hidden] {
    display: none;
}

.newsstand-packages-label {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.pack-list {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 2px 10px;
}

.album-pack {
    position: relative;
    flex: 0 0 clamp(92px, 12vw, 138px);
    aspect-ratio: 866 / 1128;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(23, 32, 51, 0.12);
    cursor: pointer;
    padding: 0;
}

.album-pack:disabled {
    cursor: wait;
    opacity: 0.7;
}

.album-pack-cover,
.album-pack-texture,
.album-pack-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.album-pack-cover {
    object-fit: cover;
}

.album-pack-texture {
    object-fit: cover;
    pointer-events: none;
}

.album-pack-placeholder {
    display: grid;
    place-items: center;
    padding: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

.pack-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 48px);
    background: rgba(5, 8, 15, 0.82);
}

.pack-overlay[hidden] {
    display: none;
}

.pack-overlay-panel {
    position: relative;
    display: grid;
    gap: 18px;
    width: min(1120px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    padding: clamp(20px, 3vw, 34px);
}

.pack-overlay-close {
    justify-self: center;
    min-width: 120px;
}

.pack-overlay-status {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
}

.pack-overlay-stickers {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    justify-content: center;
    gap: 16px;
}

.pack-overlay-sticker {
    display: grid;
    gap: 8px;
    min-width: 0;
    animation: pack-sticker-reveal 260ms ease both;
}

.pack-overlay-sticker.is-secret img {
    padding: 5px;
    border: 4px solid #f6c94c;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff6b8, #f6c94c 35%, #fff2a1 52%, #b87811);
    box-shadow:
        0 0 18px rgba(255, 215, 77, 0.95),
        0 0 42px rgba(255, 191, 0, 0.45);
}

.pack-overlay-sticker img {
    display: block;
    width: 100%;
    aspect-ratio: 433 / 564;
    object-fit: contain;
}

.pack-overlay-sticker strong {
    color: #ffffff;
    font-size: 14px;
    text-align: center;
}

.pack-overlay-new-label {
    justify-self: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #fff8b8, #ffffff, #ffe45c);
    color: #9a1f00;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
    box-shadow:
        0 0 12px rgba(255, 245, 100, 0.78),
        inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

@keyframes pack-sticker-reveal {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.album-show-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    align-items: start;
    gap: 20px;
    width: 100vw;
    margin: 0 0 24px calc(50% - 50vw);
}

.album-book-layout {
    width: 100%;
    min-width: 0;
}

.book-shell {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 18px;
    border-radius: 10px;
    background: #59616d;
    box-shadow:
        0 18px 45px rgba(23, 32, 51, 0.22),
        inset 0 0 0 1px rgba(255, 255, 255, 0.22);
    font-family: "Antonio", Arial, Helvetica, sans-serif;
    font-weight: 700;
}

.album-page-pair-index {
    position: sticky;
    top: 0;
    display: grid;
    gap: 10px;
    width: 100%;
    max-height: 100vh;
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.12);
}

.album-page-pair-index h2 {
    margin: 0;
    font-size: 18px;
}

.album-page-pair-index ol {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.album-page-pair-index a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
    text-decoration: none;
}

.album-page-pair-index a:hover,
.album-page-pair-index a.is-active {
    background: var(--accent);
    color: #ffffff;
}

.album-page-pair-index span {
    color: inherit;
    opacity: 0.72;
    font-size: 12px;
}

.book-shell::before,
.book-shell::after {
    content: "";
    position: absolute;
    inset: 14px 10px;
    border-radius: 8px;
    pointer-events: none;
}

.book-shell::before {
    transform: translate(0, 8px);
    background:
        linear-gradient(90deg, transparent 0 49%, rgba(55, 44, 31, 0.2) 49.5% 50.5%, transparent 51%),
        repeating-linear-gradient(0deg, var(--paper-edge), var(--paper-edge) 2px, #f8f1e5 2px, #f8f1e5 5px);
    box-shadow: 0 12px 20px rgba(23, 32, 51, 0.24);
    z-index: 0;
}

.book-shell::after {
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 30px rgba(23, 32, 51, 0.2);
    z-index: 3;
}

.book-spread {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    aspect-ratio: 1.9 / 1;
    min-height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: url("./page-backgrounds/Album-Background.png") center / cover no-repeat;
    perspective: 1800px;
}

.book-turn-zone {
    position: absolute;
    top: 18px;
    bottom: 18px;
    z-index: 4;
    width: clamp(32px, 3.5%, 56px);
    cursor: pointer;
}

.book-shell:not([data-previous-page-pair-url=""]) .book-turn-zone-left,
.book-shell:not([data-next-page-pair-url=""]) .book-turn-zone-right {
    cursor: pointer;
}

.book-shell[data-previous-page-pair-url=""] .book-turn-zone-left,
.book-shell[data-next-page-pair-url=""] .book-turn-zone-right {
    cursor: default;
    pointer-events: none;
}

.book-turn-zone-left {
    left: 0;
}

.book-turn-zone-right {
    right: 0;
}

.book-shell.is-turning .book-turn-zone {
    pointer-events: none;
}

/*
.book-shell.is-turning .book-content-layer {
    visibility: hidden;
}
*/

.book-spread::before {
    content: "";
    position: absolute;
    inset: 0 calc(50% - 16px) 0 calc(50% - 16px);
    background:
        linear-gradient(90deg, rgba(85, 65, 40, 0.22), rgba(255, 255, 255, 0.5) 48%, rgba(85, 65, 40, 0.28));
    box-shadow:
        -16px 0 26px rgba(61, 47, 30, 0.12),
        16px 0 26px rgba(61, 47, 30, 0.16);
    pointer-events: none;
    z-index: 4;
}

.book-surfaces,
.book-content-layer,
.book-animation-layer {
    position: absolute;
    inset: 0;
}

.book-surfaces,
.book-content-layer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.book-surfaces {
    z-index: 1;
}

.book-content-layer {
    z-index: 5;
    pointer-events: none;
}

.book-preview-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    pointer-events: none;
}

.book-animation-layer {
    z-index: 5;
    pointer-events: none;
    transform-style: preserve-3d;
}

.book-page {
    position: relative;
    min-width: 0;
    overflow: hidden;
    /* Legacy paper surface:
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)),
        repeating-linear-gradient(0deg, rgba(31, 122, 140, 0.035), rgba(31, 122, 140, 0.035) 1px, transparent 1px, transparent 36px),
        var(--paper);
    */
    background: transparent;
}

.book-page::before,
.book-page::after {
    content: "";
    position: absolute;
    bottom: 0;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 180ms ease,
        transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.book-page::before {
    width: clamp(150px, 15vw, 250px);
    height: clamp(150px, 15vw, 250px);
    filter: blur(5px);
    z-index: 2;
}

.book-page::after {
    width: clamp(142px, 14vw, 236px);
    height: clamp(142px, 14vw, 236px);
    z-index: 3;
    background: url("./masks/page-curl.svg") center / contain no-repeat;
}

.book-page-left {
    border-right: 1px solid rgba(95, 73, 46, 0.16);
    box-shadow: inset -22px 0 34px rgba(107, 83, 52, 0.12);
}

.book-page-left::after {
    left: 0;
    transform: translate(-10%, 10%) scaleX(-1) scale(0.86);
    transform-origin: 50% 100%;
    filter:
        drop-shadow(12px -12px 16px rgba(22, 18, 14, 0.3))
        drop-shadow(22px -4px 24px rgba(22, 18, 14, 0.16));
}

.book-page-right {
    box-shadow: inset 22px 0 34px rgba(107, 83, 52, 0.1);
}

.book-page-right::after {
    right: 0;
    transform: translate(10%, 10%) scale(0.86);
    transform-origin: 100% 100%;
    filter:
        drop-shadow(-12px -12px 16px rgba(22, 18, 14, 0.3))
        drop-shadow(-22px -4px 24px rgba(22, 18, 14, 0.16));
}

.book-shell:not([data-previous-page-pair-url=""]) .book-turn-zone-left:hover ~ .book-spread .book-page-left::after,
.book-shell:not([data-previous-page-pair-url=""]) .book-turn-zone-left:focus-visible ~ .book-spread .book-page-left::after {
    opacity: 1;
    transform: translate(0, 0) scaleX(-1) scale(1);
}

.book-shell:not([data-next-page-pair-url=""]) .book-turn-zone-right:hover ~ .book-spread .book-page-right::after,
.book-shell:not([data-next-page-pair-url=""]) .book-turn-zone-right:focus-visible ~ .book-spread .book-page-right::after {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.book-page-content::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: clamp(142px, 14vw, 236px);
    height: clamp(142px, 14vw, 236px);
    opacity: 0;
    pointer-events: none;
    z-index: 6;
    background: url("./masks/page-curl.svg") center / contain no-repeat;
    transition:
        opacity 180ms ease,
        transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.book-page-content-left::after {
    left: 0;
    transform: translate(-10%, 10%) scaleX(-1) scale(0.86);
    transform-origin: 50% 100%;
    filter:
        drop-shadow(12px -12px 16px rgba(22, 18, 14, 0.3))
        drop-shadow(22px -4px 24px rgba(22, 18, 14, 0.16));
}

.book-page-content-right::after {
    right: 0;
    transform: translate(10%, 10%) scale(0.86);
    transform-origin: 100% 100%;
    filter:
        drop-shadow(-12px -12px 16px rgba(22, 18, 14, 0.3))
        drop-shadow(-22px -4px 24px rgba(22, 18, 14, 0.16));
}

.book-shell:not([data-previous-page-pair-url=""]) .book-turn-zone-left:hover ~ .book-spread .book-page-content-left::after,
.book-shell:not([data-previous-page-pair-url=""]) .book-turn-zone-left:focus-visible ~ .book-spread .book-page-content-left::after {
    opacity: 1;
    transform: translate(0, 0) scaleX(-1) scale(1);
}

.book-shell:not([data-next-page-pair-url=""]) .book-turn-zone-right:hover ~ .book-spread .book-page-content-right::after,
.book-shell:not([data-next-page-pair-url=""]) .book-turn-zone-right:focus-visible ~ .book-spread .book-page-content-right::after {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.book-page-content {
    position: relative;
    display: grid;
    /* Legacy colored header row:
    grid-template-rows: clamp(42px, 10%, 68px) minmax(0, 1fr);
    */
    grid-template-rows: minmax(0, 1fr);
    gap: clamp(8px, 1vw, 14px);
    min-width: 0;
    overflow: hidden;
    padding: 0;
    /* Legacy generated page background:
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06)),
        var(--page-background-image);
    */
    background: transparent;
    background-position: center;
    background-size: cover;
}

.book-page-content-left {
    padding-right: 0;
    background-position: left center;
}

.book-page-content-right {
    padding-left: 0;
    background-position: right center;
}

.book-page-content-special {
    grid-template-rows: auto minmax(0, 1fr);
}

/*
.book-page-content-right::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06)),
        var(--page-background-image);
    background-position: left center;
    background-size: cover;
    transform: scaleX(-1);
}
*/

.page-background-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-position: center;
    background-size: cover;
}

.page-background-layer-1 {
    z-index: 3;
    background-image: var(--page-background-layer-1);
}

.page-background-layer-2 {
    z-index: 2;
    opacity: 0.5;
    background-image: var(--page-background-layer-2);
}

.page-background-texture {
    z-index: 4;
    background-image: url("../uploads/templates/Texture-Large.png");
}

/*
.page-color-waves {
    position: absolute;
    right: -8%;
    bottom: 0;
    left: -8%;
    z-index: 1;
    height: 26%;
    pointer-events: none;
    background: var(--page-color-1);
    clip-path: polygon(0 28%, 18% 18%, 36% 34%, 52% 24%, 70% 36%, 86% 20%, 100% 30%, 100% 100%, 0 100%);
}

.page-color-waves::before,
.page-color-waves::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    pointer-events: none;
}

.page-color-waves::before {
    bottom: 42%;
    height: 38%;
    background: var(--page-color-2);
    clip-path: polygon(0 52%, 18% 34%, 38% 55%, 55% 40%, 72% 58%, 88% 34%, 100% 48%, 100% 100%, 0 100%);
}

.page-color-waves::after {
    bottom: calc(55%);
    height: 28%;
    background: var(--page-color-3);
    clip-path: polygon(0 54%, 17% 40%, 34% 60%, 52% 45%, 72% 62%, 88% 42%, 100% 54%, 100% 100%, 0 100%);
}

.page-color-waves-right {
    transform: scaleX(-1);
}

 .page-paper-texture {
     position: absolute;
     inset: 0;
     z-index: 2;
     pointer-events: none;
     background: url("../uploads/templates/Texture-Large.png") center / cover no-repeat;
 }
*/

.album-page-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.3vw, 16px);
    min-height: 0;
    padding: clamp(5px, 0.7vw, 10px) clamp(10px, 1.4vw, 18px);
    color: var(--page-color-2);
}

.album-page-header h1 {
    margin: 0;
    color: inherit;
    font-size: clamp(20px, 2.6vw, 34px);
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.album-page-header-left {
    justify-content: flex-start;
}

.album-page-header-right {
    justify-content: flex-end;
    text-align: right;
}

.album-page-header-right h1 {
    font-size: clamp(13px, 1.25vw, 20px);
    letter-spacing: 0;
}

.album-flag-mark,
.album-logo-mark {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 3px solid var(--mark-border-color);
    background: var(--page-color-2);
    color: var(--page-color-1);
    font-size: clamp(11px, 1vw, 15px);
    font-weight: 800;
    overflow: hidden;
}

.album-flag-mark {
    position: relative;
    width: clamp(52px, 4.2vw, 60px);
    height: clamp(42px, 3.4vw, 48px);
    border-color: var(--page-color-3);
    border-radius: 999px;
    background: var(--page-color-2);
}

.album-logo-mark {
    width: clamp(34px, 4.3vw, 62px);
    height: clamp(34px, 4.3vw, 62px);
    aspect-ratio: 1;
    border-radius: 50%;
}

.album-flag-mark img,
.album-logo-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: inherit;
}

.album-flag-mark img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    min-width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    border-radius: 0;
    padding: 0;
    transform: translate(-50%, -50%);
}

.album-logo-mark img {
    padding: 0;
    object-fit: cover;
}

.sticker-slot-grid {
    --sticker-slot-gap: clamp(8px, 1.25vw, 18px);
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, auto);
    align-content: space-between;
    gap: var(--sticker-slot-gap);
    min-height: 0;
    padding: 0 clamp(14px, 2.3vw, 30px) clamp(48px, 5vw, 72px);
}

.book-page-content-left .sticker-slot-grid {
    padding-right: clamp(20px, 3.2vw, 44px);
}

.book-page-content-right .sticker-slot-grid {
    padding-left: clamp(20px, 3.2vw, 44px);
}

.sticker-slot-grid-stadiums {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.sticker-slot {
    display: grid;
    place-items: center;
    align-self: center;
    justify-self: center;
    width: 100%;
    aspect-ratio: 433 / 564;
    min-width: 0;
    min-height: 0;
    border: 1px solid rgba(23, 32, 51, 0.18);
    border-radius: 3px;
    background: #ffffff;
    box-shadow:
        0 8px 14px rgba(23, 32, 51, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.sticker-slot > span,
.special-sticker-frame > span {
    color: var(--slot-number-color);
    font-size: clamp(18px, 2.6vw, 36px);
    font-weight: 800;
}

.sticker-slot-horizontal {
    grid-column: span 2;
    align-self: end;
    justify-self: start;
    width: calc(((100% - var(--sticker-slot-gap)) / 2) * 564 / 433);
    aspect-ratio: 564 / 433;
}

.sticker-slot-grid-stadiums .sticker-slot-horizontal,
.sticker-slot-grid-stadiums .sticker-slot-stadiums-badge,
.sticker-slot-grid-stadiums .sticker-slot-spacer {
    grid-column: span 2;
}

.sticker-slot-grid-stadiums .sticker-slot-horizontal {
    width: 100%;
}

.sticker-slot-grid-stadiums .sticker-slot-stadiums-badge {
    width: 75%;
    justify-self: center;
}

.sticker-slot-grid-special .sticker-slot-horizontal {
    place-items: stretch;
    width: 100%;
    aspect-ratio: auto;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.sticker-slot-grid-special {
    z-index: 5;
}

.special-sticker-entry {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
}

.special-sticker-frame {
    display: grid;
    place-items: center;
    width: calc(((100% - var(--sticker-slot-gap)) / 2) * 564 / 433);
    aspect-ratio: 564 / 433;
    min-width: 0;
    min-height: 0;
    border: 1px solid rgba(23, 32, 51, 0.18);
    border-radius: 3px;
    background: #ffffff;
    box-shadow:
        0 8px 14px rgba(23, 32, 51, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.special-sticker-frame-trigger {
    cursor: pointer;
    pointer-events: auto;
}

.special-sticker-frame-trigger:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.special-sticker-note {
    position: absolute;
    inset:
        0
        0
        0
        calc((((100% - var(--sticker-slot-gap)) / 2) * 564 / 433) + clamp(4px, 0.5vw, 8px));
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-self: stretch;
    min-width: 0;
    min-height: 0;
    padding: clamp(4px, 0.5vw, 8px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 84%, var(--page-color-1));
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 400;
    pointer-events: auto;
    z-index: 5;
    text-align: left;
}

.special-sticker-note:hover,
.special-sticker-note:focus-visible {
    background: rgba(255, 255, 255, 0.96);
    border-color: var(--page-color-1);
}

.special-sticker-note-locked {
    display: grid;
    place-items: center;
    cursor: default;
    pointer-events: none;
    font-size: clamp(24px, 3vw, 42px);
    text-align: center;
}

.special-sticker-note strong {
    display: block;
    flex: 0 0 auto;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.15;
}

.sticker-slot .special-sticker-preview {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: var(--text);
    white-space: pre-wrap;
    font-weight: 400;
    font-size: 10px;
    line-height: 1.25;
}

.sticker-slot .special-sticker-note-open {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    justify-self: end;
    align-self: flex-end;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.special-sticker-overlay[hidden] {
    display: none;
}

.special-sticker-overlay {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(16px, 3vw, 44px);
    background: rgba(13, 20, 31, 0.62);
}

.special-sticker-dialog {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(18px, 3vw, 30px);
    width: min(980px, 100%);
    max-height: min(78vh, 720px);
    overflow: auto;
    padding: clamp(18px, 2.2vw, 30px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 20px 70px rgba(13, 20, 31, 0.36);
}

.special-sticker-dialog-media {
    display: grid;
    place-items: center;
    min-width: 0;
}

.special-sticker-dialog-media img {
    display: block;
    width: min(100%, 360px);
    aspect-ratio: 433 / 564;
    object-fit: contain;
}

.special-sticker-dialog-media span {
    display: grid;
    place-items: center;
    width: min(100%, 320px);
    aspect-ratio: 433 / 564;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--slot-number-color);
    font-family: "Antonio", Arial, sans-serif;
    font-size: 58px;
    font-weight: 700;
}

.special-sticker-dialog-text {
    display: grid;
    gap: 14px;
    min-width: 0;
    min-height: 0;
}

.special-sticker-dialog h2 {
    margin: 0;
    padding-right: 42px;
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.1;
}

.special-sticker-dialog p {
    min-height: 0;
    margin: 0;
    overflow: auto;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-size: 17px;
    line-height: 1.5;
}

.special-sticker-dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 6px;
    background: #e8eef5;
    color: var(--text);
    font-size: 25px;
    line-height: 1;
}

.special-sticker-dialog-close:hover {
    background: #dbe5ef;
}

.rendered-sticker-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    pointer-events: auto;
}

.rendered-sticker-link:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.rendered-sticker-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    visibility: hidden;
}

.rendered-sticker-image.is-loaded {
    visibility: visible;
}

.player-sticker-card {
    --sticker-inner-margin: clamp(3px, 0.38vw, 6px);
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.player-sticker-card::before {
    content: "";
    position: absolute;
    inset: var(--sticker-inner-margin);
    z-index: 1;
    border: 2px solid var(--page-color-1);
    border-radius: 3px;
    pointer-events: none;
}

.player-sticker-photo {
    position: absolute;
    top: var(--sticker-inner-margin);
    right: var(--sticker-inner-margin);
    bottom: var(--sticker-inner-margin);
    left: var(--sticker-inner-margin);
    z-index: 0;
    width: calc(100% - (var(--sticker-inner-margin) * 2));
    height: calc(100% - (var(--sticker-inner-margin) * 2));
    object-fit: cover;
}

.sticker-card-badge {
    position: absolute;
    top: clamp(7px, 0.82vw, 12px);
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(22px, 2.7vw, 42px);
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--page-color-1);
    font-size: clamp(8px, 0.85vw, 12px);
    font-weight: 800;
}

.sticker-card-logo {
    left: clamp(7px, 0.82vw, 12px);
}

.sticker-card-flag {
    right: clamp(7px, 0.82vw, 12px);
}

.player-sticker-info {
    position: absolute;
    inset: auto 0 0;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: end;
    gap: 1px;
    min-height: 25%;
    padding: clamp(10px, 1.5vw, 20px) 0 clamp(4px, 0.55vw, 8px);
    background: #ffffff;
    clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
}

.player-sticker-info strong {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    margin-top: 4px;
    margin-left: calc(var(--sticker-inner-margin) + 4px);
    margin-right: var(--sticker-inner-margin);
    color: #000000;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
}

.player-sticker-info small {
    grid-column: 1;
    grid-row: 1;
    justify-self: stretch;
    margin: 0 4px 0 42%;
    padding: 1px clamp(4px, 0.55vw, 8px);
    border-radius: 2px;
    background: var(--page-color-1);
    color: var(--page-color-2);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.player-position-field {
    display: grid;
    position: absolute;
    left: calc(var(--sticker-inner-margin) + 4px);
    bottom: calc(25% + var(--sticker-inner-margin) + 4px);
    z-index: 2;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 2px;
    width: clamp(20px, 2.6vw, 38px);
    aspect-ratio: 65 / 110;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    background:
        linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.45) 49% 51%, transparent 52%),
        linear-gradient(0deg, transparent 48%, rgba(255, 255, 255, 0.35) 49% 51%, transparent 52%),
        #3f7f46;
}

.player-position-field span {
    width: 4px;
    height: 4px;
    align-self: center;
    justify-self: center;
    border-radius: 50%;
    background: transparent;
}

.player-position-field span.is-active {
    background: var(--position-dot-color);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.sticker-slot-spacer {
    visibility: hidden;
}

.album-page-number {
    position: absolute;
    bottom: clamp(8px, 1.1vw, 14px);
    display: grid;
    place-items: center;
    min-width: clamp(38px, 4vw, 58px);
    min-height: clamp(24px, 2.4vw, 34px);
    padding: 0 10px;
    border-radius: 999px;
    background: var(--page-color-2);
    color: var(--page-color-1);
    font-size: clamp(12px, 1.2vw, 16px);
    font-weight: 800;
    z-index: 6;
}

.album-page-number-left {
    left: clamp(12px, 1.5vw, 20px);
}

.album-page-number-right {
    right: clamp(12px, 1.5vw, 20px);
}

.turning-page {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
        repeating-linear-gradient(0deg, rgba(31, 122, 140, 0.035), rgba(31, 122, 140, 0.035) 1px, transparent 1px, transparent 36px),
        var(--paper);
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform, opacity, box-shadow;
}

.turning-page-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    backface-visibility: hidden;
}

.turning-page-face-back {
    transform: rotateY(180deg);
}

.book-shell.is-turning-right .turning-page-face-back {
    transform: rotateY(-180deg);
}

.book-shell.is-turning-left .turning-page-face-back,
.book-shell.is-turning-right .turning-page-face-back {
    display: none;
}

.turning-page-face .book-page-content {
    width: 100%;
    height: 100%;
}

.turning-page-face .book-page-content::after {
    display: none;
}

.turning-page-face .book-page-content-left,
.turning-page-face .book-page-content-right {
    box-shadow: none;
}

.turning-page::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(90deg, rgba(42, 31, 19, 0.38), transparent 38%, rgba(255, 255, 255, 0.18));
    transition: opacity 180ms ease;
}

.book-shell.is-turning .turning-page {
    opacity: 1;
}

.book-shell.is-turning .turning-page::after {
    opacity: 1;
}

.book-shell.is-turning-left .turning-page {
    left: 0;
    border-right: 1px solid rgba(95, 73, 46, 0.2);
    transform-origin: 100% 50%;
    animation: turn-left-page 900ms cubic-bezier(0.2, 0.72, 0.18, 1) forwards;
}

.book-shell.is-turning-right .turning-page {
    right: 0;
    border-left: 1px solid rgba(95, 73, 46, 0.2);
    transform-origin: 0 50%;
    animation: turn-right-page 900ms cubic-bezier(0.2, 0.72, 0.18, 1) forwards;
}

@keyframes turn-left-page {
    0% {
        opacity: 1;
        transform: rotateY(0deg);
        box-shadow: 10px 0 18px rgba(61, 47, 30, 0.14);
    }

    42% {
        opacity: 1;
        transform: rotateY(84deg);
        box-shadow: 34px 0 46px rgba(61, 47, 30, 0.28);
    }

    50% {
        opacity: 0;
        transform: rotateY(92deg);
        box-shadow: 28px 0 40px rgba(61, 47, 30, 0.22);
    }

    100% {
        opacity: 0;
        transform: rotateY(180deg);
        box-shadow: -22px 0 34px rgba(61, 47, 30, 0.18);
    }
}

@keyframes turn-right-page {
    0% {
        opacity: 1;
        transform: rotateY(0deg);
        box-shadow: -10px 0 18px rgba(61, 47, 30, 0.14);
    }

    42% {
        opacity: 1;
        transform: rotateY(-84deg);
        box-shadow: -34px 0 46px rgba(61, 47, 30, 0.28);
    }

    50% {
        opacity: 0;
        transform: rotateY(-92deg);
        box-shadow: -28px 0 40px rgba(61, 47, 30, 0.22);
    }

    100% {
        opacity: 0;
        transform: rotateY(-180deg);
        box-shadow: 22px 0 34px rgba(61, 47, 30, 0.18);
    }
}

.page-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
    padding: clamp(22px, 3vw, 40px);
}

.count-form {
    display: flex;
    align-items: end;
    gap: 10px;
    min-width: 220px;
}

.count-form input {
    width: 90px;
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 6px;
    background: #e8eef5;
    font-weight: 700;
}

.flash.error {
    background: #fee4e2;
    color: var(--danger);
}

.flash.success {
    background: #dcfae6;
    color: var(--success);
}

.flash.temporary_password {
    border: 2px solid #d8a31c;
    background: #fff6c7;
    color: #6f4b00;
    font-family: Consolas, "Courier New", monospace;
    font-size: 18px;
}

@media (max-width: 760px) {
    .site-header,
    .section-header,
    .sticker-row {
        align-items: stretch;
        flex-direction: column;
    }

    .site-header nav {
        flex-wrap: wrap;
    }

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

    .admin-edit-header,
    .admin-form-grid,
    .admin-upload-grid {
        grid-template-columns: 1fr;
    }

    .admin-edit-header {
        align-items: stretch;
        flex-direction: column;
    }

    .duplicates-filter {
        white-space: normal;
    }

    .duplicate-sticker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .special-riddle-row,
    .special-riddle-row.is-open {
        grid-template-columns: 1fr;
    }

    .special-riddle-row button,
    .special-riddle-open-label {
        justify-self: start;
    }

    .special-sticker-dialog {
        grid-template-columns: 1fr;
    }

    .special-sticker-dialog-media img,
    .special-sticker-dialog-media span {
        width: min(100%, 260px);
    }

    .album-show-layout {
        width: calc(100vw - 32px);
        margin-right: 0;
        margin-left: calc(50% - 50vw + 16px);
        grid-template-columns: 1fr;
    }

    .album-book-layout {
        width: 100%;
    }

    .book-shell {
        width: 100%;
        padding: 12px;
    }

    .album-page-pair-index {
        position: static;
        max-height: none;
    }

    .book-turn-zone {
        top: 12px;
        bottom: 12px;
        width: 44px;
    }

    .book-turn-zone-left {
        left: 0;
    }

    .book-turn-zone-right {
        right: 0;
    }

    .book-shell::before {
        inset: 10px 8px;
    }

    .book-spread {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .book-spread::before {
        display: none;
    }

    .book-page-left {
        border-right: 0;
        border-bottom: 1px solid rgba(95, 73, 46, 0.16);
        box-shadow: inset 0 -18px 26px rgba(107, 83, 52, 0.1);
    }

    .book-page-right {
        box-shadow: inset 0 18px 26px rgba(107, 83, 52, 0.08);
    }

    .count-form {
        align-items: stretch;
        flex-direction: column;
        min-width: 0;
    }

    .count-form input {
        width: 100%;
    }

    .pack-overlay-stickers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
