:root {
    --pink:   #FF6B9D;
    --green:  #6BCB77;
    --blue:   #4D96FF;
    --orange: #FF9A3C;
    --bg:     #FFF9F0;
    --card-bg:#FFFFFF;
    --radius: 16px;
    --font:   'Nunito', 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', cursive;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: #333;
    min-height: 100vh;
    padding: 16px;
}

.page { max-width: 640px; margin: 0 auto; }

h1 { font-size: 1.8em; color: var(--pink); margin-bottom: 4px; }
h2 { font-size: 1.3em; color: var(--blue); margin-bottom: 12px; }
h3 { font-size: 1.05em; margin-bottom: 8px; }

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    margin-bottom: 16px;
}

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .9em; margin-bottom: 4px; color: #555; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0d5c5;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 1em;
    background: #fff;
    outline: none;
    transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--pink);
}
.field textarea { resize: vertical; min-height: 80px; }

.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 24px;
    font-family: var(--font);
    font-size: 1.05em;
    font-weight: bold;
    cursor: pointer;
    transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn--primary   { background: var(--pink);  color: #fff; }
.btn--secondary { background: var(--blue);  color: #fff; }
.btn--danger    { background: #e74c3c;       color: #fff; }
.btn--ghost     { background: transparent;   color: #555; border: 1px solid #ccc; padding: 5px 12px; font-size: .85em; }
.btn--wide      { width: 100%; }
.btn:disabled   { opacity: .5; cursor: default; }

.code-badge {
    display: inline-block;
    background: var(--orange);
    color: #fff;
    font-size: 2em;
    font-weight: bold;
    letter-spacing: .15em;
    padding: 10px 24px;
    border-radius: 12px;
    margin: 8px 0 16px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .85em;
    font-weight: bold;
}
.status-badge--waiting { background: #fff3cd; color: #856404; }
.status-badge--active  { background: #d1e7dd; color: #0f5132; }
.status-badge--ended   { background: #f8d7da; color: #842029; }

.player-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.player-list li {
    background: var(--blue);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .9em;
}

.leaderboard { width: 100%; border-collapse: collapse; }
.leaderboard th, .leaderboard td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.leaderboard thead tr { background: #f0e8dc; }
.leaderboard tbody tr:hover { background: #faf5ee; }
.leaderboard .rank-1 td:first-child::before { content: '🥇 '; }
.leaderboard .rank-2 td:first-child::before { content: '🥈 '; }
.leaderboard .rank-3 td:first-child::before { content: '🥉 '; }

.notice {
    background: #fff3cd;
    border: 2px solid var(--orange);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: .9em;
    margin-bottom: 12px;
}

.tab-nav { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn {
    padding: 8px 18px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: #fff;
    font-family: var(--font);
    cursor: pointer;
    font-size: .9em;
}
.tab-btn.active { border-color: var(--pink); background: var(--pink); color: #fff; }

.hidden { display: none !important; }

.section-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 16px;
    color: #aaa;
    font-size: .85em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0d5c5;
}

.field-error {
    color: #e74c3c;
    font-size: .88em;
    margin-top: 6px;
}

.limit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: .85em;
    color: #666;
}

.limit-row input[type="number"] {
    width: 64px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 1em;
    text-align: center;
}

/* ── Checkbox field ─────────────────────────────────────────────── */
.field.field--checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: .95em;
    color: #444;
}
.field.field--checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

