@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f0f0f0;
    --bg-light: #e5e5e5;
    --card: #ffffff;
    --card-border: #e0e0e0;
    --text: #3c3c3c;
    --text-muted: #777777;
    --primary: #58cc02;
    --primary-dark: #46a302;
    --primary-shadow: #3a8501;
    --secondary: #1cb0f6;
    --secondary-dark: #1899d6;
    --secondary-shadow: #1478a7;
    --danger: #ff4b4b;
    --danger-dark: #e03e3e;
    --danger-shadow: #c43535;
    --warning: #ff9600;
    --warning-dark: #e08600;
    --purple: #ce82ff;
    --gold: #ffc800;
    --success: #58cc02;
    --border: #e0e0e0;
    --radius: 16px;
    --radius-lg: 20px;
}

body {
    font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
}

.container.wide {
    max-width: 900px;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    padding: 20px 0 16px;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.header p {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ===== CARDS ===== */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    border: 2px solid var(--card-border);
    position: relative;
}

.roulette-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px;
    position: relative;
}

.roulette-container canvas {
    max-width: 100%;
    height: auto;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 800;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 700;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    background: var(--bg);
    color: var(--text);
}

.input::placeholder {
    color: #aaa;
    font-weight: 600;
}

.input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(28,176,246,0.15);
}

/* ===== BUTTONS (3D style) ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.1s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) {
    transform: translateY(3px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 0 var(--primary-shadow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-primary:active:not(:disabled) {
    box-shadow: 0 1px 0 var(--primary-shadow);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 4px 0 var(--secondary-shadow);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-dark);
}

.btn-secondary:active:not(:disabled) {
    box-shadow: 0 1px 0 var(--secondary-shadow);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 0 var(--danger-shadow);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
}

.btn-danger:active:not(:disabled) {
    box-shadow: 0 1px 0 var(--danger-shadow);
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border: 2px solid var(--border);
    box-shadow: 0 4px 0 #d0d0d0;
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--secondary);
    background: rgba(28,176,246,0.06);
}

.btn-outline:active:not(:disabled) {
    box-shadow: 0 1px 0 #d0d0d0;
}

.btn-spin {
    background: linear-gradient(180deg, #58cc02 0%, #46a302 100%);
    color: #fff;
    font-size: 1.1rem;
    padding: 16px 32px;
    width: 100%;
    box-shadow: 0 5px 0 var(--primary-shadow);
    border-radius: 16px;
}

.btn-spin:hover:not(:disabled) {
    background: linear-gradient(180deg, #62e002 0%, #4db802 100%);
}

.btn-spin:active:not(:disabled) {
    box-shadow: 0 2px 0 var(--primary-shadow);
    transform: translateY(3px);
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 14px;
    display: none;
    text-align: center;
}

.alert.show {
    display: block;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.alert-success {
    background: #e8f8d8;
    color: #3a7d00;
    border: 2px solid #c5eea0;
}

.alert-error {
    background: #ffe5e5;
    color: #c00;
    border: 2px solid #ffbdbd;
}

/* ===== PARTICIPANTS LIST ===== */
.participant-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.participant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 4px;
    transition: background 0.15s;
}

.participant-item:hover {
    background: var(--bg);
}

.participant-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.95rem;
}

.participant-color {
    width: 14px;
    height: 14px;
    border-radius: 6px;
    flex-shrink: 0;
    border: 2px solid rgba(0,0,0,0.08);
}

.btn-remove {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s;
    line-height: 1;
}

.btn-remove:hover {
    color: var(--danger);
    background: #ffe5e5;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--warning);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 20px;
    min-width: 28px;
}

/* ===== WINNER OVERLAY ===== */
.winner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(6px);
    padding: 20px;
}

.winner-overlay.show {
    opacity: 1;
    visibility: visible;
}

.winner-card {
    background: #fff;
    border-radius: 24px;
    padding: 36px 32px;
    text-align: center;
    border: 3px solid var(--primary);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transform: scale(0.7);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90vw;
    width: 360px;
}

.winner-overlay.show .winner-card {
    transform: scale(1);
}

.winner-card .winner-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
    font-weight: 900;
}

.winner-card .winner-name {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 10px;
    word-break: break-word;
}

.winner-card .winner-message {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-weight: 700;
}

.winner-card .btn {
    min-width: 160px;
}

/* ===== MISC ===== */
.empty-state {
    text-align: center;
    padding: 24px;
    color: #bbb;
    font-weight: 700;
    font-size: 0.9rem;
}

.layout-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 768px) {
    .layout-split {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title h2 {
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    display: inline-block;
    margin-right: 6px;
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px rgba(88,204,2,0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.registered-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e8f8d8;
    color: #3a7d00;
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.95rem;
    border: 2px solid #c5eea0;
}

/* ===== INPUT GROUPS ===== */
.input-group {
    display: flex;
    gap: 0;
}

.input-group .input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-group .btn,
.input-group .btn-copy {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    white-space: nowrap;
}

/* ===== PROGRESS BAR ===== */
.xp-bar {
    background: var(--bg);
    border-radius: 10px;
    height: 14px;
    overflow: hidden;
    border: 2px solid var(--border);
    margin-top: 8px;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #78e800);
    border-radius: 8px;
    transition: width 0.5s ease;
    min-width: 4%;
}

.stat-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
