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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a0b2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 10px;
    color: #fff;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(93, 78, 221, 0.15);
    border-radius: 20px;
    padding: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(147, 51, 234, 0.3);
}

h1 {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #fff;
    margin-bottom: 20px;
}

h3 {
    color: #fff;
    margin-bottom: 15px;
}

.section {
    margin-bottom: 30px;
}

#game-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Player Setup */
#setup-section {
    background: rgba(93, 78, 221, 0.2);
    padding: 30px;
    border-radius: 12px;
    border: 2px solid rgba(147, 51, 234, 0.4);
}

.saved-players-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(93, 78, 221, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.saved-players-section h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
}

#saved-players-list {
    margin-bottom: 15px;
    min-height: 40px;
}

.saved-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border-left: 3px solid #a855f7;
}

.saved-player-item span {
    color: white;
    font-weight: 500;
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-small:hover {
    background: #c0392b;
}

#player-inputs {
    margin-bottom: 20px;
}

.player-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.player-input-group input {
    flex: 1;
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.player-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.player-input-group input:focus {
    outline: none;
    border-color: #9d7ce8;
    background: rgba(255, 255, 255, 0.2);
}

.remove-player-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.remove-player-btn:hover {
    background: #c0392b;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.6);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

#add-player-btn {
    background: #27ae60;
    color: white;
    margin-right: 10px;
}

#add-player-btn:hover {
    background: #229954;
}

/* Game Title Headers */
.game-title-header {
    text-align: center;
    color: #a855f7;
    font-size: 1.5em;
    font-weight: bold;
    letter-spacing: 4px;
    border: 3px solid #9333ea;
    padding: 8px 20px;
    margin: 10px auto;
    display: inline-block;
    background: rgba(93, 78, 221, 0.2);
    width: 100%;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
}

/* Game Layout */
.game-layout-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.game-left-panel {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Game Header */
.game-header {
    background: rgba(93, 78, 221, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 12px;
    border: 2px solid rgba(147, 51, 234, 0.4);
}

.game-header h2 {
    color: white;
    margin-bottom: 10px;
}

.turn-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.turn-info p {
    margin: 0;
    font-size: 16px;
}

#killer-status {
    font-weight: bold;
    color: #a855f7;
    text-shadow: 0 0 5px rgba(168, 85, 247, 0.5);
}

/* Dart Board */
.game-board-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
}

.game-board-container {
    display: flex;
    justify-content: center;
    position: relative;
    width: 450px;
    height: 450px;
}

#board-player-names {
    position: absolute;
    width: 450px;
    height: 450px;
    top: 0;
    left: 0;
    pointer-events: none;
}

#dart-board {
    width: 450px;
    height: 450px;
    position: relative;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a0b2e 0%, #16213e 100%);
    box-shadow: 0 8px 30px rgba(147, 51, 234, 0.4), inset 0 0 50px rgba(93, 78, 221, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 6px solid #9333ea;
}

.board-segment {
    position: absolute;
    transform-origin: center;
    z-index: 1;
}

.board-segment svg {
    width: 100%;
    height: 100%;
}

.board-number {
    position: absolute;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    border-radius: 50%;
}

.board-number:hover {
    transform: scale(1.15);
}

.board-player-name-outer {
    position: absolute;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 15;
    pointer-events: none;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-player-name-outer.eliminated .board-player-name-text {
    text-decoration: line-through;
    opacity: 0.5;
    filter: grayscale(100%);
}

.board-player-name-text {
    font-size: 14px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.board-player-hits {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin: 5px 0;
}

.hit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: transparent;
    display: inline-block;
    transition: all 0.3s;
}

.hit-dot.filled {
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.board-player-lives {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 5px;
}

.life-skull {
    font-size: 14px;
    opacity: 0.3;
    transition: all 0.3s;
    filter: grayscale(100%);
}

.life-skull.alive {
    opacity: 1;
    filter: grayscale(0%);
    text-shadow: 0 0 5px currentColor;
}

.board-center {
    position: absolute;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    border-radius: 50%;
    border: 5px solid #a855f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    z-index: 5;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.6), inset 0 0 20px rgba(168, 85, 247, 0.3);
}

/* Round Indicator */
.game-right-panel {
    flex: 0 0 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.round-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.round-label {
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

#round-circles {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.round-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-circle.active {
    background: #a855f7;
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}


.round-circle.completed {
    background: #9333ea;
    border-color: #9333ea;
    box-shadow: 0 0 8px rgba(147, 51, 234, 0.5);
}

.round-multiplier {
    position: relative;
    font-size: 0.75em;
    color: #a855f7;
    font-weight: bold;
    white-space: nowrap;
    text-shadow: 0 0 5px rgba(168, 85, 247, 0.5);
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
}

/* Game Controls */
.game-controls {
    background: rgba(93, 78, 221, 0.2);
    padding: 10px 15px;
    border-radius: 12px;
    border: 2px solid rgba(147, 51, 234, 0.4);
}

.instruction-text {
    color: white;
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

.game-controls label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #fff;
}

.game-controls input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    width: 200px;
    margin-right: 10px;
}

.game-controls input:focus {
    outline: none;
    border-color: #667eea;
}

.game-controls > div {
    margin-bottom: 15px;
}

#killer-attack-section {
    background: rgba(168, 85, 247, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #a855f7;
}

/* Players Status */
.players-status {
    background: rgba(93, 78, 221, 0.2);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(147, 51, 234, 0.4);
}

.player-status-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 5px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.player-status-card.current-turn {
    border: 3px solid #a855f7;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.5);
    background: rgba(168, 85, 247, 0.2);
}

.player-status-card.killer {
    background: rgba(168, 85, 247, 0.3);
    border-left-color: #a855f7;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.player-name {
    font-weight: bold;
    font-size: 18px;
}

.player-number {
    font-size: 16px;
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
}

.hits-count {
    font-size: 16px;
}

.lives-count {
    font-size: 16px;
    font-weight: bold;
}

.lives-count.low {
    color: #e74c3c;
}

.killer-badge {
    background: #e74c3c;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin-left: 10px;
}

/* Game Over */
#game-over-section {
    text-align: center;
    padding: 40px;
    background: rgba(93, 78, 221, 0.2);
    border-radius: 12px;
    border: 2px solid rgba(147, 51, 234, 0.4);
}

#winner-info {
    font-size: 24px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(168, 85, 247, 0.3);
    color: white;
    border-radius: 12px;
    border: 2px solid #a855f7;
}

/* Hit Message */
.hit-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(93, 78, 221, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 12px;
    border: 2px solid #a855f7;
    font-size: 18px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.6);
    animation: messageFade 2s ease-out;
}

@keyframes messageFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* Responsive */
@media (max-width: 768px) {
    #dart-board {
        width: 350px;
        height: 350px;
    }

    .board-number {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .game-controls input {
        width: 100%;
        margin-bottom: 10px;
    }
}
