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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.container.landing {
    grid-template-columns: 1fr;
    max-width: 500px;
}

h1 {
    grid-column: 1 / -1;
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2.topic {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

/* --- Forms --- */

.create-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.create-form label {
    font-weight: bold;
    color: #555;
}

.create-form input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.create-form input:focus {
    outline: none;
    border-color: #667eea;
}

.create-form button {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transition: all 0.3s;
}

.create-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* --- Link boxes --- */

.link-box {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 10px 14px;
    word-break: break-all;
    font-size: 14px;
}

.link-box a {
    color: #667eea;
    text-decoration: none;
}

.link-box a:hover {
    text-decoration: underline;
}

/* --- Input section (admin) --- */

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.contestants-list {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.contestants-list h3 {
    margin-bottom: 10px;
    color: #333;
}

#contestantsList {
    list-style: none;
}

#contestantsList li {
    background: white;
    margin: 5px 0;
    padding: 8px 12px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    gap: 8px;
}

#contestantsList li.entry-hidden {
    opacity: 0.4;
    border-left-color: #ccc;
}

.entry-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.remove-btn {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
}

.remove-btn:hover {
    background: #ff3838;
}

/* --- Status bar --- */

.status-bar {
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
}

.status-open {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-closed {
    background: #fff3e0;
    color: #e65100;
}

.status-finished {
    background: #e8f5e9;
    color: #1b5e20;
}

/* --- Admin action buttons --- */

.admin-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.close-btn {
    background: #ff9800;
    color: white;
}

.reopen-btn {
    background: #4CAF50;
    color: white;
}

.refresh-btn {
    background: #2196F3;
    color: white;
}

.publish-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 12px;
}

/* --- Wheel section --- */

.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wheel-container {
    position: relative;
    margin-bottom: 20px;
}

#wheelCanvas {
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #ff4757;
    z-index: 10;
}

/* --- Spin buttons --- */

.spin-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

#spinBtn, #respinBtn {
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

#spinBtn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

#respinBtn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
}

#spinBtn:hover:not(:disabled), #respinBtn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#spinBtn:disabled, #respinBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* --- Result --- */

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result.winner {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    animation: pulse 2s infinite;
}

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

/* --- Responsive --- */

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 20px;
        margin: 20px;
    }

    h1 {
        font-size: 2em;
    }

    #wheelCanvas {
        width: 300px;
        height: 300px;
    }
}
