html, body, #map {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.canvas {
    width: 1440px;
    min-height: 100vh;
    margin: 0 auto;
    position: relative;
    background: var(--paper);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---------- HERO ---------- */
.hero {
    width: 100%;
    height: 300px;
    background: var(--hero);
    border-radius: 0 0 24px 24px;
    position: relative;
    overflow: hidden;
}

.hero .soft-strip {
    position: absolute;
    left: 445px;
    top: 116px;
    width: 547.5px;
    height: 145px;
    background: var(--hero-soft);
    border-radius: 12px;
}

.hero .title-pill {
    position: absolute;
    left: 440px;
    top: 48px;
    width: 560px;
    height: 56px;
    border: 1px solid var(--ink);
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Unbounded", sans-serif;
    font-weight: 500;
    font-size: 20px;
    background: #fff;
}

.hero .leaderboard {
    position: absolute;
    left: 1181px;
    top: 48px;
    width: 203px;
    height: 56px;
    border: 0;
    background: var(--paper);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.hero .leaderboard .icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffd479 0 35%, #e0c068 36% 100%);
}

.hero .leaderboard span {
    font-weight: 500;
    font-size: 18px;
}

.hero .next-level {
    position: absolute;
    left: 1181px;
    top: 112px;
    width: 203px;
    height: 48px;
    border: 0;
    background: var(--paper);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    font-family: "Unbounded", sans-serif;
}

.hero .next-level.disabled-skip,
.hero .next-level[disabled] {
    width: 203px; 
    height: 48px;
    background: #e0e0e0;
    color: #999999;    
    cursor: not-allowed; 
    box-shadow: var(--shadow-small);
    opacity: 0.8;
}

.hero .next-level.disabled-skip:hover,
.hero .next-level[disabled]:hover {
    background: #e0e0e0; 
    color: #999999;
    box-shadow: var(--shadow-small);
}

.hero .back {
    position: absolute;
    left: 56px;
    top: 48px;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--paper);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.hero .back span{
    text-indent: -9999em;
    background-image: url(/static/images/map_icon.png);
    background-size: contain ;
    background-repeat: no-repeat;
    background-position: center;
    width: 70%;
    height: 100%;
}

.hero .bunny {
    position: absolute;
    left: 314px;
    top: 104px;
    width: 194px;
    height: 215px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: transparent;
}

.hero .bunny img {
    max-width: 90%;
    max-height: 90%;
    user-select: none;
}

.hero .subtitle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100px;
    width: 464px;
    height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Unbounded", sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--ink);
    text-align: center;
    cursor: pointer;
    padding: 4px 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.hero .continue-txt {
  position: absolute; left: 50%; transform: translateX(-50%); top: 250px;
  width: 464px; height: 20px; display: flex; align-items: center; justify-content: center;
  font-family: "Unbounded", sans-serif; font-weight: 400; font-size: 18px; color: var(--ink);
  text-align: center; padding: 1px 1px; white-space: pre-wrap;
  overflow-wrap: anywhere; word-break: break-word; user-select: none; -webkit-user-select: none; -ms-user-select: none;
}

#extra-hint {
    width: 50%;
}

/* ---------- MAIN ---------- */
main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-top: 32px;
}

/* ---------- WORDS NAVIGATION HEADER ---------- */
.words-header {
    width: 946px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 8px;
    margin-bottom: -8px;
}

.words-header .pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--hero-soft);
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, .08);
    font-family: "Unbounded", sans-serif;
    font-size: 14px;
}

.words-header .pill strong {
    font-weight: 700;
    color: var(--ink-muted);
}

.words-header .pill span {
    font-weight: 600;
    color: var(--ink);
    margin-left: 2px;
}

/* ---------- TEST CARD  ---------- */
.test-card {
    width: 946px;
    background: var(--hero-soft);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 0;
}

.test-card label {
    color: var(--ink-muted);
    font-weight: 500;
    font-size: 18px;
}

.test-card textarea {
    width: 100%;
    min-height: 120px;
    resize: none;
    border: 0;
    outline: none;
    padding: 12px;
    border-radius: 12px;
    background: var(--hero-soft);
    color: var(--ink);
    font-family: "Unbounded", sans-serif;
    font-size: 18px;
    overflow: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
}

.test-card .row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.test-card .try {
    align-self: flex-end;
    margin-left: auto;
    border: 0;
    cursor: pointer;
    width: 96px;
    height: 40px;
    border-radius: var(--radius-pill);
    background: #100F06;
    color: var(--chip-wrong-fg);
    font-family: "Unbounded", sans-serif;
    font-weight: 500;
    font-size: 16px;
    margin-top: -10px;
}

/* ---------- WORKBENCH FOR MULTIPLAYER (2-column layout) ---------- */
.workbench {
    width: 90%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .workbench {
        grid-template-columns: 1fr;
    }
}

/* ---------- SHARED CARD STYLE (MULTIPLAYER) ---------- */
.card {
    background: var(--hero-soft);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
}


/* ---------- INPUT CARD (MULTIPLAYER) ---------- */
.input-card {
    background: var(--hero-soft);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.input-card textarea {
    flex: 1;
    resize: none;
    border: 0;
    outline: none;
    padding: 12px;
    border-radius: 12px;
    background: var(--hero-soft);
    color: var(--ink-muted);
    font-family: "Unbounded", sans-serif;
    font-size: 18px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-y: auto;
}

.input-card .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 12px;
}

.input-card .try {
    border: 0;
    cursor: pointer;
    height: 40px;
    border-radius: var(--radius-pill);
    background: #100F06;
    color: var(--chip-wrong-fg);
    font-family: "Unbounded", sans-serif;
    font-weight: 500;
    font-size: 16px;
    width: 120px;
}


/* ---------- LOADING  ---------- */
.loading {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
}

.loading.active {
    display: inline-flex;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- CHAT CARD (MULTIPLAYER) ---------- */
.chat-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.chat-card h2 {
    margin: 0;
    font-family: "Unbounded", sans-serif;
    font-size: 18px;
}

.room-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--paper);
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, .08);
    font-family: "Unbounded", sans-serif;
    font-size: 12px;
    color: var(--ink);
}

.chat-log {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 10px;
    padding: .75rem;
    overflow-y: auto;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .95rem;
    width: 100%;
}

.chat-line {
    margin: .2rem 0;
}

.chat-line.sys {
    color: #666;
    font-style: italic;
}

.chat-line.me {
    font-weight: 600;
}

.chat-inputs {
    display: flex;
    gap: .5rem;
    margin-top: .5rem;
}

.chat-inputs input[type="text"] {
    flex: 1;
    padding: .55rem .6rem;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 10px;
    background: #fff;
}

.chat-card button {
    height: 40px;
    border-radius: 12px;
    border: 0;
    padding: 0 14px;
    background: #100F06;
    color: #fff;
    font-family: "Unbounded", sans-serif;
    cursor: pointer;
}

.chat-status {
    margin-top: .35rem;
    color: #666;
    font-size: .9rem;
}

/* ---------- HISTORY ---------- */
.history-heading {
    font-family: "Unbounded", sans-serif;
    font-weight: 400;
    font-size: 18px;
    margin: 0;
}

#attempts {
    width: 946px;
}

.history-card {
    width: 100%;
    min-height: 140px;
    background: var(--card);
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border: 0;
    margin-bottom: 30px;
}

.history-card .avatar {
    width: 40px;
    height: 40px;
    border-radius: 350px;
    background: linear-gradient(135deg, #ffe0b5, #ffb5c3);
    flex-shrink: 0;
    margin-bottom: auto;
}

.history-card .text-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
}

.history-card .label {
    font-weight: 700;
    margin: 0 0 4px 0;
    font-size: 14px;
}

.history-card .main-line {
    font-family: "Unbounded", sans-serif;
    color: var(--ink);
    white-space: pre-wrap;
}

.history-card .divider {
    border-bottom: 1px dashed #897227;
    margin: 8px 0;
    width: 100%;
}

.history-card .right-slot {
    align-self: center;
    position: relative;
    width: 120px;
    height: 40px;
}

.chip {
    position: absolute;
    right: 0;
    top: 0;
    transform: rotate(-10deg);
    border-radius: var(--radius-pill);
    width: 104px;
    height: 40px;
    display: grid;
    place-items: center;
    font-family: "Unbounded", sans-serif;
    font-weight: 600;
    font-size: 16px;
    border: 0;
    background: var(--chip-ok-bg);
    color: var(--chip-ok-fg);
}

.chip.wrong {
    background: var(--chip-wrong-bg);
    color: var(--chip-wrong-fg);
    border: 2px solid #FFF6ED;
}

/* ---------- EMOJI ---------- */
.emoji-display {
    background: var(--hero);
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
}

.emoji-sequence {
    font-size: 4rem;
    letter-spacing: 0.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hint-button {
    background: var(--hero-soft);
    color: var(--ink);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.hint-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hint-text {
    color: white;
    margin-top: 1rem;
    font-style: italic;
    display: none;
}

.hint-text.visible {
    display: block;
}


/* ---------- DIFFERENCES ---------- */
.image-picker {
    width: 946px;
    margin: 0 auto;
}

.image-picker h3 {
    font-family: "Unbounded", sans-serif; 
    font-weight: 400; 
    font-size: 18px; 
    margin: 0 0 16px 0;
    color: var(--ink);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem; /* 16px */
}

.image-grid figure {
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    cursor: pointer;
}

.image-grid figure:hover {
    box-shadow: 0 6px 24px 6px rgba(0, 0, 0, .07);
    transform: translateY(-2px);
}

.image-grid img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.image-grid figcaption {
    text-align: center;
    font-weight: 500;
    padding: 10px;
    background: var(--card);
    border-top: 1px solid #ddd;
    font-family: "Unbounded", sans-serif;
    font-size: 14px;
    color: var(--ink);
    width: 100%;
}

.image-grid figure.is-selected {
    opacity: 0.4;
    filter: grayscale(80%);
    box-shadow: none;
    border-color: #aaa;
    transform: none;
}

/* --- IMAGE PUZZLES --- */
.puzzle-media {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    width: 946px; /* Match the test-card width */
    margin: 0 auto;
}

.puzzle-media figure {
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.puzzle-media img {
    display: block;
    width: 100%;
    height: auto;
}

.puzzle-media figcaption {
    text-align: center;
    font-weight: 500;
    padding: 10px;
    background: var(--card);
    border-top: 1px solid #ddd;
    font-family: "Unbounded", sans-serif;
    font-size: 14px;
    color: var(--ink);
}

/* ---------- TEXT COUNTER ---------- */
#counter {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 96px;
    border-radius: var(--radius-pill);
    background: #100F06;
    color: var(--chip-wrong-fg);
    font-family: "Unbounded", sans-serif;
    font-weight: 500;
    font-size: 16px;
    margin-top: -10px;
    transform: none;
    margin-left: auto;
    margin-right: 12px;
}

#counted {
    margin: 0;
}

/* ---------- LOGIN AND REGISTER ---------- */
body.page-login,
body.page-register {
  /* These styles are specific to the auth page layout */
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.page-login .canvas,
body.page-register .canvas {
  /* This makes the canvas responsive, overriding the fixed width */
  width: 100%;
  max-width: 1440px; 
}

body.page-login main,
body.page-register main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 120px;
  padding-left: 16px;
  padding-right: 16px;
}

/* --- Auth Wrappers --- */
.login-wrapper,
.form-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* --- Login Bunny (Login page only) --- */
.login-bunny {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(calc(-50% - 400px));
  height: 360px;
  width: auto;
  display: block;
}

.login-bunny img {
  height: 100%;
  width: auto;
  object-fit: contain;
  user-select: none;
  display: block;
}

/* --- Auth Card (Shared) --- */
.login-card {
  width: 560px;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
  border: 0;
}

/* Page-specific card colors */
body.page-login .login-card {
  background: var(--card-pink);
}
body.page-register .login-card {
  background: var(--card-green);
}

.login-title {
  font-family: "Unbounded", sans-serif;
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  line-height: 56px;
  height: 56px;
}

/* --- Auth Form (Shared) --- */
body.page-login form,
body.page-register form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.form-field label {
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.form-input {
  width: 100%;
  min-height: 48px;
  border: 0;
  outline: none;
  padding: 12px 16px;
  border-radius: 12px;
  background: #FFFFFF;
  color: #000000;
  font-family: "Unbounded", sans-serif;
  font-size: 18px;
  line-height: 1.2;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}

.form-input::placeholder {
  color: #000000;
  opacity: .5;
}

/* --- Submit Button (Page-specific widths) --- */
.submit-btn {
  border: 0;
  cursor: pointer;
  height: 40px;
  border-radius: var(--radius-pill);
  background: #100F06;
  color: var(--chip-wrong-fg);
  font-family: "Unbounded", sans-serif;
  font-weight: 500;
  font-size: 16px;
  align-self: flex-end;
}

body.page-login .submit-btn {
  width: 120px;
}

body.page-register .submit-btn {
  width: 200px;
  max-width: 100%;
  text-align: center;
}

/* --- Error & CTA (Shared) --- */
.error-text {
  width: 100%;
  background: var(--chip-wrong-bg);
  color: var(--chip-wrong-fg);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--shadow);
}

.register-cta {
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.register-cta a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
}

/* --- Auth Responsive Fixes --- */
@media (max-width: 768px) {
  body.page-login main,
  body.page-register main {
    margin-top: 64px;
  }

  /* hide bunny completely on mobile */
  .login-bunny {
    display: none;
  }

  /* let card size down and stay truly centered */
  .login-card {
    width: 90%;
    max-width: 480px;
  }
  
  /* Register page button full width */
  body.page-register .submit-btn {
    width: 100%;
    align-self: stretch;
  }
}

/* ---------- MAP ---------- */
/* --- Custom Tooltip Styling --- */
.level-tooltip {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: "Poppins", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.level-tooltip::before {
  border-top-color: rgba(0, 0, 0, 0.7);
}

/* --- Top-right HUD --- */
.hud {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  /* above Leaflet controls */
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 8px 12px;
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.hud__score {
  font-weight: 600;
  font-size: 14px;
  color: #111;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.hud__buttons {
  display: flex;
  gap: 8px;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.05s ease, box-shadow 0.2s ease, background 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: #111;
  color: #fff;
}

.btn--primary:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.btn--ghost {
  background: transparent;
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.btn--ghost:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ---------- LEADERBOARD AND PROFILE ---------- */

/* --- Base Styles --- */
body.page-leaderboard,
body.page-profile {
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- HEADER / NAVIGATION (SHARED) --- */
.header {
  width: 100%;
  text-align: center;
  height: auto;
  padding-bottom: 1.5em;
  background-color: var(--hero); /* Uses dynamic color from inline style */
}

.header h1 {
  font-family: "Unbounded", sans-serif;
  color: var(--ink);
  margin-top: 32px;
  background-color: white;
  display: inline-block;
  align-items: normal;
  justify-content: center;
  padding: 0.7em;
  border-radius: 9999px;
  border: 1px solid black;
  width: 25%;
  font-size: 1.5em;
  font-weight: 500;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  font-weight: 500;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  border: 1px solid transparent;
  color: var(--ink);
  background-color: var(--hero); /* Uses dynamic color */
}

.nav-link:hover {
  background-color: var(--hero-soft); /* Uses dynamic color */
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}

.nav-links span {
  color: #ccc;
}

/* --- CARD (SHARED) --- */
.leaderboard-card {
  width: 100%;
  max-width: 946px; /* Matches .test-card width */
  background-color: var(--paper);
  padding: 32px;
  border-radius: var(--radius-main-card);
  box-shadow: var(--shadow);
  border: 1px solid var(--card);
}

/* --- TABLE (SHARED) --- */
.leaderboard-table {
  width: 100%;
  text-align: left;
  border-collapse: separate;
  border-spacing: 0 10px; /* Vertical spacing between rows */
}

.leaderboard-table thead tr {
  background-color: var(--hero-third-color); /* Uses dynamic color */
  color: var(--ink);
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  box-shadow: 0 4px 10px rgba(25, 24, 15, 0.2);
}

.leaderboard-table th {
  padding: 12px 16px;
}

/* Rounded corners for header */
.leaderboard-table th:first-child { border-top-left-radius: var(--radius-row); border-bottom-left-radius: var(--radius-row); }
.leaderboard-table th:last-child { border-top-right-radius: var(--radius-row); border-bottom-right-radius: var(--radius-row); }

.leaderboard-table tbody {
  color: var(--ink);
  font-size: 16px;
}

.leaderboard-table tbody tr {
  border-radius: var(--radius-row);
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
  border: 1px solid transparent;
}

.leaderboard-table tbody tr:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Alternating row color */
.leaderboard-table tbody tr:nth-child(odd) {
  background-color: var(--paper);
}
.leaderboard-table tbody tr:nth-child(even) {
  background-color: var(--hero-soft); /* Uses dynamic color */
}

.leaderboard-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* Rounded corners for cells */
.leaderboard-table td:first-child { border-top-left-radius: var(--radius-row); border-bottom-left-radius: var(--radius-row); }
.leaderboard-table td:last-child { border-top-right-radius: var(--radius-row); border-bottom-right-radius: var(--radius-row); }
.leaderboard-table td:last-child,
.leaderboard-table th:last-child { text-align: right; }

/* --- FOOTER (SHARED) --- */
.info-footer {
  margin-top: 32px;
  text-align: center;
  background-color: var(--card);
  padding: 16px 24px;
  border-radius: 16px;
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
  width: 100%;
}


/* --- PAGE: LEADERBOARD --- */
body.page-leaderboard .header {
  margin-bottom: 40px;
}
body.page-leaderboard .header h1 {
  margin-bottom: 0;
}
body.page-leaderboard .header h2 {
  font-size: 1em;
  font-weight: 200;
  padding: 0.25em;
}
body.page-leaderboard .player:hover td { 
  color: var(--hero-third-color);
  font-weight: 500;
}

/* Modal Styles (Leaderboard only) */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: #fff;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  text-align: center;
  width: 300px;
  position: relative;
  font-family: "Poppins", sans-serif;
  animation: fadeIn 0.3s ease;
}
.modal-content h2 {
  margin-top: 0;
}
.close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- PAGE: PROFILE --- */
body.page-profile .header {
  margin-bottom: 1.5em;
}
body.page-profile .header h1 {
  margin-bottom: 0.5em;
}
.profile-settings {
  margin-bottom: 0.5em;
  display: flex;
  justify-content: center;
}
.profile-settings input{
  margin-right: 0.5em;
}
body.page-profile .scores:hover td:first-child { 
  color: var(--hero-third-color);
  font-weight: 500;
}