/* ==========================================================================
   HCUP — Unified Design System (Light Theme)
   Single stylesheet for all pages: index, login, signup, email-sent,
   dashboard, leaderboard, communities.
   ========================================================================== */

/* ==========================================================================
   0. CSS CUSTOM PROPERTIES (Design Tokens)

     --bg-body      page background        rgb(248, 244, 241)
     --bg-header    navbar / logo bar      rgb(255, 255, 255)
     --bg-wrap      page wrap containers   rgb(245, 246, 247)
     --bg-surface   cards / sections       rgb(255, 255, 255)
     --bg-input     form inputs / tiles    rgb(245, 245, 245)
   ========================================================================== */

:root {
    /* ── Brand / Accent ── */
    --brand:          rgb(100, 100, 100);
    --brand-hover:    rgb(60, 60, 60);
    --brand-light:    rgb(60, 60, 60);
    --brand-glow:     rgba(100, 100, 100, 0.08);
    --brand-glow-md:  rgba(100, 100, 100, 0.14);

    /* ── Backgrounds (lightest → darkest) ── */
    --bg-body:        rgb(248, 248, 248);
    --bg-header:      rgb(32, 33, 33);
    --bg-wrap:        rgb(255, 255, 255);
    --bg-surface:     rgb(255, 255, 255);
	--bg-subheader:   rgb(232, 232, 232);
    --bg-input:       rgb(245, 245, 245);
	--bg-iceblue:     rgb(227, 243, 249);
	--bg-blue1:		  rgb(211, 227, 253);
	--bg-blue2:	      rgb(157, 210, 255);

    /* ── Typography ── */
    --text-primary:   rgb(32, 33, 33);
    --text-body:      rgb(77, 73, 69);
    --text-secondary: rgb(101, 102, 103);
    --text-tertiary:  rgb(166, 169, 173);
	--text-forthiary:  rgb(255, 255, 255);
	--text-blue: rgb(79, 107, 237);

    /* ── Borders ── */
    --border:         rgb(217, 219, 222);
    --border-light:   rgb(237, 238, 242);

    /* ── Accent: Gold / Awards ── */
    --gold:           #d4a800;
    --gold-dim:       #fdf6e0;
    --gold-border:    #e6c44a;

    /* ── Accent: Orange ── */
    --orange:         #d47b00;
    --orange-dim:     #fef4e8;

    /* ── Accent: Error ── */
    --error:          #e04545;
    --error-dim:      #fde8e8;
    --error-border:   #f0b0b0;

    /* ── Accent: Success (history correct) ── */
    --success:        #2bb85a;
    --success-dim:    #e6f9ee;
    --success-border: #8edcb4;

    /* ── Misc ── */
    --shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md:      0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg:      0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm:      4px;
    --radius-md:      8px;
    --radius-lg:      14px;
}

/* ==========================================================================
   1. GLOBAL RESETS & FONTS
   ========================================================================== */

@font-face {
    font-family: 'Blue';
    src: url('fonts/Blue-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

body {
    background: var(--bg-body);
    font-family: 'Blue', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. RESPONSIVE NAVIGATION BAR
   ========================================================================== */

.navbar {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg-header);
    box-shadow: var(--shadow-md);
    top: 0;
    z-index: 1000;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
}

.navbar-container {
    padding: 0.5rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    position: relative;
}

.navbar-logo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.logo-svg {
    height: 26px;
    width: auto;
}

/* --- Language Switcher in Navbar --- */

.navbar-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.lang-link {
    color: var(--text-forthiary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.lang-link:hover {
    color: var(--text-tertiary);
    background-color: rgba(0, 0, 0, 0.05);
}

.lang-link.lang-active {
    color: var(--text-tertiary);
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.08);
}

.lang-separator {
    color: var(--text-forthiary);
    font-size: 0.85rem;
    font-weight: 300;
}

/* --- Hamburger Menu Button --- */

.hamburger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 24px;
    height: 24px;
    padding: 0;
    position: relative;
    z-index: 1005;
}

.hamburger-btn .bar {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--text-forthiary);
    border-radius: 1px;
    margin: 0 auto;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-btn.active .bar:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

.hamburger-btn.active .bar:nth-child(2) {
    transform: translateY(-4px) rotate(-45deg);
}

/* --- Mobile Dropdown Menu --- */

.mobile-menu {
    display: block;
    position: absolute;
    top: 39px;
    left: 0;
    right: 0;
    background: var(--bg-wrap);
    width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: 0;
    opacity: 0;
    transform: translateY(0);
    pointer-events: none;
    visibility: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease-out,
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.25s;
    overflow: hidden;
    z-index: 999;
}

.mobile-menu.open {
    max-height: 440px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.mobile-menu-inner {
    padding: 1.25rem;
}

/* --- Mobile Menu User Profile --- */

/* .mobile-menu-user { */
    /* display: flex; */
    /* align-items: center; */
    /* gap: 0.75rem; */
    /* background: rgba(0, 0, 0, 0.03); */
    /* padding: 0.75rem 1rem; */
    /* border-radius: 10px; */
    /* margin-bottom: 1rem; */
    /* border: 1px solid var(--border); */
/* } */

/* .user-avatar { */
    /* display: flex; */
    /* align-items: center; */
    /* justify-content: center; */
    /* background: rgba(0, 0, 0, 0.04); */
    /* border: 1px solid rgba(0, 0, 0, 0.08); */
    /* width: 30px; */
    /* height: 30px; */
    /* border-radius: 50%; */
    /* color: var(--text-primary); */
/* } */

/* .user-details { */
  /* display: flex; */
  /* flex-direction: row; */
  /* align-items: center; */
  /* justify-content: space-between; */
  /* width: 100%; */
  /* gap: 12px; */
/* } */

/* .user-email { */
    /* font-size: 0.68rem; */
    /* color: var(--text-primary); */
    /* display: block; */
    /* min-width: 50px; */
    /* overflow: hidden; */
    /* text-overflow: ellipsis; */
    /* white-space: nowrap; */
/* } */

/* .user-label { */
    /* font-size: 0.68rem; */
    /* color: var(--text-secondary); */
    /* font-weight: 700; */
    /* letter-spacing: 0.02em; */
/* } */

/* .logout-form-wrapper { */
    /* margin-left: auto; */
	/* white-space: nowrap; */
/* } */

/* @media (max-width: 380px) { */
	/* .logout-form-wrapper {margin-right: 30px} */
/* } */


/* Container holding everything */
.mobile-menu-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: #f9f8f6;
  border-radius: 8px;
}

/* Avatar circle */
.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: #e2e0db;
  border-radius: 50%;
  color: #4d4945;
  flex-shrink: 0; 
}

/* The wrapper around email + form */
.user-details {
  display: flex;
  align-items: center; /* Vertically centers the email and button */
  justify-content: space-between; /* Pushes email to left, logout to right */
  gap: 16px;
  flex-grow: 1;
  min-width: 0; /* Prevents long emails from breaking the row layout */
}

/* Long email protection */
.user-email {
  font-size: 14px;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; 
  flex-grow: 1;
}

/* Keeps the form wrapper inline */
.logout-form-wrapper {
  margin: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0; /* Prevents the logout button from shrinking */
}

/* Reset button styles */
.mobile-menu-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  color: #4d4945;
  font-family: inherit;
}

.mobile-menu-logout:hover {
  color: #000000;
}

/* --- Media Queries --- */

/* For tiny screens under 380px, reduce gaps to save precious horizontal space */
@media (max-width: 380px) {
  .mobile-menu-user {
    gap: 8px;
    padding: 10px 12px;
	margin-bottom: 10px;
}
  }
  
  .user-details {
    gap: 8px;
  }
  
  .user-email {
    font-size: 13px;
  }
}

/* --- Mobile Menu Nav Links --- */

.menu-nav-links { display: flex; flex-direction: column; gap: 0.25rem; }

.mobile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.mobile-menu-item.active {
    background-color: rgba(0, 0, 0, 0.07);
    color: var(--text-primary);
    font-weight: 600;
}

.active-indicator {
    width: 6px;
    height: 6px;
    background-color: var(--gold);
    border-radius: 50%;
}

/* --- Logout Button --- */

.mobile-menu-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-body);
    /* padding: 0.8rem 1rem; */
	padding: 0.7rem;
    font-size: 0.7rem;
    /* font-weight: 600; */
    letter-spacing: 0.01em;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

.logout-icon {
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.mobile-menu-logout:hover {
    background-color: var(--bg-input);
    border-color: var(--border);
    color: var(--text-body);
}

.mobile-menu-logout:active {
    transform: scale(0.98);
}

/* ==========================================================================
   3. CALENDAR HEADER & STRIP
   ========================================================================== */

.calendar-header {
    width: 100%;
    max-width: 480px;
    background: var(--bg-surface);
    padding: 16px 14px 10px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.day-game-title {
    font-size: 0.83rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 6px;
}

.day-game-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
}

.open-calendar-btn {
    background: var(--brand-glow);
    border: none;
    color: var(--brand);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}
.open-calendar-btn:hover {
	background: var(--bg-subheader);
}

.calendar-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.calendar-strip::-webkit-scrollbar {
    display: none;
}

.calendar-day {
    flex: 0 0 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}
.calendar-day:hover {
	background: var(--bg-subheader);
}
		
.calendar-day .day-num {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-body);
}

.calendar-day .day-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.calendar-day.active {
    background: linear-gradient(to bottom, var(--bg-header), var(--brand));
    border-color: var(--border);
}

.calendar-day.active .day-num,
.calendar-day.active .day-label {
    color: var(--bg-body);
}

/* ==========================================================================
   4. CALENDAR MODAL
   ========================================================================== */

.calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.calendar-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    background: var(--bg-surface);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px 16px;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.calendar-modal.open .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.nav-month-btn {
    background: var(--bg-input);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.nav-month-btn:hover {
    background: var(--brand);
    color: var(--bg-body);
}

.nav-month-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-month-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--brand-light);
    text-align: center;
    flex: 1;
}

.close-modal-btn {
    background: var(--bg-input);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-section {
    margin-bottom: 20px;
}

.grid-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}

.grid-weekdays span {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.grid-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.grid-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-body);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--bg-input);
    transition: all 0.1s ease;
    position: relative;
}

.grid-cell:hover:not(.empty) {
    background: var(--bg-subheader);
    /* color: var(--bg-body); */
}

.grid-cell.empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.grid-cell.has-game::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
}

.grid-cell.active {
    background: linear-gradient(to bottom, var(--bg-header), var(--brand)) !important;
    color: var(--bg-body) !important;
}

.grid-cell.active::after {
    background: var(--bg-body);
}

/* ==========================================================================
   5. SCHEDULE CONTAINER & GAME CARDS
   ========================================================================== */

.schedule-container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-wrap);
    min-height: 300px;
    padding: 0 0 40px;
    min-height: calc(100vh - 152px);
}

.no-games-fallback {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.game-card {
    width: 100%;
    padding: 14px 10px;
    border-bottom: 2px solid var(--border);
}

.game-card:last-of-type {
    border-bottom: none;
}

.game-card.has-poll {
    border-bottom: none;
}

.game-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 14px;
    font-size: .8rem;
    color: var(--text-secondary);
    font-weight: 500;
    gap: 8px;
}

.game-id {
    display: none;
}

.clash-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: #fff;
    background: #e53e3e;
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
}


/* Screens under 480px (66% scaled) */
@media (max-width: 480px) {
  .clash-badge {
    font-size: 0.73rem;      /* ~66% of 0.73rem */
    padding: 1.5px 4px;      /* ~66% of 2px 6px */
    gap: 4px;                /* ~66% of 6px */
    letter-spacing: 0.35px;  /* Reduced for smaller text */
    border-radius: 2px;
  }

  .badge-icon {
    height: 20px;            /* ~66% of 16px */
    margin-top: -3px;
    margin-bottom: -3px;
  }
  
  .game-card {
    width: 100%;
    padding: 20px 14px;
    border-bottom: 2px solid var(--border);
   }

}

/* Media query for screens less than 380px */
/* @media (max-width: 380px) { */
  /* .clash-badge { */
    /* font-size: 0.5rem;       /* Reduced text size (~half) */ */
    /* padding: 1px 3px;        /* Halved padding */ */
    /* gap: 3px;                /* Halved space between icon and text */ */
    /* letter-spacing: 0.25px; */
  /* } */

  /* .badge-icon { */
    /* height: 9px;             /* Reduced icon size to match text */ */
	/* margin-top: -3px; */
	/* margin-bottom: -3px; */
  /* } */
/* } */

/* Media query for screens less than 380px */
@media (max-width: 380px) {
  .game-header-line {
    flex-wrap: wrap;              /* Allows items to break into a second line */
    justify-content: center;      /* Centers items horizontally */
    gap: 6px;
  }

  /* Target the elements by order */
  .game-header-line > span:nth-child(1) { /* Date/Time */
    order: 2;
  }

  .clash-badge {                          /* Badge */
    order: 1;
    width: 100%;                          /* Forces the badge onto its own top row */
    font-size: 0.65rem;                   /* Slightly bumped up for readability since it has space */
    padding: 2px 6px;
    gap: 4px;
    letter-spacing: 0.25px;
  }

  .game-header-line > span:nth-child(3) { /* Arena */
    order: 3;
  }

  /* Optional: Hide or re-order game-id if it causes overflow */
  .game-id {
    order: 4;
    display: none;                        /* Often hidden on tiny screens to save space */
  }

  .badge-icon {
    height: 12px;
    margin-top: 0;
    margin-bottom: 0;
  }
  
  .game-card {
    width: 100%;
    padding: 20px 14px;
    border-bottom: 2px solid var(--border);
  }
  
}

/* ==========================================================================
   6. TEAM PREDICTION (forecast-section)
   ========================================================================== */

.team-prediction {
    width: 100%;
}

.prediction-group {
    display: flex;
    gap: 8px;
}

.team-display-block {
    flex: 1;
    display: grid;
    grid-template-columns: 40% 20% 40%;
    align-items: center;
    min-height: 56px;
    border: none;
    background: var(--bg-input);
    border-radius: 10px;
    padding: 6px 8px;
    /* gap: 6px; */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
}

.team-display-block:hover {
    background: var(--bg-subheader);
}

.team-display-block.selected {
    background: rgb(211, 227, 253) !important;
}

.team-selection-badge {
    justify-self: end;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    padding: 2px 4px;
	margin-right: 7px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.team-display-block:hover .team-selection-badge,
.team-display-block.selected .team-selection-badge {
    background: rgba(0, 0, 0, 0.08);
}

.team-logo-frame {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.team-logo-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.team-full-name {
    justify-self: start;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
	margin-left: 14px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   7. POLL SECTION
   ========================================================================== */

.poll-section {
    margin: -10px 0 4px;
}

.poll-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.poll-label-dot {
    width: 5px;
    height: 5px;
    background: var(--text-tertiary);
    border-radius: 50%;
    flex-shrink: 0;
}

.short-line {
  height: 1px;          /* Controls how thick the line is */
  width: 30%;           /* Controls how wide it is (e.g., half the screen) */
  /*background-color: #333;*/
  margin: 0 auto;       /* The "auto" on left/right centers it horizontally */
}

.poll-question {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
    line-height: 1.3;
    font-weight: 700;
}

.poll-options {
    display: flex;
    gap: 8px;
}

.poll-option {
    flex: 1;
    border: 2px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-body);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    transition: all 0.2s ease;
}

.poll-option:hover {
    background: var(--bg-subheader);
    border-color: var(--bg-subheader);
    color: var(--text-primary);
}

.poll-option.selected {
    background: var(--bg-header) !important;
    border-color: var(--bg-header) !important;
    color: var(--bg-body) !important;
}

.poll-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.poll-option-text {
    font-weight: 800;
    color: inherit;
}

/* Poll results (shown after voting or when poll is closed) */
.poll-results {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.poll-result-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.poll-result-label {
    flex: 0 0 auto;
    min-width: 60px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.poll-result-bar {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.poll-result-bar-fill {
    height: 100%;
    background: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
}

.poll-result-row.is-selected .poll-result-bar-fill {
    background: var(--text-primary);
}

.poll-result-pct {
    flex: 0 0 auto;
    font-weight: 700;
    min-width: 38px;
    text-align: right;
    font-size: 0.75rem;
}

.poll-result-votes {
    flex: 0 0 auto;
    font-size: 0.68rem;
    color: var(--text-tertiary);
    min-width: 44px;
    text-align: right;
}

.poll-suspended-badge {
    display: inline-block;
    background: var(--error-dim);
    color: var(--error);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 8px;
}

/* ==========================================================================
   8. BOOST BADGE
   ========================================================================== */

.boost-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding: 0 4px;
}

.boost-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--orange-dim);
    border: 1px solid var(--orange);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    /* transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); */
}

.boost-badge:hover {
    border-color: var(--orange);
    background: var(--orange-dim);
}

.boost-badge.active {
    background: linear-gradient(to bottom, var(--bg-header), var(--brand)) !important;
    border-color: var(--bg-border) !important;
    color: var(--bg-body) !important;
    transform: scale(1.03);
    /* box-shadow: 0 4px 10px var(--brand-glow-md); */
}

.boost-badge .boost-icon {
    color: var(--orange);
    /* transition: color 0.2s ease; */
}

.boost-badge.active .boost-icon {
    color: var(--gold);
}

.boost-badge.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.boost-badge.few-games {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-input);
    border-color: var(--border);
}

.boost-badge.few-games .boost-icon {
    color: var(--text-tertiary);
}

/* ==========================================================================
   9. ENDGAME PREDICTION (sub-vote-section)
   ========================================================================== */

.endgame-prediction {
    margin-top: 10px;
    /* background: var(--bg-input); */
    border-radius: 8px;
    padding: 8px;
    /* border: 1px dashed var(--border); */
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.endgame-prediction.visible {
    display: block;
}

.endgame-title {
    font-size: 0.8rem;
    /* font-weight: 700; */
    /* text-transform: uppercase; */
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.endgame-group {
    display: flex;
    background: var(--bg-input);
    /* border: 1px solid var(--border); */
    border-radius: 6px;
    overflow: hidden;
    padding: 2px;
}

.sub-option-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 4px;
	font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
	font-stretch: 90%;
    color: var(--text-body);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sub-option-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.sub-option-btn.active {
    background: rgb(211, 227, 253) !important;
    color: var(--text-body) !important;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.4px;
}

/* ==========================================================================
   10. FORMS & AUTH (login, signup, email-sent)
   ========================================================================== */

.login-container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-wrap);
    min-height: calc(100vh - 40px);
    padding: 14px;
}

.login-form {
    width: 100%;
    padding: 20px 14px;
}

.login-form h1 {
    margin: 0 0 0.5rem 0;
    color: var(--brand-light);
    font-weight: 700;
}

.login-form p {
    margin: 5px 0 1.5rem 0;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-body);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--bg-input);
    color: var(--text-body);
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-body);
    min-height: 70px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23656667%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2.5rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow-md);
}

.form-group select:hover {
    border-color: var(--border-light);
}

.submit-button {
    width: 100%;
    padding: 0.75rem;
    /* background: var(--brand); */
	background: linear-gradient(to bottom, var(--bg-header), var(--brand));
    color: var(--bg-body);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    /* transition: background-color 0.2s; */
}

.submit-button:hover {
    background: var(--brand-hover);
}

.team-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    background-color: var(--bg-input);
    color: var(--text-body);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23656667%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2.5rem;
}

.team-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow-md);
}

.team-select:hover {
    border-color: var(--border-light);
}

.link-text {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-blue);
}

.link-text a {
    color: var(--text-blue);
    text-decoration: none;
    font-weight: 500;
}

.link-text a:hover {
    text-decoration: underline;
}

.field-error {
    display: none;
    color: var(--error);
    font-size: 0.85em;
}

/* ==========================================================================
   11. EMAIL SENT PAGE
   ========================================================================== */

.email-address {
    background: var(--bg-surface);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    color: var(--brand-light);
    text-align: center;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.spam-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--gold-dim);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold-border);
}

.resend-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* .resend-form { */
    /* display: flex; */
    /* gap: 0.5rem; */
    /* margin-top: 1rem; */
/* } */

/* .resend-form input { */
    /* flex: 1; */
    /* padding: 0.75rem; */
    /* border: 1px solid var(--border); */
    /* border-radius: var(--radius-sm); */
    /* font-size: 0.9rem; */
    /* font-family: inherit; */
    /* background: var(--bg-input); */
    /* color: var(--text-body); */
    /* transition: border-color 0.2s, box-shadow 0.2s; */
/* } */

/* .resend-button { */
    /* padding: 0.75rem 1.25rem; */
    /* background: var(--brand); */
    /* color: var(--bg-body); */
    /* border: none; */
    /* border-radius: var(--radius-sm); */
    /* font-size: 0.9rem; */
    /* font-weight: 500; */
    /* cursor: pointer; */
    /* font-family: inherit; */
    /* transition: background-color 0.2s; */
    /* white-space: nowrap; */
/* } */

/* --- Your Existing Base Styles (Desktop / Tablet / Large Mobile) --- */
.resend-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.resend-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-body);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.resend-button {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(to bottom, var(--bg-header), var(--brand));
    color: var(--bg-body);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

/* --- New Media Query for Ultra-Small Screens (< 380px) --- */
/* 1. Targets standard mobile phones while keeping them inline */
@media (max-width: 480px) {
    .resend-form input {
        padding: 0.65rem; /* Slightly reduce padding to save horizontal space */
        font-size: 0.85rem;
    }
    
    .resend-button {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }
}

/* 2. Overrides and stacks ONLY when the screen gets dangerously small */
@media (max-width: 380px) {
    .resend-form {
        flex-direction: column;
        gap: 0.75rem;
    }

    .resend-button {
        width: 100%;
        padding: 0.85rem 1.25rem;
    }
}


.resend-form input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow-md);
}

.resend-button:hover {
    background: var(--brand-hover);
}

.resend-button:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
}


.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-blue);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ==========================================================================
   12. LOGIN ERROR PAGE
   ========================================================================== */

.error-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.error-icon svg {
    width: 56px;
    height: 56px;
}

.error-message {
    background: var(--error-dim);
    color: var(--error);
    padding: 0.9rem 1rem;
    border-radius: 6px;
    text-align: center;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    border-left: 3px solid var(--error);
}

.action-links {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.primary-link {
    display: block;
    text-align: center;
    padding: 0.75rem 1.25rem;
    background: var(--brand);
    color: var(--bg-body);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.primary-link:hover {
    background: var(--brand-hover);
}

/* ==========================================================================
   13. DASHBOARD
   ========================================================================== */

.dashboard {
    width: 100%;
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-wrap);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.dashboard h1 {
    margin: 0 0 0.5rem 0;
    color: var(--brand-light);
}

.dashboard p {
    margin: 0 0 2rem 0;
    color: var(--text-secondary);
}

.dashboard button {
    padding: 0.75rem 1.5rem;
    background: var(--brand);
    color: var(--bg-body);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s;
}

.dashboard button:hover {
    background: var(--brand-hover);
}

/* ==========================================================================
   14. HOMEPAGE (HERO & FEATURES)
   ========================================================================== */

.hero {
    width: 100%;
    max-width: 480px;
    background: var(--bg-wrap);
    padding: 2.5rem 1.5rem 2rem 1.5rem;
    text-align: center;
    box-sizing: border-box;
}

.hero-tagline {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0 0 1.75rem 0;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 320px;
    margin: 0 auto;
}

.hero-actions .btn {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(to bottom, var(--bg-header), var(--brand));
    color: var(--bg-body);
}

.btn-primary:hover {
    background: var(--brand-hover);
}

.btn-secondary {
    background: var(--bg-wrap);
    color: var(--brand);
    border: 2px solid var(--brand);
}

.btn-secondary:hover {
    background: var(--brand-glow);
}

.features {
    width: 100%;
    max-width: 480px;
    background: var(--bg-wrap);
    padding: 0.5rem 1.5rem 2.5rem 1.5rem;
    box-sizing: border-box;
	min-height: calc(100vh - 272px);
}

.feature-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 1.1rem;
    margin-top: 1.25rem;
}

.feature-emoji {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.feature-title {
    margin: 0 0 0.35rem 0;
    color: var(--brand-light);
    font-weight: 700;
    font-size: 1.02rem;
}

.feature-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

/* ==========================================================================
   15. LEADERBOARD
   ========================================================================== */

.lb-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 14px 40px;
    background: var(--bg-wrap);
    min-height: calc(100vh - 40px);
    color: var(--text-body);
}

.lb-header { padding: 18px 0 8px; }
.lb-header h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 800; color: var(--brand-light); font-style: italic; }
.lb-header p { margin: 0; color: var(--text-secondary); font-size: .9rem; }

.lb-your-rank {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-subheader);
    color: var(--text-body);
    padding: 12px 14px;
    margin: 14px 0 10px;
    /* border-radius: var(--radius-md); */
}
.lb-your-rank-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.lb-your-rank-pts { font-size: .9rem; opacity: .9; }
.lb-your-rank-value { font-size: 1.5rem; font-weight: 800; margin-left: auto; }

.lb-podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 18px 0 8px; }
.lb-podium-step {
    flex: 1;
    text-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 8px;
    min-width: 0;
}
.lb-podium-step.is-1 {
    order: 2;
    padding-top: 15px;
    background: var(--gold-dim);
    border: 2px solid var(--gold-border);
    transform: scale(1.06);
}
.lb-podium-step.is-2 { order: 1; padding-top: 10px; }
.lb-podium-step.is-3 { order: 3; padding-top: 10px; }
.lb-podium-step.is-me { border: 2px solid var(--brand); }
.lb-podium-medal { font-size: .85rem; line-height: 1; }
.lb-podium-place { font-size: .72rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.lb-podium-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-body);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-podium-pts { font-size: 1.3rem; font-weight: 800; color: var(--brand); margin-top: 2px; }

.lb-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 12px;
}
.lb-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-body);
}
.lb-row:last-child { border-bottom: none; }
.lb-row.is-me { background: var(--bg-surface); }
.lb-rank-badge {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    background: var(--bg-surface);
    color: var(--text-secondary);
}
.lb-rank-badge.is-podium { background: transparent; font-size: 1.2rem; width: auto; }
.lb-user { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lb-name {
    font-weight: 600;
    color: var(--text-body);
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.lb-you {
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    background: var(--brand);
    color: var(--bg-body);
    padding: 2px 6px;
    border-radius: 6px;
}
.lb-meta { width: 100%; font-size: .72rem; color: var(--text-tertiary); }
.lb-points { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.lb-total { font-size: 1.25rem; font-weight: 800; color: var(--brand); line-height: 1; }
.lb-break { font-size: .68rem; color: var(--text-tertiary); margin-top: 2px; }

.lb-empty { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.lb-empty-icon { font-size: 2.4rem; margin-bottom: 10px; }
.lb-empty-hint { font-size: .82rem; color: var(--text-tertiary); margin-top: 6px; }

/* --- Leaderboard tabs --- */
.lb-tabs {
    display: flex;
    gap: 0;
    margin: 14px 0 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-surface);
}
.lb-tab {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.lb-tab:first-child { border-right: 1px solid var(--border); }
.lb-tab:hover { background: var(--bg-input); color: var(--brand); }
.lb-tab.is-active {
    background: var(--bg-input);
    color: var(--brand-light);
    border-bottom-color: var(--brand);
    font-weight: 700;
}

.lb-rules { margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; background: var(--bg-surface); }
.lb-rules-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); margin: 0 0 8px; }
.lb-rules ul { margin: 0; padding-left: 18px; color: var(--text-body); font-size: .85rem; line-height: 1.5; }
.lb-rules li { margin-bottom: 3px; }

/* ==========================================================================
   16. COMMUNITIES (community)
   ========================================================================== */

.community-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 18px 14px 40px;
    background: var(--bg-wrap);
    min-height: calc(100vh - 40px);
    color: var(--text-body);
}

.community-header { padding: 18px 0 8px; }
.community-header h1 {
    margin: 0 0 4px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-light);
    font-style: italic;
}
.community-header p { margin: 0; color: var(--text-secondary); font-size: .9rem; }

.community-subhead {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 6px;
    color: var(--text-secondary);
    font-size: .85rem;
}
.community-subhead .community-badge {
    background: var(--bg-surface);
    color: var(--brand);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .75rem;
}

/* --- Flash messages --- */
.community-flash {
    border-radius: 10px;
    padding: 10px 12px;
    margin: 12px 0;
    font-size: .88rem;
    line-height: 1.4;
}
.community-flash.ok   { background: var(--success-dim); border: 1px solid var(--success-border); color: var(--success); }
.community-flash.err  { background: var(--error-dim); border: 1px solid var(--error-border); color: var(--error); }
.community-flash.info { background: var(--bg-surface); border: 1px solid var(--border-light); color: var(--text-body); }

/* --- Cards --- */
.community-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin: 10px 0;
    text-decoration: none;
    color: inherit;
    display: block;
}
.community-card .community-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.community-card h2 { margin: 0; font-size: 1.05rem; color: var(--brand-light); font-weight: 700; }
.community-card .community-card-desc { margin: 4px 0 0; color: var(--text-secondary); font-size: .82rem; }
.community-card .community-card-meta {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .78rem;
    color: var(--text-tertiary);
}
.community-card-meta .open { color: var(--text-blue); }

.community-card .community-card-rank { color: var(--brand); font-weight: 700; }

/* --- community forms --- */
.community-form { margin: 14px 0; }
.community-form .form-group label { display: block; margin-bottom: .5rem; margin-top: .5rem; color: var(--text-body); font-weight: 500; font-size: .9rem; }
.community-form .form-group input,
.community-form .form-group textarea {
    width: 100%;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-body);
    transition: border-color .2s, box-shadow .2s;
}
.community-form .form-group textarea { min-height: 70px; resize: vertical; }
.community-form .form-group input:focus,
.community-form .form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow-md);
}
.community-form .submit-button { margin-top: 4px; }

.community-btn {
    display: inline-block;
    padding: 9px 16px;
    background: var(--brand);
    color: var(--bg-body);
    border: none;
    border-radius: var(--radius-md);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background-color .2s, transform .1s ease;
}
.community-btn:hover { background: var(--brand-hover); }
.community-btn:active { transform: scale(.98); }
.community-btn.secondary { background: var(--bg-surface); color: var(--brand); }
.community-btn.secondary:hover { background: var(--bg-input); }
.community-btn.danger { background: var(--error-dim); color: var(--error); border: 1px solid var(--error-border); }
.community-btn.danger:hover { background: var(--error-border); }
.community-btn.small { padding: 5px 10px; font-size: .78rem; }

.community-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

.community-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    margin: 12px 0;
}
.community-section h3 {
    margin: 0 0 10px;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    font-weight: 700;
}

/* --- Pending invitations list --- */
.community-invite-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: .86rem;
}
.community-invite-row:last-child { border-bottom: none; }
.community-invite-row .community-invite-email { color: var(--text-body); font-weight: 500; word-break: break-all; }
.community-invite-row .community-invite-meta { color: var(--text-tertiary); font-size: .74rem; margin-top: 2px; }
.community-invite-row form { display: inline; }

/* --- Members' picks --- */
.community-pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.community-pick-row:last-child { border-bottom: none; }
.community-pick-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: var(--text-body);
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.community-pick-tag { flex: 0 0 auto; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.community-pick-tag.home  { background: var(--bg-input); color: var(--brand); }
.community-pick-tag.away  { background: var(--orange-dim); color: var(--orange); }
.community-pick-tag.none  { background: var(--bg-input); color: var(--text-tertiary); }
.community-pick-ot { flex: 0 0 auto; font-size: .72rem; color: var(--text-tertiary); }
.community-pick-boost { flex: 0 0 auto; font-size: .72rem; font-weight: 700; color: var(--bg-body); background: var(--gold); padding: 2px 6px; border-radius: 6px; }

/* --- Empty state --- */
.community-empty { text-align: center; padding: 36px 20px; color: var(--text-secondary); }
.community-empty-icon { font-size: 2.2rem; margin-bottom: 10px; }
.community-empty p { margin: 4px 0; }
.community-empty .community-empty-hint { font-size: .82rem; color: var(--text-tertiary); }

/* --- Owner-only details --- */
.community-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--brand);
    font-size: .88rem;
    padding: 6px 0;
}
.community-details[open] summary { margin-bottom: 8px; }

/* --- Back link --- */
.community-back {
    display: inline-block;
    margin: 6px 0 14px;
    color: var(--text-blue);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
}
.community-back:hover { text-decoration: underline; }

/* ────────────────────────────────────────────────────────────────
   History page (/history)
   ──────────────────────────────────────────────────────────────── */

.hist-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 14px 40px;
    background: var(--bg-wrap);
    min-height: calc(100vh - 40px);
    color: var(--text-body);
}

/* Summary card */
.hist-summary {
    display: flex;
    justify-content: space-around;
    background: var(--bg-subheader);
    color: var(--text-body);
    padding: 14px 8px;
    margin-bottom: 18px;
    /* border-radius: var(--radius-md); */
}
.hist-summary-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hist-summary-value { font-size: 1.35rem; font-weight: 800; }
.hist-summary-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; opacity: .8; }

/* Empty state */
.hist-empty { text-align: center; padding: 48px 16px; color: var(--text-secondary); }
.hist-empty-icon { font-size: 2.4rem; margin-bottom: 8px; }
.hist-empty-hint { font-size: .85rem; opacity: .7; margin-top: 4px; }

/* Month accordion */
.hist-month { margin-bottom: 10px;}
.hist-month-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.07);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: .95rem;
    color: var(--text-body);
    user-select: none;
}
.hist-month-summary::-webkit-details-marker { display: none; }
/* .hist-month-summary::before { */
    /* content: "▶"; */
    /* font-size: .65rem; */
    /* margin-right: 8px; */
    /* transition: transform .2s; */
/* } */
.hist-month-summary::before {
    content: "";
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    margin-right: 8px;
    
    /* Change this to change the arrow's color dynamically */
    background-color: currentColor; 

    /* Your custom SVG used as a mask */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;

    vertical-align: middle;
    transition: transform .2s;
}
.hist-month[open] > .hist-month-summary::before { transform: rotate(90deg); }
.hist-month-stats { font-size: .78rem; font-weight: 500; color: var(--text-secondary); }
.hist-month-days { padding: 0 0 4px; }

/* Day accordion */
.hist-day { margin: 4px 0 0; }
.hist-day-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px 8px 24px;
    background: var(--bg-input);
    border-radius: 6px;
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-body);
    user-select: none;
}
.hist-day-summary::-webkit-details-marker { display: none; }
/* .hist-day-summary::before { */
    /* content: "▸"; */
    /* font-size: .6rem; */
    /* margin-right: 6px; */
    /* transition: transform .2s; */
    /* color: var(--text-tertiary); */
/* } */
.hist-day-summary::before {
    content: "";
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    margin-right: 6px;
    
    /* Change this to change the arrow's color dynamically */
    background-color: currentColor; 

    /* Your custom SVG used as a mask */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;

    vertical-align: middle;
    transition: transform .2s;
}
.hist-day[open] > .hist-day-summary::before { transform: rotate(90deg); }
.hist-day-stats { font-size: .72rem; font-weight: 500; color: var(--text-secondary); }
.hist-day-games { padding: 6px 0 0 0; }

/* Game card */
.hist-game {
    background: var(--bg-wrap);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--text-tertiary);
    overflow: hidden;
}
.hist-game.is-full { border-left-color: var(--success); }
.hist-game.is-partial { border-left-color: var(--gold-border); }
.hist-game.is-wrong { border-left-color: var(--error); }

.hist-game-header { padding: 10px 14px 6px; }
.hist-teams { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.hist-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    opacity: .65;
}
.hist-team.is-winner { opacity: 1; font-weight: 700; }
.hist-team-logo { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.hist-team-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Period scores */
.hist-periods { display: flex; gap: 2px; margin-bottom: 4px; }
.hist-period {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 32px;
    padding: 2px 4px;
}
.hist-period.is-total {
    border-left: 1px solid var(--border);
    padding-left: 6px;
    margin-left: 2px;
}
.hist-period-label { font-size: .6rem; color: var(--text-tertiary); text-transform: uppercase; font-weight: 600; }
.hist-period-score { display: flex; align-items: center; gap: 2px; font-size: .82rem; font-weight: 600; color: var(--text-secondary); }
.hist-period-score .is-winner { color: var(--success); font-weight: 800; }
.hist-period-sep { color: var(--text-tertiary); font-weight: 400; }

/* Prediction block */
.hist-game-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px 10px;
    border-top: 1px solid var(--border);
}
.hist-pred-block { flex: 1; display: flex; flex-direction: column; gap: 4px; position: relative; }
.hist-pred-row { display: flex; align-items: center; gap: 6px; font-size: .8rem; }
.hist-pred-label { color: var(--text-tertiary); font-size: .7rem; text-transform: uppercase; min-width: 52px; font-weight: 600; }
.hist-pred-value { font-weight: 600; }
.hist-pred-value.is-correct { color: var(--success); }
.hist-pred-value.is-wrong { color: var(--error); }
.hist-pts { font-size: .72rem; color: var(--text-tertiary); margin-left: 4px; }
.hist-actual { font-size: .68rem; color: var(--text-tertiary); margin-left: 2px; }
.hist-boost-badge {
    display: inline-block;
    background: var(--gold-border);
    color: var(--bg-body);
    font-size: .62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 2px;
    text-transform: uppercase;
    width: fit-content;
}

/* Game total */
.hist-game-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 12px;
    min-width: 52px;
}
.hist-total-pts { font-size: 1.5rem; font-weight: 800; color: var(--text-body); line-height: 1; }
.hist-total-label { font-size: .6rem; text-transform: uppercase; color: var(--text-tertiary); letter-spacing: .3px; }

/* ==========================================================================
   17. PRIZES PAGE
   ========================================================================== */

.prizes-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 18px 14px 40px;
    background: var(--bg-wrap);
    min-height: calc(100vh - 40px);
    color: var(--text-body);
}

.prizes-header {
    padding: 18px 0 8px;
}

.prizes-header h1 {
    margin: 0 0 4px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-light);
    font-style: italic;
}

.prizes-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    margin: 16px 0;
}

.prizes-section-title {
    margin: 0 0 12px;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    font-weight: 700;
}

.prizes-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.prizes-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.prizes-item:last-child {
    border-bottom: none;
}

.prizes-place {
    font-size: .95rem;
    font-weight: 700;
    color: var(--brand-light);
    line-height: 1.2;
}

.prizes-desc {
    font-size: .9rem;
    color: var(--text-body);
    line-height: 1.5;
}

.prizes-disclaimer {
    margin-top: 20px;
    padding: 14px;
    background: var(--bg-input);
    border-left: 3px solid var(--border-light);
    border-radius: var(--radius-md);
}

.prizes-disclaimer p {
    margin: 0;
    font-size: .85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   18. RULES PAGE
   ========================================================================== */

.rules-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 18px 14px 40px;
    background: var(--bg-wrap);
    min-height: calc(100vh - 40px);
    color: var(--text-body);
}

.rules-header {
    padding: 18px 0 8px;
}

.rules-header h1 {
    margin: 0 0 4px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-light);
    font-style: italic;
}

.rules-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    margin: 16px 0;
}

.rules-section-title {
    margin: 0 0 12px;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.rules-paragraph {
    margin: 0 0 10px;
    font-size: .9rem;
    color: var(--text-body);
    line-height: 1.6;
}

.rules-paragraph:last-child {
    margin-bottom: 0;
}
