/* ============================================
   RUTA DE PREMIOS — CUSTOM STYLES
   Extends styles.css shared base
   ============================================ */

:root {
    --prize-size: 75px;
    --prize-size-mobile: 64px;
    --line-width: 16px;
    --line-color: #333;
    --line-fill: linear-gradient(180deg, #EA7600, #FF6B35);
    --unlock-glow: 0 0 20px rgba(234, 118, 0, 0.5);
    --route-bg: #FFFFFF;
    --route-panel: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
    --hub-size: 48px;
    --branch-bar: 10px;
}

/* ============================================
   RUTA LAYOUT (override center-content)
   ============================================ */
.ruta-layout {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.ruta-center {
    background: #ffffff;
    padding: 30px;
    width: 100%;
    max-width: 1000px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E5E5;
}

body.dark-theme .ruta-center {
    background: #111111;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(234, 118, 0, 0.15);
    border: 1px solid #222;
}

/* Page Title - Club PETROMAYAB Vibe */
.page-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 800;
    font-style: italic;
    color: var(--brand-red);
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

body.dark-theme .page-title {
    color: #ffffff;
    text-shadow: 2px 2px 0px var(--brand-red), 0 0 15px rgba(234, 118, 0, 0.6);
}

/* ============================================
   CAMPAIGN TABS (Nacional vs Local)
   ============================================ */
.campaign-tabs {
    display: flex;
    gap: 4px;
    padding: 0 4px;
    margin: 20px 0 0;
    background: transparent;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
}

.campaign-tabs::-webkit-scrollbar {
    display: none;
}

.campaign-tabs.hidden {
    display: none;
}

body.dark-theme .campaign-tabs {
    border-bottom-color: #333;
}

.campaign-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 16px;
    background: #F5F5F5;
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    color: #888;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
    top: 2px;
}

body.dark-theme .campaign-tab {
    background: #1a1a1a;
    color: #666;
}

.campaign-tab:hover {
    background: #ebebeb;
    color: #333;
}

body.dark-theme .campaign-tab:hover {
    background: #252525;
    color: #abaaaa;
}

.campaign-tab.active {
    color: var(--brand-red);
    background: #ffffff;
    border-color: #E5E5E5;
    border-bottom: 2px solid #ffffff;
    z-index: 2;
}

body.dark-theme .campaign-tab.active {
    background: #111111;
    border-color: #333;
    border-bottom: 2px solid #111111;
    text-shadow: 0 0 10px rgba(234, 118, 0, 0.4);
}

.tab-icon {
    font-size: 1.1rem;
}

/* ============================================
   USER SUMMARY BAR
   ============================================ */
.user-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-radius: 14px;
    padding: 14px 24px;
    color: #fff;
    flex-shrink: 0;
    margin-top: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    /* Keep it readable */
    margin-left: auto;
    margin-right: auto;
}

.summary-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.summary-info {
    flex: 1;
    min-width: 0;
}

.summary-info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.summary-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.puntos-badge {
    background: var(--brand-red);
    color: #fff;
}

.desbloqueados-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #ccc;
}

/* Progress Ring */
.summary-progress {
    flex-shrink: 0;
}

.progress-ring {
    position: relative;
    width: 48px;
    height: 48px;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.ring-fill {
    fill: none;
    stroke: var(--brand-red);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    stroke-dashoffset: 113.1;
    transition: stroke-dashoffset 1.5s ease-out;
}

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6rem;
    font-weight: 800;
    color: #fff;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--brand-red);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: toastSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.toast.visible {
    display: flex;
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
    line-height: 1.35;
}

/* ============================================
   PRIZE ROUTE PATH (Starcraft Skill-Tree)
   ============================================ */
.prize-route {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0;
    padding: 30px 20px 40px;
    position: relative;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    width: 100%;
    background: var(--route-panel);
    border-radius: 16px;
    border: 1px solid #E5E5E5;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
    scrollbar-color: #CCCCCC #F0F0F0;
}

body.dark-theme .prize-route {
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 100%);
    border: 2px solid #2a2a2a;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
    scrollbar-color: #444 #111;
}

.prize-route::-webkit-scrollbar {
    width: 6px;
}

.prize-route::-webkit-scrollbar-track {
    background: #F0F0F0;
    border-radius: 4px;
}

body.dark-theme .prize-route::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
}

.prize-route::-webkit-scrollbar-thumb {
    background: #CCCCCC;
    border-radius: 4px;
}

body.dark-theme .prize-route::-webkit-scrollbar-thumb {
    background: #444;
}

.prize-route::-webkit-scrollbar-thumb:hover {
    background: var(--brand-red);
}

/* --- START NODE --- */
.start-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 10px;
}

.start-circle {
    width: 110px;
    height: 130px;
    background: #FFFFFF;
    color: var(--brand-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: relative;
}

body.dark-theme .start-circle {
    background: #1a1a1a;
    color: #fff;
}

/* Hexagonal shape for start node */
.start-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #FFFFFF;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    z-index: 0;
}

body.dark-theme .start-circle::before {
    background: #1a1a1a;
}

.start-circle::after {
    content: '';
    position: absolute;
    inset: -3px;
    background: var(--brand-red);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    z-index: -1;
    box-shadow: 0 0 12px rgba(234, 118, 0, 0.2);
}

.start-circle>* {
    position: relative;
    z-index: 1;
}

.start-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #777;
    text-transform: uppercase;
}

/* --- PRIZE NODE (zero height — prizes float beside their hex) --- */
.prize-node {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 0;
    overflow: visible;
    flex-shrink: 0;
    cursor: pointer;
    z-index: 4;
}

.prize-node:hover {
    z-index: 5;
}

/* --- HEXAGONAL SPINE CONNECTOR (SC-style triple layer) --- */
.prize-connector {
    width: 110px;
    height: 130px;
    position: relative;
    flex-shrink: 0;
    margin: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Layer 2: White background hex (the visible gap between border and fill) */
.prize-connector::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #FFFFFF;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    z-index: 0;
}

body.dark-theme .prize-connector::before {
    background: #111;
}

/* Layer 1: Outer glow border (slightly larger hex behind everything) */
.prize-connector::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: #E5E5E5;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    z-index: -1;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

body.dark-theme .prize-connector::after {
    background: #333;
}

/* Layer 3: Inner fill area — the actual content hex */
.prize-connector .connector-fill {
    display: block;
    position: absolute;
    inset: 4px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: #F9F9F9;
    z-index: 1;
    transition: background 0.6s ease;
}

body.dark-theme .prize-connector .connector-fill {
    /* No black shadow lines for empty state */
    background: #111;
}

/* ---- FILLED (unlocked) state ---- */
.prize-connector.filled .connector-fill {
    background:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.15) 20px,
            rgba(255, 255, 255, 0.15) 23px),
        linear-gradient(180deg, var(--brand-red) 0%, #aa0d22 100%);
}

body.dark-theme .prize-connector.filled .connector-fill {
    background:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 20px,
            rgba(0, 0, 0, 0.6) 20px,
            rgba(0, 0, 0, 0.6) 23px),
        linear-gradient(180deg, #EA7600 0%, #8B1500 100%);
}

.prize-connector.filled::after {
    background: var(--brand-red);
    box-shadow: 0 0 10px rgba(234, 118, 0, 0.4);
}

/* ---- PARTIAL fill state ---- */
.prize-connector.partial .connector-fill {
    background:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.15) 20px,
            rgba(255, 255, 255, 0.15) 23px),
        linear-gradient(to top,
            var(--brand-red) 0%,
            var(--brand-red) var(--pct, 0%),
            #F9F9F9 var(--pct, 0%),
            #F9F9F9 100%);
}

body.dark-theme .prize-connector.partial .connector-fill {
    background:
        /* Apply shadow lines ONLY to the filled portion, leaving top #111 solid */
        repeating-linear-gradient(0deg,
            transparent,
            transparent 20px,
            rgba(0, 0, 0, 0.6) 20px,
            rgba(0, 0, 0, 0.6) 23px),
        linear-gradient(to top,
            #EA7600 0%,
            #EA7600 var(--pct, 0%),
            #111 var(--pct, 0%),
            #111 100%);
}

.prize-connector.partial::after {
    background: linear-gradient(to top,
            var(--brand-red) 0%,
            var(--brand-red) var(--pct, 0%),
            #E5E5E5 var(--pct, 0%),
            #E5E5E5 100%);
}

body.dark-theme .prize-connector.partial::after {
    background: linear-gradient(to top,
            #FF6B35 0%,
            #FF6B35 var(--pct, 0%),
            #555 var(--pct, 0%),
            #555 100%);
}

/* Number label — at hex JUNCTION point (centered exactly on the line) */
.hex-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    font-size: 0.65rem;
    font-weight: 900;
    color: #111;
    background: #FFFFFF;
    padding: 1px 8px;
    border-radius: 12px;
    border: 1px solid #ccc;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

body.dark-theme .hex-label {
    background: #1a1a1a;
    color: #fff;
    border-color: #444;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.prize-node.unlocked .hex-label {
    color: var(--brand-red);
    border-color: var(--brand-red);
}

body.dark-theme .prize-node.unlocked .hex-label {
    color: #FF6B35;
    border-color: #FF6B35;
}

.prize-node.current-target .hex-label {
    color: #888;
}

/* --- PRIZE CARD (Metallic dark frame) --- */
.prize-circle-wrapper {
    width: var(--prize-size);
    height: var(--prize-size);
    flex-shrink: 0;
    position: relative;
}

.prize-front {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #444;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.2);
    transition: border-color 0.4s, box-shadow 0.4s, transform 0.2s;
    background: #1a1a1a;
}

.prize-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    pointer-events: none;
    user-select: none;
}

/* Unlocked state (Starcraft Glow Style) */
.prize-node.unlocked .prize-front {
    border-color: var(--brand-red);
    box-shadow: 0 0 12px rgba(234, 118, 0, 0.8), inset 0 0 10px rgba(234, 118, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-theme .prize-node.unlocked .prize-front {
    border-color: #ff3333;
    box-shadow: 0 0 18px rgba(255, 51, 51, 0.9), inset 0 0 15px rgba(255, 51, 51, 0.5), 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Locked state */
.prize-node.locked .prize-front {
    filter: grayscale(0.8);
    opacity: 0.5;
    border-color: #333;
}

.prize-node.locked .prize-circle-wrapper {
    cursor: not-allowed;
}

/* --- LOCK OVERLAY --- */
.lock-overlay {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    background: #888;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #fff;
    z-index: 2;
    border: 2px solid #fff;
}

.prize-node.unlocked .lock-overlay {
    background: #2E7D32;
}

.prize-node.unlocked .lock-overlay::after {
    content: '✓';
    font-weight: 900;
}

.prize-node.locked .lock-overlay::after {
    content: '🔒';
}

/* --- PRIZE INFO (text beside circle) --- */
.prize-info {
    flex: 1;
    min-width: 0;
}

.prize-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 2px;
}

body.dark-theme .prize-name {
    color: #e0e0e0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.prize-threshold {
    font-size: 0.65rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

body.dark-theme .prize-threshold {
    color: #888;
}

.prize-node.unlocked .prize-name {
    color: #FF6B35;
    text-shadow: 0 0 8px rgba(234, 118, 0, 0.3);
}

.prize-node.unlocked .prize-threshold {
    color: #4CAF50;
}

/* --- CURRENT POSITION MARKER --- */
.prize-node.current-target .prize-front {
    animation: currentPulse 2s infinite;
}

@keyframes currentPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(234, 118, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(234, 118, 0, 0);
    }
}

.prize-node.current-target .prize-info::after {
    content: '✦ ¡Próximo premio!';
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--brand-red);
    margin-top: 2px;
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* --- START NODE --- */
.start-node {
    display: none;
}

.start-node .start-circle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a1a1a, #333);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    font-weight: 900;
    border: 3px solid #555;
}

.start-node .start-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- CHOICE NODE (Branches float beside hex chain) --- */

.choices-wrapper {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Center perfectly on the top junction point */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 380px;
    pointer-events: auto;
}

/* Drawing the horizontal branching lines (subtle) */
.choices-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    width: 80%;
    height: 2px;
    background: #333;
    z-index: 0;
    opacity: 0.5;
}

.prize-node.unlocked .choices-wrapper::before {
    background: rgba(234, 118, 0, 0.3);
    opacity: 0.6;
}

/* ONLY ONE CHOICE (Alternating Left/Right layout) */
.choices-wrapper.single-choice.align-right {
    justify-content: flex-end;
}

.choices-wrapper.single-choice.align-right::before {
    left: 40%;
    width: 50%;
}

.choices-wrapper.single-choice.align-left {
    justify-content: flex-start;
}

.choices-wrapper.single-choice.align-left::before {
    left: 10%;
    width: 50%;
}

/* Prizes are now rigidly aligned to the top hex junction, no manual staggering needed */

.prize-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
    width: 90px;
    z-index: 2;
}

.prize-choice:hover {
    transform: scale(1.05);
}

.prize-choice .prize-name {
    font-size: 0.65rem;
    text-align: center;
    line-height: 1.1;
    color: #ccc;
    padding: 2px 4px;
    border-radius: 4px;
}

.prize-choice .prize-circle-wrapper {
    width: var(--prize-size);
    height: var(--prize-size);
}

.prize-choice.rejected .prize-front,
.prize-choice.out-of-stock .prize-front {
    filter: grayscale(1);
    opacity: 0.6;
}

.prize-choice.out-of-stock {
    cursor: not-allowed;
}

.stock-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 5;
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #FF8F00, #F57F17);
    padding: 3px 6px;
    border-radius: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(245, 127, 23, 0.4);
    animation: badgePulse 2.5s ease-in-out infinite;
    line-height: 1;
}

.stock-badge .stock-count {
    font-size: 0.7rem;
    font-weight: 900;
}

.stock-badge .stock-sep {
    font-size: 0.5rem;
    opacity: 0.7;
    margin: 0 1px;
}

.stock-badge .stock-total {
    font-size: 0.5rem;
    font-weight: 600;
    opacity: 0.75;
}

.stock-badge.urgente {
    background: linear-gradient(135deg, #E53935, #FF6F00);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.5);
    animation: badgePulse 1.2s ease-in-out infinite;
}

.stock-badge.agotado {
    font-size: 0.55rem;
    background: linear-gradient(135deg, #C96500, #D32F2F);
    box-shadow: 0 2px 6px rgba(198, 40, 40, 0.4);
    animation: none;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

.prize-choice-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 8px;
    position: relative;
}

.prize-choice-meta .prize-tooltip {
    bottom: -32px;
    top: auto;
}

.choice-node-container {
    width: auto;
}

/* --- SHAKE ANIMATION (locked click) --- */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.prize-node.shake {
    animation: shake 0.4s ease-in-out;
}

/* --- TOOLTIP --- */
.prize-tooltip {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.prize-tooltip.visible {
    opacity: 1;
}

.prize-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
}

/* --- UNLOCK BURST ANIMATION --- */
@keyframes unlockBurst {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.prize-node.just-unlocked .prize-front {
    animation: unlockBurst 0.6s ease-out;
}

/* --- CONFETTI CANVAS --- */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ============================================
   BOTTOM SHEET MODAL
   ============================================ */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sheet-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.prize-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 16px 24px 30px;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    max-height: 95vh;
    overflow-y: auto;
}

.prize-sheet.visible {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .prize-sheet {
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        border-radius: 20px;
        transform: translate(-50%, calc(-50% + 120vh));
        max-height: 90vh;
    }

    .prize-sheet.visible {
        transform: translate(-50%, -50%);
    }
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.sheet-emoji {
    margin-bottom: 10px;
    line-height: 1;
    display: flex;
    justify-content: center;
}

.sheet-prize-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.sheet-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #222;
    margin: 0 0 10px;
    font-family: var(--font);
}

.sheet-description {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.5;
    margin: 0 0 14px;
    font-weight: 500;
}

.sheet-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.sheet-meta .meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #555;
}

.sheet-meta .meta-tag.unlocked-tag {
    background: #e8f5e9;
    color: #2E7D32;
}

.sheet-btn {
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: block;
}

.sheet-btn:hover {
    transform: scale(1.02);
}

.sheet-btn-redeem {
    background: var(--brand-red);
    color: #fff;
    margin-bottom: 8px;
}

.sheet-btn-redeem:hover {
    background: #b91d00;
}

.sheet-btn-redeem.redeemed {
    background: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

.sheet-btn-close {
    background: #f0f0f0;
    color: #555;
}

.sheet-btn-close:hover {
    background: #e0e0e0;
}

/* Sheet steps */
.sheet-step {
    text-align: center;
}

.sheet-step.hidden {
    display: none;
}

/* --- CONFIRMATION STEP --- */
.confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.confirm-text {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.5;
    margin: 0 0 18px;
    font-weight: 500;
}

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.sheet-btn-confirm {
    background: #2E7D32;
    color: #fff;
}

.sheet-btn-confirm:hover {
    background: #1b5e20;
}

.sheet-btn-cancel {
    background: #f0f0f0;
    color: #555;
}

.sheet-btn-cancel:hover {
    background: #e0e0e0;
}

/* --- QR CODE STEP --- */
.qr-container {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.qr-image {
    width: 280px;
    height: 280px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border: 8px solid #fff;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.qr-instruction {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
}

.countdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a1a1a;
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 900;
    font-family: 'Inter', monospace;
    margin-bottom: 10px;
    animation: countdownPulse 1.5s infinite;
}

@keyframes countdownPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(234, 118, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(234, 118, 0, 0);
    }
}

.countdown-badge.urgent {
    background: var(--brand-red);
    animation: countdownPulse 0.8s infinite;
}

.countdown-icon {
    font-size: 1rem;
}

.countdown-time {
    letter-spacing: 1px;
}

.qr-code-text {
    font-size: 0.6rem;
    color: #aaa;
    margin: 0;
    font-family: monospace;
    letter-spacing: 1px;
}

/* --- LOCK OVERLAY (during redemption) --- */
.redeem-lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(3px);
}

.redeem-lock-overlay.hidden {
    display: none;
}

/* --- CANJEADO state (redeemed prizes) --- */
.prize-node.canjeado .prize-front {
    border-color: #555;
    opacity: 0.5;
    filter: grayscale(0.5);
}

.prize-node.canjeado .lock-overlay {
    background: #444;
}

.prize-node.canjeado .lock-overlay::after {
    content: '✓';
    font-weight: 900;
}

.prize-node.canjeado .prize-name {
    color: #666;
    text-decoration: line-through;
}

.prize-node.canjeado .prize-threshold {
    color: #555;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 700px) {

    .ruta-layout {
        padding: 0;
    }

    .ruta-center {
        padding: 16px 12px;
        border-radius: 0;
        box-shadow: none;
    }

    .campaign-tabs {
        margin: 16px 0 0;
    }

    .campaign-tab {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .user-summary {
        margin-top: 20px;
        padding: 12px 14px;
        gap: 10px;
        margin-bottom: 8px;
    }

    .summary-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }

    .summary-info strong {
        font-size: 0.8rem;
    }

    .stat-badge {
        font-size: 0.58rem;
        padding: 2px 6px;
    }

    .progress-ring {
        width: 40px;
        height: 40px;
    }

    .ring-text {
        font-size: 0.5rem;
    }

    .toast {
        padding: 8px 12px;
        margin-bottom: 8px;
    }

    /* Mobile Vertical Route logic */
    .prize-route {
        padding: 20px 0 10px;
    }

    .prize-node {
        width: 100%;
    }

    /* Shrink the gap between choices slightly on mobile */
    .choices-wrapper {
        gap: 30px;
    }

    .prize-choice {
        width: 65px;
    }

    .start-circle {
        width: var(--prize-size-mobile);
        height: var(--prize-size-mobile);
        font-size: 1.3rem;
    }

    .prize-circle-wrapper,
    .prize-choice .prize-circle-wrapper {
        width: var(--prize-size-mobile);
        height: var(--prize-size-mobile);
    }

    .prize-choice {
        width: 70px;
    }

    .prize-front {
        border-radius: 14px;
    }

    .prize-name {
        font-size: 0.75rem;
    }

    .prize-threshold {
        font-size: 0.6rem;
    }

    .prize-connector {
        width: 100px;
        height: 110px;
    }

    .start-circle {
        width: 100px;
        height: 110px;
    }

    .choices-wrapper {
        width: 320px;
    }

    .page-title {
        font-size: 1.2rem !important;
    }

    .prize-sheet {
        padding: 14px 18px 26px;
    }

    .sheet-emoji {
        margin-bottom: 8px;
    }

    .sheet-prize-img {
        width: 64px;
        height: 64px;
        border-radius: 12px;
    }

    .sheet-title {
        font-size: 1rem;
    }

    .sheet-description {
        font-size: 0.82rem;
    }
}

@media (max-width: 420px) {

    :root {
        --prize-size: 50px;
    }

    .prize-circle-wrapper {
        width: 50px;
        height: 50px;
    }

    .prize-front {
        border-radius: 10px;
    }

    .prize-name {
        font-size: 0.6rem;
    }

    .prize-threshold {
        font-size: 0.5rem;
    }

    .prize-connector {
        width: 90px;
        height: 100px;
    }

    .start-circle {
        width: 90px;
        height: 100px;
    }

    .choices-wrapper {
        width: 280px;
    }

    .hex-label {
        font-size: 0.55rem;
    }

    .summary-info strong {
        font-size: 0.72rem;
    }

    .page-title {
        font-size: 1rem !important;
    }
}