:root {
    --primary-color: #14B8A6;
    --primary-dark: #0F766E;
    --secondary-color: #F59E0B;
    --secondary-dark: #B45309;
    --dark-bg-color: #1E293B;
    --text-primary-light: #F1F5F9;
    --text-primary-dark: #334155;
    --background-color: #F8FAFC;
    --card-background: #FFFFFF;
    --border-color: #E2E8F0;
    --border-radius-lg: 0.75rem;
    --border-radius-sm: 0.5rem;
    --btn-blue: #3B82F6;
    --btn-red: #EF4444;
    --btn-green: #22C55E;
}
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: pan-x;
}
#participants-map-container,
#eta-map-container,
#map-container {
    touch-action: auto !important;
}
.app-container {
    width: 100%;
    max-width: 420px;
    background-color: var(--card-background);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 7rem;
    animation: fadeIn 0.4s ease-in-out;
}
.page {
    display: none;
}
.page.active {
    display: block;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-container img {
    height: 8rem;
    width: auto;
}
.header-bg {
    background-color: var(--dark-bg-color);
    color: var(--text-primary-light);
    padding: 1rem 1rem;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-bg img {
    height: 5rem;
    width: auto;
    opacity: 0.7;
    margin-right: 0;
}
.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    height: 200px;
}
.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}
.slider-item {
    min-width: 100%;
    position: relative;
    height: 100%;
}
.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.banner-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.banner-container::-webkit-scrollbar {
    display: none;
}
.banner-wrapper {
    display: flex;
    gap: 1rem;
    padding: 0.25rem;
}
.banner-item {
    display: inline-block;
    width: 85%;
    flex-shrink: 0;
    height: 110px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.menu-item:hover {
    transform: translateY(-4px);
    box-shadow: 8px 20px -4px rgba(0, 0, 0, 0.15);
}
.menu-item i {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}
.menu-item span {
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.menu-item.primary {
    background-color: var(--primary-color);
}
.menu-item.secondary {
    background-color: var(--secondary-color);
}
.menu-item.blue {
    background-color: var(--btn-blue);
}
.menu-item.red {
    background-color: var(--btn-red);
}
.bottom-nav {
    max-width: 420px;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    background-color: var(--card-background);
}
.nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}
.nav-item.active i {
    transform: scale(1.1);
}
.nav-item .badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--btn-red);
    color: white;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    font-size: 0.6rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.card {
    background-color: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}
.btn {
    border-radius: var(--border-radius-sm);
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}
.btn:hover {
    transform: translateY(-2px);
}
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--dark-bg-color);
}
.btn-secondary:hover {
    background-color: var(--secondary-dark);
}
.btn-full {
    border-radius: var(--border-radius-sm);
}
.rounded-full-btn {
    border-radius: 9999px;
}
input,
select,
textarea {
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
    outline: none;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.modal-content {
    background-color: var(--card-background);
    border-radius: 1.5rem 1.5rem 0 0;
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    animation: slideUp 0.3s ease-out forwards;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content.fullscreen {
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
}
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.75rem;
    font-weight: 300;
    cursor: pointer;
    color: #9CA3AF;
    z-index: 10;
}
.modal-back {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    color: var(--text-primary-dark);
    cursor: pointer;
}
.modal-header {
    position: sticky;
    top: 0;
    background: var(--card-background);
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}
@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
.blinking-live {
    animation: blink 1s linear infinite;
}
.blinking-clocking {
    animation: blink 1s infinite;
}
.blinking-tab {
    animation: blink 1.5s linear infinite;
}
.tab-button {
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
}
.tab-button.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.tab-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 2px solid var(--border-color);
}
.notif-motif {
    background-image: linear-gradient(45deg, #f0fdfa 25%, transparent 25%), linear-gradient(-45deg, #f0fdfa 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f0fdfa 75%), linear-gradient(-45deg, transparent 75%, #f0fdfa 75%);
    background-size: 10px 10px;
}
#reader {
    width: 100%;
    height: auto;
}
#reader video {
    width: 100%;
    height: auto;
}
.pigeon-detail-modal-content {
    max-height: 90vh;
    width: 100%;
    max-width: 420px;
    margin-top: auto;
    background-color: var(--card-background);
    padding: 0;
    overflow: hidden;
    border-radius: 1.5rem 1.5rem 0 0;
    display: flex;
    flex-direction: column;
}
.pigeon-detail-header-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.pigeon-detail-header-photo {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}
.pigeon-detail-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 60%);
}
.pigeon-header-info {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    color: white;
    z-index: 5;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
.pigeon-detail-name {
    font-size: 1.5rem;
    font-weight: 600;
}
.pigeon-detail-ring {
    font-size: 0.875rem;
    font-family: monospace;
    margin-top: 0.25rem;
}
.modal-close-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: none;
    cursor: pointer;
}
.pigeon-owner-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}
.pigeon-detail-scroll-container {
    padding: 1rem;
    overflow-y: auto;
    flex-grow: 1;
}
.rank-card-wrapper {
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.rank-card-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, transparent, transparent, #F59E0B);
    animation: rotate 4s linear infinite;
    z-index: -1;
}
.rank-card-content {
    background: white;
    z-index: 2;
    position: relative;
}
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.rank-1-wrapper::before {
    background: conic-gradient(transparent, transparent, transparent, #F59E0B);
}
.rank-2-wrapper::before {
    background: conic-gradient(transparent, transparent, transparent, #9CA3AF);
}
.rank-3-wrapper::before {
    background: conic-gradient(transparent, transparent, transparent, #B45309);
}
.rank-1-icon {
    color: #F59E0B;
    text-shadow: 0 0 5px #F59E0B;
}
.rank-2-icon {
    color: #9CA3AF;
    text-shadow: 0 0 5px #9CA3AF;
}
.rank-3-icon {
    color: #B45309;
    text-shadow: 0 0 5px #B45309;
}
.header-filter-container {
    background-color: var(--border-color);
    border-radius: 999px;
    padding: 0.25rem;
    display: flex;
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
}
.header-filter-btn {
    flex: 1;
    padding: 0.625rem 0.5rem;
    border-radius: 999px;
    border: none;
    background-color: transparent;
    color: var(--text-primary-dark);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}
.header-filter-btn.active {
    background-color: var(--card-background);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.sub-filter-container {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-color);
}
.sub-filter-container::-webkit-scrollbar {
    display: none;
}
.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background-color: var(--card-background);
    color: var(--text-secondary-dark);
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}
.filter-btn:not(.active):hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #f0fdfa;
}
.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}
.tab-group-container {
    display: flex;
    padding: 0.375rem;
    background-color: var(--border-color);
    border-radius: 999px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    margin: 1rem;
}
.tab-group-button {
    flex: 1 1 0%;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary-dark);
    border: none;
    background-color: transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-group-button:hover:not(.active) {
    color: var(--primary-dark);
}
.tab-group-button.active {
    background-color: var(--card-background);
    color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.hide-scroll::-webkit-scrollbar {
    display: none;
}
.hide-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.banner-overlay-gradient {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
}
#eta-detail-modal .modal-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background-color: var(--background-color);
}
.modal-header-map {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    height: 40vh;
    background-color: #e0e0e0;
}
.eta-map-container {
    width: 100%;
    height: 100%;
}
.map-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 1rem 2rem 1rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    color: white;
    z-index: 5;
}
.map-title-overlay h3 {
    font-size: 1.25rem;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}
.map-title-overlay p {
    font-size: 0.875rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}
.map-control-button {
    width: 2.5rem;
    height: 2.5rem;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    color: var(--text-primary-dark);
}
.map-control-button.active {
    background-color: var(--primary-color);
    color: white;
}
.eta-info-scroll-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}
#header-logo-icon {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}
#header-logo-icon.hidden-for-animation {
    opacity: 0;
}
.animating-logo-clone {
    position: fixed;
    height: 8rem;
    z-index: 9999;
    opacity: 0;
    animation: animateLogoIntro 2.8s ease-in-out forwards;
}
.content-blurred {
    filter: blur(5px);
    transition: filter 0.5s ease;
}
@keyframes animateLogoIntro {
    0% {
        opacity: 0;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.8);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }
    60% {
        opacity: 1;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(1.5);
    }
    90% {
        opacity: 1;
        top: 1.4rem;
        right: 1rem;
        height: 2.5rem;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        top: 1.4rem;
        right: 1rem;
        height: 2.5rem;
        transform: translate(0, 0) scale(1);
    }
}
.pigeon-card-label .card {
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}
.pigeon-card-label .card:hover {
    background-color: #f0fdfa;
}
.pigeon-card-label input[type="checkbox"]:checked+.card {
    border: 2px solid #14b8a6;
    background-color: #ccfbf1;
}
.pigeon-card-label input[type="checkbox"]:checked+.card .pigeon-checkbox-icon {
    background-color: #14b8a6;
    border-color: #14b8a6;
}
.pigeon-card-label input[type="checkbox"]:checked+.card .pigeon-checkbox-icon i {
    display: block !important;
}
.winner-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 120px;
    min-width: 320px;
    max-width: 400px;
    overflow: hidden;
}
.winner-card-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    object-fit: cover;
}
.winner-card-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem;
    flex-grow: 1;
    width: calc(100% - 120px);
    overflow: hidden;
}
.winner-card .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.winner-card .rank-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border-radius: 9999px;
    border-width: 1px;
}
.race-detail-modal-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background-color: #f8fafc;
    height: 90vh;
    max-height: 800px;
}
.race-detail-tabs {
    display: flex;
    padding: 0.5rem;
    margin: 0.75rem 0.75rem 0 0.75rem;
    background-color: #e2e8f0;
    border-radius: 9999px;
    flex-shrink: 0;
}
.race-detail-tab-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    border: none;
    background-color: transparent;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.race-detail-tab-btn.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.race-detail-tab-content-container {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}
.race-detail-tab-content {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 1rem;
    animation: fadeIn 0.4s ease-in-out;
}
.race-detail-tab-content.active {
    display: flex;
}
.sticky-footer-container {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, #f8fafc, #f8fafc, rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0));
    padding: 1.5rem 1rem 1rem 1rem;
    margin: 0 -1rem -1rem -1rem;
}
.participant-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.participant-filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background-color: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}
.participant-filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.participant-card {
    cursor: pointer;
}
#participants-map-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: 0.75rem;
    overflow: hidden;
}
#merpati-detail-modal {
    z-index: 1010;
}
.ol-pin-badge {
    position: absolute;
    bottom: calc(100% - 10px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 2;
}
.ace-pigeon-modal-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background-color: #f1f5f9;
}
.ace-pigeon-header {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    flex-shrink: 0;
}
.ace-pigeon-header-photo {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}
.ace-pigeon-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 60%);
}
.ace-pigeon-header-info {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}
.ace-pigeon-name {
    font-size: 1.75rem;
    font-weight: 700;
}
.ace-pigeon-ring {
    font-size: 1rem;
    font-family: monospace;
    opacity: 0.9;
}
.ace-pigeon-scroll-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}
.ace-pigeon-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.ace-pigeon-stat-card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.ace-pigeon-stat-card .icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.ace-pigeon-stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary-dark);
}
.ace-pigeon-stat-card .label {
    font-size: 0.75rem;
    color: #64748b;
}
.ace-pigeon-race-history-list .race-card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.ace-pigeon-race-history-list .race-card .rank {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary-dark);
}
.ace-pigeon-race-history-list .race-card .rank.rank-1 {
    background-color: #facc15;
    color: white;
}
.ace-pigeon-rank-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #4b5563;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
}
.sub-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.sub-filter-container .filter-btn {
    border: 1px solid #d1d5db;
    background-color: #fff;
    color: #374151;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.sub-filter-container .filter-btn.active {
    background-color: var(--primary-color, #14B8A6);
    color: #fff;
    border-color: var(--primary-color, #14B8A6);
}
.races-list-modal-content {
    padding: 0;
    background-color: #f1f5f9;
    max-height: 90vh;
    overflow-y: auto;
}
.races-list-header {
    padding: 1rem;
    padding-bottom: 0.75rem;
    text-align: center;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}
.races-list-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary-dark);
}
.races-list-header p {
    font-size: 0.875rem;
    color: #64748b;
}
.races-list-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.race-list-card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.race-list-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.race-list-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
}
.race-list-card-details {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.race-list-card-details .detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}
.race-list-card-details .detail-item .label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #475569;
}
.race-list-card-details .detail-item .value {
    font-weight: 600;
    color: var(--text-primary-dark);
}
.race-list-card-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}
#header-logo-icon {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}
#header-logo-icon.hidden-for-animation {
    opacity: 0;
}
.animating-logo-clone {
    position: fixed;
    height: 6rem;
    z-index: 9999;
    opacity: 0;
    animation: animateLogoIntro 2.5s ease-in-out forwards;
}
.live-result-detail-content {
    background-color: #f1f5f9;
}
.result-detail-scroll-container {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}
.result-rank-display {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.result-rank-display .rank-icon {
    font-size: 2rem;
    color: #f59e0b;
}
.result-rank-display .rank-number {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary-dark);
}
.result-rank-display .rank-label {
    font-size: 0.875rem;
    color: #64748b;
}
.result-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.result-stat-card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 0.75rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.result-stat-card .value {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary-dark);
}
.result-stat-card .unit {
    font-size: 0.75rem;
    color: var(--text-primary-dark);
    margin-left: 2px;
}
.result-stat-card .label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.result-info-list .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}
.result-info-list .info-item:last-child {
    border-bottom: none;
}
.result-info-list .info-item .label {
    color: #64748b;
}
.result-info-list .info-item .value {
    font-weight: 600;
    color: var(--text-primary-dark);
    text-align: right;
}
#info-modal {
    z-index: 9000;
}
.my-races-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #e2e8f0;
    border-radius: 9999px;
}
.my-races-filters button {
    flex: 1;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: none;
    background-color: transparent;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.my-races-filters button.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.my-races-event-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}
.my-races-event-card .banner {
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
}
.my-races-event-card .banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}
.my-races-event-card .banner h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.my-races-event-card .banner .status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    color: white;
    text-transform: capitalize;
}
.my-races-event-card .banner .status.mendatang { background-color: rgba(59, 130, 246, 0.8); }
.my-races-event-card .banner .status.berlangsung { background-color: rgba(239, 68, 68, 0.8); }
.my-races-event-card .banner .status.selesai { background-color: rgba(107, 114, 128, 0.8); }
.my-races-event-card .details {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #475569;
}
.my-races-event-card .actions {
    display: flex;
    gap: 0.75rem;
    padding: 0 1rem 1rem 1rem;
}
.my-races-event-card .actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-cancel-event {
    background-color: #fee2e2;
    color: #b91c1c;
}
.btn-cancel-event:hover {
    background-color: #fecaca;
}
#cancel-pigeon-list .pigeon-item-cancel {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}
#cancel-pigeon-list .pigeon-item-cancel img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
#cancel-pigeon-list .pigeon-info-cancel {
    flex-grow: 1;
    min-width: 0;
}
#cancel-pigeon-list .pigeon-info-cancel .name {
    font-weight: 600;
    color: var(--text-primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#cancel-pigeon-list .pigeon-info-cancel .ring {
    font-size: 0.8rem;
    color: #64748b;
    font-family: monospace;
}
#cancel-pigeon-list .pigeon-status-cancel {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-align: center;
}
#cancel-pigeon-list .status-locked {
    background-color: #e2e8f0;
    color: #64748b;
}
#cancel-pigeon-list .btn-cancel-pigeon {
    background-color: #fee2e2;
    color: #b91c1c;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#cancel-pigeon-list .btn-cancel-pigeon:hover {
    background-color: #fecaca;
}
#cancel-pigeon-modal .modal-content {
    max-height: 80vh;
    border-radius: 1.5rem 1.5rem 0 0;
}
.modal-header-cancel {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.modal-header-cancel h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary-dark);
}
.modal-header-cancel p {
    font-size: 0.875rem;
    color: #64748b;
}
#cancel-pigeon-list {
    padding-top: 1rem;
    max-height: calc(80vh - 150px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.pigeon-item-cancel-label {
    display: block;
    cursor: pointer;
}
.pigeon-item-cancel-label .pigeon-item-cancel {
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
}
.pigeon-item-cancel-label.selected .pigeon-item-cancel {
    border-color: var(--primary-color);
    background-color: #f0fdfa;
}
.cancel-sticky-footer {
    position: sticky;
    bottom: -1.5rem;
    left: -1.5rem;
    right: -1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(to top, white, rgba(255, 255, 255, 0.8));
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}
#merpati-detail-modal { z-index: 1010; }
#pedigree-modal { z-index: 1015; }
#add-ancestor-modal { z-index: 1020; }
#edit-notes-modal { z-index: 1025; }


/* ================================================================== */
/* ========= START: SCROLLABLE HORIZONTAL PEDIGREE STYLES =========== */
/* ================================================================== */

/* --- Modal & Main Container --- */
#pedigree-modal .modal-content {
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: #f8fafc;
    overflow: hidden; /* Important: Modal content itself does not scroll */
}

.pedigree-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
}

.pedigree-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.pedigree-header-info .name { font-size: 1.1rem; font-weight: 700; }
.pedigree-header-info .ring { font-size: 0.8rem; font-family: monospace; color: #64748b; }
#download-pedigree-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    padding: 0.5rem;
}

/* --- Scrollable Viewport --- */
#pedigree-container {
    flex-grow: 1;
    overflow: auto; /* CRITICAL: Enables both X and Y scrolling */
    background-color: #f1f5f9;
    background-image:
        linear-gradient(rgba(0,0,0,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* --- Tree Wrapper --- */
.pedigree-tree-wrapper {
    display: flex;
    gap: 5rem; /* Generous space between generation columns */
    position: relative; /* CRITICAL: Positioning context for connector lines */
    padding: 2rem; /* Space around the entire tree */
    width: fit-content;
}

/* --- Generation Column --- */
.pedigree-generation {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 2rem; /* Generous space between cards */
}

/* --- Uniform Node Card Styling --- */
.pedigree-node {
    position: relative;
    z-index: 2; /* Ensure cards are above lines */
    width: 220px; /* Uniform, spacious width */
    flex-shrink: 0;
    background-color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pedigree-node:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Gender Indicator Borders */
.pedigree-node.male { border-left: 5px solid #3B82F6; }
.pedigree-node.female { border-left: 5px solid #EC4899; }

/* Card Content */
.pedigree-node img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.75rem;
    border: 3px solid #e2e8f0;
}
.pedigree-node .name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary-dark);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pedigree-node .ring-badge {
    font-family: monospace;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    background-color: #f1f5f9;
    color: #475569;
    margin: 0.5rem 0;
}
.relation-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

/* --- Connector Lines (Drawn with JS) --- */
.connector-line {
    position: absolute;
    background-color: #adb5bd; /* Darker, more visible line */
    z-index: 1; /* Ensure lines are below cards */
}

/* --- Placeholder / Add Button Styling --- */
.pedigree-node.is-placeholder {
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    cursor: pointer;
    box-shadow: none;
    justify-content: center;
}
.pedigree-node.is-placeholder:hover {
    border-color: var(--primary-color);
    background-color: #f0fdfa;
}
.pedigree-add-btn {
    background: none;
    border: none;
    padding: 0;
    color: #9ca3b8;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}
.pedigree-add-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ================================================================== */
/* ============= START: RESTYLED PEDIGREE CARD & FORM =============== */
/* ================================================================== */

/* --- Kartu Potret Baru --- */
.pedigree-node {
    width: 240px; /* Sedikit lebih lebar */
    /* Tinggi akan otomatis mengikuti konten */
}

.pedigree-node img {
    width: 60px; /* Sedikit lebih kecil agar lebih proporsional */
    height: 60px;
}

/* --- Daftar Catatan Lomba di dalam Kartu --- */
.pedigree-notes-list {
    width: 100%;
    text-align: left;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.75rem;
    color: #475569;
}

.pedigree-notes-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    max-height: 80px; /* Batasi tinggi dan aktifkan scroll jika terlalu banyak */
    overflow-y: auto;
    scrollbar-width: thin;
}

.pedigree-notes-list li {
    padding-left: 1.2rem;
    position: relative;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.pedigree-notes-list li::before {
    content: '\f091'; /* Ikon piala dari Font Awesome */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 1px;
    color: var(--secondary-color);
}

/* --- Hasil Pencarian Leluhur --- */
.ancestor-result-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.ancestor-result-item:hover {
    background-color: #f1f5f9;
}
.ancestor-result-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 0.75rem;
    object-fit: cover;
}
.ancestor-result-item .info .name {
    font-weight: 600;
    color: var(--text-primary-dark);
}
.ancestor-result-item .info .ring {
    font-size: 0.75rem;
    font-family: monospace;
    color: #64748b;
}

/* --- Input Riwayat Lomba di Form --- */
.note-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.note-input-wrapper input {
    flex-grow: 1;
}
.note-input-wrapper .remove-note-btn {
    background-color: #fee2e2;
    color: #ef4444;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

/* ================================================================== */
/* ============= START: FINAL PEDIGREE DOWNLOAD STYLES ============== */
/* ================================================================== */

.report-container-vertical {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1240px; /* Lebar standar untuk kualitas tinggi */
    padding: 50px;
    background-color: #ffffff; /* Latar belakang putih bersih */
    font-family: 'Poppins', sans-serif;
    color: #1e293b;
    box-sizing: border-box;
}

.report-header {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 30px;
    margin-bottom: 40px;
}
.report-header img.logo {
    width: 80px;
    height: 80px;
    margin-right: 20px;
}
.report-header .titles h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}
.report-header .titles h2 {
    font-size: 28px;
    font-weight: 500;
    margin: 5px 0 0 0;
    color: #475569;
}

.report-tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* Jarak vertikal antar generasi */
}
.report-generation {
    display: flex;
    justify-content: center;
    gap: 1.5rem; /* Jarak horizontal antar kartu */
    width: 100%;
}
.report-card {
    display: flex;
    align-items: center;
    width: 100%; /* Kartu akan mengisi ruang yang tersedia di generasinya */
    max-width: 550px; /* Batas lebar kartu untuk generasi orang tua */
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.report-card.gen-0 { /* Kartu utama */
    max-width: 600px;
    border-color: var(--primary-color);
    background-color: #f0fdfa;
}
.report-card.male { border-left: 6px solid #3B82F6; }
.report-card.female { border-left: 6px solid #EC4899; }
.report-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 3px solid white;
}
.report-card-info {
    text-align: left;
}
.report-card-info .relation { font-size: 16px; font-weight: 500; color: var(--primary-color); }
.report-card-info .name { font-size: 22px; font-weight: 600; }
.report-card-info .ring { font-size: 16px; font-family: monospace; color: #64748b; }
.report-card-notes {
    margin-top: 8px;
    font-size: 14px;
    color: #475569;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
}
.report-card-notes em { font-style: italic; color: #64748b; }

.report-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
    width: 100%;
}
.report-footer h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}
.report-footer-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    border: 1px solid #e2e8f0;
    display: flex;
    gap: 30px;
}
.report-footer-stats, .report-footer-history { flex-basis: 50%; }
.report-stat-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 16px; }
.report-history-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.report-history-table th, .report-history-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.report-history-table th { font-weight: 600; background-color: #f8fafc; }

/* TAMBAHKAN BLOK CSS INI DI style.css */

.pedigree-node .edit-notes-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(3px);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    border: 1px solid #e2e8f0;
    color: #475569;
    cursor: pointer;
    display: none; /* Sembunyi secara default */
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 3;
}

.pedigree-node:hover .edit-notes-btn {
    display: flex; /* Tampil saat di-hover */
}

.pedigree-node .edit-notes-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.disqualified-card {
    background-color: #FEF2F2;
    border-color: #F87171;
    cursor: pointer;
}

.disqualified-card .disqualified-icon {
    background-color: #EF4444;
    color: #fff;
}
.disqualified-card .disqualified-reason {
    color: #EF4444;
    font-size: 0.75rem;
}

.card-item-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-item-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.card-item-details img {
    flex-shrink: 0;
}

.card-item-details .text-content {
    flex-grow: 1;
    min-width: 0;
}

.card-item-actions {
    flex-shrink: 0;
    text-align: right;
}