:root {
    --primary: #ffb043;
    --secondary: #a52a2a;
    --dark: #121212;
    --darker: #0a0a0a;
    --light: #f0f0f0;
    --team1: #3b5998;
    --team2: #8b0000;
    --danger: #8b0000;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--dark);
}

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

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Orbitron', sans-serif;
    background-color: var(--darker);
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 247, 255, 0.1) 0%, rgba(18, 18, 18, 0) 70%);
    pointer-events: none;
    z-index: 1;
}

header {
    text-align: center;
    padding: 1rem;
    width: 100%;
    z-index: 2;
}

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px var(--primary);
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    flex: 1;
}

.main-content {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    height: calc(100vh - 150px);
    /* Adjust for header and padding */
    min-height: 500px;
}

.panel {
    background-color: var(--dark);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Ensure content doesn't overflow */
}

.panel-title {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.input-container {
    margin-bottom: 1rem;
}

input {
    font-family: 'Orbitron', sans-serif;
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: var(--light);
    font-size: 0.9rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 247, 255, 0.3);
}

button {
    font-family: 'Orbitron', sans-serif;
    padding: 0.75rem 1.5rem;
    background: #8b6d43;
    border: 2px solid #594626;
    border-radius: 0;
    color: #f8f0dd;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    box-shadow: 0 3px 0 #594626, 0 3px 6px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    width: 100%;
}

button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 50% 50%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #594626, 0 5px 10px rgba(0, 0, 0, 0.5);
    background: #9d7b4d;
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #594626;
}

button.secondary {
    background: #6b452d;
    border: 2px solid #4d3120;
    color: #f8f0dd;
    box-shadow: 0 3px 0 #4d3120, 0 3px 6px rgba(0, 0, 0, 0.4);
}

button.secondary:hover {
    background: #7a5036;
    box-shadow: 0 5px 0 #4d3120, 0 5px 10px rgba(0, 0, 0, 0.5);
}

button.secondary:active {
    box-shadow: 0 1px 0 #4d3120;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* Players list scrollbar - existing style */
#playersList {
    list-style-type: none;
    margin-top: 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--dark);
}

#playersList::-webkit-scrollbar {
    width: 6px;
}

#playersList::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 3px;
}

#playersList::-webkit-scrollbar-track {
    background-color: var(--dark);
}

/* Team scrollbars - new styles */
#team1List {
    scrollbar-width: thin;
    scrollbar-color: var(--team1) var(--dark);
}

#team1List::-webkit-scrollbar {
    width: 6px;
}

#team1List::-webkit-scrollbar-thumb {
    background-color: var(--team1);
    border-radius: 3px;
}

#team1List::-webkit-scrollbar-track {
    background-color: var(--dark);
}

#team2List {
    scrollbar-width: thin;
    scrollbar-color: var(--team2) var(--dark);
}

#team2List::-webkit-scrollbar {
    width: 6px;
}

#team2List::-webkit-scrollbar-thumb {
    background-color: var(--team2);
    border-radius: 3px;
}

#team2List::-webkit-scrollbar-track {
    background-color: var(--dark);
}

.players-container {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--dark);
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    margin-bottom: 0.3rem;
    border-radius: 0;
    border-left: 3px solid var(--primary);
    font-size: 0.9rem;
}

.remove-player {
    background: none;
    border: none;
    color: rgba(255, 0, 0, 0.7);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.1rem 0.3rem;
    transition: all 0.2s;
    box-shadow: none;
    width: auto;
}

.remove-player:hover {
    color: rgba(139, 0, 0, 1);
    transform: scale(1.1);
    box-shadow: none;
}

.wheel-container {
    position: relative;
    width: min(320px, 100%);
    height: min(320px, 100%);
    margin: 0 auto;
    aspect-ratio: 1/1;
    /* Maintain perfect circle */
}

.wheel {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 247, 255, 0.3),
        0 0 60px rgba(0, 247, 255, 0.2);
    border: 8px solid var(--dark);
    transform: rotate(0deg);
    will-change: transform;
    background-color: #1a1a1a;
    background-image: radial-gradient(circle at center, #1f1f1f 0%, #0d0d0d 100%);
}

.wheel-center {
    position: absolute;
    width: 50px;
    height: 50px;
    background: var(--dark);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    border: 4px solid var(--primary);
    box-shadow: 0 0 20px var(--primary);
    background-image: radial-gradient(circle at center, #2a2a2a 0%, #0d0d0d 100%);
}

.wheel-pointer {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: 30px;
    height: 50px;
    background: none;
    filter: drop-shadow(0 5px 15px rgba(165, 42, 42, 0.6));
}

.wheel-pointer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #a52a2a 0%, #8b0000 50%, #6b0000 100%);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    transform-style: preserve-3d;
    transform: perspective(100px) rotateX(5deg);
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.3),
        0 0 5px #8b0000 inset;
    animation: pointerPulse 2s infinite alternate ease-in-out;
}

.wheel-pointer::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    width: 16px;
    height: 6px;
    background: var(--dark);
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.5;
}

@keyframes pointerPulse {
    0% {
        filter: drop-shadow(0 0 5px #8b0000);
    }

    100% {
        filter: drop-shadow(0 0 12px #8b0000);
    }
}

/* Çark döndürülürken gösterge vurgusu */
.spinning~.wheel-pointer::before {
    background: linear-gradient(135deg, #a52a2a 0%, #8b0000 50%, #6b0000 100%);
    animation: pointerActive 0.4s infinite alternate;
}

@keyframes pointerActive {
    0% {
        filter: drop-shadow(0 0 8px #8b0000);
    }

    100% {
        filter: drop-shadow(0 0 15px #8b0000);
    }
}

.slice {
    position: absolute;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, 50% 0%);
    transform-origin: 50% 50%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    color: var(--dark);
}

.slice span {
    transform: rotate(90deg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.selected-player {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.8), rgba(20, 20, 20, 0.9));
    border-radius: 10px;
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 1.3rem;
    margin: 1.5rem auto;
    min-height: 60px;
    max-width: 90%;
    width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Start invisible but will be made visible with .active class */
    transform-style: preserve-3d;
    transform: perspective(800px) rotateX(10deg);
    box-shadow: 
        0 15px 25px rgba(0, 0, 0, 0.4),
        0 5px 10px rgba(139, 109, 67, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
    font-weight: 700;
    color: #ffb043;
    text-transform: uppercase;
}

/* Add light reflection effect */
.selected-player::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.05) 30%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shineEffect 4s infinite linear;
    pointer-events: none;
    z-index: 1;
}

/* Add border glow effect */
.selected-player::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 1px;
    background: linear-gradient(135deg, #ffb043 0%, #a52a2a 50%, #8b0000 100%);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
    animation: borderPulse 3s infinite alternate;
}

/* Make the text visually stand out with 3D effect */
.selected-player span {
    display: inline-block;
    transform: translateZ(10px);
    position: relative;
    z-index: 3;
    text-shadow: 
        0 1px 0 #ffb043,
        0 2px 0 rgba(255, 176, 67, 0.8),
        0 3px 3px rgba(0, 0, 0, 0.5);
}

/* Animations for the 3D effects */
@keyframes shineEffect {
    0% {
        transform: translate(-50%, -50%) rotate(45deg);
    }
    100% {
        transform: translate(50%, 50%) rotate(45deg);
    }
}

@keyframes borderPulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

/* Active animation when a player gets selected */
.selected-player.active {
    opacity: 1;
    transform: perspective(800px) rotateX(0deg);
    animation: selectedPlayerReveal 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Keep it visible after animation */
    animation-fill-mode: forwards;
}

@keyframes selectedPlayerReveal {
    0% {
        opacity: 0;
        transform: perspective(800px) rotateX(30deg) translateY(30px);
    }
    40% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: perspective(800px) rotateX(0deg) translateY(0);
    }
}

.teams-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    flex: 1;
    overflow: hidden;
    /* Prevent overflow */
}

.team {
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.team h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.team-1 {
    background-color: rgba(59, 89, 152, 0.2);
    border: 2px solid var(--team1);
    height: 49%;
}

.team-1 h3 {
    color: var(--team1);
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.team-2 {
    background-color: rgba(139, 0, 0, 0.2);
    border: 2px solid var(--team2);
    height: 49%;
}

.team-2 h3 {
    color: var(--team2);
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.team-players {
    list-style-type: none;
    overflow-y: auto;
    flex: 1;
    /* Take remaining space */
}

.team-player {
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 0.3rem;
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.9rem;
}

.team-1 .team-player {
    border-left: 3px solid var(--team1);
}

.team-2 .team-player {
    border-left: 3px solid var(--team2);
}

.vs-container {
    position: relative;
    text-align: center;
    width: 100%;
    margin-top: auto;
    padding-top: 0.5rem;
    margin-bottom: auto;
    padding-bottom: 0.5rem;
}

.vs-text {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(to right, var(--team1), var(--team2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.ready-text {
    font-size: 1rem;
    color: var(--light);
    letter-spacing: 2px;
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(0, 247, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

/* Enhanced Responsive Design */

/* For very small screens and portrait orientation */
@media (max-width: 768px) or (max-height: 600px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        gap: 1rem;
    }

    .panel {
        max-height: 80vh;
    }

    h1 {
        font-size: 2rem;
    }

    #playersPanel,
    #teamsPanel {
        height: auto;
        min-height: 300px;
    }

    #wheelPanel {
        height: auto;
        min-height: 400px;
    }

    .wheel-container {
        width: min(250px, 90vw);
        height: min(250px, 90vw);
    }

    .team {
        height: auto;
        min-height: 140px;
    }
}

/* For landscape orientation on mobile devices */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        grid-template-columns: repeat(3, 1fr);
        height: auto;
        min-height: auto;
        max-height: 80vh;
    }

    .panel {
        height: calc(100vh - 150px);
    }

    .wheel-container {
        width: min(200px, 30vw);
        height: min(200px, 30vw);
    }

    h1 {
        font-size: 1.8rem;
    }

    .selected-player {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        min-height: 40px;
        font-size: 1rem;
    }

    .button-container {
        padding-top: 0.25rem;
    }
}

/* For tablets and medium screens */
@media (min-width: 768px) and (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .panel:nth-child(3) {
        grid-column: 1 / 3;
        height: auto;
        min-height: 250px;
    }

    .wheel-container {
        width: min(280px, 80%);
        height: min(280px, 80%);
    }

    .teams-container {
        flex-direction: row;
    }

    .team {
        height: auto;
        width: 49%;
    }

    .vs-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: auto;
        border: none;
        padding: 1rem;
        background-color: rgba(0, 0, 0, 0.7);
        border-radius: 50%;
        height: 100px;
        width: 100px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

/* For very wide screens */
@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }

    .main-content {
        grid-template-columns: 1fr 1.5fr 1fr;
        height: calc(90vh - 150px);
    }

    .wheel-container {
        width: min(400px, 100%);
        height: min(400px, 100%);
    }

    h1 {
        font-size: 3rem;
    }

    .panel-title {
        font-size: 1.5rem;
    }

    button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

/* Make sure all elements are visible during zoom */
@media (max-resolution: 150dpi),
(min-resolution: 300dpi) {

    html,
    body {
        zoom: reset;
        -moz-transform: scale(1);
        -moz-transform-origin: 0 0;
        -o-transform: scale(1);
        -o-transform-origin: 0 0;
        -webkit-transform: scale(1);
        -webkit-transform-origin: 0 0;
    }

    .container {
        max-width: 100%;
        padding: 0 2%;
    }

    .main-content {
        width: 96%;
        margin: 0 2%;
    }
}

/* Ensure zoom doesn't break layout */
@media (any-hover: none) {

    /* Touch device specific adjustments */
    button {
        padding: 0.8rem 1.6rem;
        /* Larger touch targets */
    }

    .remove-player {
        padding: 0.5rem;
    }
}

/* Animation states */
button.stop {
    background: #8b0000;
    border: 2px solid #5c0000;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

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

@keyframes wheelSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: wheelSpin 0.333s linear infinite;
    /* Exactly 3 rotations per second */
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Footer Styles */
.footer {
    width: 100%;
    padding: 1rem 0;
    margin-top: 1rem;
    text-align: center;
    border-top: 1px solid rgba(139, 109, 67, 0.3);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    z-index: 2;
    position: relative;
}

.copyright {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

.footer a:hover {
    color: var(--secondary);
    text-shadow: 0 0 5px rgba(139, 109, 67, 0.4);
}

.footer a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--secondary);
    transition: width 0.3s ease;
}

.footer a:hover:after {
    width: 100%;
}

.mute-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.mute-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.mute-button svg {
    fill: #fff;
    width: 24px;
    height: 24px;
}
