:root {
    --surface: #faf9fd;
    --surface-container-low: #f4f3f7;
    --surface-container: #efedf1;
    --surface-container-high: #e9e7eb;
    --surface-container-highest: #e3e2e6;
    --surface-container-lowest: #ffffff;
    --on-surface: #1a1b1e;
    --on-surface-variant: #414754;
    --primary: #005bbf;
    --primary-container: #1a73e8;
    --on-primary: #ffffff;
    --on-primary-fixed: #001a41;
    --primary-fixed: #d8e2ff;
    --secondary: #006e2a;
    --secondary-container: #8ffa9b;
    --on-secondary: #ffffff;
    --on-secondary-container: #00531e;
    --outline: #727785;
    --outline-variant: #c1c6d6;
    --error: #ba1a1a;
    --error-container: #ffdad6;
    --on-error-container: #93000a;
    --inverse-surface: #2f3033;
    --inverse-on-surface: #f1f0f4;
    --inverse-primary: #adc7ff;
}

.quiniela-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.quiniela-header .material-symbols-outlined {
    font-size: 28px;
    color: var(--primary);
}

/* Group filter pills */
.group-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 8px;
}

/* Sticky filter wrapper */
.filters-sticky-wrapper {
    position: sticky;
    top: 140px;
    z-index: 10;
    background: var(--surface);
    padding: 8px 0;
}
@media (max-width: 991px) {
    .filters-sticky-wrapper { top: 60px; }
}
@media (max-width: 991px) {
    .filters-sticky-wrapper { top: 60px; }
    body { padding-bottom: 80px !important; }
    .quiniela-header { margin-top: 24px; margin-bottom: 24px; }
    .filters-sticky-wrapper .group-filters { margin-top: 48px; }
    .quiniela-bottom-bar { margin-bottom: 24px; }
    .group-filters {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .group-filters::-webkit-scrollbar { display: none; }
}
.group-filter-pill {
    font-size: 14px;
    font-weight: 500;
    padding: 6px 20px;
    border-radius: 9999px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: all .2s;
    background: var(--surface-container);
    color: var(--on-surface-variant);
    border: 1px solid var(--outline-variant);
}
.group-filter-pill:hover {
    background: var(--surface-container-high);
}
.group-filter-pill.active {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
}

/* Match card */
.match-card {
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: transform .2s;
}
.match-card:hover {
    transform: translateY(-2px);
}
.match-card-header {
    background: var(--surface-container-low);
    padding: 8px 16px;
    border-bottom: 1px solid var(--outline-variant);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.match-card-header span {
    font-size: 12px;
    font-weight: 500;
    color: var(--on-surface-variant);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.match-card-body {
    padding: 16px;
}
.match-predictions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

/* Selection buttons */
.selection-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 8px;
    border: 2px solid var(--outline-variant);
    background: transparent;
    cursor: pointer;
    transition: all .15s;
    position: relative;
    min-height: 90px;
}
.selection-btn:hover:not(.disabled) {
    border-color: var(--primary);
    background: #f0f4ff;
}
.selection-btn .flag-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.selection-btn .btn-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--on-surface);
}
.selection-btn .draw-icon {
    font-size: 24px;
    color: var(--outline);
}
.selection-btn .draw-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--on-surface);
}

/* Selected state */
.selection-btn.selected {
    background: var(--secondary-container);
    border-color: var(--secondary);
    box-shadow: 0 2px 8px rgba(0,110,42,.2);
}
.selection-btn.selected .btn-label,
.selection-btn.selected .draw-label {
    color: var(--on-secondary-container);
}
.selection-btn.selected .draw-icon {
    color: var(--on-secondary-container);
}
.selection-check {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 16px;
    color: var(--secondary);
}
.selection-btn.selected .selection-check {
    display: block;
}

/* Disabled state */
.selection-btn.disabled {
    cursor: not-allowed;
    opacity: .5;
}
.selection-btn.disabled:hover {
    border-color: var(--outline-variant);
    background: transparent;
}

/* Progress section */
.progress-section {
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 12px;
    padding: 16px;
}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.progress-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--on-surface-variant);
}
.progress-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}
.progress-bar-track {
    width: 100%;
    background: var(--surface-container-highest);
    border-radius: 9999px;
    height: 8px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 9999px;
    transition: width .5s;
}

/* Circular progress (mobile) */
.circular-progress {
    width: 64px;
    height: 64px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.circular-progress .bg-circle {
    fill: none;
    stroke: var(--surface-container-high);
    stroke-width: 4;
}
.circular-progress .fg-circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset .5s;
}
.circular-progress .pct-text {
    position: absolute;
    font-size: 12px;
    font-weight: 700;
    color: var(--on-surface);
}

/* Reward section */
.reward-section {
    background: var(--primary-fixed);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}
.reward-section p {
    font-size: 12px;
    color: var(--on-primary-fixed);
    margin-bottom: 8px;
}
.reward-section .reward-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--on-primary-fixed);
}
.reward-section .reward-item .material-symbols-outlined {
    font-size: 20px;
}

/* Share section */
.share-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--outline-variant);
}
.share-section p {
    font-size: 12px;
    font-weight: 500;
    color: var(--on-surface-variant);
    margin-bottom: 8px;
    text-align: center;
}
.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform .2s;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.share-btn:hover {
    transform: scale(1.1);
}
.share-btn .material-symbols-outlined {
    font-size: 20px;
    color: #fff;
}
.share-btn-whatsapp { background: #25D366; }
.share-btn-twitter { background: #000; }
.share-btn-facebook { background: #1877F2; }
.share-btn-copy {
    background: var(--surface-container-high);
    border: 1px solid var(--outline-variant);
}
.share-btn-copy .material-symbols-outlined {
    color: var(--on-surface-variant);
}

/* Progress sidebar (desktop) */
.progress-sidebar {
    position: sticky;
    top: 150px;
}

/* Fixed bottom bar (mobile) */
.quiniela-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: var(--surface-container-lowest);
    border-top: 1px solid var(--outline-variant);
    padding: 8px 0 12px;
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.quiniela-bottom-bar .btn {
    font-size: 14px;
    white-space: nowrap;
}
@media (max-width: 991px) {
    body { padding-bottom: 80px !important; }
}

/* Confetti */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confetti-fall 3s ease-out infinite;
}
@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(300px) rotate(720deg); opacity: 0; }
}

/* Success animation */
@keyframes success-scale {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
.success-check-anim {
    animation: success-scale .6s cubic-bezier(.175,.885,.32,1.275) forwards;
}

/* Responsive */
@media (max-width: 575px) {
    .match-predictions { gap: 4px; }
    .selection-btn { padding: 10px 4px; min-height: 80px; }
    .selection-btn .flag-img { width: 24px; height: 24px; }
    .selection-btn .btn-label { font-size: 10px; }
    .match-card-body { padding: 12px; }
}

/* Toast / alert custom */
.alert-soft {
    border-radius: 12px;
    border: 1px solid var(--outline-variant);
}
