/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f3;
    color: #333;
    line-height: 1.7;
}

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, #6c5ce7, #a855f7);
    color: #fff;
    text-align: center;
    padding: 2.5rem 1rem;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

header p {
    font-size: 1.05rem;
    opacity: 0.9;
}

/* ===== Main ===== */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ===== Tool Section ===== */
.tool-section {
    margin-bottom: 3rem;
}

.tool-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Input Panel */
.input-panel {
    flex: 0 0 320px;
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.input-panel h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #6c5ce7;
}

.input-panel label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

#names-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e2e2;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

#names-input:focus {
    outline: none;
    border-color: #6c5ce7;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn:active {
    transform: scale(0.97);
}

/* Participant count hint */
.input-hint {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: #999;
    text-align: center;
}

/* Wheel Panel */
.wheel-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.wheel-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    max-width: 100%;
    margin: 0 auto;
}

#wheel-canvas {
    width: 400px;
    height: 400px;
    max-width: 100%;
    display: block;
    border-radius: 50%;
    box-shadow: 0 0 0 8px #fff, 0 0 0 12px #6c5ce7, 0 8px 30px rgba(0, 0, 0, 0.15);
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 28px solid #e74c3c;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    z-index: 2;
}

.btn-spin {
    width: auto;
    min-width: 220px;
    padding: 1.1rem 3rem;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border-radius: 50px;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.45);
}

.btn-spin:hover {
    box-shadow: 0 8px 28px rgba(231, 76, 60, 0.6);
    transform: translateY(-2px);
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Winner Box */
.winner-box {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: #fff;
    padding: 1.5rem 2.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 6px 25px rgba(0, 184, 148, 0.4);
    animation: popIn 0.5s ease;
}

.winner-box.hidden {
    display: none;
}

.winner-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
    margin-bottom: 0.3rem;
}

.winner-name {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
}

@keyframes popIn {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== SEO Section ===== */
.seo-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.seo-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.seo-card--highlight {
    border-left: 5px solid #6c5ce7;
}

.seo-card h2 {
    font-size: 1.4rem;
    color: #6c5ce7;
    margin-bottom: 1rem;
}

.seo-card p {
    margin-bottom: 0.85rem;
    color: #555;
}

.seo-card p:last-child {
    margin-bottom: 0;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #999;
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 820px) {
    .tool-container {
        flex-direction: column;
    }

    .input-panel {
        flex: none;
        width: 100%;
    }

    .wheel-wrapper {
        width: 340px;
        height: 340px;
    }

    #wheel-canvas {
        width: 340px;
        height: 340px;
    }

    header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    main {
        padding: 1rem 0.75rem;
    }

    .input-panel,
    .seo-card {
        padding: 1.25rem;
    }

    .wheel-wrapper {
        width: 280px;
        height: 280px;
    }

    #wheel-canvas {
        width: 280px;
        height: 280px;
    }

    .btn-spin {
        font-size: 1.15rem;
        padding: 0.9rem 2rem;
    }

    .winner-name {
        font-size: 1.3rem;
    }
}
