:root {
    --sky-top: #b9e6ff;
    --sky-mid: #a8ddff;
    --sky-bot: #9ad4ff;
    --card-bg: rgba(255,255,255,0.9);
    --text: #12324a;
    --muted: #5a7a90;
    --accent: #1ea7ff;
    --accent-2: #00c389;
    --shadow: 0 10px 24px rgba(0,0,0,0.12);
}
body.scoreboard-theme {
    margin: 0;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bot) 100%);
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    overflow-x: hidden; /* prevent stray horizontal scroll from animated clouds or wide elements */
    overflow-y: auto;   /* allow vertical scroll only when content truly exceeds viewport */
}
/* Clouds copied from game.html.twig styles */
#bg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.cloud {
    position: fixed;
    width: 200px;
    height: 60px;
    background: #fff;
    border-radius: 100px;
    opacity: 0.8;
    filter: drop-shadow(0 10px 12px rgba(0,0,0,0.08));
    pointer-events: none;
    z-index: 1;
    left: 110vw;
}
.cloud:before, .cloud:after {
    content: '';
    position: absolute;
    background: #fff;
    width: 100px;
    height: 80px;
    position: absolute;
    top: -15px;
    left: 10px;
    border-radius: 100px;
    transform: rotate(30deg);
}
.cloud:after {
    width: 120px;
    height: 120px;
    top: -55px;
    left: auto;
    right: 15px;
}
@keyframes cloud-left {
    0% { left: 110vw; }
    100% { left: -50vw; }
}
.cloud.x1 { top: 10vh; animation: cloud-left 140s linear infinite; animation-delay: -14s;  transform: scale(0.9); will-change: left, transform; }
.cloud.x2 { top: 16vh; animation: cloud-left 170s linear infinite; animation-delay: -102s; transform: scale(1.1); will-change: left, transform; }
.cloud.x3 { top: 8vh;  animation: cloud-left 200s linear infinite; animation-delay: -40s;  transform: scale(1.4); opacity: 0.9; will-change: left, transform; }
.cloud.x4 { top: 22vh; animation: cloud-left 230s linear infinite; animation-delay: -184s; transform: scale(0.8); opacity: 0.8; will-change: left, transform; }
.cloud.x5 { top: 5vh;  animation: cloud-left 260s linear infinite; animation-delay: -78s;  transform: scale(1.6); opacity: 0.85; will-change: left, transform; }

.sb-wrap { position: relative; z-index: 2; display: grid; place-items: center; padding: 32px 16px; min-height: calc(100vh - 64px); }
.sb-card {
    width: min(920px, 94vw);
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(4px);
    padding: 24px;
    box-sizing: border-box; /* ensure padding is included in width to avoid overflow */
}
.sb-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 12px; width: 100%; }
.sb-header > div:nth-child(2) { text-align: center; }
.sb-title { font-size: 1.8rem; font-weight: 900; letter-spacing: .5px; text-shadow: 0 2px 0 rgba(255,255,255,0.6), 0 6px 16px rgba(0,0,0,0.15); }
.sb-sub { color: var(--muted); font-size: .95rem; }

.sb-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.sb-table thead th { text-align: left; font-weight: 800; color: var(--muted); padding: 12px 14px; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.sb-table tbody tr { background: #ffffff; transition: transform 120ms ease, box-shadow 120ms ease; }
.sb-table tbody tr:nth-child(even) { background: #f7fbff; }
.sb-table tbody tr:hover { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(0,0,0,0.06); }
.sb-table td { padding: 14px; font-weight: 700; }
.sb-rank { width: 110px; color: #2d475a; }
.sb-name { }
.sb-score { text-align: right; color: #0d6b31; text-shadow: 0 1px 0 rgba(255,255,255,0.7); }

/* top 3 highlights */
tr.top1 { background: linear-gradient(90deg, #fff8e1, #fffde7); }
tr.top2 { background: linear-gradient(90deg, #eef6ff, #f3f9ff); }
tr.top3 { background: linear-gradient(90deg, #fff3e0, #fff7e6); }
.medal { font-size: 1.1rem; margin-right: 6px; }
.rank-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #eaf6ff; color: #024d7a; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.04); }

.badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: #e8f6ff; color: #0367a6; font-weight: 700; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.04); }
.badge .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(30,167,255,0.18); }

.sb-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.sb-actions { display: flex; gap: 8px; }
.sb-btn {
    appearance: none; border: 0; background: var(--accent); color: #fff; font-weight: 800;
    padding: 10px 14px; border-radius: 12px; cursor: pointer; box-shadow: var(--shadow);
    text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.sb-btn[aria-disabled="true"] { background: #c8e9ff; color: #7aa6c1; cursor: not-allowed; box-shadow: none; pointer-events: none; }
.sb-stats { color: var(--muted); font-size: .95rem; }
.sb-back { display: grid; place-items: center; margin-top: 12px; }
.sb-btn.secondary { background: var(--accent-2); }