body {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: Arial, sans-serif;
    margin: 20px;
}

#container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

#container > button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

#settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 8px;
}

#settings label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

#settings label > span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 18px;
}

#settings input {
    width: 100px;
    padding: 5px;
}

#settings input[type="number"] {
    text-align: center;
}

#settings input[type="color"] {
    width: 100px;
}

.name-input {
    border: none;
    background: transparent;
    width: auto !important;
    padding: 2px !important;
    cursor: pointer;
    font-size: 18px;
}

.name-input:focus {
    background: white;
    border: 1px solid #3498db;
    outline: none;
}

.info-icon {
    cursor: help;
    color: #3498db;
    font-weight: bold;
}

#game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
}

svg {
    display: block;
}

.dot {
    fill: #333;
}

.line {
    stroke: #ccc;
    stroke-width: 8;
    cursor: pointer;
    stroke-linecap: round;
}

.line:hover {
    stroke: #999;
}

.line.selected {
    cursor: default;
}

.line.p1 {
    stroke: #3498db;
}

.line.p2 {
    stroke: #e74c3c;
}

.box {
    opacity: 0.6;
}

.box.p1 {
    fill: #3498db;
}

.box.p2 {
    fill: #e74c3c;
}

#info {
    margin-top: 20px;
    font-size: 18px;
    text-align: center;
}

button {
    padding: 8px 16px;
    font-size: 16px;
    cursor: pointer;
}

#celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fireworks {
    position: absolute;
    width: 100%;
    height: 100%;
}

.firework {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: explode 1s ease-out;
}

@keyframes explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(20);
        opacity: 0;
    }
}

.trophy-container {
    position: relative;
    z-index: 1001;
    text-align: center;
    animation: trophyAppear 1s ease-out 1.5s both;
}

@keyframes trophyAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.trophy {
    font-size: 120px;
    animation: bounce 0.5s ease-in-out 2.5s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.winner-name {
    font-size: 36px;
    color: white;
    font-weight: bold;
    margin-top: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#modal-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#modal-message {
    font-size: 18px;
    margin-bottom: 20px;
}

#modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#modal-buttons button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

#modal-yes {
    background: #e74c3c;
    color: white;
}

#modal-no {
    background: #95a5a6;
    color: white;
}
