* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent animation flash on page load */
.player-orbit,
.player-orbit-inner,
.player-orbit-outer {
    opacity: 0;
    animation-play-state: paused;
}

body.loaded .player-orbit,
body.loaded .player-orbit-inner,
body.loaded .player-orbit-outer {
    opacity: 1;
    animation-play-state: running;
    transition: opacity 0.3s ease;
}

/* Ensure container animations work properly */
.player-orbit .player-container,
.player-orbit-inner .player-container,
.player-orbit-outer .player-container {
    animation-play-state: inherit;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    padding: 20px;
    overflow: auto;
    position: relative;
}

.container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    max-height: 100vh;
    aspect-ratio: 1;
}

/* Format Selector Styles */
.format-selector {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.format-button {
    background-color: #fff;
    border: 2px solid #ddd;
    border-left: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0 20px 20px 0;
    min-width: 80px;
    text-align: center;
    font-family: Arial, sans-serif;
    letter-spacing: 0.5px;
}

.format-button:hover {
    background-color: #f8f8f8;
    border-color: #bbb;
    padding-right: 25px;
}

.format-button.active {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.format-button.active:hover {
    background-color: #1557b0;
    border-color: #1557b0;
}

.core-circle {
    width: 210px;
    height: 210px;
    border: 4px solid #22c55e; /* Green */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    position: relative;
    z-index: 3;
    /* Prevent flash on load */
    opacity: 1;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.core-circle span {
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #333;
}

.core-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.player-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    transition: transform 0.5s ease-out;
}

.player-orbit .player-container {
    animation: orbit-core 160s linear infinite;
}

.player-orbit-2 {
    animation-delay: -32s;
}

.player-orbit-2 .player-container {
    animation: orbit-core 160s linear infinite;
    animation-delay: -32s;
}

.player-orbit-3 {
    animation-delay: -64s;
}

.player-orbit-3 .player-container {
    animation: orbit-core 160s linear infinite;
    animation-delay: -64s;
}

.player-orbit-4 {
    animation-delay: -96s;
}

.player-orbit-4 .player-container {
    animation: orbit-core 160s linear infinite;
    animation-delay: -96s;
}

.player-orbit-5 {
    animation-delay: -128s;
}

.player-orbit-5 .player-container {
    animation: orbit-core 160s linear infinite;
    animation-delay: -128s;
}


.player-orbit-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    transition: transform 0.5s ease-out;
}

.player-orbit-inner .player-container {
    animation: orbit-inner 200s linear infinite;
}

.player-orbit-inner-2 .player-container {
    animation: orbit-inner 200s linear infinite;
    animation-delay: -25s;
}

.player-orbit-inner-3 .player-container {
    animation: orbit-inner 200s linear infinite;
    animation-delay: -50s;
}

.player-orbit-inner-4 .player-container {
    animation: orbit-inner 200s linear infinite;
    animation-delay: -75s;
}

.player-orbit-inner-5 .player-container {
    animation: orbit-inner 200s linear infinite;
    animation-delay: -100s;
}

.player-orbit-inner-6 .player-container {
    animation: orbit-inner 200s linear infinite;
    animation-delay: -125s;
}

.player-orbit-inner-7 .player-container {
    animation: orbit-inner 200s linear infinite;
    animation-delay: -150s;
}

.player-orbit-inner-8 .player-container {
    animation: orbit-inner 200s linear infinite;
    animation-delay: -175s;
}

.player-container {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
}


.player-name {
    font-size: 8px;
    color: #333;
    margin-top: 2px;
    white-space: nowrap;
    font-family: Arial, sans-serif;
}

.player-indicator {
    font-size: 16px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    /* Ensure no default content */
    content: '';
    min-width: 0;
    min-height: 0;
}

/* Only show dots when they have the up/down classes */
.player-indicator:not(.indicator-up):not(.indicator-down) {
    display: none !important;
}

.player-name-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.indicator-up {
    color: #22c55e; /* Green for moving inward */
}

.indicator-down {
    color: #ef4444; /* Red for moving outward */
}

/* Ensure core circle player names have same font size as others */
.core-circle .player-name {
    font-size: 8px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure all core circle players are positioned consistently */
.core-circle .player-orbit .player-container {
    position: absolute;
    top: 50%;
    left: 50%;
}


.player-orbit-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    transition: transform 0.5s ease-out;
}

.player-orbit-outer-2 {
    animation-delay: -120s;
}

.player-orbit-outer-3 {
    animation-delay: -80s;
}

.player-orbit-outer .player-container {
    animation: orbit-outer 240s linear infinite;
}

.player-orbit-outer-2 .player-container {
    animation-delay: -120s;
}

.player-orbit-outer-3 .player-container {
    animation-delay: -80s;
}

.player-orbit-outer-4 {
    animation-delay: -48s;
}

.player-orbit-outer-4 .player-container {
    animation: orbit-outer 240s linear infinite;
    animation-delay: -48s;
}

.player-orbit-outer-5 {
    animation-delay: -192s;
}

.player-orbit-outer-5 .player-container {
    animation: orbit-outer 240s linear infinite;
    animation-delay: -192s;
}


.player-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    background-color: #fff;
}

/* Disable all CSS animations - using JavaScript instead */
.player-orbit .player-container,
.player-orbit-inner .player-container,
.player-orbit-outer .player-container {
    animation: none !important;
    animation-delay: 0s !important;
}

/* Ensure inner circle players stay inside inner circle */
.inner-circle > .player-orbit-outer {
    display: none;
}

/* Ensure core circle players stay inside core circle */
.core-circle > .player-orbit-inner,
.core-circle > .player-orbit-outer {
    display: none;
}

@keyframes orbit-core {
    from {
        transform: rotate(0deg) translateX(105px) rotate(0deg);
    }
    to {
        transform: rotate(-360deg) translateX(105px) rotate(360deg);
    }
}

@keyframes orbit-inner {
    from {
        transform: rotate(0deg) translateX(220px) rotate(0deg);
    }
    to {
        transform: rotate(-360deg) translateX(220px) rotate(360deg);
    }
}

@keyframes orbit-outer {
    from {
        transform: rotate(0deg) translateX(300px) rotate(0deg);
    }
    to {
        transform: rotate(-360deg) translateX(300px) rotate(360deg);
    }
}

.inner-circle {
    width: 440px;
    height: 440px;
    border: 4px solid #ff9800; /* Orange */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    /* Prevent flash on load */
    opacity: 1;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.outer-circle {
    width: 600px;
    height: 600px;
    border: 4px solid #ef4444; /* Red */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    /* Prevent flash on load */
    opacity: 1;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Responsive scaling for different viewports */
@media (max-width: 900px) {
    .outer-circle {
        width: min(90vw, 600px);
        height: min(90vw, 600px);
    }
    
    .inner-circle {
        width: min(calc(90vw * 0.733), 440px);
        height: min(calc(90vw * 0.733), 440px);
    }
    
    .core-circle {
        width: min(calc(90vw * 0.35), 210px);
        height: min(calc(90vw * 0.35), 210px);
    }
}

/* Small tablet/large mobile */
@media (max-width: 600px) {
    .player-image {
        width: 22px;
        height: 22px;
        border: 1px solid #fff;
    }
    
    
    .player-name {
        font-size: 5.5px;
        margin-top: 1px;
    }
    
    .player-indicator {
        font-size: 10px;
    }
    
    .player-name-wrapper {
        gap: 2px;
    }
    
    .core-circle .player-name {
        font-size: 5.5px;
    }
}

/* Mobile format selector - Complete redesign */
@media (max-width: 768px) {
    /* Reset body for mobile */
    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
    
    /* Main container uses full viewport */
    .container {
        position: relative;
        width: 100vw;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
        padding: 0;
        padding-bottom: 80px; /* Just enough padding for buttons */
        max-width: 100vw;
        aspect-ratio: auto; /* Remove aspect ratio constraint */
    }
    
    /* Format selector at the bottom - minimal footprint */
    .format-selector {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        height: auto;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 0;
        background: none;
        border: none;
        z-index: 1000;
        top: auto; /* Override desktop positioning */
        right: auto; /* Override any right positioning */
    }
    
    .format-button {
        background-color: #fff;
        border: 2px solid #ddd;
        border-radius: 25px;
        padding: 12px 28px;
        font-size: 16px;
        font-weight: 600;
        min-width: 90px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .format-button.active {
        background-color: #1a73e8;
        color: white;
        border-color: #1a73e8;
    }
    
    /* Circle sizes for mobile - use most of viewport */
    .outer-circle {
        width: min(85vw, calc(100vh - 140px));
        height: min(85vw, calc(100vh - 140px));
        border: 3px solid #ef4444; /* Red */
    }
    
    .inner-circle {
        width: calc(min(85vw, calc(100vh - 140px)) * 0.65);
        height: calc(min(85vw, calc(100vh - 140px)) * 0.65);
        border: 3px solid #ff9800; /* Orange */
    }
    
    .core-circle {
        width: calc(min(85vw, calc(100vh - 140px)) * 0.3);
        height: calc(min(85vw, calc(100vh - 140px)) * 0.3);
        border: 3px solid #22c55e; /* Green */
    }
    
    .core-circle span {
        font-size: 12px;
    }
    
    .core-logo {
        width: 50px;
        height: 50px;
        object-fit: contain;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
    }
    
    .player-image {
        width: 25px;
        height: 25px;
        border: 1px solid #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    
    
    
    
    
    .player-name {
        font-size: 6px;
        margin-top: 1px;
    }
    
    .player-indicator {
        font-size: 12px;
    }
    
    .player-name-wrapper {
        gap: 2px;
    }
    
    .core-circle .player-name {
        font-size: 6px;
    }
    
    /* Update orbit animations for new circle sizes */
    @keyframes orbit-core {
        from {
            transform: rotate(0deg) translateX(calc(min(85vw, calc(100vh - 140px)) * 0.15)) rotate(0deg);
        }
        to {
            transform: rotate(-360deg) translateX(calc(min(85vw, calc(100vh - 140px)) * 0.15)) rotate(360deg);
        }
    }
    
    @keyframes orbit-inner {
        from {
            transform: rotate(0deg) translateX(calc(min(85vw, calc(100vh - 140px)) * 0.325)) rotate(0deg);
        }
        to {
            transform: rotate(-360deg) translateX(calc(min(85vw, calc(100vh - 140px)) * 0.325)) rotate(360deg);
        }
    }
    
    @keyframes orbit-outer {
        from {
            transform: rotate(0deg) translateX(calc(min(85vw, calc(100vh - 140px)) * 0.425)) rotate(0deg);
        }
        to {
            transform: rotate(-360deg) translateX(calc(min(85vw, calc(100vh - 140px)) * 0.425)) rotate(360deg);
        }
    }
}

@media (max-width: 375px) {
    .core-circle {
        width: 100px;
        height: 100px;
        border: 2px solid #22c55e; /* Green */
    }
    
    .core-circle span {
        font-size: 10px;
    }
    
    .inner-circle {
        width: 210px;
        height: 210px;
        border: 2px solid #ff9800; /* Orange */
    }
    
    .outer-circle {
        width: 290px;
        height: 290px;
        border: 2px solid #ef4444; /* Red */
    }
    
    .player-image {
        width: 20px;
        height: 20px;
        border: 1px solid #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    
    
    
    
    .player-name {
        font-size: 5px;
        margin-top: 1px;
    }
    
    .player-indicator {
        font-size: 10px;
    }
    
    .player-name-wrapper {
        gap: 2px;
    }
    
    .core-circle .player-name {
        font-size: 5px;
    }
    
    @keyframes orbit-core {
        from {
            transform: rotate(0deg) translateX(50px) rotate(0deg);
        }
        to {
            transform: rotate(-360deg) translateX(50px) rotate(360deg);
        }
    }
    
    @keyframes orbit-inner {
        from {
            transform: rotate(0deg) translateX(105px) rotate(0deg);
        }
        to {
            transform: rotate(-360deg) translateX(105px) rotate(360deg);
        }
    }
    
    @keyframes orbit-outer {
        from {
            transform: rotate(0deg) translateX(145px) rotate(0deg);
        }
        to {
            transform: rotate(-360deg) translateX(145px) rotate(360deg);
        }
    }
}

/* Prevent user selection and improve touch handling */
.player-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.player-orbit:hover .player-container,
.player-orbit-inner:hover .player-container,
.player-orbit-outer:hover .player-container {
    z-index: 10;
}

.player-image:hover {
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .player-image:hover {
        transform: none;
    }
    
    .player-image:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* Outer circle - 13 players evenly spaced */
.player-orbit-outer .player-container {
    animation: orbit-outer 240s linear infinite;
}

.player-orbit-outer-1 {
    animation-delay: -18s;
}

.player-orbit-outer-1 .player-container {
    animation-delay: -18s;
}

.player-orbit-outer-2 {
    animation-delay: -37s;
}

.player-orbit-outer-2 .player-container {
    animation-delay: -37s;
}

.player-orbit-outer-3 {
    animation-delay: -55s;
}

.player-orbit-outer-3 .player-container {
    animation-delay: -55s;
}

.player-orbit-outer-4 {
    animation-delay: -74s;
}

.player-orbit-outer-4 .player-container {
    animation-delay: -74s;
}

.player-orbit-outer-5 {
    animation-delay: -92s;
}

.player-orbit-outer-5 .player-container {
    animation-delay: -92s;
}

.player-orbit-outer-6 {
    animation-delay: -110s;
}

.player-orbit-outer-6 .player-container {
    animation-delay: -110s;
}

.player-orbit-outer-7 {
    animation-delay: -129s;
}

.player-orbit-outer-7 .player-container {
    animation-delay: -129s;
}

.player-orbit-outer-8 {
    animation-delay: -147s;
}

.player-orbit-outer-8 .player-container {
    animation-delay: -147s;
}

.player-orbit-outer-9 {
    animation-delay: -166s;
}

.player-orbit-outer-9 .player-container {
    animation-delay: -166s;
}

.player-orbit-outer-10 {
    animation-delay: -184s;
}

.player-orbit-outer-10 .player-container {
    animation-delay: -184s;
}

.player-orbit-outer-11 {
    animation-delay: -203s;
}

.player-orbit-outer-11 .player-container {
    animation-delay: -203s;
}

.player-orbit-outer-12 {
    animation-delay: -221s;
}

.player-orbit-outer-12 .player-container {
    animation-delay: -221s;
}

.player-orbit-outer-13 {
    animation-delay: 0s;
}

.player-orbit-outer-13 .player-container {
    animation-delay: 0s;
}