/* --- HOLIDAY PREMIUM VARIABLE BLUEPRINT --- */
:root {
    --primary: #c0392b;           /* Rich Festive Crimson */
    --primary-hover: #962d22;     /* Deep Velvet Red */
    --secondary: #1e7e34;         /* Traditional Pine Emerald */
    --secondary-hover: #145523;   /* Deep Forest Green */
    --dark: #2c3e50;              /* Premium Charcoal Slate */
    --card-bg: #ffffff;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 4px 6px rgba(44, 62, 80, 0.05);
    --shadow-md: 0 10px 20px rgba(44, 62, 80, 0.08);
    --font-stack: 'Segoe UI', system-ui, -apple-system, sans-serif;
    
    /* Perfect High-Contrast Candy Cane Striping */
    --peppermint-stripe: repeating-linear-gradient(
        45deg,
        #ffffff,
        #ffffff 12px,
        #c0392b 12px,
        #c0392b 24px
    );
}

/* --- BASE STYLING & CHRISTMAS BLUE BACKGROUND --- */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    /* Deep Midnight Christmas Blue Frost Gradient */
    background: linear-gradient(180deg, #102a43 0%, #102a43 40%, #0b1d33 100%);
    color: var(--dark);
    margin: 0;
    padding: 16px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

/* --- PEPPERMINT BORDER FRAME SYSTEM --- */
.peppermint-frame {
    background-image: var(--peppermint-stripe);
    padding: 6px; /* Thick candy cane border width */
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    margin-bottom: 24px;
}


/* --- HARDWARE-ACCELERATED PURE CSS SNOWFIELD --- */
.snow-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: #ffffff;
    font-size: 1em;
    user-select: none;
    z-index: 1;
    opacity: 0.85;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.6));
    animation: fall linear infinite;
}

.snowflake:nth-of-type(1)  { left: 10%; font-size: 1.2em; animation-duration: 12s; animation-delay: 0s; }
.snowflake:nth-of-type(2)  { left: 25%; font-size: 0.8em; animation-duration: 15s; animation-delay: 1s; opacity: 0.5; }
.snowflake:nth-of-type(3)  { left: 40%; font-size: 1.4em; animation-duration: 10s; animation-delay: 2s; }
.snowflake:nth-of-type(4)  { left: 55%; font-size: 0.9em; animation-duration: 18s; animation-delay: 0.5s; opacity: 0.6; }
.snowflake:nth-of-type(5)  { left: 70%; font-size: 1.1em; animation-duration: 14s; animation-delay: 3s; }
.snowflake:nth-of-type(6)  { left: 85%; font-size: 0.7em; animation-duration: 16s; animation-delay: 1.5s; }
.snowflake:nth-of-type(7)  { left: 95%; font-size: 1.3em; animation-duration: 11s; animation-delay: 4s; }
.snowflake:nth-of-type(8)  { left: 20%; font-size: 1.0em; animation-duration: 13s; animation-delay: 5s; opacity: 0.7; }
.snowflake:nth-of-type(9)  { left: 65%; font-size: 0.8em; animation-duration: 17s; animation-delay: 2.5s; }

@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(105vh) rotate(360deg); }
}

/* --- PEPPERMINT BORDER SYSTEM FRAMES --- */
.peppermint-frame {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 6px; /* Width of the frame border exposure */
    background-image: var(--peppermint-stripe);
    box-shadow: var(--shadow-md);
}

.peppermint-inner {
    background: var(--card-bg);
    border-radius: calc(var(--border-radius-lg) - 4px);
    padding: 24px;
}

/* --- CRISP PREMIUM HEADER OVERLAY --- */
header {
    text-align: center;
    margin-bottom: 24px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md), inset 0 -4px 0 rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.1);
}

header h1 {
    margin: 0;
    font-size: 2em;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* --- CONCISE COMPACT NAV BUTTONS --- */
/* Navigation Container Setup */
.nav-bar {
    display: flex;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #e2e8f0; /* Matches your light capsule bar wrapper in 67991.jpg */
    padding: 6px;
    border-radius: 30px;
    gap: 6px;
    justify-content: space-between;
    align-items: stretch;
    margin-bottom:20px;
}

/* Base Tab Configurations */
.nav-btn {
    flex: 1; /* Enforces equal sizing so tabs never crowd each other out */
    min-width: 0; /* Prevents text from forcing element expansion */
    display: flex;
    flex-direction: row; /* Horizontal layout on wider viewports */
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: #2c3e50;
    border-radius: 24px;
    transition: all 0.2s ease;
    text-align: center;
}

/* Active Tab Highlight Style */
.nav-btn.active {
    background: #c0392b; /* Matches your red admin theme in 67991.jpg */
    color: #ffffff;
}

/* Mobile Responsiveness Rules Override */
@media (max-width: 480px) {
    .nav-btn {
        flex-direction: column; /* Stacks icons over text to save horizontal space */
        gap: 4px;
        padding: 8px 4px;
        font-size: 0.78rem; /* Scales text neatly within modern compact margins */
        line-height: 1.1;
    }
    
    .nav-btn i {
        font-size: 1.15em; /* Gives the icon slight structural prominence */
    }
}


/* --- VIEW SECTION MANAGER --- */
.view-section {
    display: none !important; /* Controlled securely by SPA Hash Routing logic */
}
.view-section.active {
    display: block !important;
}

/* --- CARDS & GRID LAYOUT MODULES --- */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 950px) {
    .grid { grid-template-columns: 1fr 1.8fr; }
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(220, 221, 225, 0.5);
    width: 100%;
}

.card h2 {
    margin-top: 0;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--dark);
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

/* --- INTERACTIVE ACTION BUTTONS --- */
button, .btn-primary, .btn-secondary, .btn-dark {
    font-family: var(--font-stack);
    font-size: 0.9em;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-hover); transform: translateY(-1px); }

.btn-dark { background: var(--dark); color: white; }
.btn-dark:hover { background: #1a252f; }

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* --- POLISHED INPUT SYSTEM --- */
.form-group { margin-bottom: 18px; width: 100%; }
label { display: block; font-size: 0.85em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #7f8c8d; margin-bottom: 6px; }
input, select, textarea {
    width: 100%; padding: 12px; border: 1px solid #dcdde1; border-radius: var(--border-radius-sm);
    background: #fdfdfd; font-family: var(--font-stack); color: var(--dark); font-size: 0.95em; transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; background: #fff; }

/* --- SEAMLESS PUBLIC CARDS DASHBOARD --- */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.player-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    border: 1px solid rgba(220, 221, 225, 0.4);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.player-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(192, 57, 43, 0.15);
}

.player-icon {
    width: 48px; height: 48px; background: #fdf2f2; color: var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4em;
}

.player-header { display: flex; gap: 15px; align-items: center; margin-bottom: 15px; }
.player-name { font-size: 1.15em; color: var(--dark); font-weight: bold; margin: 0; }
.player-tagline { font-size: 0.85em; color: var(--secondary); font-weight: 600; font-style: italic; margin: 2px 0 0 0; }
.player-bio { font-size: 0.9em; color: #555; line-height: 1.4; margin: 0 0 15px 0; flex-grow: 1; }

/* --- COMPLETE SECURITY BLUR LAYER --- */
.blur-text {
    filter: blur(14px);
    user-select: none;
    cursor: pointer;
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.blur-text.revealed {
    filter: blur(0);
}

/* --- DATA TABLE RESPONSIVENESS MATRIX --- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid #edf2f7; font-size: 0.95em; }
th { font-weight: 700; color: #7f8c8d; text-transform: uppercase; font-size: 0.8em; letter-spacing: 0.5px; }

@media (max-width: 650px) {
    table, tbody, tr, td { display: block; width: 100%; }
    tr { background: white; border: 1px solid #edf2f7; border-radius: var(--border-radius-sm); margin-bottom: 16px; padding: 12px; box-shadow: var(--shadow-sm); }
    td { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border: none; }
    td:nth-of-type(1) { border-bottom: 1px dashed #edf2f7; padding-bottom: 10px; margin-bottom: 4px; display: block; }
    td:nth-of-type(2)::before { content: "Family Group:"; font-weight: bold; color: #7f8c8d; }
    td:nth-of-type(3)::before { content: "Spending Limit:"; font-weight: bold; color: #7f8c8d; }
    td:nth-of-type(4)::before { content: "Status:"; font-weight: bold; color: #7f8c8d; }
    td:nth-of-type(5) { border-top: 1px dashed #edf2f7; padding-top: 10px; justify-content: flex-end; gap: 8px; }
}

/* --- CONNECTED STATUS GLOW ANIMATION --- */
.status-connected {
    color: #fff !important; /* Brighter festive neon-green for optimal dark red contrast */
    font-weight: 700;
    font-size: 0.95em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(46, 204, 113, 0.55); /* Soft matching background pod */
    border: 1px solid rgba(46, 204, 113, 0.3);
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 4px rgba(46, 204, 113, 0.2);
        opacity: 0.85;
    }
    50% {
        box-shadow: 0 0 14px rgba(46, 204, 113, 0.6);
        border-color: rgba(46, 204, 113, 0.6);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 4px rgba(46, 204, 113, 0.2);
        opacity: 0.85;
    }
}

/* --- PREMIUM STORY DISPATCH CARDS --- */
.story-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(220, 221, 225, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.story-header-meta {
    background: #f7f9fc;
    padding: 16px 20px;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Collapsed story card header: thumbnail + badges + chevron share a top row,
   headline always gets flex-basis:100% so it wraps onto its own full-width line
   - keeps long headlines readable without crowding the badges, at every screen size. */
.story-accordion-toggle {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 15px 40px 15px 15px; /* right padding reserves room for the pinned chevron */
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.story-header-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    flex-grow: 1;
}

/* Stacks the "NEW" badge above the date when present; with no badge it's just the date alone */
.story-header-date-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* Pinned to the corner instead of flowing with the badges - a nested flex-wrap group can grow
   to multiple rows, and a sibling can't slot into the gaps of that, so it kept getting bumped
   to its own line. Fixed position keeps it exactly where an accordion toggle is expected to be. */
.story-accordion-toggle .accordion-icon {
    position: absolute;
    top: 17px;
    right: 15px;
}

.story-header-title {
    flex-basis: 100%;
    margin: 0;
    font-size: 1.25em;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.3;
}

.story-body {
    padding: 20px 24px 0 24px;
}

/* Grid-rows based accordion: animates smoothly to any content height (incl. images loading in) without JS measurement */
.story-accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-accordion-content.is-open {
    grid-template-rows: 1fr;
}

.story-accordion-inner {
    overflow: hidden;
    min-height: 0;
}

/* One-time glow pulse used to draw the eye to a card after jumping to it from a dossier */
@keyframes story-jump-highlight {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.25); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.story-card-jump-highlight {
    animation: story-jump-highlight 1.3s ease-out;
}

.story-body h3 {
    margin: 0 0 12px 0;
    font-size: 1.4em;
    color: var(--dark);
    font-weight: 800;
}

.story-text {
    font-size: 0.95em;
    color: #334155;
    line-height: 1.6;
    white-space: pre-line; /* Preserves paragraph formatting from JSON strings cleanly */
}
/* Target all images within the .story-text container */
/* Target the image inside .story-text and force it to be responsive */
.story-text img {
  /* Use !important to override the inline max-width: 300px on small screens */
  max-width: 100% !important; 
  width: auto;
  height: auto;
  
  /* Break it out of the text line so it behaves like a standalone block */
  display: block !important; 
  clear: both;
  margin: 1.5rem auto !important; /* Overrides margin: 10px 0 */
  
  /* Your Festive Storybook Border styles */
  padding: 8px;
  border: 4px double #d4af37 !important; 
  background-color: #fffdf6; 
  border-radius: 6px !important;
  
  /* Depth shadows */
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.15), 
    inset 0 0 10px rgba(139, 69, 19, 0.1); 
}


/* Optional: Festive hover effect to make it feel "alive" */
.story-text img:hover {
  transform: scale(1.02);
  box-shadow: 
    0 6px 20px rgba(212, 175, 55, 0.3), /* Festive gold glow */
    inset 0 0 10px rgba(139, 69, 19, 0.1);
}


.story-badge {
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    background: #edf2f7;
    color: #4a5568;
}

.story-people-tags {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.story-people-label {
    font-size: 0.78em;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.story-people-pill {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border-radius: 20px;
    padding: 3px 10px 3px 3px;
    transition: background 0.15s ease;
}

.story-people-pill:hover {
    background: #edf2f7;
}

.story-people-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #c0392b;
    background: #ffffff;
    flex-shrink: 0;
    display: block;
}

.story-people-name {
    font-size: 0.82em;
    font-weight: 600;
    color: #2c3e50;
}

/* --- COMPACT IMAGE LAYOUT FRAMING --- */
.story-banner-img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-bottom: 1px solid #edf2f7;
    background: #e2e8f0;
}

/* --- ADAPTIVE COLLAPSIBLE ADMIN MODULES --- */
.collapsible-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(220, 221, 225, 0.5);
    margin-bottom: 20px;
    overflow: hidden;
    width: 100%;
}

.collapsible-header {
    padding: 20px 24px;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: #f8fafc;
}

.collapsible-header h2 {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 1.25em;
}

.collapse-icon {
    font-size: 1.1em;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.collapsible-content {
    max-height: 0; /* Hidden by default */
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

/* Open State Indicators */
.collapsible-card.is-open .collapsible-content {
    max-height: none; /* No fixed cap: tall lists (e.g. the registry on a phone) must never be cut off. toggleAdminCard animates the height. */
    opacity: 1;
    padding: 0 24px 24px 24px; /* Move inner card padding down here so it doesn't show when closed */
}

.collapsible-card.is-open .collapse-icon {
    transform: rotate(180deg);
    color: var(--primary);
}

/* --- PREMIUM PLAYER PORTRAIT FRAMES --- */
.player-portrait {
    width: 48px;
    height: 48px;
    border-radius: 10px !important;
    object-fit: cover;
    border: 2px solid #edf2f7;
    box-shadow: var(--shadow-sm);
    background: #ffffff;
}
/* Container restructuring to create a banner layout */
.player-card .player-header {
    display: flex;
    align-items: stretch; /* Stretches the image container to match text height */
    gap: 16px;            /* Generates clean space between banner image and text */
    margin-bottom: 12px;
    background: #f8fafc;  /* Subtle backing color to frame the inner banner area */
    border-radius: 12px;
    overflow: hidden;     /* Ensures the image corners clip perfectly to the banner curve */
    padding-right: 12px;  /* Spacing for the right-side text content */
}

/* Redefining the wrapper into a tall, left-aligned banner column */
.player-card .profile-image-wrapper {
    width: 80px !important;   /* Scaled up from 48px to create a prominent banner anchor */
    height: auto !important;  /* Auto height allows it to match the flexbox container height */
    min-height: 90px;         /* Ensures a solid vertical footprint if bio text is short */
    position: relative;
    flex-shrink: 0;
}

/* Transforming the portrait into a flush vertical banner block */
.player-card .player-portrait {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;      /* Removes the circle shape to create a clean banner edge */
    object-fit: cover !important;
    border: none !important;          /* Flushes image directly to the card bounds */
    border-right: 3px solid #c0392b; /* Festive dark red accent strip dividing image and text */
    box-shadow: none !important;
}

/* Centered fallback icon container matching new banner dimensions */
.player-card div[id^="fallback-icon-"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0 !important;
    border-right: 3px solid #c0392b;
    background: #edf2f7;
}

/* Text alignment tuning next to the new banner block */
.player-card .player-header > div:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers the name and tagline vertically against the banner */
    padding: 8px 0;
}

.player-card .player-name {
    margin: 0 0 4px 0;
    font-size: 1.2rem;
}

.player-card .player-tagline {
    margin: 0;
}

/* Container for the portrait to act as the outer frame */
.player-card .profile-image-wrapper {
    width: 75px !important;
    height: 75px !important;
    flex-shrink: 0;
    position: relative;
    
    /* The Festive Frame Effect */
    background: #ffffff;
    border: 3px solid #c0392b;     /* Candy-apple red outer wood frame */
    box-shadow: 
        0 0 0 2px #ffffff,         /* Crisp white inner matte border */
        0 4px 10px rgba(0,0,0,0.15); /* Soft drop shadow to make the frame pop */
    border-radius: 8px !important;  /* Softly squared corner frames */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Force the portrait inside to fill the frame cleanly */
.player-card .player-portrait {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 4px !important; /* Matches the inner frame curve */
    border: none !important;
    display: block;
}

/* Fallback icon frame matching the exact same festive structure */
.player-card div[id^="fallback-icon-"] {
    width: 100% !important;
    height: 100% !important;
    background: #f1f5f9;
    color: #c0392b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Keep the text content vertically centered next to the new frame */
.player-card .player-header {
    display: flex;
    align-items: center; /* Aligns frame cleanly with text */
    gap: 16px;
    padding: 12px;
    background: #f8fafc; /* Matches the header container card from 67998.jpg */
    border-radius: 12px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .santa-widget-container .peppermint-inner {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    .santa-widget-container div[style*="border-right"] {
        border-right: none !important;
        border-bottom: 1px dashed rgba(44, 62, 80, 0.15) !important;
        padding-right: 0 !important;
        padding-bottom: 15px !important;
    }
}

/* Custom styling for the Santa Dashboard Tracker */
.peppermint-frame {
    background: var(--peppermint-stripe);
    padding: 6px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.peppermint-inner {
    background: var(--card-bg);
    border-radius: calc(var(--border-radius-lg) - 4px);
}

#christmas-countdown {
    font-variant-numeric: tabular-nums; /* Prevents text from jumping around as numbers change */
    letter-spacing: -0.5px;
}

.fa-spin-hover:hover {
    animation: fa-spin 2s linear infinite;
}

/* Main Layout Container */
.admin-dashboard-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    padding: 20px 0;
    align-items: start; /* Prevents columns from stretching to match heights */
}

/* .view-section.active forces display:block !important, which otherwise always wins over
   the display:grid above regardless of specificity - this restores the two-column layout. */
#view-admin.active {
    display: grid !important;
}

/* Category Group Wrapper */
.admin-category-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

/* Category Title Styling */
.group-title {
    font-size: 1.4em;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ensure your existing collapsible cards look cohesive inside the new wrapper */
.admin-category-group .collapsible-card {
    background: #ffffff;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #dcdde1;
}

.admin-category-group .collapsible-card:last-child {
    margin-bottom: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .admin-dashboard-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}



/* --- POLL CHOICES & SIGNUP FLOW --- */
/* The global input/label rules (full-width, padded, uppercase) are meant for forms, so poll
   choices opt out of them here and lay themselves out with flex. */
.poll-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 10px 0;
    padding: 14px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--dark);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.poll-choice:hover { border-color: #b7c3d0; background: #fff; }
.poll-choice:has(input[type="radio"]:checked) { border-color: var(--secondary); background: #eafaf1; }
.poll-choice.is-disabled { opacity: 0.6; cursor: default; }
.poll-choice.is-disabled:hover { border-color: #e2e8f0; background: #f8fafc; }

.poll-choice input[type="radio"] {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    accent-color: var(--secondary);
    cursor: inherit;
}
.poll-choice-text { flex: 1; min-width: 0; }

.poll-money {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.poll-money-sign { font-weight: 700; color: #7f8c8d; }
.poll-money input[type="number"] {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
    font-weight: 600;
}

.poll-prompt { margin: 0 0 14px 0; color: var(--dark); line-height: 1.5; }
.poll-error {
    display: none;
    margin: 0 0 12px 0;
    padding: 10px 12px;
    background: #fdecea;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    color: #922b21;
    font-size: 0.9em;
}
.poll-error.is-visible { display: block; }

.poll-actions { display: flex; gap: 10px; margin-top: 16px; }
.poll-actions .grow { flex: 1; }
.poll-actions button { padding: 14px 18px; font-size: 1.05em; }

.poll-notice {
    padding: 18px 16px;
    border-radius: 10px;
    border: 1px solid;
    text-align: center;
    line-height: 1.5;
    color: var(--dark);
}
.poll-notice i { display: block; font-size: 1.8em; margin-bottom: 8px; }

/* --- STYLED CONFIRM POPUP (replaces the browser's confirm()) --- */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    animation: confirmFadeIn 0.18s ease-out;
}
.confirm-modal-card {
    width: 100%;
    max-width: 380px;
    padding: 28px 24px 22px;
    background: #fdfbf7;
    border: 3px double #d4af37;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    text-align: center;
    color: var(--dark);
    animation: confirmSlideUp 0.22s ease-out;
}
.confirm-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef6ff;
    border: 2px solid #5dade2;
    color: #2e86c1;
    font-size: 1.5em;
}
.confirm-modal-title { margin: 0 0 8px 0; font-family: Georgia, serif; font-size: 1.3em; }
.confirm-modal-message { margin: 0 0 22px 0; color: #5d6d7e; line-height: 1.5; font-size: 0.95em; }
.confirm-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.confirm-modal-actions button { width: 100%; padding: 13px 18px; font-size: 1em; }

@keyframes confirmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes confirmSlideUp { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


/* --- ADMIN: MODALS, TOOLBARS, SCROLL LISTS --- */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
}
.admin-modal-overlay.is-open { display: flex; animation: confirmFadeIn 0.18s ease-out; }

.admin-modal-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: #fff;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: confirmSlideUp 0.22s ease-out;
}
.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid #edf2f7;
    background: #fdfbf7;
}
.admin-modal-header h2 { margin: 0 !important; padding: 0 !important; border: none !important; font-size: 1.25em; }
.admin-modal-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    color: #7f8c8d;
    font-size: 1.8em;
    line-height: 1;
}
.admin-modal-close:hover { color: var(--primary); background: #f1f5f9; }
.admin-modal-body { padding: 20px 24px 24px; overflow-y: auto; }
.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) {
    .admin-modal-overlay { padding: 10px; }
    .admin-form-row { grid-template-columns: 1fr; gap: 0; }
}

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 24px 12px; }
.admin-toolbar-wrap { flex-wrap: wrap; }
.admin-toolbar-group { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-toolbar button { padding: 9px 14px; }

.admin-summary { margin: 0 0 10px 0; font-size: 0.85em; font-weight: 700; color: #7f8c8d; }
.admin-summary .on { color: var(--secondary); }
.admin-summary .off { color: #c0392b; }

.admin-scroll-list {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    background: #fafbfc;
}

/* Story rows */
.admin-story-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid #edf2f7;
}
.admin-story-row:last-child { border-bottom: none; }
.admin-story-row.is-disabled { background: #f6f7f9; }
.admin-story-row.is-disabled .admin-story-main { opacity: 0.55; }
.admin-story-main { flex: 1; min-width: 0; }
.admin-story-main strong { display: block; overflow-wrap: anywhere; }
.admin-story-main small { color: #7f8c8d; }
.admin-story-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.admin-story-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.admin-story-actions button { padding: 7px 10px; font-size: 0.85em; }
.state-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.state-pill.on { background: #e6f4ea; color: #1e7e34; }
.state-pill.off { background: #fdecea; color: #c0392b; }

/* On/off switch (overrides the global label/input form styling) */
label.switch {
    position: relative;
    display: inline-block;
    flex: 0 0 46px;
    width: 46px;
    height: 26px;
    margin: 0;
    cursor: pointer;
}
label.switch input { position: absolute; opacity: 0; width: 0; height: 0; padding: 0; }
.switch-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e0;
    border-radius: 999px;
    transition: background 0.2s ease;
}
.switch-slider::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}
label.switch input:checked + .switch-slider { background: var(--secondary); }
label.switch input:checked + .switch-slider::before { transform: translateX(20px); }
label.switch input:focus-visible + .switch-slider { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 520px) {
    .admin-story-row { flex-wrap: wrap; }
    .admin-story-main { flex-basis: calc(100% - 70px); }
    .admin-story-actions { margin-left: 58px; }
}


/* --- "SIGNED IN AS" STRIP (shared-device safety) --- */
.identity-bar {
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 auto 16px auto;
    padding: 8px 14px;
    max-width: 750px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.9em;
    color: var(--dark);
}
.identity-bar i { color: var(--secondary); }
.identity-switch {
    padding: 4px 12px;
    background: none;
    border: 1px solid #cbd5e0;
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
}
.identity-switch:hover { background: #fdecea; border-color: var(--primary); }

/* Connection status (header) when running without the cloud */
.status-offline { color: #fff3cd !important; font-weight: 600; }

/* Admin: destructive button inside the participant editor */
.btn-danger-outline {
    background: #fff;
    color: #c0392b;
    border: 1px solid #e6b0aa;
}
.btn-danger-outline:hover { background: #fdecea; }


/* --- NORTH POLE GAZETTE INTRO --- */
.story-intro {
    max-width: 750px;
    margin: 0 auto 20px auto;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.92);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    color: var(--dark);
    font-size: 0.95em;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}


/* --- COMPACT COUNTDOWN (shown while the app is locked) --- */
/* Inline styles on the widget need !important to override. Hides the Santa tracker half. */
#santaWidgetWrap.is-compact .santa-widget-container { margin-bottom: 16px !important; }
#santaWidgetWrap.is-compact .peppermint-inner { grid-template-columns: 1fr !important; gap: 0 !important; padding: 12px 16px !important; }
#santaWidgetWrap.is-compact #countdown-wrapper { border-right: none !important; padding-right: 0 !important; }
#santaWidgetWrap.is-compact #countdown-wrapper h3 { font-size: 0.85em !important; margin-bottom: 2px !important; }
#santaWidgetWrap.is-compact #christmas-countdown { font-size: 1.5em !important; }
#santaWidgetWrap.is-compact #countdown-wrapper small,
#santaWidgetWrap.is-compact .santa-tracker-side { display: none !important; }


/* --- HONORARY ELF CARDS (not in this year's gift exchange) --- */
/* A cool, snowy tint so it reads as "different" without feeling dimmed or left out. */
.player-card--elf {
    background: linear-gradient(180deg, #f6faff 0%, #eaf3fc 100%);
    border-color: #cfe1f3;
}
.player-card--elf:hover { border-color: #9cc3e8; }
.player-card.player-card--elf .player-header { background: #e1edf9; }
.player-card.player-card--elf .profile-image-wrapper {
    border-color: #5b9bd5;
}
.player-card.player-card--elf div[id^="fallback-icon-"] { color: #2e6fa8; background: #e8f1fa; }
.elf-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px dashed #9cc3e8;
    border-radius: var(--border-radius-sm);
    color: #2e6fa8;
    font-size: 0.9em;
    font-weight: 700;
}
.elf-badge i { color: #d4a017; }


/* --- CHARACTER DOSSIER: extras (file, intel, medals, stamp, burst) --- */
#dossierModal .dossier-modal-card { max-width: 420px; max-height: 90vh; overflow-y: auto; }
#dossierModal .dossier-portrait-frame { cursor: pointer; transition: transform 0.15s ease; }
#dossierModal .dossier-portrait-frame:hover { transform: scale(1.05); }
#dossierModal .dossier-portrait-frame:focus-visible { outline: 3px solid #d4af37; outline-offset: 3px; }

.dossier-section {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.dossier-h {
    margin: 0 0 8px 0;
    font-size: 0.8em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #c0392b;
}
.dossier-file-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.9em;
}
.dossier-file-row:first-of-type { padding-top: 0; }
.dossier-file-row:last-child { border-bottom: none; padding-bottom: 0; }
.dossier-h + .dossier-file-row { padding-top: 0; }
.dossier-file-label { font-size: 0.7em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #94a3b8; }
.dossier-file-label i { color: #d4af37; margin-right: 3px; }
.dossier-file-value { color: #2c3e50; font-weight: 600; overflow-wrap: anywhere; }
.dossier-partners { display: flex; flex-wrap: wrap; gap: 6px; }
.dossier-partner {
    padding: 3px 10px;
    background: #fdfbf7;
    border: 1px solid #d4af37;
    border-radius: 999px;
    color: #2c3e50;
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
}
.dossier-partner:hover { background: #fdf3d0; }

.dossier-medals { display: flex; flex-direction: column; gap: 8px; }
.dossier-medal { display: flex; align-items: center; gap: 10px; font-size: 0.9em; }
.dossier-medal-icon { font-size: 1.5em; line-height: 1; }
.dossier-medal-text { display: flex; flex-direction: column; color: #2c3e50; }
.dossier-medal-text small { color: #94a3b8; font-weight: 700; }


/* Stamp that slams down beside the portrait */
.dossier-stamp {
    position: absolute;
    top: 52px;
    left: 12px;
    max-width: 96px;
    padding: 3px 7px;
    border: 3px solid #c0392b;
    border-radius: 6px;
    color: #c0392b;
    font-size: 0.62em;
    font-weight: 900;
    letter-spacing: 1.5px;
    line-height: 1.2;
    text-align: center;
    transform: rotate(-14deg);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}
.dossier-stamp.is-elf { border-color: #2e6fa8; color: #2e6fa8; }
.dossier-stamp.is-playing { animation: stampSlam 0.45s ease-out 0.25s forwards; }
.dossier-stamp.is-static { opacity: 0.85; }
@keyframes stampSlam {
    0%   { opacity: 0; transform: rotate(-14deg) scale(2.6); }
    60%  { opacity: 1; transform: rotate(-14deg) scale(0.9); }
    100% { opacity: 0.88; transform: rotate(-14deg) scale(1); }
}

/* Emoji burst */
.dossier-burst {
    position: absolute;
    z-index: 3;
    font-size: 1.15rem;
    pointer-events: none;
    animation: burstOut 1.1s ease-out forwards;
}
@keyframes burstOut {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); }
}
@media (prefers-reduced-motion: reduce) {
    .dossier-stamp.is-playing { animation: none; opacity: 0.85; }
    .dossier-burst { display: none; }
}


/* --- STORY REACTIONS --- */
.story-reactions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 24px 0 24px;
}
.reaction-prompt { font-size: 0.75em; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #94a3b8; }
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 999px;
    color: var(--dark);
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.reaction-btn:hover { background: #fff; border-color: #b7c3d0; transform: translateY(-1px); }
.reaction-btn.is-mine { background: #eafaf1; border-color: var(--secondary); }
.reaction-emoji { font-size: 1.15em; line-height: 1; }
.reaction-count { font-size: 0.85em; color: #5d6d7e; }
.reaction-btn.is-mine .reaction-count { color: var(--secondary); }

/* One-line "who can see this" note under each poll question */
.poll-privacy { margin: 0 0 14px 0; font-size: 0.8em; color: #7f8c8d; line-height: 1.4; }
.poll-privacy i { margin-right: 4px; color: #94a3b8; }


/* Tall admin lists (registry, assignments) scroll inside their panel instead of stretching the page */
.admin-scroll-tall {
    max-height: 65vh;
    overflow: auto;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
}
.collapsible-content > .admin-scroll-tall { margin-top: 4px; }


/* --- DAILY IDEA, GIFT BOX & CORK BOARD --- */
.idea-card {
    position: relative;
    max-width: 750px;
    margin: 0 auto 24px auto;
    padding: 18px 20px 20px;
    background: #fffdf5;
    border: 1px solid #e6d28a;
    border-left: 5px solid #d4af37;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}
.idea-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.idea-head h3 { margin: 0; color: var(--primary); font-size: 1.05em; text-transform: uppercase; letter-spacing: 1px; }
.idea-date { font-size: 0.85em; color: #7f8c8d; font-weight: 600; }

/* The gift you tap to open */
.gift-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 18px 12px;
    background: repeating-linear-gradient(45deg, #fff, #fff 10px, #fdf0ee 10px, #fdf0ee 20px);
    border: 2px dashed var(--primary);
    border-radius: 14px;
    color: var(--primary);
    cursor: pointer;
}
.gift-box:hover { background: #fdf0ee; }
.gift-emoji { font-size: 3.4rem; line-height: 1; animation: giftWiggle 3s ease-in-out infinite; transform-origin: 50% 80%; }
.gift-label { font-size: 1em; font-weight: 800; letter-spacing: 0.5px; }
@keyframes giftWiggle {
    0%, 70%, 100% { transform: rotate(0); }
    75% { transform: rotate(-8deg); }
    80% { transform: rotate(8deg); }
    85% { transform: rotate(-6deg); }
    90% { transform: rotate(6deg); }
}

.idea-reveal.just-opened { animation: ideaPop 0.5s ease-out; }
@keyframes ideaPop { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }
.idea-kicker { font-size: 0.75em; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #b8892a; margin-bottom: 4px; }
.idea-text { margin: 0 0 16px 0; font-size: 1.15em; line-height: 1.55; color: var(--dark); font-weight: 600; }

/* The cork board */
.board-title { font-size: 0.8em; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #8b5a2b; margin-bottom: 8px; }
.cork-board {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 14px;
    justify-content: center;
    min-height: 120px;
    padding: 24px 16px 18px;
    background-color: #c8a070;
    background-image:
        radial-gradient(rgba(0, 0, 0, 0.14) 1px, transparent 1.6px),
        radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.6px);
    background-size: 7px 7px, 11px 11px;
    background-position: 0 0, 3px 4px;
    border: 7px solid #8b5a2b;
    border-radius: 10px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}
.cork-empty { align-self: center; color: #5b3a17; font-weight: 700; font-size: 0.95em; text-align: center; }
.sticker {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 14px 10px 8px;
    background: #fffef7;
    border-radius: 4px;
    box-shadow: 1px 3px 6px rgba(0, 0, 0, 0.35);
    transform: rotate(var(--tilt, 0deg));
}
.sticker-pin {
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    background: radial-gradient(circle at 35% 30%, #ff8a7a, #c0392b 60%);
    border-radius: 50%;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
}
.sticker-emoji { font-size: 2.1rem; line-height: 1.1; }
.sticker-name { margin-top: 4px; font-size: 0.72em; font-weight: 800; color: #5d4a2e; letter-spacing: 0.3px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Emoji tray */
.board-tray { margin-top: 12px; }
.board-tray-title { font-size: 0.85em; color: #7f8c8d; margin-bottom: 6px; }
.tray-label { margin: 8px 0 4px; font-size: 0.7em; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; }
.tray-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tray-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease;
}
.tray-btn:hover { transform: translateY(-2px) scale(1.06); border-color: #b7c3d0; }
.tray-btn.is-mine { background: #eafaf1; border-color: var(--secondary); }

@media (prefers-reduced-motion: reduce) {
    .gift-emoji { animation: none; }
    .idea-reveal.just-opened { animation: none; }
}

/* Pin of the Day: before the start date / after Christmas */
.idea-note {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #fdf8e7;
    border: 1px dashed #d4af37;
    border-radius: 12px;
}
.idea-note .gift-emoji { animation: none; font-size: 2.4rem; }
.idea-note-text { font-weight: 700; color: var(--dark); line-height: 1.45; }


/* --- FAMILY GAMES: Would You Rather, Guess It, Madlib, Champions --- */
.game-card { display: block; }
.game-title { margin: 0 0 6px 0; color: #2c3e50; }
.game-fine { margin: 10px 0 0 0; font-size: 0.82em; color: #7f8c8d; line-height: 1.45; }

.game-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    background: #f1f5f9;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    color: var(--dark);
    line-height: 1.45;
    font-size: 0.95em;
}
.game-notice i { margin-top: 3px; color: #64748b; }
.game-notice.is-good { background: #eafaf1; border-color: #27ae60; }
.game-notice.is-good i { color: #27ae60; }
.game-notice.is-warn { background: #fff5eb; border-color: #f39c12; }
.game-notice.is-warn i { color: #e67e22; }

/* Would You Rather */
.rather-cards { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin-top: 12px; }
.rather-choice {
    width: 100%;
    padding: 22px 16px;
    background: #fff;
    border: 3px solid #e2e8f0;
    border-radius: 14px;
    color: var(--dark);
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.rather-choice:first-child { border-color: #f5c6c0; background: #fff8f7; }
.rather-choice:last-child { border-color: #bcdcc4; background: #f7fcf8; }
.rather-choice:hover { transform: translateY(-2px); border-color: var(--dark); }
.rather-or {
    align-self: center;
    margin: -12px 0;
    padding: 6px 14px;
    background: var(--dark);
    border: 3px solid #fff;
    border-radius: 999px;
    color: #fff;
    font-size: 0.8em;
    font-weight: 900;
    letter-spacing: 2px;
    z-index: 1;
}
.rather-results { margin-top: 14px; }
@media (min-width: 640px) {
    .rather-cards { flex-direction: row; align-items: center; gap: 0; }
    .rather-choice { flex: 1; }
    .rather-or { margin: 0 -14px; }
}

/* Guess It */
.game-puzzle {
    margin: 12px 0;
    padding: 18px 12px;
    background: #fffdf5;
    border: 2px dashed #d4af37;
    border-radius: 12px;
    font-size: 2.2rem;
    line-height: 1.3;
    letter-spacing: 4px;
    text-align: center;
    word-break: break-word;
}
.game-hint-btn {
    margin-bottom: 8px;
    padding: 5px 12px;
    background: none;
    border: 1px solid #cbd5e0;
    border-radius: 999px;
    color: #64748b;
    font-size: 0.85em;
    cursor: pointer;
}
.game-hint { margin-bottom: 8px; padding: 8px 12px; background: #fdf8e7; border-radius: 8px; color: #7f6a1e; font-size: 0.9em; }
.guess-row { display: flex; gap: 8px; }
.guess-row input { flex: 1; min-width: 0; padding: 12px 14px; font-size: 1em; }
.guess-row button { padding: 12px 18px; flex: 0 0 auto; }

.game-answer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 6px;
    padding: 14px;
    background: #eafaf1;
    border: 1px solid #27ae60;
    border-radius: 12px;
    text-align: center;
}
.game-answer-label { font-size: 0.72em; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #1e7e34; }
.game-answer-text { font-size: 1.4em; font-weight: 800; color: var(--dark); }
.game-guesses { margin-top: 12px; border: 1px solid #edf2f7; border-radius: 10px; overflow: hidden; }
.game-guess-line {
    display: grid;
    grid-template-columns: 90px 1fr 24px;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.9em;
}
.game-guess-line:last-child { border-bottom: none; }
.game-guess-line.is-right { background: #f3fbf5; }
.game-guess-line span { overflow-wrap: anywhere; }
.game-mark { color: #1e7e34; font-weight: 900; text-align: center; }

/* Madlib */
.madlib-progress { height: 10px; margin-top: 12px; background: #f1e9cf; border-radius: 5px; overflow: hidden; }
.madlib-progress-fill { height: 100%; background: linear-gradient(90deg, #f5b45c, #d4af37); border-radius: 5px; transition: width 0.4s ease; }
.madlib-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.madlib-field { display: flex; flex-direction: column; gap: 4px; margin: 0; text-transform: none; letter-spacing: 0; }
.madlib-field-label { font-size: 0.9em; font-weight: 700; color: var(--dark); }
.madlib-field input { padding: 12px 14px; font-size: 1em; }
.madlib-submit { width: 100%; margin-top: 12px; padding: 13px; font-size: 1.05em; }
.madlib-story {
    margin-top: 12px;
    padding: 18px;
    background: #fffdf5;
    border: 1px solid #e6d28a;
    border-left: 5px solid #d4af37;
    border-radius: 10px;
    font-size: 1.1em;
    line-height: 1.9;
    color: var(--dark);
    white-space: pre-wrap;
}
.madlib-word { padding: 1px 6px; background: #fde68a; border-radius: 5px; color: #7c2d12; font-weight: 800; cursor: help; }
.madlib-word.is-missing { background: #e2e8f0; color: #64748b; font-style: italic; font-weight: 600; }

/* Christmas Champions */
.champions-card {
    max-width: 750px;
    margin: 0 auto 24px auto;
    padding: 16px 18px;
    background: #fffdf5;
    border: 1px solid #e6d28a;
    border-left: 5px solid #d4af37;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}
.champions-title { margin-bottom: 8px; color: var(--primary); font-size: 1.05em; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.champions-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed #efe3b0; }
.champions-row:last-child { border-bottom: none; }
.champions-row.is-first .champions-name { font-weight: 800; }
.champions-rank { font-size: 1.2em; text-align: center; }
.champions-pts { font-weight: 800; color: #b8892a; }

/* Admin rows for the games */
.admin-kind-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: #eef2ff;
    border-radius: 999px;
    color: #4338ca;
    font-size: 0.7em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}
.admin-guess-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.85em; border-bottom: 1px dashed #edf2f7; }
.admin-guess-row span { overflow-wrap: anywhere; }
.admin-grade-btn { padding: 3px 9px; border-radius: 999px; font-size: 0.8em; font-weight: 800; border: 1px solid; background: #fff; cursor: pointer; white-space: nowrap; }
.admin-grade-btn.is-right { color: #1e7e34; border-color: #27ae60; background: #eafaf1; }
.admin-grade-btn.is-wrong { color: #c0392b; border-color: #e6b0aa; background: #fdecea; }

/* Madlib: tap a word to show who added it */
.madlib-word[data-by] { cursor: pointer; }
.madlib-word.is-showing::after { content: " \00b7 " attr(data-by); font-size: 0.65em; font-weight: 700; color: #92400e; letter-spacing: 0.3px; }


/* --- AUTO STORY RELEASE --- */
.scheduled-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: #fff3e0;
    border: 1px dashed #f5b45c;
    border-radius: 6px;
    color: #b25e00;
    font-size: 0.72em;
    font-weight: 800;
    line-height: 1.3;
}
.story-card.is-scheduled { border-style: dashed !important; border-color: #f5b45c !important; opacity: 0.92; }
.state-pill.sched { background: #fff3e0; color: #b25e00; }
.story-mode-select { flex: 0 0 auto; width: 108px; padding: 6px 8px; font-size: 0.85em; font-weight: 700; border-radius: 8px; }


/* --- ADMIN ON A PHONE: never wider than the screen --- */
.admin-dashboard-layout { grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); }
.admin-category-group { min-width: 0; }
.btn-group { flex-wrap: wrap; }
