/* Global */
body {
    background: linear-gradient(180deg, #0f1724 0%, #121826 100%);
    color: #e6eef8;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 20px;
    min-height: 100vh;
    margin: 0;
}

/* Header */
.app-header {
    position: relative;
    text-align: center;
    width: 100%;
    margin: 18px 0 8px 0;
    pointer-events: auto;
}

/* ensure header doesn't overlap content and remains visible */
.app-header {
    z-index: 1;
}

.app-header h1 {
    margin: 0;
    font-size: clamp(20px, 3.5vw, 28px);
    letter-spacing: 0.6px;
}

.subtitle {
    margin: 6px 0 0 0;
    font-size: clamp(12px, 2.2vw, 16px);
    color: #9fb3d6;
}

/* Main container */
.roulette-container {
    width: min(920px, calc(100% - 40px));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    padding: 28px;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
    margin: 8px 0 32px 0;
}

/* Wheel area */
.wheel-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.roulette-wheel {
    width: clamp(180px, 40vw, 360px);
    height: clamp(180px, 40vw, 360px);
    border-radius: 50%;
    border: 10px solid rgba(248, 201, 76, 0.14);
    background: conic-gradient(#f8c94c 0% 16.66%,
            #ff6b6b 16.66% 33.33%,
            #4ecdc4 33.33% 50%,
            #1dd1a1 50% 66.66%,
            #ffc93c 66.66% 83.33%,
            #ff9f43 83.33% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 -12px 30px rgba(0, 0, 0, 0.25), 0 6px 20px rgba(16, 24, 40, 0.6);
}

/* Centre minimalisé : seulement un emoji, pas de fond ni d'ombre */
.wheel-center {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(28px, 6vw, 56px);
    color: #ffffff;
    pointer-events: none;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
}

/* Pointer */
.wheel-pointer {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 22px solid #f8c94c;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

/* Spin state */
.roulette-wheel.spinning {
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#spin-btn {
    padding: 14px 34px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 40px;
    border: none;
    background: linear-gradient(180deg, #ffce55, #f8c94c);
    color: #071126;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(248, 201, 76, 0.15);
}

#spin-btn {
    font-size: clamp(14px, 2.6vw, 18px);
}

#spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

#spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#spin-btn.cooldown {
    background: linear-gradient(180deg, #4a5568, #2d3748);
    color: #a0aec0;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Result */
.result {
    min-height: 28px;
    font-weight: 700;
    color: #e6eef8;
}

.result.success {
    color: #ffdddd;
}

.result.error {
    color: #ffb4b4;
}

.result.note {
    color: #ffdca3;
}

/* History */
.history-section {
    padding: 8px 12px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.00));
    border: 1px solid rgba(255, 255, 255, 0.02);
    max-height: 520px;
    overflow: auto;
}

/* Leaderboard (visually aligned with history) */
.leaderboard-section {
    padding: 8px 12px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.00));
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.leaderboard-header {
    margin-bottom: 10px;
}

.leaderboard-box {
    padding: 6px;
    min-height: 64px;
}

.leaderboard-empty {
    color: #7d97b3;
    padding: 12px;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.0));
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(180deg, #2b7a78, #1b5f63);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #eef8f6;
    box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.25);
}

.meta-lg {
    flex: 1;
    min-width: 0;
}

.member-lg {
    font-weight: 700;
    color: #eaf6ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-lg {
    font-size: 12px;
    color: #9fb3d6;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.history-header h2 {
    margin: 0;
    font-size: 16px;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-btn {
    background: transparent;
    border: none;
    color: #9fb3d6;
    cursor: pointer;
    font-size: 13px;
    padding: 6px;
}

.hint {
    color: #7d97b3;
    font-size: 11px;
}

/* List */
.history-list {
    list-style: none;
    padding: 6px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-empty {
    color: #7d97b3;
    padding: 12px;
}

/* Item */
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.0));
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(180deg, #2b7a78, #1b5f63);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #eef8f6;
    box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.25);
}

.meta {
    flex: 1;
    min-width: 0;
}

.member {
    font-weight: 700;
    color: #eaf6ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time {
    font-size: 12px;
    color: #9fb3d6;
}

.badge {
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    color: #ffd8b1;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 880px) {
    .roulette-container {
        grid-template-columns: 1fr;
        padding: 18px;
        width: calc(100% - 28px);
    }

    .wheel-area {
        order: 0;
    }

    .history-section {
        order: 1;
    }
}

@media (max-width: 420px) {
    .roulette-container {
        padding: 12px;
        gap: 12px;
    }

    #spin-btn {
        padding: 10px 20px;
    }

    .history-section,
    .leaderboard-section {
        padding: 8px;
    }
}
/* Happy Hour Banner */
.happy-hour-banner {
    background: linear-gradient(90deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    color: #5e2a30;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    margin: 10px 0 20px 0;
    border-radius: 8px;
    width: min(920px, calc(100% - 40px));
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
    animation: pulse 2s infinite;
    font-size: 1.1em;
}

.happy-hour-banner.hidden {
    display: none;
}

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