:root {
    --bg-color-center: #3a415a; --bg-color-edge: #232738;
    --nav-bg: rgba(30, 34, 50, 0.85); --card-bg: rgba(59, 66, 91, 0.65); --footer-bg: #1a1d29;
    --text-color: #f8f9fa; --text-muted: #d1d6e6;
    --primary-color: #81b29a; --primary-light: #a8e6cf;
    --secondary-color: #e07a5f; --secondary-light: #ff9b83;
    --nav-link-color: #f8f9fa; --nav-link-hover-bg: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.12);
    --spore-color: #bcab64; --error-color: #e07a5f;
    --font-primary: 'Montserrat', sans-serif; --font-secondary: 'Playfair Display', serif;
}

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

html {
    background-color: var(--bg-color-edge);
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    line-height: 1.6; font-size: 17px;
    display: flex; flex-direction: column; min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top center, var(--bg-color-center) 0%, var(--bg-color-edge) 100%);
    z-index: -2;
    pointer-events: none;
}

/* --- Mycelium Simulator --- */
#mycelium-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

/* Cross-page transitions (Chrome 126+, Safari 18.2+; others just navigate). */
@view-transition { navigation: auto; }
/* Event card <-> event page morph (names are set by main.js only for the event
   being opened). Posters are cropped, not stretched, while they change shape;
   text keeps its size and anchors top-left instead of being squashed. */
::view-transition-group(*.vt-img) { overflow: hidden; border-radius: 12px; }
::view-transition-old(*.vt-img), ::view-transition-new(*.vt-img) { width: 100%; height: 100%; object-fit: cover; }
::view-transition-old(*.vt-text), ::view-transition-new(*.vt-text) { width: 100%; height: 100%; object-fit: none; object-position: top left; }
.vt-word { display: inline-block; }
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

main, footer {
    position: relative;
    z-index: 1;
}

h1, h2, h3, h4 { font-family: var(--font-secondary); font-weight: 700; color: var(--primary-color); }
a { color: var(--primary-color); text-decoration: none; transition: all 0.3s ease; }
a:hover { color: var(--primary-light); text-shadow: 0 0 8px rgba(129,178,154,0.4); }

header {
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 0 2%;
    display: flex; justify-content: space-between; align-items: center;
    height: 75px; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s ease-in-out;
}

.header-left { display: flex; align-items: center; }
.header-left h1 { font-size: 1.6rem; color: var(--text-color); margin-left: 15px; letter-spacing: 0.5px; }

.logo-container { height: 45px; position: relative; margin-right: 15px; cursor: pointer; }
#club-logo { height: 100%; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; z-index: 10; }
.logo-container:hover #club-logo { transform: scale(1.15) rotate(-5deg); }
#spore-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: visible;}

.spore { position: absolute; width: 3px; height: 3px; background-color: var(--spore-color); border-radius: 50%; opacity: 0; animation: driftAndFade 3s ease-out forwards; box-shadow: 0 0 5px var(--spore-color); }
@keyframes driftAndFade {
    0% { opacity: 0.9; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--spore-drift-x), 150px) scale(0.5); }
}

nav ul { list-style: none; display: flex; align-items: center; gap: 5px; }
nav ul li { position: relative; }
nav ul li a { display: block; padding: 10px 15px; border-radius: 6px; font-weight: 500; font-size: 0.95em; color: var(--nav-link-color); white-space: nowrap; transition: all 0.2s; }
nav ul li a:hover, nav ul li a.active-link { background-color: var(--nav-link-hover-bg); color: var(--primary-light); }

.dropdown-content {
    display: none; position: absolute; top: 100%; left: 0;
    background-color: var(--nav-bg); min-width: 160px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); border-radius: 0 0 8px 8px;
    border: 1px solid rgba(255,255,255,0.05); border-top: none;
    flex-direction: column; overflow: hidden; z-index: 1001;
}
@media (min-width: 1090px) { .dropdown:hover .dropdown-content { display: flex; } }
.dropdown.dropdown-open .dropdown-content { display: flex; }
.dropdown-content li { width: 100%; }
.dropdown-content li a { border-radius: 0; padding: 12px 15px; }

main { padding: 40px 5%; flex-grow: 1; max-width: 1350px; margin: 0 auto; width: 100%; }
.page-content { animation: fadeInContent 0.6s ease-out forwards; }
@keyframes fadeInContent { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.page-content h2 {
    font-size: 2.8rem; margin-bottom: 25px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    display: inline-block; position: relative;
    width: fit-content;
}
.page-content h2::after { content: ''; position: absolute; left: 0; bottom: -8px; width: 60px; height: 4px; background: var(--secondary-color); border-radius: 2px; }
.page-content h3 { font-size: 2.2rem; margin-bottom: 15px; margin-top: 35px; }
.page-content p, .page-content ul { margin-bottom: 18px; font-size: 1.15rem; color: var(--text-muted); }

.event-item, .partner-item, .admin-module, .document-layout, .resource-list li {
    background: var(--card-bg); backdrop-filter: blur(10px);
    padding: 30px; margin-bottom: 30px; border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color); border-left: 5px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.event-item:hover, .partner-item:hover, .resource-list li:hover {
    transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.2);
}
ul.resource-list { list-style: none; padding-left: 0; }

.event-item { display: flex; flex-direction: row; gap: 35px; align-items: center; }
/* Posters keep their own shape: scaled down to fit the column, never cropped. */
.event-item-img { flex: 0 0 240px; display: flex; justify-content: center; }
.event-item-img img { width: auto; height: auto; max-width: 100%; max-height: 380px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); display: block; }
.event-item-content { flex: 1; min-width: 0; }
.event-item-content h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 0; }

.rsvp-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary-light); color: #1a1c29 !important;
    padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 800;
    margin-left: 12px; border: 1px solid var(--primary-color); vertical-align: middle;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.rsvp-pill i { font-size: 0.75rem; color: #1a1c29; }
.event-info-side h2 .rsvp-pill { -webkit-text-fill-color: #1a1c29 !important; }

#custom-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); display: none; justify-content: center; align-items: center; z-index: 2000; }
.custom-modal-content { background: var(--card-bg); border: 1px solid var(--border-color); padding: 30px; border-radius: 16px; text-align: center; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.custom-modal-content h3 { margin-top: 0; color: var(--error-color); }
.modal-actions { display: flex; justify-content: center; gap: 15px; margin-top: 25px; }

.internal-rsvp-form { background: rgba(0,0,0,0.15); padding: 25px; border-radius: 12px; border: 1px solid var(--border-color); margin-top: 20px; }
.internal-rsvp-form h4 { font-size: 1.4rem; margin-bottom: 15px; margin-top: 0;}
.internal-rsvp-form input { margin-bottom: 15px; }

#hero-home {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 60px; margin-bottom: 50px; margin-top: 20px;
}
.hero-image-container { flex: 0 0 45%; position: sticky; top: 95px; }
.hero-image-container img { width: 100%; height: auto; max-height: 80vh; object-fit: cover; border-radius: 16px; box-shadow: 0 15px 40px rgba(0,0,0,0.4); }
.hero-content { flex: 1; min-width: 0; }

@media (min-width: 1400px) {
    main { max-width: 1450px; }
    #hero-home { gap: 100px; }
    .hero-image-container { flex: 0 0 40%; max-width: 600px; }
}

#home-gallery-highlights { text-align: center; margin-top: 60px; padding-top: 40px; border-top: 1px solid rgba(255,255,255,0.05); }
#home-gallery-highlights h3 { font-size: 2.4rem; margin-bottom: 20px; }
#home-gallery-highlights > p { font-size: 1.25rem; max-width: 900px; margin: 0 auto 20px auto; color: var(--text-color); }
.scrolling-wrapper { display: flex; overflow-x: auto; padding-bottom: 25px; gap: 20px; cursor: grab; margin-top: 30px; max-width: 100%; user-select: none; -webkit-user-select: none;}
.scrolling-wrapper::-webkit-scrollbar { height: 10px; }
.scrolling-wrapper::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 5px; }
.scrolling-wrapper::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 5px; }
.gallery-image-item { flex: 0 0 auto; width: 280px; height: 200px; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 15px rgba(0,0,0,0.3); transition: transform 0.3s;}
.gallery-image-item:hover { transform: scale(1.03); }
.gallery-image-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }


.event-info-side h2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.event-item-content h3, .event-info-side h2 {
    width: fit-content;
    contain: layout;
}

.event-detail-hero {
    position: relative; flex-grow: 1; display: flex; align-items: center; justify-content: center;
    overflow: hidden; overflow: clip; padding: 40px 20px; width: 100%; min-height: 80vh;
}
.hero-bg {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover !important; background-position: center !important;
    filter: blur(20px) brightness(0.35); transform: scale(1.15); z-index: -1;
}
.event-container-featured {
    width: 100%; max-width: 55%; margin: 0 auto;
    background: rgba(42, 47, 69, 0.7); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: row; gap: 50px;
    border-radius: 16px; overflow: hidden; overflow: clip; box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    position: relative; z-index: 1;
}
/* The poster column stretches to the card's height; any space the poster doesn't
   fill shows a blurred copy of it instead of an empty band, and the poster stays in
   view while the text beside it scrolls. overflow: clip (not hidden) keeps sticky working. */
.event-image-side {
    flex: 0 0 40%; max-width: 25vw; position: relative; overflow: clip;
    display: flex; align-items: flex-start; justify-content: center;
}
.event-image-side::before {
    content: ''; position: absolute; inset: -60px;
    background: var(--poster-url) center / cover no-repeat;
    filter: blur(40px) brightness(0.4) saturate(1.2);
}
.event-image-side img {
    position: sticky; top: 20px; display: block; width: 100%; height: auto;
    aspect-ratio: var(--poster-ratio); max-height: 85vh; object-fit: contain;
}
.event-info-side { flex: 1; padding: 50px 50px 50px 0; display: flex; flex-direction: column; justify-content: center; color: #f8f9fa; }
/* Wide (landscape) posters go full width above the text. */
.event-container-featured.poster-wide { flex-direction: column; gap: 0; max-width: min(960px, 92%); }
.poster-wide .event-image-side { flex: none; max-width: none; width: 100%; }
.poster-wide .event-image-side img { max-height: 70vh; }
.poster-wide .event-info-side { padding: 40px 50px; }
/* Tall/square posters on wide screens: main.js sizes the poster column so the poster
   is exactly as tall as the text beside it (--poster-w = text height x poster ratio),
   and the card shrinks to fit both. If that can't fit, the layout above is kept. */
@media (min-width: 951px) {
    .event-container-featured.poster-fit { width: var(--card-w); max-width: none; }
    .event-container-featured.rsvp-below { flex-wrap: wrap; row-gap: 0; }
    .poster-fit .event-image-side { flex: 0 0 var(--poster-w); width: var(--poster-w); max-width: none; align-items: stretch; }
    .poster-fit .event-info-side { flex: 0 0 var(--text-w); width: var(--text-w); }
    /* The column matches the poster's shape to the pixel; fill only absorbs rounding. */
    .poster-fit .event-image-side img { position: relative; top: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: fill; }
    .event-container-featured.poster-stack { flex-direction: column; gap: 0; width: var(--card-w); max-width: none; }
    .poster-stack .event-image-side { flex: none; max-width: none; width: 100%; }
    .poster-stack .event-image-side img { position: relative; top: 0; max-height: none; }
    .poster-stack .event-info-side { padding: 40px 50px; }
    /* RSVP moved under the poster + text so the text column is short enough to match. */
    .rsvp-below > .internal-rsvp-form { flex: 0 0 100%; margin: 0; border: none; border-top: 1px solid rgba(255,255,255,0.1); border-radius: 0; padding: 25px 50px 30px; }
    .rsvp-below #internal-rsvp-form { display: flex; gap: 12px; align-items: flex-start; }
    .rsvp-below #internal-rsvp-form input { flex: 1; margin-bottom: 0; }
    .rsvp-below #internal-rsvp-form .btn { flex: none; padding: 14px 22px; }
}
.event-info-side h2 { margin: 0 0 10px 0; font-size: 2.8rem; border-bottom: none; }
.event-info-side h2 .rsvp-pill { -webkit-text-fill-color: #1a1c29 !important; }
.event-info-side p { margin: 5px 0; line-height: 1.6; color: #d1d6e6; font-size: 1.15rem; }
.event-info-side hr { border: none; border-top: 1px solid rgba(255, 255, 255, 0.15); margin: 25px 0; width: 100%; }

.add-to-calendar { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    padding: 12px 20px; text-decoration: none; border-radius: 10px;
    font-weight: 600; font-size: 0.95rem; cursor: pointer; border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: var(--font-primary); text-align: center;
}
.btn[hidden] { display: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-primary { background: linear-gradient(135deg, var(--primary-color), #5f9ea0); color: #151722 !important; box-shadow: 0 4px 15px rgba(129, 178, 154, 0.3); }
.btn-primary:hover { box-shadow: 0 8px 25px rgba(129, 178, 154, 0.5); transform: translateY(-3px); }
.btn-secondary { background: rgba(255,255,255,0.05); color: var(--text-color) !important; border: 1px solid var(--border-color); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); transform: translateY(-3px); color: white !important; border-color: rgba(255,255,255,0.3); }

.btn-share { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--primary-color); color: var(--primary-light) !important; }
.btn-share:hover { background: var(--primary-color); color: #1a1c29 !important; }

.join-button {
    background: linear-gradient(135deg, #ff9b83, #e07a5f) !important; color: #1a1c29 !important;
    font-weight: 800; border-radius: 25px; padding: 10px 24px; margin-left: 10px;
    box-shadow: 0 0 15px rgba(255, 155, 131, 0.4); text-transform: uppercase; letter-spacing: 1px;
}
.join-button:hover { box-shadow: 0 0 25px rgba(255, 155, 131, 0.7); transform: translateY(-3px) scale(1.05); filter: brightness(1.1); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], input[type="url"], input[type="number"], textarea, select {
    width: 100%; padding: 14px; border: 1px solid var(--border-color); border-radius: 10px; background-color: rgba(0,0,0,0.25);
    color: var(--text-color); font-family: var(--font-primary); font-size: 1rem; transition: border-color 0.3s, box-shadow 0.3s;
}
select { appearance: none; cursor: pointer; padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23d1d6e6' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; }
select option { background: #2a2d3e; color: var(--text-color); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(129,178,154,0.2); }
label { display: block; font-weight: 600; font-size: 0.95rem; margin-top: 15px; margin-bottom: 5px;}

.rsvp-success-container {
    padding: 30px 20px; background: rgba(129, 178, 154, 0.1); border: 2px solid var(--primary-color);
    border-radius: 16px; margin: 25px 0; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.checkmark-circle {
    width: 60px; height: 60px; background: var(--primary-color); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 15px;
    box-shadow: 0 0 20px rgba(129, 178, 154, 0.4); animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.checkmark-circle i { color: #151722; font-size: 30px; }
@keyframes popIn { 0% { transform: scale(0); } 80% { transform: scale(1.2); } 100% { transform: scale(1); } }

.file-input-wrapper { position: relative; margin-bottom: 20px; }
input[type="file"] { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; z-index: 2; }
.custom-file-label { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, 0.05); border: 2px dashed var(--border-color); padding: 15px; border-radius: 10px; color: var(--text-muted); transition: all 0.3s ease; cursor: pointer; }
.custom-file-label i { font-size: 1.4rem; color: var(--primary-color); }
.file-input-wrapper:hover .custom-file-label { border-color: var(--primary-color); background: rgba(129, 178, 154, 0.05); color: var(--text-color); }
#file-name-display { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--primary-light); font-style: italic; }

#admin-login-section { max-width: 450px; margin: 40px auto; padding: 40px; background: var(--card-bg); backdrop-filter: blur(15px); border-radius: 16px; border: 1px solid var(--border-color); box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
#admin-login-form { display: flex; flex-direction: column; }
#admin-login-form button { margin-top: 25px; align-self: flex-start; }

#admin-events-list li { background-color: rgba(0,0,0,0.25); padding: 18px; margin-bottom: 12px; border-radius: 10px; border: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.action-buttons button { padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.9rem; color: #fff; transition: all 0.2s; }
.edit-item-btn { background: linear-gradient(135deg, #4a8bc2, #3b74a3); box-shadow: 0 4px 10px rgba(74,139,194,0.3);}
.edit-item-btn:hover { box-shadow: 0 6px 15px rgba(74,139,194,0.5); transform: translateY(-2px);}
.delete-item-btn { background: linear-gradient(135deg, var(--error-color), #c7664e); box-shadow: 0 4px 10px rgba(224,122,95,0.3);}
.delete-item-btn:hover { box-shadow: 0 6px 15px rgba(224,122,95,0.5); transform: translateY(-2px);}

/* Admin: Discord sync */
.discord-fields { border: 1px solid var(--border-color); border-radius: 10px; padding: 12px 16px 16px; margin-top: 18px; }
.discord-fields legend { padding: 0 6px; font-weight: 600; color: #8f9cff; }
.discord-note { margin: 0 0 10px; font-size: 0.9rem; color: var(--text-muted); }
.discord-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.discord-check input, .discord-role input {
    -webkit-appearance: none; appearance: none; flex: none; width: 18px; height: 18px; margin: 0; padding: 0;
    border: 2px solid var(--text-muted); border-radius: 5px; background: rgba(0, 0, 0, 0.25);
    display: inline-grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s;
}
.discord-check input::after, .discord-role input::after {
    content: ""; width: 9px; height: 5px; border: solid #1e2230; border-width: 0 0 2.5px 2.5px;
    transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .12s;
}
.discord-check input:checked, .discord-role input:checked { background: var(--primary-color); border-color: var(--primary-color); }
.discord-check input:checked::after, .discord-role input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.discord-check input:focus-visible, .discord-role input:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.discord-check:hover input:not(:checked), .discord-role:hover input:not(:checked) { border-color: var(--primary-light); }
.discord-roles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.discord-role { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border-color); border-radius: 999px; cursor: pointer; font-size: 0.9rem; }
.discord-role { transition: border-color .15s, background .15s; }
.discord-role:has(input:checked) { border-color: var(--primary-color); background: rgba(129, 178, 154, 0.15); }
.discord-role .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--role-color, #99aab5); }
.discord-role.unmentionable { opacity: 0.75; }
.discord-error { display: block; color: var(--error-color); margin-top: 8px; }
.discord-status { display: inline-block; margin-top: 4px; font-size: 0.85rem; }
.discord-status.ok { color: #8f9cff; }
.discord-status.bad { color: var(--error-color); }
.discord-retry-btn { background: linear-gradient(135deg, #5865f2, #4752c4); }

/* Admin tabs + page-content editor */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.admin-tab { background: rgba(255,255,255,0.05); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 16px; font: 600 0.95rem var(--font-primary); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; transition: background 0.2s, border-color 0.2s; }
.admin-tab:hover { background: rgba(255,255,255,0.1); }
.admin-tab.active { background: var(--primary-color); border-color: var(--primary-color); color: #151722; }
.admin-module > h3:first-child { margin-top: 0; display: flex; align-items: baseline; gap: 15px; flex-wrap: wrap; }
.admin-view-link { font-family: var(--font-primary); font-size: 0.9rem; font-weight: 600; }
.admin-image-preview { display: block; max-width: 220px; max-height: 280px; width: auto; height: auto; border-radius: 10px; border: 1px solid var(--border-color); margin-bottom: 15px; }
.admin-image-preview[hidden] { display: none; }
.hero-editor { display: flex; gap: 25px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.hero-editor > div { flex: 1; min-width: 240px; }
.hero-editor .btn { margin: 0 8px 8px 0; }
.cf-field label, .cf-row label { font-weight: 600; }
.cf-field label input, .cf-field label textarea, .cf-row label input, .cf-row label textarea { margin-top: 5px; font-weight: 400; }
.cf-hint { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--text-muted); opacity: 0.8; }
textarea { resize: vertical; }
.cf-list { margin-top: 20px; }
.cf-rows { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 12px; }
.cf-row { display: flex; gap: 12px; align-items: flex-start; background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); border-radius: 10px; padding: 4px 14px 14px; }
.cf-row-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.cf-row-fields label:has(textarea) { grid-column: 1 / -1; }
.cf-row-ctrls { display: flex; gap: 6px; margin-top: 15px; }
.cf-row-ctrls .btn { padding: 8px 10px; }
.cf-row-ctrls .cf-remove:hover { background: var(--error-color); border-color: var(--error-color); }
.cf-actions { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; margin-top: 25px; }
.content-status { font-size: 0.9rem; margin: 0; }
.content-status.ok { color: var(--primary-light); }
.content-status.error, .error-message { color: var(--error-color); }
#home-gallery-highlights > p + p { margin-top: 1.2em; }

.copy-tooltip { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--primary-color); color: #1a1c29; padding: 10px 20px; border-radius: 30px; font-weight: bold; z-index: 9999; animation: popUp 0.3s ease forwards; }
@keyframes popUp { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

footer { background-color: var(--footer-bg); color: var(--text-muted); padding: 30px 0; text-align: center; font-size: 0.95rem; margin-top: auto; border-top: 1px solid rgba(255,255,255,0.05); }

@media (max-width: 1089px) {
    header { flex-direction: column; height: auto; padding: 15px 2%; }
    nav ul { flex-wrap: wrap; justify-content: center; margin-top: 15px; }
    nav ul li.dropdown { position: relative; }
    .dropdown-content { position: absolute; width: max-content; min-width: 150px; left: 50%; transform: translateX(-50%); top: 100%; border-left: none; margin-top: 10px; }
}

@media (max-width: 950px) {
    #hero-home { flex-direction: column; text-align: center; gap: 30px;}
    .hero-image-container, .hero-content { max-width: 100%; width: 100%; }
    .hero-image-container { position: static; }

    .event-container-featured, .event-container-featured.poster-wide { flex-direction: column; gap: 0; max-width: 700px; }
    .event-image-side { max-width: none; flex: none; width: 100%; }
    .event-image-side img, .poster-wide .event-image-side img { max-height: 60vh; }
    .event-info-side, .poster-wide .event-info-side { padding: 30px; }
}

@media (max-width: 768px) {
    main { padding: 20px 5%; }
    .page-content h2 { font-size: 2.2rem; margin-bottom: 15px; }
    .page-content h3 { font-size: 1.8rem; margin-top: 25px; }

    .event-item {
        flex-direction: column;
        padding: 20px;
        align-items: stretch;
        text-align: left;
        gap: 15px;
    }
    .event-item-img { flex: 0 0 auto; width: 100%; max-width: 100%; margin: 0; }
    .event-item-img img { max-height: 60vh; }
    .event-item-content h3 { font-size: 1.5rem; }
    .meta-block p, .description p { font-size: 1rem; }

    #home-gallery-highlights p {
        font-size: 0.95rem;
        overflow-wrap: break-word;
        word-wrap: break-word;
        padding: 0 10px;
    }

    .btn { padding: 10px 15px; font-size: 0.85rem; }
    .add-to-calendar { gap: 8px; }

    #admin-events-list li { flex-direction: column; align-items: flex-start; gap: 15px; }
    .cf-row { flex-direction: column; gap: 0; }
    .cf-row-ctrls { align-self: flex-end; }
    .action-buttons { width: 100%; display: flex; justify-content: flex-end; }
}
/* RSVP manage page (links in RSVP emails) */
.rsvp-manage { max-width: 640px; margin: 0 auto; }
.rsvp-manage-notice { background: rgba(143,188,143,0.15); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px 16px; color: var(--text-color) !important; }
.rsvp-manage-card { background: rgba(0,0,0,0.25); border: 1px solid var(--border-color); border-radius: 12px; padding: 18px 20px; margin: 18px 0; }
.rsvp-manage-card h3 { margin: 0 0 10px; }
.rsvp-manage-card h3 a { color: var(--primary-light, var(--primary-color)); text-decoration: none; }
.rsvp-manage-card p { margin: 0 0 6px !important; font-size: 1.05rem !important; }
.rsvp-manage-who { opacity: 0.8; }
.rsvp-manage-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.rsvp-manage-actions form { margin: 0; }
.rsvp-cancel-btn { background: linear-gradient(135deg, var(--error-color), #c7664e); color: #fff; }
/* Admin: email attendees */
.rsvp-mail-tag { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-color); white-space: nowrap; }
.rsvp-mail-tag.confirmed { color: #8fd18f; }
.rsvp-mail-tag.unconfirmed { color: var(--text-muted); }
.rsvp-mail-tag.off { color: var(--error-color); }
.rsvp-mail-tag.discord { color: #a5adff; }
.email-attendees { border-top: 1px solid var(--border-color); margin-top: 18px; padding-top: 14px; }
.email-attendees input, .email-attendees textarea, .email-attendees select { margin-bottom: 10px; }
.mail-log { font-size: 0.85rem; margin-top: 12px; color: var(--text-muted); }
.mail-log .failed { color: var(--error-color); }
.rsvp-check-inbox { margin-top: 10px; font-size: 0.95rem; color: var(--spore-color); }
.link-btn { background: none; border: none; padding: 0; color: var(--primary-light, var(--primary-color)); text-decoration: underline; cursor: pointer; font: inherit; }
/* "Action needed" box (unconfirmed RSVP email) */
.action-needed { border: 2px solid #e0a800; background: rgba(224,168,0,0.12); border-radius: 12px; padding: 14px 18px; margin: 14px 0; text-align: left; }
.action-needed p { margin: 0 0 8px !important; color: var(--text-color) !important; font-size: 1rem !important; }
.action-needed-title { font-weight: 700; color: #fff3cf !important; font-size: 1.2rem !important; }
.action-needed-btn { font-size: 1.05rem; padding: 12px 22px; }
.action-needed .link-btn { color: #ffd166; }
.action-needed-tag { font-size: 0.78rem !important; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #ffd166 !important; margin-bottom: 2px !important; }

/* Small centered pages: RSVP manage, Discord email link, RSVP cancelled, errors */
.panel-page { max-width: 560px; margin: 10px auto 40px; text-align: center; }
.panel-card {
    background: var(--card-bg); backdrop-filter: blur(12px); border: 1px solid var(--border-color);
    border-radius: 18px; padding: 34px 32px 30px; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.panel-badge {
    width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px;
    font-size: 1.6rem; color: var(--primary-light); background: rgba(129,178,154,0.14); border: 1px solid rgba(129,178,154,0.4);
}
.panel-badge.discord { color: #b4bbff; background: rgba(88,101,242,0.18); border-color: rgba(88,101,242,0.5); }
.panel-badge.warn { color: #ffd166; background: rgba(224,168,0,0.14); border-color: rgba(224,168,0,0.45); }
.panel-badge.muted { color: var(--text-muted); background: rgba(255,255,255,0.05); border-color: var(--border-color); }
.panel-page h2 { font-size: 2.1rem; margin: 0 0 22px; }
.panel-page h2::after { left: 50%; transform: translateX(-50%); }
.panel-page p { font-size: 1.05rem; margin-bottom: 14px; }
.panel-page p:last-child { margin-bottom: 0; }
.panel-lead { color: var(--text-color) !important; }
.panel-notice {
    background: rgba(129,178,154,0.14); border: 1px solid rgba(129,178,154,0.35); border-radius: 12px;
    padding: 12px 16px; margin: 0 0 18px; color: var(--text-color) !important; font-size: 1rem !important;
}
.panel-event {
    background: rgba(0,0,0,0.22); border: 1px solid var(--border-color); border-radius: 14px;
    padding: 16px 18px; margin: 4px 0 18px; text-align: left;
}
.panel-event h3 { font-size: 1.5rem; margin: 0 0 10px; }
.panel-event h3 a { color: var(--primary-light); text-decoration: none; }
.panel-event p { margin: 0 0 6px !important; font-size: 1rem !important; }
.panel-event i { width: 1.2em; text-align: center; margin-right: 4px; color: var(--primary-color); }
.panel-status { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; font-size: 0.9rem; font-weight: 700; }
.panel-status.in { color: #a8e6cf; background: rgba(129,178,154,0.18); }
.panel-status.wait { color: #ffd166; background: rgba(224,168,0,0.15); }
.panel-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; }
.panel-actions form { margin: 0; width: 100%; display: flex; justify-content: center; }
.panel-actions .btn { width: min(100%, 300px); justify-content: center; text-align: center; }
.panel-form { max-width: 360px; margin: 22px auto 0; text-align: left; }
.panel-form label { margin-top: 0; }
.panel-form .btn { width: 100%; margin-top: 14px; }
.panel-form .error-message { margin: 8px 0 0 !important; font-size: 0.95rem !important; }
.panel-small { font-size: 0.92rem !important; }
.panel-small a, .panel-page p a { color: var(--primary-light); }
@media (max-width: 600px) {
    .panel-card { padding: 26px 18px 22px; }
    .panel-page h2 { font-size: 1.7rem; }
    .panel-actions .btn { width: 100%; min-width: 0; }
}

.footer-link { color: var(--text-muted); text-decoration: underline; }
.footer-link:hover { color: var(--primary-light); }
.privacy-page { max-width: 760px; margin: 0 auto; }
.privacy-page h3 { font-size: 1.6rem; margin-top: 30px; }
.privacy-page ul { padding-left: 1.2em; }
.privacy-page li { margin-bottom: 8px; }
.privacy-page a { color: var(--primary-light); }
.privacy-updated { font-size: 0.95rem !important; opacity: 0.8; }
.privacy-note { font-size: 0.85rem !important; color: var(--text-muted); margin-top: 10px !important; }
.privacy-note a { color: var(--primary-light); }

/* Discord member settings (/discord/link/:token) */
.settings-row { text-align: left; border-top: 1px solid var(--border-color); margin-top: 22px; padding-top: 18px; }
.settings-label { font-weight: 700; color: var(--text-color); margin-bottom: 8px; }
.settings-label i { color: var(--primary-color); width: 1.3em; }
.settings-value { margin-bottom: 8px; color: var(--text-muted); word-break: break-all; }
.settings-change summary { cursor: pointer; color: var(--primary-light); font-size: 0.95rem; margin: 4px 0; }
.settings-change .panel-form { margin: 10px 0 0; max-width: none; }
.settings-unlink { color: var(--error-color) !important; font-size: 0.95rem; margin-top: 8px; }
.settings-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 10px 0; cursor: pointer; color: var(--text-muted); }
.settings-check.off { opacity: 0.55; cursor: default; }
.settings-check input {
    -webkit-appearance: none; appearance: none; flex: none; width: 18px; height: 18px; margin: 2px 0 0; padding: 0;
    border: 2px solid var(--text-muted); border-radius: 5px; background: rgba(0,0,0,0.25); display: inline-grid; place-content: center; cursor: pointer;
}
.settings-check input::after { content: ""; width: 9px; height: 5px; border: solid #1e2230; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px) scale(0); }
.settings-check input:checked { background: var(--primary-color); border-color: var(--primary-color); }
.settings-check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.settings-check input:disabled { cursor: default; }
.settings-notify .btn { margin-top: 6px; }
.settings-signups { list-style: none; padding: 0; margin: 0 0 8px; }
.settings-signups li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 0.98rem; }
.settings-signups li a { color: var(--primary-light); font-weight: 700; text-decoration: none; }
.settings-signups li span { color: var(--text-muted); font-size: 0.9rem; }
.settings-signups .panel-status { margin: 0; padding: 2px 10px; font-size: 0.8rem; }
