:root {
    --crc-track-height-base: 160px;
    --crc-background-height-scale: 1;
    --crc-track-height: calc(var(--crc-track-height-base) * var(--crc-background-height-scale));
    --crc-tile-size-base: 120px;
    --crc-tile-size-adjust: 0px;
    --crc-tile-size: calc(var(--crc-tile-size-base) + var(--crc-tile-size-adjust));
    --crc-tile-extra: max(0px, calc(10px + var(--crc-tile-size-adjust)));
    --crc-tile-gap: clamp(18px, 3vw, 36px);
    --crc-color-1: #ffd5a5;
    --crc-color-2: #f4b5c4;
    --crc-color-3: #cdbef2;
    --crc-color-4: #b5e0f4;
    --crc-color-5: #c4f5d5;
    --crc-color-6: #fee1e8;
    --crc-color-7: #fdeccf;
    --crc-color-8: #e0c3fc;
    --crc-bubble-gap-base: 48px;
    --crc-bubble-gap: var(--crc-bubble-gap-base);
    --crc-bubble-offset-y: 0px;
    --crc-bubble-width: 160px;
    --crc-character-offset-x: 0px;
    --crc-character-offset-y: 0px;
    --crc-character-scale: 1;
    --crc-character-base-width: 92px;
    --crc-bg-image-opacity: 1;
    --crc-bg-image-height-scale: 1;
    --crc-final-treasure-offset-x: 0px;
    --crc-final-treasure-offset-y: 0px;
    --crc-final-treasure-scale: 1;
    --crc-final-treasure-goal-offset-x: 0px;
    --crc-final-treasure-goal-offset-y: 0px;
    --crc-final-treasure-goal-scale: 1;
    --crc-stamp-book-offset-x: 0px;
    --crc-stamp-book-offset-y: 0px;
    --crc-stamp-book-scale: 1;
    --crc-stamp-book-bg: linear-gradient(135deg, #f5e3ff 0%, #d8b4fe 100%);
    --crc-stamp-book-icon-color: #c59ff5;
    --crc-stamp-book-icon-fill: #f5e6ff;
    --crc-stamp-book-text: #4f2d7f;
    --crc-sound-toggle-offset-x: 0px;
    --crc-sound-toggle-offset-y: 0px;
    --crc-sound-toggle-scale: 1;
    --crc-sound-toggle-bg: transparent;
    --crc-final-claim-offset-x: 0px;
    --crc-final-claim-offset-y: 0px;
    --crc-final-claim-scale: 1;
    --crc-card-padding-top-base: 56px;
    --crc-card-padding-bottom-base: 18px;
    --crc-card-max-width: 720px;
    --crc-card-side-gap: 32px;
    --crc-track-padding: clamp(20px, 8vw, 64px);
    --crc-track-justify: center;
}

@media (max-height: 900px) and (min-width: 768px) {
    :root {
        --crc-track-height-base: 96px;
        --crc-track-height: calc(var(--crc-track-height-base) * var(--crc-background-height-scale));
        --crc-tile-size-base: 72px;
        --crc-bubble-gap-base: 28px;
        --crc-tile-gap: clamp(8px, 2.8vw, 20px);
        --crc-character-base-width: 58px;
        --crc-card-padding-top-base: 34px;
        --crc-card-padding-bottom-base: 12px;
        --crc-card-side-gap: 24px;
        --crc-track-padding: clamp(12px, 4vw, 32px);
    }

    .crc-intro-banner {
        width: min(calc(100% - 24px), 260px);
        border-radius: 28px;
        padding: 14px 18px;
    }

    .crc-intro-button {
        font-size: 16px;
        padding: 10px 18px;
        border-radius: 999px;
    }

    .crc-rally-card {
        padding: 34px 12px 12px;
        border-radius: 15px;
        box-shadow: 0 18px 46px rgba(0, 0, 0, 0.08);
    }

    .crc-rally-track {
        gap: var(--crc-tile-gap);
        padding: 0 8px;
    }

    .crc-tile {
        min-width: 44px;
        flex: 0 0 calc(var(--crc-tile-size) + var(--crc-tile-extra));
    }

    .crc-tile-inner {
        width: calc(var(--crc-tile-size) + var(--crc-tile-extra));
        height: calc(var(--crc-tile-size) + var(--crc-tile-extra));
        border-radius: 50%;
        border-width: 3px;
        box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08);
    }

    .crc-tile-bubble {
        font-size: 13px;
        padding: 12px 14px;
        border-radius: 18px;
    }

    .crc-tile-index {
        font-size: 16px;
    }

    .crc-character img {
        margin-top: 12px;
        filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
    }

    .crc-rally-controls {
        top: 8px;
        gap: 8px;
        padding: 0 12px;
    }

    .crc-rally-controls-left,
    .crc-rally-controls-right {
        gap: 8px;
    }

    .crc-stamp-book-toggle {
        padding: 8px 12px;
        font-size: 13px;
    }

    .crc-stamp-book-label {
        font-size: 13px;
    }

    .crc-reset {
        padding: 8px 12px;
        font-size: 13px;
    }

    .crc-final-claim {
        font-size: 14px;
    }
}

.crc-rally-wrapper {
    position: relative;
    width: min(calc(100% - var(--crc-card-side-gap, 32px)), var(--crc-card-max-width, 720px));
    max-width: var(--crc-card-max-width, 720px);
    margin: 0 auto 10px;
    display: block;
}

.crc-hide-desktop {
    display: none !important;
}

.crc-hide-tablet,
.crc-hide-mobile {
    display: block;
}

@media (max-width: 1024px) {
    .crc-hide-desktop {
        display: block !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .crc-hide-tablet {
        display: none !important;
    }

    .crc-rally-track {
        height: calc(var(--crc-tile-size) + var(--crc-tile-extra) + 56px);
        padding: 0 clamp(12px, 4vw, 32px);
    }

    .crc-character {
        bottom: calc((var(--crc-tile-size) + var(--crc-tile-extra)) / 4 - 20px + var(--crc-character-offset-y));
    }
}

@media (max-width: 640px) {
    .crc-hide-mobile {
        display: none !important;
    }
    .crc-hide-tablet {
        display: block !important;
    }
    .crc-hide-desktop {
        display: block !important;
    }
}

.crc-rally-wrapper.layout-full {
    width: calc(100% - 32px);
    max-width: none;
}

.crc-rally-wrapper .crc-rally-card {
    transform-origin: 50% 100%;
}



.crc-rally-wrapper.is-locked .crc-rally-card {
    display: none;
}

.crc-rally-wrapper.is-active .crc-rally-card {
    display: block;
}

.crc-rally-card.is-entering {
    animation: crc-rally-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.crc-rally-wrapper.has-intro-played .crc-rally-card {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

@keyframes crc-rally-enter {
    from {
        opacity: 0;
        transform: translateY(48px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.crc-intro-banner {
    position: fixed;
    left: 50%;
    bottom: 9px;
    bottom: calc(9px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: min(calc(100% - 32px), 420px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 10050;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.crc-rally-wrapper.is-active .crc-intro-banner {
    opacity: 0;
    transform: translate(-50%, -16px);
    pointer-events: none;
}

.crc-rally-wrapper.is-locked .crc-intro-banner {
    opacity: 1;
    pointer-events: auto;
}

.crc-intro-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #ff8c94 0%, #ffd166 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 18px 38px rgba(255, 140, 148, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.crc-intro-button:hover,
.crc-intro-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px rgba(255, 140, 148, 0.38);
    outline: none;
}

.crc-intro-button:focus-visible::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.75);
}

.crc-intro-button-label {
    font-size: inherit;
    font-weight: inherit;
}

.crc-hide-button {
    position: absolute;
    top: -20px;
    right: -20px;
    margin-right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: #f4f4f4;
    color: #5d3a6d;
    font-size: 0;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    z-index: 11000;
}

.crc-hide-button::before {
    content: '\2212';
    font-size: 24px;
    line-height: 1;
    color: inherit;
}

.crc-hide-button:hover,
.crc-hide-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
    outline: none;
}

.crc-hide-button:focus-visible::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(93, 58, 109, 0.45);
}

.crc-rally-wrapper[data-crc-intro-container].is-active .crc-hide-button {
    display: inline-flex;
}
.crc-rally-wrapper[data-crc-intro-container][data-crc-intro-active="false"] .crc-hide-button {
    display: none;
}

.crc-final-claim {
    position: relative;
    z-index: 10010;
}

.crc-final-claim-text {
    display: inline-block;
    white-space: pre-line;
    font-size: 0.92em;
    font-weight: 700;
}

.crc-rally-card {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 9px;
    bottom: calc(9px + env(safe-area-inset-bottom, 0px));
    width: min(calc(100% - var(--crc-card-side-gap, 32px)), var(--crc-card-max-width, 720px));
    max-width: var(--crc-card-max-width, 720px);
    margin: 0 auto;
    padding: calc(var(--crc-card-padding-top-base) * var(--crc-background-height-scale)) 20px calc(var(--crc-card-padding-bottom-base) * var(--crc-background-height-scale));
    padding-bottom: calc(var(--crc-card-padding-bottom-base) * var(--crc-background-height-scale) + env(safe-area-inset-bottom, 0px));
    border-radius: 24px;
    background-image: linear-gradient(145deg, var(--crc-bg-gradient-start, rgba(255,255,255,0)) 0%, var(--crc-bg-gradient-end, rgba(255,244,247,0)) 100%);
    background-color: var(--crc-bg-color, rgba(255,255,255,0));
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.08);
    font-family: 'Nunito', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    color: #4d3a62;
    z-index: 9999;
}

.crc-rally-card::before,
.crc-rally-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crc-rally-card::before {
    background-image: var(--crc-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: var(--crc-bg-image-opacity, 1);
    transition: opacity 0.35s ease;
    z-index: -2;
    transform-origin: 50% 100%;
    transform: scaleY(var(--crc-bg-image-height-scale, 1));
}

.crc-rally-card:not(.has-background)::before {
    opacity: 0;
}

.crc-rally-card::after {
    background-image: linear-gradient(
        145deg,
        var(--crc-bg-overlay-color-start, rgba(255, 255, 255, var(--crc-bg-overlay-opacity, 0.85))) 0%,
        var(--crc-bg-overlay-color-end, rgba(255, 244, 247, var(--crc-bg-overlay-opacity, 0.9))) 100%
    );
    z-index: -1;
}

.crc-rally-card.layout-full {
    width: calc(100% - var(--crc-card-side-gap, 32px));
}

.crc-rally-card * {
    box-sizing: border-box;
}

.crc-rally-track {
    position: relative;
    height: calc(var(--crc-track-height) * 0.42);
    display: flex;
    justify-content: var(--crc-track-justify, center);
    align-items: flex-end;
    gap: var(--crc-tile-gap);
    padding: 0 var(--crc-track-padding, clamp(20px, 8vw, 64px));
    width: min(100%, var(--crc-track-width-value, calc(var(--crc-track-width-percent, 100) * 1%)));
    margin: 0 auto;
    overflow: visible;
}

.crc-tile {
    position: relative;
    z-index: 1;
    flex: 0 0 calc(var(--crc-tile-size) + var(--crc-tile-extra));
    min-width: calc(72px + var(--crc-tile-extra));
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.crc-tile.is-cleared {
    z-index: 2;
}

.crc-tile.is-active {
    z-index: 3;
}

.crc-tile-inner {
    position: relative;
    width: calc(var(--crc-tile-size) + var(--crc-tile-extra));
    height: calc(var(--crc-tile-size) + var(--crc-tile-extra));
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 4px solid rgba(255, 255, 255, 0.65);
    box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
}

.crc-tile:nth-child(1) .crc-tile-inner { background: var(--crc-color-1); }
.crc-tile:nth-child(2) .crc-tile-inner { background: var(--crc-color-2); }
.crc-tile:nth-child(3) .crc-tile-inner { background: var(--crc-color-3); }
.crc-tile:nth-child(4) .crc-tile-inner { background: var(--crc-color-4); }
.crc-tile:nth-child(5) .crc-tile-inner { background: var(--crc-color-5); }
.crc-tile:nth-child(6) .crc-tile-inner { background: var(--crc-color-6); }
.crc-tile:nth-child(7) .crc-tile-inner { background: var(--crc-color-7); }
.crc-tile:nth-child(8) .crc-tile-inner { background: var(--crc-color-8); }

.crc-tile-final {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.crc-tile-final .crc-tile-inner {
    position: relative;
    width: max(calc(var(--crc-tile-size) + var(--crc-tile-extra)), calc(var(--crc-final-treasure-size, 60px) + 32px));
    height: max(calc(var(--crc-tile-size) + var(--crc-tile-extra)), calc(var(--crc-final-treasure-size, 60px) + 32px));
    background: linear-gradient(140deg, #fff2c6 0%, #ffd27e 40%, #ffb347 100%);
    border-radius: 36px;
    box-shadow: 0 20px 40px rgba(255, 150, 0, 0.35);
    border: 4px solid rgba(255, 255, 255, 0.85);
    padding: 22px 20px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.crc-final-treasure {
    width: calc(var(--crc-final-treasure-size, 60px) * var(--crc-final-treasure-scale, 1));
    max-width: none;
    height: auto;
    margin: 0;
    display: block;
    align-self: center;
    left: 50%;
    transform: translate(calc(-50% + var(--crc-final-treasure-offset-x, 0px)), var(--crc-final-treasure-offset-y, 0px));
    transform-origin: center;
    filter: drop-shadow(0 6px 12px rgba(255, 148, 0, 0.45));
    position: relative;
    z-index: 2;
    order: 2;
}

.crc-tile-final.is-ready .crc-final-treasure,
.crc-tile-final.is-claimed .crc-final-treasure {
    --crc-final-treasure-offset-x: var(--crc-final-treasure-goal-offset-x, 0px);
    --crc-final-treasure-offset-y: var(--crc-final-treasure-goal-offset-y, 0px);
    --crc-final-treasure-scale: var(--crc-final-treasure-goal-scale, 1);
}

.crc-tile-final .crc-tile-inner::before,
.crc-tile-final .crc-tile-inner::after {
    content: '';
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
    z-index: 0;
}

.crc-tile-final .crc-tile-inner::after {
    inset: -10%;
    background: radial-gradient(circle at center, rgba(255, 207, 64, 0.55) 0%, rgba(255, 207, 64, 0) 65%);
    filter: blur(8px);
}

.crc-tile-final-pill {
    width: 52px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    margin: 4px 0 0;
}

.crc-tile-final-message {
    font-size: 14px;
    font-weight: 700;
    color: #8a4d0f;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 0;
    opacity: 0.75;
    transition: opacity 0.3s ease, color 0.3s ease;
    position: relative;
    z-index: 2;
}

.crc-tile-final-message[hidden] {
    display: none !important;
}

.crc-final-claim {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 22px;
    border: none;
    background: linear-gradient(135deg, #ffb347 0%, #ffcc33 100%);
    color: #4d2800;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 12px 22px rgba(255, 163, 0, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 10010;
    width: 100%;
    min-width: 112px;
    max-width: 180px;
    margin-top: 0;
    margin-bottom: 12px;
    order: -1;
    --crc-final-claim-transform: translate(var(--crc-final-claim-offset-x), var(--crc-final-claim-offset-y)) scale(var(--crc-final-claim-scale));
    transform: var(--crc-final-claim-transform);
    transform-origin: center;
}

.crc-final-claim:hover,
.crc-final-claim:focus-visible {
    box-shadow: 0 18px 32px rgba(255, 148, 0, 0.4);
    outline: none;
}

.crc-final-claim:focus-visible::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 28px;
    border: 2px solid rgba(77, 40, 0, 0.45);
}

.crc-tile-final.is-ready .crc-tile-final-message {
    opacity: 1;
    color: #5c3300;
}

.crc-tile-final.is-ready .crc-final-claim {
    display: inline-flex;
}

.crc-tile-final.is-claimed .crc-final-claim {
    display: inline-flex;
}

.crc-tile-final.is-claimed .crc-tile-final-message {
    opacity: 0;
}

.crc-tile-final.is-ready .crc-tile-inner {
    box-shadow: 0 26px 46px rgba(255, 165, 0, 0.45);
}

.crc-tile-final.is-ready .crc-tile-inner::before,
.crc-tile-final.is-ready .crc-tile-inner::after {
    opacity: 1;
    transform: scale(1);
}

.crc-tile-final.is-ready .crc-final-treasure {
    animation: crcTreasurePulse 1.8s ease-in-out infinite;
}

.crc-tile-final.is-ready .crc-tile-inner::before {
    animation: crcFinalGlow 2.4s linear infinite;
}

@keyframes crcFinalGlow {
    0% {
        opacity: 0.35;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.35;
        transform: scale(0.9);
    }
}

@keyframes crcTreasurePulse {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.05);
    }
}

.crc-tile-index {
    font-size: 18px;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
    line-height: 1;
    margin-bottom: 6px;
}

.crc-tile-bubble {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: calc(100% + 18px);
    transform: translate(-50%, 0);
    width: var(--crc-bubble-width, 160px);
    min-width: var(--crc-bubble-width, 160px);
    max-width: calc(100% - 16px);
    min-width: var(--crc-bubble-width, 160px);
    padding: 10px 14px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 2;
}

.crc-tile-bubble::after {
    content: '';
    position: absolute;
    left: 50%;
    border-width: 8px;
    border-style: solid;
    transform: translateX(-50%);
    top: auto;
    bottom: -16px;
    border-color: #ffffff transparent transparent transparent;
}

.crc-tile.is-active .crc-tile-inner {
    transform: translateY(-6px);
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.18);
}

.crc-tile.is-active .crc-tile-bubble,
.crc-tile.is-cleared .crc-tile-bubble {
    opacity: 1;
    pointer-events: auto;
    z-index: 4;
}

.crc-tile.is-active .crc-tile-bubble {
    bottom: auto;
    top: var(--crc-bubble-top-active, calc(-1 * var(--crc-tile-size) - var(--crc-bubble-gap) + var(--crc-bubble-offset-y)));
    border: 1px solid transparent;
    z-index: 5;
}

.crc-tile.is-active .crc-tile-bubble::after {
    top: 100%;
    bottom: auto;
    border-color: #ffffff transparent transparent transparent;
}

.crc-character {
    position: absolute;
    bottom: calc((var(--crc-tile-size) + var(--crc-tile-extra)) / 4 - 18px + var(--crc-character-offset-y));
    left: 0;
    transform: translateZ(0);
    transition: none;
    pointer-events: none;
    z-index: 6;
}

.crc-character.is-ready {
    transition: left 0.7s cubic-bezier(0.21, 0.92, 0.32, 1.05);
    will-change: left;
}

.crc-character img {
    width: calc(var(--crc-character-base-width) * var(--crc-character-scale));
    height: auto;
    max-height: none;
    filter: drop-shadow(0 15px 24px rgba(0, 0, 0, 0.2));
    margin-top: 20px;
    transform-origin: 50% 100%;
}

.crc-character.is-animating.crc-anim-jump img {
    animation: crc-jump 0.9s cubic-bezier(0.25, 0.9, 0.35, 1) forwards;
}

.crc-character.is-animating.crc-anim-float img {
    animation: crc-float 1.2s ease-in-out forwards;
}

.crc-character.is-animating.crc-anim-slide img {
    animation: crc-slide 0.7s cubic-bezier(0.25, 0.9, 0.35, 1) forwards;
}

.crc-character.is-animating.crc-anim-sway img {
    animation: crc-sway 0.8s cubic-bezier(0.42, 0, 0.22, 1) forwards;
}

.crc-character.is-animating.crc-anim-twirl img {
    animation: crc-twirl 0.85s cubic-bezier(0.42, 0, 0.22, 1) forwards;
}

.crc-character.is-animating.crc-anim-bounce img {
    animation: crc-bounce 0.75s cubic-bezier(0.28, 0.84, 0.42, 1) forwards;
}

.crc-character.crc-no-transition {
    transition: none !important;
}

@keyframes crc-jump {
    0% { transform: translateY(0); }
    45% { transform: translateY(-32px); }
    70% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes crc-float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
    100% { transform: translateY(0); }
}

@keyframes crc-slide {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
    18% {
        transform: translate3d(0, 4px, 0) scale(0.98) rotate(2deg);
    }
    45% {
        transform: translate3d(0, -20px, 0) scale(1.06) rotate(-4deg);
    }
    72% {
        transform: translate3d(0, -6px, 0) scale(0.98) rotate(3deg);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
}

@keyframes crc-sway {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    25% {
        transform: translate3d(-6px, -8px, 0) rotate(-4deg);
    }
    50% {
        transform: translate3d(4px, -12px, 0) rotate(3deg);
    }
    75% {
        transform: translate3d(-3px, -6px, 0) rotate(-2deg);
    }
    100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
}

@keyframes crc-twirl {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
    30% {
        transform: translate3d(0, -16px, 0) scale(1.05) rotate(20deg);
    }
    60% {
        transform: translate3d(0, -8px, 0) scale(1.05) rotate(-340deg);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1) rotate(-360deg);
    }
}

@keyframes crc-bounce {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    30% {
        transform: translate3d(0, -18px, 0) scale(1.05);
    }
    55% {
        transform: translate3d(0, -4px, 0) scale(0.96);
    }
    75% {
        transform: translate3d(0, -12px, 0) scale(1.02);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.crc-rally-controls {
    position: absolute;
    top: 14px;
    right: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
}

.crc-rally-controls-left,
.crc-rally-controls-right {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.crc-rally-controls-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.crc-level {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(255, 231, 187, 0.85);
    color: #5d3a6d;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.crc-level[hidden] {
    display: none !important;
}

.crc-tile-link {
    color: #5d3a6d !important;
    font-weight: 700;
    display: inline-block;
    width: 100%;
    padding: 2px 4px;
    max-width: 100%;
    transition: color 0.2s ease, transform 0.2s ease;
    transform: translateY(0);
    text-decoration-line: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: currentColor;
    text-decoration-skip-ink: auto;
    text-underline-offset: 3px;
    cursor: pointer;
    word-break: break-word;
}

.crc-tile-link:hover {
    color: #7a4aa5 !important;
    transform: translateY(-2px);
}

.crc-reset {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    background: #ff8c94;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crc-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.crc-sound-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    margin-left: 0;
    margin-right: 20px;
    background-color: var(--crc-sound-toggle-bg, transparent);
    background-image: url('../img/sound-on.svg');
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 12px 26px rgba(44, 82, 93, 0.22);
    position: relative;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    --crc-sound-toggle-transform: translate(var(--crc-sound-toggle-offset-x), var(--crc-sound-toggle-offset-y)) scale(var(--crc-sound-toggle-scale));
    transform: var(--crc-sound-toggle-transform);
    transform-origin: center;
}

.crc-sound-toggle.is-muted {
    background-image: url('../img/sound-off.svg');
}

.crc-sound-toggle:hover,
.crc-sound-toggle:focus-visible {
    transform: var(--crc-sound-toggle-transform);
    box-shadow: 0 12px 26px rgba(44, 82, 93, 0.22);
    background-color: var(--crc-sound-toggle-bg, transparent) !important;
    outline: none;
}

.crc-sound-toggle:focus-visible::after {
    content: none;
}

.crc-rally-card.crc-has-finished [data-crc-sound="toggle"] {
    pointer-events: none;
    opacity: 0.55;
}

.crc-stamp-book-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crc-stamp-book-controls .crc-stamp-book-toggle {
    margin-right: 0;
}

.crc-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.crc-goal-popup[hidden] {
    display: none;
}

.crc-goal-popup {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483000;
}

.crc-goal-popup.is-visible {
    display: flex;
}

.crc-goal-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.crc-goal-popup-dialog {
    position: relative;
    z-index: 2147483001;
    width: min(92%, 504px);
    border-radius: 32px;
    background: linear-gradient(135deg, #c5ecec 0%, #a8dde0 100%);
    box-shadow: 0 32px 90px rgba(18, 48, 56, 0.45);
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 38px;
}

.crc-goal-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: #ffffff;
    background-image: url('../img/close.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    color: #5aaeb6;
    font-size: 0;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(44, 82, 93, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.crc-goal-popup-close:hover,
.crc-goal-popup-close:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(44, 82, 93, 0.28);
}

.crc-goal-popup-header {
    padding: 38px 38px 24px;
    background: linear-gradient(135deg, #7fc9d4 0%, #6db5c1 100%);
    color: #f8ffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crc-goal-popup-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.crc-goal-popup-subtitle {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.crc-goal-popup-stamp-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0 32px;
}

.crc-goal-popup-stamp {
    width: 318px;
    height: 318px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe7d6 0%, #ffd4a5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 14px solid #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.crc-goal-popup-stamp img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-goal-popup-actions {
    padding: 0 38px;
}

.crc-goal-popup-action {
    width: 100%;
    padding: 16px 22px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #ffffff 0%, #e8f4f4 100%);
    color: #2c525d;
    font-weight: 700;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 14px 30px rgba(44, 82, 93, 0.22);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.crc-goal-popup-action:hover,
.crc-goal-popup-action:focus-visible {
    transform: translateY(-1px);
    color: #2c525d;
    box-shadow: 0 18px 32px rgba(44, 82, 93, 0.25);
    outline: none;
}

.crc-goal-popup-action:focus-visible::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid rgba(44, 82, 93, 0.45);
}

.crc-goal-popup-action-icon {
    font-size: 16px;
}

.crc-goal-popup-celebration {
    position: absolute;
    inset: -120px;
    pointer-events: none;
    opacity: 0;
}

.crc-goal-popup.is-celebrating .crc-goal-popup-celebration {
    opacity: 1;
    animation: crc-confetti 2.8s ease-out both;
}

.crc-goal-popup.is-celebrating .crc-goal-popup-stamp {
    animation: crc-stamp-pop 0.8s ease-out;
}

.crc-goal-popup-celebration::before,
.crc-goal-popup-celebration::after {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    opacity: 0.8;
}

.crc-goal-popup-celebration.crc-effect-sparkle::before {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 230, 150, 0.4) 40%, transparent 70%);
}

.crc-goal-popup-celebration.crc-effect-fireworks::before {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(165, 210, 255, 0.45) 40%, transparent 65%);
}

.crc-goal-popup-celebration.crc-effect-popup::before {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 199, 221, 0.5) 40%, transparent 70%);
}

.crc-goal-popup-celebration::after {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    filter: blur(20px);
}

@keyframes crc-stamp-pop {
    0% {
        transform: scale(0.6) rotate(-8deg);
    }
    60% {
        transform: scale(1.05) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes crc-confetti {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

@keyframes crc-sparkle {
    0%, 100% { transform: scale(0.9); opacity: 0.4; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes crc-fireworks {
    0% { transform: scale(0.6); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 0.85; }
    100% { transform: scale(0.6); opacity: 0.4; }
}

@keyframes crc-popup {
    0% { transform: scale(0.6); opacity: 0; }
    80% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    :root {
        --crc-track-height-base: 180px;
        --crc-track-height: calc(var(--crc-track-height-base) * var(--crc-background-height-scale));
        --crc-tile-size-base: 96px;
        --crc-bubble-gap-base: 36px;
        --crc-tile-gap: clamp(8px, 2.8vw, 20px);
        --crc-character-base-width: 72px;
        --crc-card-padding-top-base: 46px;
        --crc-card-padding-bottom-base: 16px;
    }

    .crc-rally-card {
        bottom: 16px;
        padding: calc(var(--crc-card-padding-top-base) * var(--crc-background-height-scale)) 18px calc(var(--crc-card-padding-bottom-base) * var(--crc-background-height-scale));
    }

    .crc-tile-bubble {
        min-width: 100px;
        font-size: 13px;
    }

    .crc-rally-controls {
        top: 0;
        right: 16px;
        left: auto;
        justify-content: flex-end;
        gap: 8px;
        padding: 0;
    }

    .crc-rally-controls-right {
        flex-direction: row-reverse;
        gap: 8px;
        align-items: center;
    }

    .crc-stamp-book {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        --crc-stamp-book-offset-x: -20px;
        --crc-stamp-book-offset-y: -36px;
    }

    .crc-stamp-book-toggle {
        gap: 4px;
        padding: 8px 10px;
        border-radius: 22px;
        background: var(--crc-stamp-book-bg, rgba(255, 255, 255, 0.85));
        color: var(--crc-stamp-book-text, #4f2d7f);
        font-weight: 600;
        box-shadow: 0 8px 18px rgba(79, 45, 127, 0.18);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .crc-stamp-book:hover .crc-stamp-book-toggle,
    .crc-stamp-book:focus-within .crc-stamp-book-toggle {
        padding: 8px 10px;
        transform: translateY(-1px);
        box-shadow: 0 12px 22px rgba(79, 45, 127, 0.22);
    }

.crc-stamp-book-icon {
    width: 18px;
    height: 18px;
}

.crc-stamp-book-icon.has-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    box-shadow: none;
}

.crc-stamp-book-icon.has-image::before,
.crc-stamp-book-icon.has-image::after {
    content: none;
}

.crc-stamp-book-icon.has-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.crc-stamp-book-icon::before,
.crc-stamp-book-icon::after {
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px var(--crc-stamp-book-icon-color, #c59ff5);
}

    .crc-stamp-book-icon::after {
        transform: translateX(3px);
        background: #f5e6ff;
        background: color-mix(in srgb, var(--crc-stamp-book-icon-color, #c59ff5) 35%, #ffffff);
    }

    .crc-stamp-book-label {
        font-size: 12px;
        transform: translateX(-4px);
    }

    .crc-stamp-book-modal {
        width: min(94%, 540px);
        padding: 28px 24px 24px;
    }

    .crc-stamp-book-title {
        padding: 10px 24px;
        font-size: 18px;
    }

    .crc-stamp-book-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
    }

    .crc-stamp-card-figure {
        width: 156px;
        height: 156px;
    }

    .crc-goal-popup-dialog {
        width: min(92%, 360px);
    }

    .crc-goal-popup-stamp {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 560px) {
    :root {
        --crc-track-height-base: 110px;
        --crc-track-height: calc(var(--crc-track-height-base) * var(--crc-background-height-scale));
        --crc-tile-size-base: clamp(38px, 12vw, 58px);
        --crc-bubble-gap-base: 18px;
        --crc-tile-gap: clamp(6px, 3vw, 16px);
        --crc-character-base-width: clamp(50px, 16vw, 62px);
        --crc-card-padding-top-base: 38px;
        --crc-card-padding-bottom-base: 12px;
    }

    .crc-rally-wrapper {
        width: calc(100% - 12px);
        margin: 0 auto 10px;
    }

    .crc-rally-card {
        bottom: 10px;
        padding: calc(var(--crc-card-padding-top-base) * var(--crc-background-height-scale)) 12px calc(var(--crc-card-padding-bottom-base) * var(--crc-background-height-scale));
    }

    .crc-rally-track {
        gap: var(--crc-tile-gap);
        padding: 0 clamp(12px, 6vw, 28px);
        height: calc(var(--crc-track-height) * 0.432);
        justify-content: center;
        width: min(100%, calc(var(--crc-track-width-percent, 100) * 0.85%));
        margin: 0 auto;
        overflow: visible;
    }

    .crc-tile {
        min-width: auto;
        flex: 0 0 auto;
    }

    .crc-tile-inner {
        width: min(var(--crc-tile-size), 100%);
        height: min(var(--crc-tile-size), 100%);
        border-radius: 50%;
        border-width: 3px;
    }

    .crc-tile-bubble {
        min-width: 80px;
        font-size: 12px;
        padding: 6px 8px;
    }

    .crc-rally-track [data-crc-tile]:not([data-crc-tile="0"]) .crc-tile-bubble,
    .crc-rally-track [data-crc-tile]:not([data-crc-tile="0"]) .crc-tile-bubble::after {
        display: none !important;
        pointer-events: none !important;
    }

    .crc-tile-link {
        font-size: 13px;
        padding: 2px 2px 4px;
    }

    .crc-character {
        bottom: calc(var(--crc-tile-size) / 6 - 15px);
    }

    .crc-character.is-ready {
        transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .crc-tile-final {
        flex: 0 0 auto;
    }

    .crc-tile-final .crc-tile-inner {
        width: max(min(calc(var(--crc-tile-size) + var(--crc-tile-extra)), 100px), calc(var(--crc-final-treasure-size, 60px) + 24px));
        height: max(min(calc(var(--crc-tile-size) + var(--crc-tile-extra)), 100px), calc(var(--crc-final-treasure-size, 60px) + 24px));
        border-radius: 18px;
        padding: 18px 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .crc-final-treasure {
        width: min(calc(var(--crc-final-treasure-size, 60px) * var(--crc-final-treasure-scale, 1)), clamp(48px, 20vw, 160px));
        max-width: 100%;
        margin: 0;
        align-self: center;
        left: 50%;
        transform: translateX(calc(-50% + 5px));
    }

    .crc-final-claim {
        font-size: 13px;
        padding: 6px 14px;
    }

    .crc-tile-final-message {
        font-size: 13px;
    }

    .crc-final-claim-text {
        text-align: center;
        line-height: 1.25;
    }

    .crc-rally-controls {
        top: 0;
        right: 12px;
        left: auto;
        justify-content: flex-end;
        gap: 6px;
        padding: 0;
    }

    .crc-rally-controls-right {
        width: auto;
        flex-direction: row-reverse;
        gap: 6px;
        align-items: center;
    }

    .crc-stamp-book {
        position: static;
        flex-direction: row;
        gap: 6px;
        align-items: center;
        --crc-stamp-book-offset-x: -14px;
        --crc-stamp-book-offset-y: -40px;
        --crc-stamp-book-scale: 0.85;
    }

    .crc-sound-toggle {
        --crc-sound-toggle-scale: 0.85;
        display: none !important;
    }
}

.crc-stamp-book {
    position: relative;
    z-index: auto;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-right: 20px;
    --crc-stamp-book-offset-x-clamped: clamp(-80px, var(--crc-stamp-book-offset-x, 0px), 160px);
    --crc-stamp-book-offset-y-clamped: clamp(-80px, var(--crc-stamp-book-offset-y, 0px), 160px);
    --crc-stamp-book-transform: translate(var(--crc-stamp-book-offset-x-clamped), var(--crc-stamp-book-offset-y-clamped)) scale(var(--crc-stamp-book-scale));
    transform: var(--crc-stamp-book-transform);
    transform-origin: top right;
}

.crc-stamp-book-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px;
    border: none;
    border-radius: 26px;
    background: var(--crc-stamp-book-bg, linear-gradient(135deg, #f5e3ff 0%, #d8b4fe 100%));
    color: var(--crc-stamp-book-text, #4f2d7f);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(79, 45, 127, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, padding 0.25s ease;
}

.crc-stamp-book:hover .crc-stamp-book-toggle,
.crc-stamp-book:focus-within .crc-stamp-book-toggle {
    padding: 12px 18px;
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(79, 45, 127, 0.28);
}

.crc-stamp-book-icon {
    width: 24px;
    height: 24px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.crc-stamp-book-icon::before,
.crc-stamp-book-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: #fff;
    box-shadow: inset 0 0 0 2px var(--crc-stamp-book-icon-color, #c59ff5);
}

.crc-stamp-book-icon::after {
    transform: translateX(4px);
    background: linear-gradient(135deg, #fff 0%, #fbe9ff 100%);
    background: color-mix(in srgb, var(--crc-stamp-book-icon-color, #c59ff5) 30%, #ffffff);
}

.crc-stamp-book-label {
    font-size: 14px;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transform: translateX(-6px);
    transition: max-width 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.crc-stamp-book:hover .crc-stamp-book-label,
.crc-stamp-book:focus-within .crc-stamp-book-label {
    max-width: 140px;
    opacity: 1;
    transform: translateX(0);
}

.crc-stamp-book-panel[hidden] {
    display: none;
}

.crc-stamp-book-panel {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10045;
}

.crc-stamp-book-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.crc-stamp-book-modal {
    position: relative;
    z-index: 1;
    width: min(90%, var(--crc-card-max-width, 720px));
    max-height: 82vh;
    padding: 36px 40px 32px;
    border-radius: 34px;
    background: linear-gradient(135deg, #e5f6f4 0%, #c2e0de 100%);
    box-shadow: 0 30px 80px rgba(29, 73, 87, 0.3);
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow: hidden;
}

.crc-stamp-book-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.crc-stamp-book-modal::after {
    content: '';
    position: absolute;
    inset: 24px;
    border-radius: 24px;
    border: 2px solid rgba(37, 81, 94, 0.25);
    pointer-events: none;
}

.crc-stamp-book-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    background-image: url('../img/close.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    color: #5aaeb6;
    font-size: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(44, 82, 93, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    appearance: none;
    outline: none;
}

.crc-stamp-book-close:hover,
.crc-stamp-book-close:focus-visible,
.crc-stamp-book-close:active,
.crc-stamp-book-close:focus {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(44, 82, 93, 0.28);
    background-color: #ffffff;
}

.crc-stamp-book-close::-moz-focus-inner {
    border: 0;
    padding: 0;
}

.crc-stamp-book-title {
    margin: 0;
    padding: 8px 30px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(54, 93, 105, 0.9) 0%, rgba(44, 82, 93, 0.95) 100%);
    color: #f5f9f9;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    position: relative;
    box-shadow: 0 12px 24px rgba(37, 81, 94, 0.35);
}

.crc-stamp-book-title::before,
.crc-stamp-book-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 24px;
    height: 1.5px;
    background: rgba(245, 249, 249, 0.6);
}

.crc-stamp-book-title::before {
    left: 18px;
}

.crc-stamp-book-title::after {
    right: 18px;
}

.crc-stamp-book-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 12px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.crc-stamp-book-section {
    position: relative;
    padding: 12px 0 0;
}

.crc-stamp-book-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2c525d;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 16px;
    margin-bottom: 18px;
    position: relative;
}

.crc-stamp-book-section-header::before,
.crc-stamp-book-section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(44, 82, 93, 0.35);
}

.crc-stamp-book-section-header::before {
    margin-right: 12px;
}

.crc-stamp-book-section-header::after {
    margin-left: 12px;
}

.crc-stamp-book-month {
    font-size: 16px;
    letter-spacing: 0.18em;
}

.crc-stamp-book-count {
    font-size: 13px;
    letter-spacing: 0.12em;
    color: rgba(44, 82, 93, 0.7);
}

.crc-stamp-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px 22px;
}

.crc-stamp-card {
    position: relative;
    padding: 16px 16px 10px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(233, 248, 247, 0.75) 100%);
    box-shadow: 0 18px 30px rgba(37, 81, 94, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border: 2px solid rgba(44, 82, 93, 0.12);
}

.crc-stamp-card::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px dashed rgba(44, 82, 93, 0.15);
    border-radius: 18px;
    pointer-events: none;
}

.crc-stamp-card-figure {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe0e0 0%, #f7cbcb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 6px solid #ffffff;
    box-shadow: 0 12px 24px rgba(255, 122, 122, 0.25);
}

.crc-stamp-card-figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-stamp-card-date {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: #2c525d;
}

.crc-stamp-book-empty {
    font-size: 16px;
    color: #2c525d;
    text-align: center;
    padding: 32px 0;
    font-weight: 600;
}

.crc-rally-card.crc-has-finished .crc-rally-controls,
.crc-rally-card.crc-has-finished .crc-rally-controls * {
    pointer-events: none;
    opacity: 0.55;
}
