/* ==========================================================================
   WHEEL OF NAMES - MOBILE LEGENDS THEME
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #054ad0;
    --secondary-color: #0339a8;
    --light-color: #2b6edb;
    --lighter-color: #5c8fe6;
    --lightest-color: #b3d1ff;
    --accent-gold: #f4c430;
    
    --shadow-soft: 0 8px 32px rgba(5, 74, 208, 0.15);
    --shadow-medium: 0 12px 48px rgba(5, 74, 208, 0.25);
    --shadow-strong: 0 20px 60px rgba(5, 74, 208, 0.35);
    
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================================================
   BACKGROUND IMAGE WITH NATURAL SWAYING ANIMATION
   ========================================================================== */
.background-image {
    position: fixed;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background: url("background1.jpg") no-repeat center center;
    background-size: cover;
    z-index: -3;
    filter: brightness(0.9);
    animation: backgroundSway 15s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes backgroundSway {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(1%, -0.5%) scale(1.02);
    }
    50% {
        transform: translate(-1%, 0.5%) scale(1.01);
    }
    75% {
        transform: translate(0.5%, -0.3%) scale(1.015);
    }
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(5, 74, 208, 0.2),
        rgba(3, 57, 168, 0.3)
    );
    z-index: -2;
}

/* ==========================================================================
   MAIN CONTAINER
   ========================================================================== */
.container {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 900px;
    width: 100%;
    box-shadow: var(--shadow-strong), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(5, 74, 208, 0.3);
    margin-bottom: 40px;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
    border-radius: 20px 20px 0 0;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

h1 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 0 0 20px rgba(5, 74, 208, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* ==========================================================================
   WHEEL SECTION
   ========================================================================== */
.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.wheel-container {
    position: relative;
    width: 550px;
    height: 550px;
    margin-bottom: 30px;
    max-width: 100%;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    cursor: pointer;
    filter: drop-shadow(0 10px 30px rgba(5, 74, 208, 0.5)) drop-shadow(0 0 20px rgba(244, 196, 48, 0.3));
}

#wheelCanvas:hover {
    filter: drop-shadow(0 15px 40px rgba(5, 74, 208, 0.7)) drop-shadow(0 0 30px rgba(244, 196, 48, 0.5));
}

.pointer {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 25px solid transparent;
    border-bottom: 25px solid transparent;
    border-right: 50px solid var(--accent-gold);
    filter: drop-shadow(0 0 10px rgba(244, 196, 48, 0.8)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    z-index: 10;
}

.spin-button {
    padding: 18px 60px;
    font-size: 1.5em;
    font-weight: bold;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a929 100%);
    color: #000;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: var(--shadow-medium), 0 0 20px rgba(244, 196, 48, 0.4);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.spin-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
}

.spin-button:hover:not(:disabled)::before {
    left: 100%;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-strong), 0 0 30px rgba(244, 196, 48, 0.6);
}

.spin-button:active:not(:disabled) {
    transform: translateY(0) scale(1);
}

.spin-button:disabled {
    background: linear-gradient(135deg, #666 0%, #444 100%);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: var(--shadow-soft);
}

.winner-display {
    margin-top: 20px;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(244, 196, 48, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
    padding: 15px 30px;
    background: rgba(5, 74, 208, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 2px solid var(--accent-gold);
    display: none;
}

/* ==========================================================================
   INPUT SECTION
   ========================================================================== */
.input-section {
    width: 100%;
    max-width: 500px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#nameInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 1em;
    border: 2px solid rgba(5, 74, 208, 0.5);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #ffffff;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
}

#nameInput:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-medium), 0 0 15px rgba(244, 196, 48, 0.3);
}

#nameInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.add-button {
    padding: 15px 30px;
    font-size: 1em;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
}

.add-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.add-button:active {
    transform: translateY(0);
}

.names-list {
    background: rgba(5, 74, 208, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(5, 74, 208, 0.3);
    box-shadow: var(--shadow-soft);
}

.names-list h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.names-list::-webkit-scrollbar {
    width: 8px;
}

.names-list::-webkit-scrollbar-track {
    background: rgba(5, 74, 208, 0.1);
    border-radius: 10px;
}

.names-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.names-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

.name-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    transition: var(--transition-smooth);
    border: 1px solid rgba(5, 74, 208, 0.2);
}

.name-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
    border-color: var(--accent-gold);
}

.name-item span {
    color: #ffffff;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.delete-button {
    padding: 8px 20px;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: var(--transition-fast);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

.delete-button:hover {
    background: linear-gradient(135deg, #ff6666 0%, #ff0000 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 68, 68, 0.5);
}

/* ==========================================================================
   TOURNAMENT BRACKET SECTION
   ========================================================================== */
.bracket-container {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 1600px;
    width: 100%;
    box-shadow: var(--shadow-strong), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(5, 74, 208, 0.3);
    margin-bottom: 40px;
}

.bracket-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a929 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
    border-radius: 20px 20px 0 0;
}

.bracket-header {
    margin-bottom: 30px;
}

.bracket-header h2 {
    color: #ffffff;
    font-size: 2em;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(244, 196, 48, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.bracket-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bracket-mode-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #ffffff;
    border: 2px solid rgba(5, 74, 208, 0.5);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-btn .icon {
    font-size: 1.2em;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-medium), 0 0 20px rgba(5, 74, 208, 0.5);
}

.bracket-format-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.bracket-format-selector label {
    color: #ffffff;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.format-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

#bracketFormat {
    padding: 12px 20px;
    font-size: 1em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #ffffff;
    border: 2px solid rgba(5, 74, 208, 0.5);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    min-width: 150px;
}

#customTeamCount {
    padding: 12px 20px;
    font-size: 1em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #ffffff;
    border: 2px solid rgba(5, 74, 208, 0.5);
    border-radius: 10px;
    transition: var(--transition-smooth);
    width: 100px;
    text-align: center;
}

#bracketFormat:focus,
#customTeamCount:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(244, 196, 48, 0.3);
}

#bracketFormat option {
    background: var(--secondary-color);
    color: #ffffff;
}

.bracket-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 14px 35px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
}

.generate-btn {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a929 100%);
    color: #000;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium), 0 0 20px rgba(244, 196, 48, 0.5);
}

.reset-btn {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: #ffffff;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 68, 68, 0.5);
}

/* Bracket Content */
.bracket-content {
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bracket-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.placeholder-icon {
    font-size: 5em;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.bracket-placeholder h3 {
    color: #ffffff;
    font-size: 1.8em;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.bracket-placeholder p {
    font-size: 1.1em;
    line-height: 1.6;
}

/* Tournament Bracket Display - IMPROVED LAYOUT */
.tournament-bracket {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 80px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 40px 20px;
    min-height: 500px;
}

.tournament-bracket::-webkit-scrollbar {
    height: 12px;
}

.tournament-bracket::-webkit-scrollbar-track {
    background: rgba(5, 74, 208, 0.1);
    border-radius: 10px;
}

.tournament-bracket::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.tournament-bracket::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 220px;
    position: relative;
}

.round-title {
    text-align: center;
    color: var(--accent-gold);
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(244, 196, 48, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(5, 74, 208, 0.3);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--accent-gold);
}

.bracket-match {
    background: rgba(5, 74, 208, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(5, 74, 208, 0.5);
    border-radius: 12px;
    padding: 12px;
    position: relative;
    transition: var(--transition-smooth);
    margin-bottom: 15px;
}

.bracket-match:hover {
    background: rgba(5, 74, 208, 0.3);
    border-color: var(--accent-gold);
    transform: scale(1.03);
    box-shadow: var(--shadow-medium), 0 0 20px rgba(244, 196, 48, 0.3);
    z-index: 10;
}

.match-slot {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 6px 0;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    font-size: 0.95em;
}

.match-slot.empty {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    cursor: default;
    font-size: 0.85em;
}

.match-slot.empty:hover {
    background: rgba(255, 255, 255, 0.15);
}

.match-slot.filled {
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.match-slot.winner {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a929 100%);
    color: #000;
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(244, 196, 48, 0.6);
}

.match-slot.bye {
    background: rgba(100, 100, 100, 0.3);
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    cursor: not-allowed;
}

.match-slot.editable:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-gold);
}

.match-number {
    font-size: 0.75em;
    color: var(--accent-gold);
    margin-bottom: 8px;
    font-weight: bold;
    text-align: center;
}

/* Connector Lines - IMPROVED */
.bracket-match::after {
    content: '';
    position: absolute;
    right: -40px;
    top: 50%;
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, var(--accent-gold), rgba(244, 196, 48, 0.3));
    transform: translateY(-50%);
}

.bracket-round:last-of-type .bracket-match::after {
    display: none;
}

/* Vertical connectors for matches */
.bracket-match::before {
    content: '';
    position: absolute;
    right: -40px;
    top: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(244, 196, 48, 0.3), var(--accent-gold), rgba(244, 196, 48, 0.3));
    transform: translateY(-50%);
}

.bracket-match:nth-child(odd)::before {
    height: 150%;
    top: 50%;
}

.bracket-match:nth-child(even)::before {
    height: 150%;
    top: -50%;
}

.bracket-round:last-of-type .bracket-match::before {
    display: none;
}

/* Champion Display */
.champion-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 250px;
}

.champion-trophy {
    font-size: 4em;
    margin-bottom: 20px;
    animation: rotate 4s linear infinite;
    filter: drop-shadow(0 0 20px rgba(244, 196, 48, 0.8));
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.champion-slot {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a929 100%);
    color: #000;
    border: 3px solid #fff;
    border-radius: 15px;
    padding: 20px 30px;
    font-size: 1.3em;
    font-weight: bold;
    box-shadow: var(--shadow-strong), 0 0 30px rgba(244, 196, 48, 0.8);
    text-align: center;
    min-width: 200px;
    max-width: 250px;
    word-wrap: break-word;
}

.champion-slot.empty {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    font-size: 1.1em;
}

/* Bracket Info */
.bracket-info {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 20px;
    padding: 15px;
    background: rgba(5, 74, 208, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(5, 74, 208, 0.3);
}

.bracket-info p {
    margin: 5px 0;
    font-size: 0.95em;
}

.bracket-info strong {
    color: var(--accent-gold);
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, rgba(5, 74, 208, 0.95) 0%, rgba(3, 57, 168, 0.95) 100%);
    backdrop-filter: blur(20px);
    margin: 10% auto;
    padding: 40px;
    border: 3px solid var(--accent-gold);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow-strong), 0 0 40px rgba(244, 196, 48, 0.4);
    animation: slideIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #fff 50%, var(--accent-gold) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: var(--accent-gold);
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(244, 196, 48, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.winner-name {
    font-size: 2.5em;
    font-weight: bold;
    color: #ffffff;
    margin: 30px 0;
    padding: 20px;
    background: rgba(244, 196, 48, 0.2);
    border: 2px solid var(--accent-gold);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(244, 196, 48, 0.4), inset 0 0 20px rgba(244, 196, 48, 0.1);
    animation: pulse 1s infinite;
    text-shadow: 0 0 15px rgba(244, 196, 48, 0.8);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.modal-question {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.9);
    margin: 20px 0;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.modal-button {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.modal-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.modal-button:hover::before {
    width: 200px;
    height: 200px;
}

.modal-button.confirm {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a929 100%);
    color: #000;
}

.modal-button.confirm:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium), 0 0 20px rgba(244, 196, 48, 0.6);
}

.modal-button.cancel {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.modal-button.cancel:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

/* Match Selection Modal */
.match-contestants {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.contestant-option {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.contestant-option:hover {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a929 100%);
    color: #000;
    border-color: var(--accent-gold);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(244, 196, 48, 0.6);
}

/* ==========================================================================
   CONFETTI EFFECTS
   ========================================================================== */
.confetti {
    position: fixed;
    width: 15px;
    height: 15px;
    z-index: 999;
    pointer-events: none;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ==========================================================================
   INFO & MISC
   ========================================================================== */
.info {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
    font-size: 0.9em;
    font-style: italic;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1200px) {
    .tournament-bracket {
        gap: 60px;
    }
    
    .bracket-round {
        min-width: 200px;
    }
}

@media (max-width: 968px) {
    .container, .bracket-container {
        padding: 30px 20px;
    }

    .wheel-container {
        width: 450px;
        height: 450px;
    }

    h1 {
        font-size: 2em;
    }

    .spin-button {
        padding: 15px 50px;
        font-size: 1.2em;
    }

    .modal-content {
        margin: 15% auto;
        padding: 30px 20px;
    }

    .winner-name {
        font-size: 2em;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-button {
        width: 100%;
    }

    .bracket-mode-selector,
    .bracket-actions {
        flex-direction: column;
    }

    .mode-btn,
    .action-btn {
        width: 100%;
    }

    .tournament-bracket {
        gap: 40px;
        padding: 30px 15px;
    }
    
    .bracket-round {
        min-width: 180px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container, .bracket-container {
        padding: 20px 15px;
        border-radius: 15px;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .wheel-container {
        width: 100%;
        max-width: 320px;
        height: auto;
        aspect-ratio: 1;
        margin-bottom: 20px;
    }

    .pointer {
        right: -15px;
        border-top: 18px solid transparent;
        border-bottom: 18px solid transparent;
        border-right: 36px solid var(--accent-gold);
    }

    .spin-button {
        padding: 12px 40px;
        font-size: 1.1em;
        width: 100%;
        max-width: 300px;
    }

    .input-section {
        max-width: 100%;
    }

    .input-group {
        flex-direction: column;
        gap: 10px;
    }

    #nameInput,
    .add-button {
        width: 100%;
        padding: 12px 15px;
    }

    .names-list {
        padding: 15px;
        max-height: 250px;
    }

    .modal-content {
        margin: 20% auto;
        padding: 25px 15px;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 1.8em;
    }

    .winner-name {
        font-size: 1.6em;
        padding: 15px;
    }

    .modal-question {
        font-size: 1em;
    }

    .modal-button {
        padding: 12px 30px;
        font-size: 1em;
    }

    .bracket-header h2 {
        font-size: 1.5em;
    }

    .bracket-round {
        min-width: 160px;
    }

    .round-title {
        font-size: 0.9em;
        padding: 8px;
        margin-bottom: 20px;
    }

    .bracket-match {
        padding: 10px;
        margin-bottom: 12px;
    }

    .match-slot {
        padding: 8px 10px;
        font-size: 0.85em;
    }

    .champion-slot {
        padding: 15px 20px;
        font-size: 1.1em;
    }

    .contestant-option {
        padding: 15px;
        font-size: 1.1em;
    }

    .tournament-bracket {
        gap: 30px;
        padding: 20px 10px;
    }

    .bracket-match::after {
        right: -30px;
        width: 30px;
    }

    .bracket-match::before {
        right: -30px;
    }

    .format-input-group {
        flex-direction: column;
        width: 100%;
    }

    #bracketFormat,
    #customTeamCount {
        width: 100%;
    }
}