/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: #000000;
    min-height: 100vh;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 10px;
}

header p {
    color: #cccccc;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Sections */
section {
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

section h2 {
    font-family: 'Open Sans', sans-serif;
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Input Section */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#nameInput {
    flex: 1;
    padding: 15px;
    border: 1px solid #555555;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #2a2a2a;
    color: #ffffff;
}

#nameInput:focus {
    outline: none;
    border-color: #ffffff;
}

#nameInput::placeholder {
    color: #888888;
}

/* Buttons */
.btn {
    padding: 15px 25px;
    border: 1px solid #ffffff;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #2a2a2a;
    color: #ffffff;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
    min-width: 80px;
}

.btn-primary:hover {
    background: #cccccc;
}

.btn-select {
    background: #ffffff;
    color: #000000;
    font-size: 1.2rem;
    padding: 20px 30px;
    width: 100%;
    margin: 20px 0;
}

.btn-select:hover:not(:disabled) {
    background: #cccccc;
}

.btn-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #555555;
    border-color: #555555;
    color: #888888;
}

.btn-secondary {
    background: #2a2a2a;
    color: #ffffff;
    width: 100%;
    margin-top: 20px;
}

.btn-secondary:hover {
    background: #3a3a3a;
}

.btn-remove {
    background: #2a2a2a;
    color: #ffffff;
    border: 1px solid #555555;
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    margin-left: 10px;
}

.btn-remove:hover {
    background: #3a3a3a;
}

/* Name List */
.name-list {
    min-height: 60px;
}

.name-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #2a2a2a;
    border: 1px solid #444444;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: slideInRight 0.3s ease-out;
}

.name-item:last-child {
    margin-bottom: 0;
}

.name-text {
    font-weight: 400;
    color: #ffffff;
}

.empty-message {
    text-align: center;
    color: #888888;
    font-style: italic;
    padding: 20px;
}

/* Slider */
.slider-container {
    text-align: center;
}

.slider-container label {
    display: block;
    margin-bottom: 15px;
    font-weight: 400;
    color: #ffffff;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

#selectCount {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #444444;
    outline: none;
    -webkit-appearance: none;
}

#selectCount::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: 2px solid #000000;
}

#selectCount::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: 2px solid #000000;
}

#selectCountValue {
    font-size: 1.5rem;
    font-weight: 400;
    color: #ffffff;
    min-width: 30px;
}

/* Alligator Game */
.game-section {
    background: #1a1a1a;
    border: 2px solid #333333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #2a2a2a;
    border: 1px solid #444444;
    border-radius: 4px;
}

.current-player {
    font-weight: 600;
    color: #ffffff;
}

.game-status {
    font-weight: 400;
    color: #cccccc;
}

.alligator-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.alligator-mouth {
    background: #2a2a2a;
    border: 3px solid #ffffff;
    border-radius: 20px;
    padding: 30px;
    position: relative;
}

.alligator-mouth::before {
    content: "🧽";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    /*background: #ffffff;*/
    padding: 0 10px;
}

.teeth-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 300px;
}

.tooth {
    width: 50px;
    height: 50px;
    background: #2a2a2a;
    border: 2px solid #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    color: #ffffff;
}

.tooth:hover {
    background: #3a3a3a;
    transform: scale(1.05);
}

.tooth.pulled {
    background: #444444;
    border-color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

.tooth.pulled::after {
    content: "🦷";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
}

.tooth.mine {
    background: #ff0000;
    border-color: #ff6666;
    animation: explode 0.5s ease-in-out;
}

.tooth.mine::after {
    content: "💥";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
}

.tooth.safe {
    background: #00aa00;
    border-color: #00cc00;
}

.tooth.safe::after {
    content: "🍽️";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
}

/* Results */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.result-item {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 400;
    color: #ffffff;
    animation: bounceIn 0.6s ease-out;
    border: 1px solid #444444;
}

.result-item:nth-child(2) {
    animation-delay: 0.1s;
}

.result-item:nth-child(3) {
    animation-delay: 0.2s;
}

.result-item:nth-child(4) {
    animation-delay: 0.3s;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    color: #cccccc;
    font-weight: 400;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes explode {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.8); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 0.5s linear infinite;
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        max-width: 600px;
        padding: 40px 20px;
    }
    
    header h1 {
        font-size: 3rem;
    }
    
    section {
        padding: 30px;
    }
    
    .input-group {
        gap: 15px;
    }
    
    #nameInput {
        padding: 18px;
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 18px 30px;
        font-size: 1.1rem;
    }
    
    .btn-select {
        font-size: 1.4rem;
        padding: 25px 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    .slider-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    #selectCount {
        width: 100%;
    }
}