/* ===== CHICKEN ROAD — asphalt road stage (Royale Violet chrome) ===== */
/* Stage ka look asal game jaisa: dhusar asphalt, safed dashed lane
 * lines, manhole multipliers, striped barriers, neela badge. Chrome
 * (stats, pills, chips) Royale Violet hi rehta hai. */

.cr-stage {
    --acc: #f59e0b;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(245, 158, 11, 0.13), transparent 60%),
        linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(245, 196, 81, 0.22);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 12px;
    width: 100%;
    max-width: 356px;
    margin: 0 auto;
}

.cr-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

/* difficulty pills — locked (disabled) while a round is live */
.cr-diff-row {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.cr-diff-btn {
    flex: 1;
    padding: 9px 2px;
    min-height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 196, 81, 0.18);
    border-radius: 10px;
    color: #a79fc2;
    font-weight: 800;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.cr-diff-btn.active {
    background: linear-gradient(180deg, #ffd76a, #e8a91c);
    color: #2a1a00;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(245, 196, 81, 0.4);
}
.cr-diff-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.cr-diff-btn:disabled.active { opacity: 1; }

/* the road scrolls sideways INSIDE the stage — the page never does */
.cr-road-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.cr-road-wrap::-webkit-scrollbar { display: none; }

.cr-road {
    position: relative;
    display: flex;
    height: 232px;
    width: max-content;
    min-width: 100%;
    /* asphalt: dhusar tar-coal, upar-neeche gehri kinari (curb) */
    background:
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.4px),
        radial-gradient(rgba(0, 0, 0, 0.16) 1px, transparent 1.4px),
        linear-gradient(180deg, #7d7d7d 0%, #707070 12%, #6a6a6a 88%, #5f5f5f 100%);
    background-size: 9px 9px, 13px 13px, 100% 100%;
    background-position: 0 0, 4px 6px, 0 0;
    border: 1px solid rgba(0, 0, 0, 0.45);
    border-radius: 14px;
    box-shadow: inset 0 9px 0 rgba(0, 0, 0, 0.22), inset 0 -11px 0 rgba(0, 0, 0, 0.28);
    overflow: hidden;
}
/* takkar ke pal poori road par laal jhalak */
.cr-road.cr-flash { animation: cr-road-flash 0.55s ease; }
@keyframes cr-road-flash {
    0%, 100% { box-shadow: inset 0 9px 0 rgba(0, 0, 0, 0.22), inset 0 -11px 0 rgba(0, 0, 0, 0.28), inset 0 0 0 rgba(239, 68, 68, 0); }
    30% { box-shadow: inset 0 9px 0 rgba(0, 0, 0, 0.22), inset 0 -11px 0 rgba(0, 0, 0, 0.28), inset 0 0 64px rgba(239, 68, 68, 0.6); }
}

.cr-pad {
    flex: 0 0 52px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    background: repeating-linear-gradient(45deg, #5c5c5c 0 10px, #525252 10px 20px);
    z-index: 1;
}
.cr-pad-start { border-right: 3px dashed rgba(255, 255, 255, 0.65); }
.cr-pad-finish { border-left: 3px dashed rgba(255, 255, 255, 0.65); }
.cr-pad-label {
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.75);
    writing-mode: vertical-rl;
}
.cr-pad-flag { font-size: 1.3rem; }

/* lane = asphalt ka hissa, dayein taraf safed dashed divider */
.cr-lane {
    position: relative;
    flex: 0 0 48px;
    border-right: 3px dashed rgba(255, 255, 255, 0.65);
    transition: background 0.25s;
}
.cr-lane.safe { background: linear-gradient(180deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.10)); }
.cr-lane.next {
    background: linear-gradient(180deg, rgba(245, 196, 81, 0.22), rgba(245, 196, 81, 0.10));
    box-shadow: inset 0 0 0 1px rgba(245, 196, 81, 0.5);
}
.cr-lane.crash {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.5), rgba(239, 68, 68, 0.28));
}

/* manhole cover — har lane ke beech, us step ka multiplier */
.cr-manhole {
    position: absolute;
    left: 50%;
    top: 92px;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #4e4e4e, #343434 68%, #262626);
    border: 2px solid #1e1e1e;
    box-shadow:
        inset 0 0 0 3px rgba(255, 255, 255, 0.05),
        inset 0 -5px 8px rgba(0, 0, 0, 0.55),
        0 2px 5px rgba(0, 0, 0, 0.4);
    color: #f3f4f6;
    font-size: 0.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.cr-manhole::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    pointer-events: none;
}
.cr-manhole.done { opacity: 0.55; }
.cr-manhole.next {
    color: #ffd76a;
    border-color: rgba(245, 196, 81, 0.75);
    box-shadow:
        inset 0 0 0 3px rgba(245, 196, 81, 0.15),
        inset 0 -5px 8px rgba(0, 0, 0, 0.55),
        0 0 12px rgba(245, 196, 81, 0.45);
}

/* striped barrier — paar ki hui lane ke upar, wapas ka rasta band */
.cr-barrier {
    position: absolute;
    top: 14px;
    left: 2px;
    right: 2px;
    height: 16px;
    border-radius: 3px;
    background: repeating-linear-gradient(45deg, #f5b81d 0 9px, #262626 9px 18px);
    border: 1px solid rgba(0, 0, 0, 0.55);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
    z-index: 2;
}
.cr-barrier::before,
.cr-barrier::after {
    content: '';
    position: absolute;
    bottom: -6px;
    width: 5px;
    height: 6px;
    background: #cfcfcf;
    border-radius: 0 0 2px 2px;
}
.cr-barrier::before { left: 6px; }
.cr-barrier::after { right: 6px; }

/* sajawati traffic — lane ke andar upar/neeche daudti gaadiyan */
.cr-traffic {
    position: absolute;
    left: 50%;
    top: 0;
    font-size: 1.45rem;
    line-height: 1;
    z-index: 3;
    pointer-events: none;
    will-change: transform;
}
.cr-traffic.down { animation-name: cr-drive-down; animation-timing-function: linear; animation-fill-mode: forwards; }
.cr-traffic.up { animation-name: cr-drive-up; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes cr-drive-down {
    from { transform: translate(-50%, -90px) rotate(-90deg); opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    to { transform: translate(-50%, 330px) rotate(-90deg); opacity: 0; }
}
@keyframes cr-drive-up {
    from { transform: translate(-50%, 330px) rotate(90deg); opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    to { transform: translate(-50%, -90px) rotate(90deg); opacity: 0; }
}

/* takkar wali gaadi — murgi ki kataar tak tez ghusti hai */
.cr-hitcar {
    position: absolute;
    left: 50%;
    top: 0;
    font-size: 1.7rem;
    line-height: 1;
    z-index: 5;
    pointer-events: none;
    animation: cr-rush 0.34s ease-in forwards;
}
@keyframes cr-rush {
    from { transform: translate(-50%, -90px) rotate(-90deg); }
    to { transform: translate(-50%, 152px) rotate(-90deg); }
}

/* murgi + neeche neela current-multiplier badge */
.cr-chicken {
    position: absolute;
    bottom: 20px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 4;
    transition: left 0.35s cubic-bezier(0.3, 0.9, 0.4, 1.2);
    pointer-events: none;
}
.cr-chicken-emoji {
    font-size: 2.3rem;
    line-height: 1;
    display: block;
    transform: scaleX(-1); /* murgi dayein (aage) dekhti hai */
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
}
.cr-badge {
    margin-top: 3px;
    position: relative;
    background: linear-gradient(180deg, #3f83c5, #2563a8);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    padding: 2px 7px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}
.cr-badge::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid #3f83c5;
}
.cr-chicken.hop { animation: cr-hop 0.35s ease; }
@keyframes cr-hop {
    0% { margin-bottom: 0; }
    45% { margin-bottom: 13px; }
    100% { margin-bottom: 0; }
}
.cr-chicken.crashed {
    animation: cr-shake 0.4s ease;
    filter: grayscale(0.4) drop-shadow(0 0 12px rgba(239, 68, 68, 0.8));
}
@keyframes cr-shake {
    0%, 100% { transform: translateX(-50%) rotate(0); }
    25% { transform: translateX(-56%) rotate(-14deg); }
    50% { transform: translateX(-44%) rotate(12deg); }
    75% { transform: translateX(-52%) rotate(-6deg); }
}
.cr-chicken.celebrate { animation: cr-celebrate 0.38s ease; }
.cr-chicken.celebrate::after {
    content: '✨';
    position: absolute;
    top: -15px;
    right: -13px;
    font-size: 1rem;
    animation: cr-sparkle 0.5s ease forwards;
}
@keyframes cr-celebrate {
    0% { margin-bottom: 0; }
    35% { margin-bottom: 16px; }
    70% { margin-bottom: 2px; }
    100% { margin-bottom: 0; }
}
@keyframes cr-sparkle {
    from { opacity: 0; transform: translateY(4px) scale(0.6); }
    to { opacity: 1; transform: translateY(-4px) scale(1.1); }
}

/* multiplier ladder — chips scroll sideways inside the stage */
.cr-ladder {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.cr-ladder::-webkit-scrollbar { display: none; }
.cr-chip {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 196, 81, 0.16);
    color: #a79fc2;
    font-size: 0.62rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cr-chip.done {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.45);
    color: #86efac;
}
.cr-chip.next {
    background: linear-gradient(180deg, #ffd76a, #e8a91c);
    border-color: transparent;
    color: #2a1a00;
}

/* chickenroad controls: cashout label carries mult + payout — give it room */
.controls-group[data-controls="chickenroad"] .action-btn.cashout {
    max-width: 250px;
    font-size: 0.82rem;
    letter-spacing: 0.4px;
    padding: 0 8px;
}
.controls-group[data-controls="chickenroad"] .action-btn.primary::before { content: "🐔 "; }

@media (max-height: 700px) {
    .cr-stage { padding: 10px; }
    .cr-road { height: 196px; }
    .cr-manhole { top: 74px; }
    @keyframes cr-rush {
        from { transform: translate(-50%, -90px) rotate(-90deg); }
        to { transform: translate(-50%, 118px) rotate(-90deg); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .cr-traffic, .cr-hitcar, .cr-chicken.hop, .cr-chicken.crashed,
    .cr-chicken.celebrate, .cr-road.cr-flash { animation: none !important; }
    .cr-chicken { transition: none; }
}
