/* 
 * AETHERIA - NamelessMC Template
 * Complete Version (Phases 1-9)
 * Style: Apple Glassmorphism + Minecraft Font
 */

/* =========================================
   1. FONT DEFINITION (Local Files)
   ========================================= */
@font-face {
    font-family: 'Minecraft';
    src: url('fonts/minecraft.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Minecraft';
    src: url('fonts/minecraft-italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Minecraft';
    src: url('fonts/minecraft-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

/* =========================================
   2. CSS VARIABLES (Theme Engine)
   ========================================= */
:root {
    /* Palette Light Mode (Default) */
    --bg-color: #dec9e9;
    --text-color: #000000;
    --container-bg: #d2b7e5;
    --container-border: rgba(255, 255, 255, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-blur: 16px;
    --primary-accent: #6247aa; /* Viola scuro */
    
    /* UI Elements */
    --radius-squircle: 24px;
    --radius-btn: 12px;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
}

/* Palette Dark Mode (Attivata via data-theme="dark") */
[data-theme="dark"] {
    --bg-color: #815ac0;
    --text-color: #ffffff;
    --container-bg: #6247aa;
    --container-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(20, 20, 20, 0.7);
    --primary-accent: #dec9e9; /* Lilla chiaro */
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.4);
}

/* =========================================
   3. GLOBAL RESET & TYPOGRAPHY
   ========================================= */
html, body {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    font-family: 'Minecraft', 'Helvetica Neue', Arial, sans-serif !important;
    -webkit-font-smoothing: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Spazio extra in fondo per il footer flottante */
    padding-bottom: 40px !important;
}

/* Sovrascrittura Font Semantic UI */
h1, h2, h3, h4, h5, .ui.header, .ui.button, .ui.input, .ui.segment, .ui.message, .ui.label {
    font-family: 'Minecraft', sans-serif !important;
}

p, li, span, div {
    line-height: 1.6;
    letter-spacing: 0.3px;
}

/* =========================================
   4. UI COMPONENTS (Card, Inputs, Buttons)
   ========================================= */

/* Contenitori Principali */
.ui.segment, .ui.card, .ui.cards > .card, .widget-card {
    background-color: var(--container-bg) !important;
    color: var(--text-color) !important;
    border-radius: var(--radius-squircle) !important;
    border: 1px solid var(--container-border) !important;
    box-shadow: var(--shadow-soft) !important;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.ui.segment .ui.header, .ui.card .header {
    color: var(--text-color) !important;
}

#wrapper, .pusher { background: transparent !important; }

/* Buttons Micro-interactions */
.ui.button {
    border-radius: var(--radius-btn) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    border: none !important;
}

.ui.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    filter: brightness(1.1);
}

.ui.button:active {
    transform: scale(0.95);
}

.ui.primary.button, .ui.blue.button {
    background-color: var(--primary-accent) !important;
    color: #fff !important;
}

/* Inputs Apple Style */
.ui.input input, .ui.form input:not([type]), .ui.form textarea {
    border-radius: var(--radius-btn) !important;
    background-color: rgba(255,255,255,0.5) !important;
    border: 1px solid var(--container-border) !important;
    padding: 12px !important;
    transition: all 0.2s ease !important;
}

[data-theme="dark"] .ui.input input, 
[data-theme="dark"] .ui.form input:not([type]) {
    background-color: rgba(0,0,0,0.3) !important;
    color: #fff !important;
}

.ui.input input:focus, .ui.form input:focus {
    border-color: var(--primary-accent) !important;
    box-shadow: 0 0 0 3px rgba(98, 71, 170, 0.2) !important;
    background-color: rgba(255,255,255,0.8) !important;
}

/* =========================================
   5. NAVBAR (Floating)
   ========================================= */
.aetheria-navbar {
    width: calc(100% - 40px);
    max-width: 1100px;
    margin: 20px auto 0 auto;
    position: sticky;
    top: 20px;
    z-index: 999;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    padding: 0.6rem 1.5rem;
    box-shadow: var(--shadow-soft);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-logo {
    display: flex; align-items: center;
    font-weight: 700; font-size: 1.4rem;
    color: var(--text-color); text-decoration: none;
}
.nav-logo:hover { color: var(--text-color); }

.nav-links { display: flex; gap: 15px; align-items: center; }

.nav-item {
    position: relative;
    color: var(--text-color); opacity: 0.7;
    text-decoration: none; font-size: 1rem;
    padding: 0.5rem 0.8rem;
    transition: all 0.2s ease;
    display: flex; align-items: center; gap: 8px;
    background: transparent !important;
}
.nav-item:hover { opacity: 1; transform: translateY(-1px); }

/* Active Dot */
.nav-item.active { opacity: 1; font-weight: 700; }
.nav-item.active::after {
    content: ''; position: absolute; bottom: 2px; left: 50%;
    transform: translateX(-50%); width: 5px; height: 5px;
    background-color: var(--primary-accent); border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-accent);
}

/* User & Actions */
.nav-actions { display: flex; align-items: center; gap: 15px; }

.user-btn {
    display: flex; align-items: center; gap: 10px; padding: 4px;
    border-radius: 50px; color: var(--text-color); cursor: pointer;
    border: 1px solid transparent; transition: all 0.2s;
}
.user-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--container-border); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

/* User Dropdown */
.custom-dropdown {
    position: absolute; top: 55px; right: 0; width: 240px;
    background: var(--container-bg); border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle); padding: 10px;
    display: none; flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); backdrop-filter: blur(20px);
    z-index: 1000;
}
.custom-dropdown.show { display: flex; animation: slideDown 0.2s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.dropdown-item {
    padding: 10px 15px; color: var(--text-color); text-decoration: none;
    border-radius: 12px; display: flex; align-items: center; gap: 12px;
    font-size: 0.95rem; transition: background 0.2s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.15); }
.dropdown-badge { margin-left: auto; background: #ff3b30; color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; }
.dropdown-divider { height: 1px; background: var(--container-border); margin: 5px 10px; }
.dropdown-header { padding: 10px; font-size: 0.85rem; opacity: 0.6; text-transform: uppercase; font-weight: bold; }

/* iOS Switch */
.ios-switch { position: relative; display: inline-block; width: 50px; height: 28px; margin-right: 5px; }
.ios-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e4e4e4; transition: .4s; border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px;
    background-color: white; transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: #34c759; }
input:checked + .slider:before { transform: translateX(22px); }
[data-theme="dark"] .slider { background-color: #3a3a3c; }
[data-theme="dark"] input:checked + .slider { background-color: #30d158; }

/* Mobile Hiding */
@media (max-width: 900px) {
    .nav-links.desktop-only { display: none; }
    .aetheria-navbar { width: calc(100% - 20px); padding: 0.5rem 1rem; }
    .user-btn span.desktop-only { display: none; }
}

/* =========================================
   6. PORTAL LAYOUT (Homepage)
   ========================================= */
.portal-grid {
    display: flex; flex-direction: column; gap: 25px;
    margin-bottom: 80px !important; /* Spazio per non coprire il footer */
}

/* Hero Section */
.hero-section {
    position: relative; width: 100%;
    background: radial-gradient(circle at top left, #dec9e9, transparent 60%),
                radial-gradient(circle at bottom right, #6247aa, transparent 60%),
                var(--container-bg);
    border-radius: var(--radius-squircle); padding: 4rem 2rem;
    text-align: center; border: 1px solid var(--container-border);
    box-shadow: var(--shadow-soft);
}
.hero-logo-img { max-height: 120px; margin-bottom: 1.5rem; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2)); }

.hero-ip-container {
    display: inline-flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, 0.3); padding: 10px 20px;
    border-radius: 50px; cursor: pointer; backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.5); transition: all 0.2s ease;
}
[data-theme="dark"] .hero-ip-container { background: rgba(0, 0, 0, 0.3); border-color: rgba(255,255,255,0.1); }
.hero-ip-container:hover { transform: scale(1.02); background: rgba(255, 255, 255, 0.5); }
.hero-ip-container:active { transform: scale(0.95); }

/* Split Section (Store/Discord) */
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.feature-card {
    background: var(--glass-bg); border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle); padding: 2.5rem;
    display: flex; flex-direction: row; align-items: center;
    text-decoration: none; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-soft);
}
.feature-card:hover { transform: translateY(-5px); border-color: var(--primary-accent); }
.feature-card.store { background: linear-gradient(135deg, rgba(255, 159, 67, 0.1), rgba(255, 159, 67, 0.2)); }
.feature-card.community { background: linear-gradient(135deg, rgba(84, 160, 255, 0.1), rgba(84, 160, 255, 0.2)); }
.feature-icon-large { font-size: 3.5rem; margin-right: 25px; filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2)); }
.feature-content h2 { margin: 0; font-size: 1.8rem; font-weight: 800; color: var(--text-color); }
.feature-content p { margin: 5px 0 0 0; opacity: 0.7; font-size: 1rem; color: var(--text-color); }

/* Guides Section */
.guides-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 20px; margin-bottom: 30px; }
.guide-card { display: flex; flex-direction: column; align-items: center; text-decoration: none; transition: transform 0.2s; }
.guide-card:hover { transform: translateY(-5px); }
.guide-icon-box {
    width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-squircle);
    background: var(--container-bg); border: 1px solid var(--container-border);
    display: flex; align-items: center; justify-content: center; font-size: 3rem;
    margin-bottom: 10px; box-shadow: var(--shadow-soft);
}
.guide-bg-red { background: linear-gradient(135deg, #ff4d4d, #c0392b); color: white; }
.guide-bg-purple { background: linear-gradient(135deg, #a55eea, #8854d0); color: white; }
.guide-bg-orange { background: linear-gradient(135deg, #ffaf40, #ff9f43); color: white; }
.guide-bg-green { background: linear-gradient(135deg, #2ecc71, #27ae60); color: white; }
.guide-label { font-weight: 700; font-size: 1rem; color: var(--text-color); text-align: center; }

/* Mini Grid (Vecchio) */
.mini-grid-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 15px; margin-left: 10px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px; }
.mini-card {
    aspect-ratio: 1 / 1; background: var(--container-bg); border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle); display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); padding: 15px; text-align: center;
}
.mini-card:hover { transform: translateY(-5px) scale(1.05); background: rgba(255,255,255,0.2); border-color: var(--primary-accent); }
.mini-card i { font-size: 2.5rem; margin-bottom: 15px; color: var(--primary-accent); }
.mini-card span { font-weight: 700; color: var(--text-color); font-size: 1rem; }

/* How To Play */
.htp-card {
    background: var(--glass-bg); border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle); padding: 2rem; height: 100%;
    position: relative; backdrop-filter: blur(var(--glass-blur));
}
.htp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.htp-dots { display: flex; gap: 5px; }
.htp-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(0,0,0,0.2); }
.htp-dot.active { background: var(--primary-accent); }
.htp-step-title { font-size: 0.9rem; text-transform: uppercase; opacity: 0.7; margin-bottom: 10px; }
.htp-content { font-size: 1.1rem; margin-bottom: 20px; line-height: 1.6; }
.htp-image { width: 100%; border-radius: var(--radius-btn); margin-bottom: 40px; }
.htp-next-btn {
    position: absolute; bottom: 20px; right: 20px; background: rgba(255,255,255,0.1);
    border: 1px solid var(--container-border); padding: 10px 20px;
    border-radius: var(--radius-btn); color: var(--text-color); text-decoration: none;
    font-weight: bold; transition: all 0.2s; cursor: pointer;
}
.htp-next-btn:hover { background: var(--primary-accent); color: white; }

/* Steps Animation */
.htp-step { display: none; animation: fadeIn 0.3s ease; }
.htp-step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

/* Community Box */
.community-box {
    background: var(--glass-bg); border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle); padding: 2rem; text-align: center;
    backdrop-filter: blur(var(--glass-blur)); display: flex; flex-direction: column;
    align-items: center; justify-content: center; height: 100%;
}
.discord-count { font-size: 1.5rem; font-weight: 800; margin: 10px 0; }
.join-btn {
    background: #5865F2; color: white; padding: 12px 30px;
    border-radius: var(--radius-btn); font-weight: bold; text-decoration: none;
    transition: transform 0.2s; display: block; width: 100%;
}
.join-btn:hover { transform: scale(1.05); color: white; }
.rules-btn-block {
    margin-top: 20px; background: rgba(0,0,0,0.2); color: var(--text-color);
    padding: 15px; border-radius: var(--radius-btn); text-align: center;
    display: block; font-weight: bold; text-decoration: none;
    border: 1px solid var(--container-border); transition: all 0.2s;
}
.rules-btn-block:hover { background: rgba(0,0,0,0.3); color: var(--text-color); }

@media (max-width: 768px) {
    .split-section { grid-template-columns: 1fr; }
    .feature-card { padding: 1.5rem; }
    .mini-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================
   7. FORUM LAYOUT (List Style)
   ========================================= */
.forum-category-card {
    background: var(--container-bg); border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle); overflow: hidden; margin-bottom: 2rem;
    box-shadow: var(--shadow-soft); backdrop-filter: blur(var(--glass-blur));
}
.forum-category-header {
    background: rgba(0, 0, 0, 0.03); padding: 15px 25px; font-size: 1.1rem;
    font-weight: 800; color: var(--primary-accent); text-transform: uppercase;
    letter-spacing: 1px; border-bottom: 1px solid var(--container-border);
}
.forum-node {
    display: flex; align-items: center; padding: 20px 25px;
    border-bottom: 1px solid var(--container-border); transition: background 0.2s ease;
    text-decoration: none !important; color: var(--text-color) !important;
}
.forum-node:last-child { border-bottom: none; }
.forum-node:hover { background: rgba(255, 255, 255, 0.1); }
.node-icon-wrapper {
    width: 50px; height: 50px; display: flex; align-items: center; justify-content: center;
    background: rgba(98, 71, 170, 0.1); border-radius: 14px; margin-right: 20px;
    font-size: 1.5rem; color: var(--primary-accent);
}
.node-content { flex: 1; }
.node-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; display: block; }
.node-description { font-size: 0.9rem; opacity: 0.6; }
.node-stats { text-align: right; min-width: 100px; margin-left: 20px; opacity: 0.5; font-size: 0.85rem; }

/* Topic List */
.topic-list { display: flex; flex-direction: column; gap: 10px; }
.topic-row {
    display: flex; align-items: center; background: var(--container-bg);
    border: 1px solid var(--container-border); border-radius: 16px; padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.topic-row:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); background: rgba(255,255,255,0.4); }
[data-theme="dark"] .topic-row:hover { background: rgba(255,255,255,0.05); }
.topic-avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 15px; }
.topic-info { flex: 1; }
.topic-title { font-size: 1.1rem; font-weight: 700; color: var(--text-color); text-decoration: none; }
.topic-meta { font-size: 0.85rem; opacity: 0.6; margin-top: 2px; }
.topic-labels .ui.label { padding: 4px 8px; font-size: 0.7rem; border-radius: 6px; }

/* =========================================
   8. AUTH & PROFILE (Apple ID)
   ========================================= */
.auth-container {
    max-width: 450px; margin: 4rem auto; padding: 2.5rem;
    background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--container-border); border-radius: var(--radius-squircle);
    box-shadow: var(--shadow-soft); text-align: center;
}
.auth-title {
    font-size: 2rem; font-weight: 800; margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-color), var(--primary-accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.profile-cover-banner {
    height: 200px; width: 100%; background-size: cover; background-position: center;
    border-radius: var(--radius-squircle) var(--radius-squircle) 0 0; position: relative;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}
.profile-header-content { margin-top: -80px; text-align: center; position: relative; padding-bottom: 20px; }
.profile-avatar-large {
    width: 140px; height: 140px; border-radius: 50%; border: 5px solid var(--container-bg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); object-fit: cover; background: var(--container-bg);
}
.profile-username { font-size: 2.2rem; font-weight: 800; margin-top: 10px; margin-bottom: 5px; }
.profile-role-badge {
    display: inline-block; padding: 5px 15px; background: var(--primary-accent);
    color: #fff; border-radius: 50px; font-size: 0.9rem; font-weight: bold;
}
.profile-stats-grid { display: flex; justify-content: center; gap: 30px; margin-top: 20px; margin-bottom: 20px; }
.stat-value { font-size: 1.4rem; font-weight: 800; display: block; }
.stat-label { font-size: 0.8rem; opacity: 0.6; text-transform: uppercase; letter-spacing: 1px; }

/* Tabs */
.ui.top.attached.tabular.menu {
    background: rgba(0,0,0,0.05); border: none; border-radius: 12px; padding: 5px;
    display: inline-flex; margin: 0 auto 20px auto !important; width: auto !important;
}
.ui.top.attached.tabular.menu .item {
    border: none !important; background: transparent !important;
    color: var(--text-color) !important; border-radius: 8px !important; margin: 0 !important;
}
.ui.top.attached.tabular.menu .item.active {
    background: var(--container-bg) !important; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: var(--primary-accent) !important;
}

/* =========================================
   9. DYNAMIC ISLAND & SPOTLIGHT
   ========================================= */
.dynamic-island-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 10000; display: flex; justify-content: center; pointer-events: none;
}
.dynamic-island {
    background: #000; color: #fff; border-radius: 50px; padding: 0;
    max-width: 0; height: 35px; opacity: 0; display: flex; align-items: center;
    justify-content: center; gap: 12px; overflow: hidden; white-space: nowrap;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4); transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dynamic-island.active { padding: 12px 25px; max-width: 600px; height: auto; min-height: 50px; opacity: 1; pointer-events: auto; }
.island-icon { font-size: 1.2rem; color: #34c759; }
.island-icon.error { color: #ff3b30; } .island-icon.info { color: #007aff; }
.island-content { font-weight: 600; font-size: 0.95rem; letter-spacing: 0.5px; }

/* Spotlight Overlay */
#spotlight-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(15px);
    z-index: 10001; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.2s ease;
}
#spotlight-overlay.active { opacity: 1; visibility: visible; }
.spotlight-box {
    width: 600px; max-width: 90%; background: var(--container-bg);
    border: 1px solid var(--container-border); border-radius: var(--radius-squircle);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); padding: 20px;
    transform: scale(0.95); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#spotlight-overlay.active .spotlight-box { transform: scale(1); }
.spotlight-input-wrapper { display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--container-border); padding-bottom: 10px; }
.spotlight-icon { font-size: 1.5rem; opacity: 0.5; }
.spotlight-input { width: 100%; background: transparent; border: none; font-size: 1.5rem; font-family: 'Minecraft', sans-serif; color: var(--text-color); outline: none; }
.spotlight-footer { margin-top: 10px; font-size: 0.8rem; opacity: 0.5; text-align: right; }
.kbd-shortcut { background: rgba(128,128,128,0.2); padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; }

/* =========================================
   10. LOADER & FOOTER (con Safety Net)
   ========================================= */
#page-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(222, 201, 233, 0.6); 
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    z-index: 99999; display: flex; justify-content: center; align-items: center;
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.6s ease;
    
    /* SAFETY NET: Nascondi automaticamente dopo 4s anche se JS è rotto */
    animation: safetyNetHide 0s linear 4s forwards;
}

[data-theme="dark"] #page-loader { background: rgba(98, 71, 170, 0.7); }

.loader-spinner {
    width: 60px; height: 60px; border: 5px solid rgba(255,255,255,0.2);
    border-top: 5px solid var(--primary-accent); border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Animazione di sicurezza CSS */
@keyframes safetyNetHide {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* Classe aggiunta da JS per nasconderlo prima se il sito carica veloce */
body.loaded #page-loader { opacity: 0; visibility: hidden; pointer-events: none; }

/* Footer Style */
.aetheria-footer {
    width: calc(100% - 40px); max-width: 1100px;
    margin: 40px auto 60px auto !important;
    background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--container-border); border-radius: var(--radius-squircle);
    padding: 2rem; box-shadow: var(--shadow-soft);
    display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
    position: relative; z-index: 10;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.footer-link { color: var(--text-color); opacity: 0.6; text-decoration: none; font-weight: bold; transition: opacity 0.2s; }
.footer-link:hover { opacity: 1; color: var(--primary-accent); }
.footer-socials { display: flex; gap: 15px; }
.social-btn {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    background: var(--container-bg); border-radius: 50%; color: var(--text-color);
    border: 1px solid var(--container-border); transition: all 0.2s; font-size: 1.2rem;
}
.social-btn:hover { transform: translateY(-3px) scale(1.1); background: var(--primary-accent); color: #fff; }
.footer-copyright { opacity: 0.4; font-size: 0.8rem; text-align: center; }

/* Fix per le immagini reali nell'How To Play */
.htp-image-real {
    width: 100%;
    height: 180px; /* Altezza fissa per mantenere il layout stabile */
    object-fit: cover; /* Taglia l'immagine se necessario per riempire lo spazio */
    border-radius: var(--radius-btn);
    margin-bottom: 40px;
    background-color: rgba(0,0,0,0.1); /* Colore di sfondo mentre carica */
    border: 1px solid var(--container-border);
}

/* Container for multiple images side by side */
.htp-image-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.htp-image-row .htp-image-real {
    width: 100%;
    height: 180px;
    margin-bottom: 40px;
}

@media (max-width: 600px) {
    .htp-image-row {
        grid-template-columns: 1fr;
    }
}
/* FIX IMMAGINI GUIDE (Phase 9 Update) */
.guide-image-real {
    width: 100%;
    aspect-ratio: 1/1; /* Quadrato perfetto */
    object-fit: cover; /* Taglia l'immagine per riempire il quadrato */
    border-radius: var(--radius-squircle);
    margin-bottom: 10px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--container-border);
    background-color: var(--container-bg);
    transition: transform 0.2s ease;
}

/* Hover Effect sulle immagini */
.guide-card:hover .guide-image-real {
    transform: scale(1.05); /* Zoom leggero */
    border-color: var(--primary-accent);
}

/* =========================================
   PHASE 10: STAFF CAROUSEL & PISTON
   ========================================= */

/* --- STAFF CAROUSEL (Fixed & Smooth) --- */
.staff-section {
    width: 100%;
    margin-top: 40px;
}

.staff-card {
    /* Forziamo il BEIGE (#f9f7e8) e testo scuro sempre */
    background: #f9f7e8 !important; 
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: var(--radius-squircle);
    padding: 3rem;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
    color: #333 !important; 
}

.staff-card .staff-name {
    background: none; -webkit-text-fill-color: initial;
    color: #2c3e50; text-shadow: none;
    font-size: 2.5rem; font-weight: 800; margin: 0 0 15px 0;
}

.staff-card .staff-desc {
    color: #555; font-weight: 500;
    font-size: 1.1rem; line-height: 1.6; opacity: 0.9;
}

/* Slide Container */
.staff-slide {
    display: none;
    height: 100%;
    /* Rimosso animation dal container per gestire gli elementi separatamente */
}

.staff-slide.active {
    display: block;
}

/* ANIMAZIONI FLUIDE SEPARATE */

/* 1. Il testo entra dal basso */
.staff-slide.active .staff-content {
    animation: textSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0; /* Parte invisibile */
}

/* 2. Il render entra da destra (senza ridimensionarsi!) */
.staff-slide.active .staff-render {
    animation: charSlideIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0; /* Parte invisibile */
}

@keyframes textSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes charSlideIn {
    from { opacity: 0; transform: translateX(50px); } /* Entra da destra */
    to { opacity: 1; transform: translateX(0); }      /* Si ferma al suo posto */
}

/* Layout Content */
.staff-content {
    width: 62%; 
    z-index: 2;
    position: relative;
}

/* Render 3D (FIXED) */
.staff-render {
    position: absolute;
    right: 47px !important; 
    bottom: -75px;
    height: 110%; 
    width: auto;
    object-fit: contain;
    z-index: 1;
    filter: drop-shadow(-15px 10px 25px rgba(0,0,0,0.2));
    pointer-events: none; 
    
    /* FIX CRUCIALE: Rimuoviamo la transition di default che causava il "pop" */
    transition: none; 
    transform-origin: center bottom;
}

/* Hover Effect (Applicato solo all'hover, non all'entrata) */
.staff-card:hover .staff-render {
    transition: transform 0.4s ease-out; /* La transizione esiste solo qui */
    transform: scale(1.03) rotate(-1deg);
}

/* Ruoli */
.staff-role-badge {
    display: inline-block; padding: 5px 12px; color: white;
    border-radius: 8px; font-weight: bold; font-size: 0.85rem;
    margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.staff-role-badge.red { background: #e74c3c !important; }
.staff-role-badge.orange { background: #f39c12 !important; }
.staff-role-badge.green { background: #27ae60 !important; }

/* Navigation Heads */
.staff-nav {
    display: flex; gap: 15px; margin-top: 30px;
    z-index: 10; position: relative;
}
.staff-nav-head {
    width: 45px; height: 45px; border-radius: 12px;
    cursor: pointer; transition: all 0.2s; opacity: 0.6;
    background-size: cover; background-color: rgba(0,0,0,0.1);
    border: 2px solid rgba(0,0,0,0.1);
}
.staff-nav-head:hover { transform: translateY(-3px); opacity: 1; }
.staff-nav-head.active {
    border-color: #333; opacity: 1; transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Progress Bar */
.staff-progress-container {
    position: absolute; bottom: 0; left: 0;
    width: 100%; height: 6px; background: rgba(0,0,0,0.05);
}
.staff-progress-bar {
    height: 100%; background: #e74c3c; width: 0%;
}
.staff-progress-bar.animating {
    animation: progressFill 20s linear forwards;
}
@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

/* Mobile */
@media (max-width: 768px) {
    .staff-content { width: 100%; text-align: center; }
    .staff-render { 
        position: relative; right: auto; bottom: auto; 
        height: 250px; margin: 20px auto; display: block; 
        animation: textSlideUp 0.6s ease forwards; /* Su mobile entra dal basso */
    }
    .staff-nav { justify-content: center; }
}

/* =========================================
   PHASE 13: PISTON ANIMATION (Footer Anchored)
   ========================================= */

#piston-wrapper {
    position: absolute; /* Assoluto RISPETTO AL FOOTER */
    
    /* Posizionamento */
    bottom: 0;      /* Appoggiato al fondo del footer */
    left: 60px;     /* Distanza dal lato sinistro del footer */
    /* Se lo vuoi che esce un po' dal footer verso l'alto, usa top: -50px; */
    
    z-index: 15;    /* Sopra al contenuto del footer */
    
    /* Dimensioni */
    width: 80px;    /* Un po' più piccolo per non coprire i link */
    height: 120px;
    
    cursor: pointer;
}

/* Stile base immagini (uguale a prima) */
.piston-img {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    transition: opacity 0.1s ease-in-out;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
}

/* Logica Visibilità (uguale a prima) */
.piston-visible { opacity: 1; }
.piston-hidden { opacity: 0; }

#piston-wrapper:hover .piston-visible { opacity: 0; }
#piston-wrapper:hover .piston-hidden { opacity: 1; }

/* Responsive: Nascondilo su cellulare se da fastidio */
@media (max-width: 768px) {
    #piston-wrapper { display: none; }
}

/* =========================================
   PHASE 10 UPDATE: BEIGE CAROUSEL & PROGRESS
   ========================================= */

.staff-card {
    /* Forziamo il BEIGE (#f9f7e8) e testo scuro sempre */
    background: #faedcd !important; 
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: var(--radius-squircle);
    padding: 3rem;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
    
    /* Colore testo forzato scuro per contrasto col beige */
    color: #333 !important; 
}

/* Sovrascrivi il titolo per essere leggibile su beige */
.staff-card .staff-name {
    background: none;
    -webkit-text-fill-color: initial;
    color: #2c3e50;
    text-shadow: none;
}

/* Sovrascrivi descrizione */
.staff-card .staff-desc {
    color: #555;
    font-weight: 500;
}

/* COLORI RUOLI */
.staff-role-badge {
    display: inline-block;
    padding: 5px 12px;
    color: white;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.staff-role-badge.red    { background: #e74c3c !important; } /* Owner */
.staff-role-badge.orange { background: #f39c12 !important; } /* Admin */
.staff-role-badge.green  { background: #27ae60 !important; } /* Builder */

/* PROGRESS BAR */
.staff-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.05);
}

.staff-progress-bar {
    height: 100%;
    background: #e74c3c; /* Colore barra (rosso o accent) */
    width: 0%;
}

/* Animazione attiva: 20 secondi lineare */
.staff-progress-bar.animating {
    animation: progressFill 20s linear forwards;
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

/* Aggiorna le testoline per vedersi bene sul beige */
.staff-nav-head {
    border: 2px solid rgba(0,0,0,0.1);
}
.staff-nav-head.active {
    border-color: #333;
    transform: scale(1.1);
}

/* =========================================
   PHASE 11: TRANSPARENT BANNER
   ========================================= */

/* Rimuove lo stile "scatola" dal contenitore del banner */
.banner-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
}

/* Se l'immagine ha bordi, li togliamo o li ammorbidiamo */
.banner-image {
    box-shadow: none !important; /* Nessuna ombra rettangolare */
    border: none !important;
    background: transparent !important;
}

/* =========================================
   PHASE 12 (FIXED): HIGH QUALITY BACKGROUND
   ========================================= */

/* 1. Pulizia del Body */
body {
    /* Il body ha solo il colore solido di base (che si vedrà in fondo) */
    background-color: var(--bg-color) !important;
    background-image: none !important;
    position: relative; /* Necessario per i livelli sotto */
    z-index: 1; /* Il contenuto sta sopra a tutto */
}

/* 2. LIVELLO 1: L'Immagine (Sotto a tutto) */
body::before {
    content: "";
    position: fixed; /* FISSA: Non scorre e non si streccia! */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Alta solo quanto lo schermo */
    z-index: -2;   /* Dietro a tutto */
    
    /* Qui metti la tua immagine */
    background-image: url('https://www.acemanwolf.net/wp-content/uploads/2022/02/minecraft-biome.jpg');
    
    background-size: cover;       /* Copre lo schermo senza deformarsi */
    background-position: center;  /* Centrata */
    background-repeat: no-repeat;
    
    /* Opzionale: un leggero blur all'immagine per far risaltare il testo */
    filter: blur(2px); 
}

/* 3. LIVELLO 2: Il Gradiente (Sopra l'immagine, sotto il contenuto) */
body::after {
    content: "";
    position: fixed; /* Anche questo fisso */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1; /* Sopra l'immagine (-2) ma sotto il sito (1) */
    pointer-events: none; /* Lascia passare i click */
}

/* GRADIENTE LIGHT MODE */
/* Sfuma da trasparente (alto) a colore solido LILLA (basso) */
body::after {
    background: linear-gradient(
        to bottom,
        rgba(222, 201, 233, 0.2) 0%,   /* In alto si vede l'immagine */
        rgba(222, 201, 233, 0.8) 60%,  /* A metà inizia a coprire */
        #dec9e9 100%                   /* In basso è solido */
    );
}

/* GRADIENTE DARK MODE */
/* Sfuma da trasparente (alto) a colore solido VIOLA SCURO (basso) */
[data-theme="dark"] body::after {
    background: linear-gradient(
        to bottom,
        rgba(129, 90, 192, 0.3) 0%,    /* In alto scuro trasparente */
        rgba(129, 90, 192, 0.9) 70%,   /* A metà copre */
        #815ac0 100%                   /* In basso è solido */
    );
}

/* Se vuoi cambiare l'immagine specifica per la Dark Mode */
[data-theme="dark"] body::before {
    /* Decommenta e cambia link se vuoi un'immagine diversa per la notte */
    /* background-image: url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSKFpuJCxKT8mHiRcX1xZh3SenTlL4culBOOA&s'); */
    
    /* Oppure scuriamo quella esistente */
    filter: brightness(0.6) blur(2px);
}

/* =========================================
   PHASE 14: CONTAINER FIX
   ========================================= */
.aetheria-container {
    width: 95% !important; /* Lascia un po' di spazio su mobile */
    max-width: 1000px !important; /* Stessa larghezza della navbar */
    margin: 0 auto !important; /* Centra orizzontalmente */
    position: relative;
    z-index: 2;
}

/* =========================================
   PHASE 15: FORUM REDESIGN (Apple Lists)
   ========================================= */

/* 1. CATEGORY WRAPPER */
.forum-category-block {
    background: var(--glass-bg);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--glass-blur));
}

.forum-category-header {
    padding: 15px 25px;
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid var(--container-border);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-accent);
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 2. FORUM NODES (Le singole sezioni) */
.forum-node-row {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--container-border);
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
}

.forum-node-row:last-child {
    border-bottom: none;
}

.forum-node-row:hover {
    background: rgba(255,255,255,0.2);
    z-index: 2; /* Per stare sopra agli altri durante l'hover */
}

/* Icona sinistra (Squircle colorato) */
.node-icon {
    width: 45px;
    height: 45px;
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: 14px; /* Icona iOS style */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--text-color);
    margin-right: 20px;
    box-shadow: var(--shadow-soft);
}

/* Contenuto Testuale */
.node-content {
    flex: 1;
}

.node-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    display: block;
    margin-bottom: 4px;
}

.node-desc {
    font-size: 0.9rem;
    opacity: 0.6;
    line-height: 1.4;
}

/* Statistiche (Topic/Posts) - Nascoste su mobile */
.node-stats {
    text-align: right;
    min-width: 100px;
    opacity: 0.5;
    font-size: 0.8rem;
    margin: 0 20px;
}

/* Freccetta iOS a destra */
.node-chevron {
    opacity: 0.3;
    font-size: 0.9rem;
}

/* 3. TOPIC LIST (Lista Discussioni) */
.topic-card {
    display: flex;
    align-items: center;
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: 18px;
    padding: 15px 20px;
    margin-bottom: 10px;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--glass-blur));
}

.topic-card:hover {
    transform: translateY(-3px) scale(1.01);
    background: rgba(255,255,255,0.4);
    border-color: var(--primary-accent);
}
[data-theme="dark"] .topic-card:hover { background: rgba(255,255,255,0.1); }

/* Sticky (Importanti) */
.topic-card.sticky {
    border-left: 4px solid #ff9f43; /* Arancione per sticky */
}

/* Locked (Chiusi) */
.topic-card.locked {
    opacity: 0.7;
    background: rgba(0,0,0,0.05);
}

.topic-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.topic-info { flex: 1; }

.topic-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    display: block;
}

.topic-meta {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 3px;
}

.topic-labels .ui.label {
    padding: 3px 8px;
    font-size: 0.7rem;
    border-radius: 6px;
    margin-right: 5px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .node-stats { display: none; }
    .forum-category-header { font-size: 1rem; }
    .node-icon { width: 35px; height: 35px; font-size: 1.1rem; }
}

/* =========================================
   PHASE 16: TOPIC VIEW (Post Cards)
   ========================================= */

/* 1. POST CARD CONTAINER */
.post-card {
    display: flex;
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    margin-bottom: 25px; /* Spazio tra i post */
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--glass-blur));
    transition: transform 0.2s ease;
}

/* Effetto focus quando si passa sopra col mouse (opzionale, molto sottile) */
.post-card:hover {
    border-color: var(--primary-accent);
}

/* 2. SIDEBAR UTENTE (Sinistra) */
.post-sidebar {
    width: 200px;
    background: rgba(0,0,0,0.03); /* Leggermente più scuro del contenuto */
    border-right: 1px solid var(--container-border);
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0; /* Non si rimpicciolisce */
}

.post-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 4px solid var(--container-bg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    object-fit: cover;
}

.post-username {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 1.2;
}

.post-user-title {
    font-size: 0.8rem;
    background: var(--primary-accent);
    color: white;
    padding: 3px 10px;
    border-radius: 50px;
    margin-bottom: 10px;
    font-weight: bold;
}

.post-user-stats {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 10px;
    line-height: 1.6;
}

/* 3. CONTENT AREA (Destra) */
.post-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 30px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--container-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
    opacity: 0.6;
    font-size: 0.85rem;
}

.post-body {
    flex: 1; /* Prende tutto lo spazio disponibile */
    font-size: 1rem;
    line-height: 1.8; /* Ottima leggibilità */
}

.post-body img {
    max-width: 100%;
    border-radius: var(--radius-btn);
    margin: 10px 0;
}

.post-signature {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--container-border);
    opacity: 0.5;
    font-size: 0.9rem;
    font-style: italic;
}

/* 4. ACTIONS (Bottoni in basso) */
.post-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end; /* Bottoni a destra */
    gap: 10px;
}

.post-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s;
    background: rgba(0,0,0,0.05);
    color: var(--text-color);
}
.post-btn:hover {
    background: var(--primary-accent);
    color: white;
    transform: translateY(-2px);
}

/* Bottoni speciali */
.post-btn.delete { color: #e74c3c; background: rgba(231, 76, 60, 0.1); }
.post-btn.delete:hover { background: #e74c3c; color: white; }

.post-btn.edit { color: #f39c12; background: rgba(243, 156, 18, 0.1); }
.post-btn.edit:hover { background: #f39c12; color: white; }

/* 5. RESPONSIVE (Mobile) */
@media (max-width: 768px) {
    .post-card { flex-direction: column; }
    
    .post-sidebar {
        width: 100%;
        flex-direction: row; /* Orizzontale su mobile */
        border-right: none;
        border-bottom: 1px solid var(--container-border);
        padding: 15px;
        align-items: center;
        text-align: left;
        gap: 15px;
    }
    
    .post-avatar { width: 50px; height: 50px; margin-bottom: 0; }
    .post-user-stats { display: none; } /* Nascondi stats su mobile per pulizia */
    .post-content-area { padding: 20px; }
}

/* Quick Reply Box */
.quick-reply-card {
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    padding: 2rem;
    margin-top: 30px;
    backdrop-filter: blur(var(--glass-blur));
}

/* =========================================
   PHASE 17: BLOG / UPDATE GRID LAYOUT
   ========================================= */

/* Griglia per i topic/news */
.updates-grid {
    display: grid;
    /* auto-fit è meglio di auto-fill per centrare il contenuto */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 25px;
    margin-top: 20px;
    /* Centra orizzontalmente tutto il blocco */
    justify-content: center;
    /* Opzionale: limita la larghezza massima se vuoi che non si allarghino troppo */
    width: 100%;
}
}

/* La Card del singolo Update */
.update-card {
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--glass-blur));
    height: 100%; /* Altezza uniforme */
    position: relative;
    text-decoration: none !important;
}

.update-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-accent);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* Thumbnail (Immagine in alto) */
.update-thumb {
    height: 200px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    /* Immagine di default se non specificata */
    background-image: url('https://assets.namelessmc.com/img/minecraft-logo.png');
    border-bottom: 1px solid var(--container-border);
}

/* Overlay scuro sull'immagine */
.update-thumb::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.6) 100%);
}

/* Etichetta (Tag) fluttuante sopra l'immagine */
.update-tag-float {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
}
.update-tag-float .ui.label {
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border-radius: 8px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* Corpo della card */
.update-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.update-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.3;
}

.update-meta {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.update-excerpt {
    font-size: 1rem;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 20px;
    /* Nasconde testo troppo lungo */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.update-footer {
    margin-top: auto; /* Spinge in basso */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--container-border);
    padding-top: 15px;
}

.update-author img {
    width: 25px; height: 25px; border-radius: 50%;
    vertical-align: middle; margin-right: 5px;
}

/* Pinned Icon */
.pinned-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    background: #ff9f43;
    color: white;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* =========================================
   PHASE 18: NEWS VISIBILITY FIX
   ========================================= */

/* 1. Forza lo sfondo delle Card (che altrimenti sembrano vuote) */
.update-card {
    /* 
       LOGICA COLORE LIGHT MODE:
       1. Se esiste la variabile --news-bg-light (definita nel TPL), usa quella.
       2. Altrimenti, usa var(--container-bg) (il colore standard Lilla).
    */
    background: var(--news-bg-light, var(--container-bg)) !important;
    
    border: 1px solid var(--container-border) !important;
    border-radius: var(--radius-squircle) !important;
    overflow: hidden !important;
    
    /* Il colore del testo segue automaticamente il tema (Nero in light) */
    color: var(--text-color) !important; 
    
    box-shadow: var(--shadow-soft) !important;
    backdrop-filter: blur(var(--glass-blur));
    
    /* Animazioni fluide */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                border-color 0.3s ease !important;
    will-change: transform, box-shadow;
}

/* LOGICA DARK MODE */
[data-theme="dark"] .update-card {
    /* 
       Se siamo in Dark Mode, usa --news-bg-dark se esiste,
       altrimenti usa il container standard scuro.
    */
    background: var(--news-bg-dark, var(--container-bg)) !important;
    
    /* Il testo diventerà automaticamente Bianco grazie a var(--text-color) */
}

/* Fix per elementi interni che devono seguire il testo */
.update-title, .update-excerpt, .update-footer span {
    color: inherit !important; /* Eredita dal padre (Nero o Bianco) */
}

.update-footer {
    border-top: 1px solid rgba(128,128,128, 0.2); /* Bordo separatore adattivo */
}
}

/* 2. Box per il Titolo (Header) */
.news-header-box {
    background: var(--glass-bg); /* Sfondo vetro */
    padding: 30px;
    border-radius: var(--radius-squircle);
    border: 1px solid var(--container-border);
    margin-bottom: 40px;
    text-align: center;
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-soft);
}

/* Rende il testo del titolo più leggibile */
.news-header-box h1 {
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* =========================================
   PHASE 19: FIX NEWS SQUIRCLE
   ========================================= */

/* 1. Forza l'arrotondamento sulla Card */
.update-card {
    border-radius: var(--radius-squircle) !important; /* Forza i 24px */
    overflow: hidden !important; /* Taglia l'immagine che esce */
    
    /* Fix per browser webkit (Chrome/Safari) che a volte ignorano overflow con le immagini */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

/* 2. Forza l'arrotondamento anche sull'immagine in alto */
.update-thumb {
    /* Arrotonda solo sopra */
    border-top-left-radius: var(--radius-squircle) !important;
    border-top-right-radius: var(--radius-squircle) !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* 3. Assicurati che l'ultimo elemento in basso non esca dai bordi */
.update-footer {
    border-bottom-left-radius: var(--radius-squircle) !important;
    border-bottom-right-radius: var(--radius-squircle) !important;
}

/* =========================================
   PHASE 20: ULTRA-FLUID NEWS ANIMATION
   ========================================= */

.update-card {
    /* 1. La curva magica "Apple" (Veloce inizio, atterraggio morbido) */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                border-color 0.3s ease !important;
    
    /* 2. Ottimizzazione GPU (Evita scatti) */
    will-change: transform, box-shadow;
}

.update-card:hover {
    /* 3. Movimento combinato: Si alza di 10px e si ingrandisce del 2% */
    transform: translateY(-10px) scale(1.02) !important;
    
    /* 4. Ombra profonda e diffusa (Soft Shadow) */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    
    /* 5. Bordo colorato */
    border-color: var(--primary-accent) !important;
    
    /* Z-index per assicurarsi che passi "sopra" alle altre se vicine */
    z-index: 5; 
}

/* Opzionale: Effetto zoom leggero sull'immagine di sfondo */
.update-thumb {
    transition: background-size 0.5s ease-out !important;
    background-size: 100% auto !important; /* Zoom normale */
    background-position: center center !important;
}

.update-card:hover .update-thumb {
    background-size: 110% auto !important; /* Zoom al 110% */
}

/* =========================================
   PHASE 21: NEWS HEADER COLOR FIX
   ========================================= */

/* Forza il titolo e il paragrafo nel box delle news a seguire il tema */
.news-header-box .ui.header,
.news-header-box p {
    color: var(--text-color) !important;
    transition: color 0.3s ease;
}

/* Opzionale: Se vuoi il sottotitolo leggermente più trasparente */
.news-header-box p {
    opacity: 0.8;
}

/* =========================================
   PHASE 23: NEWS HEADER BOX FIX
   ========================================= */

.news-header-box {
    /* Sfondo VETRO (Colore base + Blur) */
    background: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    
    /* Forma e Bordi */
    border-radius: var(--radius-squircle);
    border: 1px solid var(--container-border);
    
    /* Spaziatura */
    padding: 3rem 2rem;
    margin-bottom: 40px;
    margin-top: 20px;
    text-align: center;
    
    /* Ombra */
    box-shadow: var(--shadow-soft);
    
    /* Assicuriamoci che stia sopra lo sfondo */
    position: relative;
    z-index: 2;
}

/* Fix Colore Testo Header */
.news-header-box h1.ui.header {
    font-size: 3.5rem !important; /* Bello grande */
    margin-bottom: 15px !important;
    color: var(--text-color) !important; /* Si adatta al tema */
    text-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.news-header-box p {
    font-size: 1.3rem !important;
    opacity: 0.8;
    color: var(--text-color) !important;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Fallback per Dark Mode se glass-bg è troppo trasparente */
[data-theme="dark"] .news-header-box {
    background: rgba(30, 30, 30, 0.6) !important;
}

/* =========================================
   PHASE 24 UPDATE: DYNAMIC ARTICLE COLORS & HERO
   ========================================= */

.article-container {
    /* DEFAULT: Usa il colore del tema se non specificato */
    background: var(--container-bg);
    
    /* LOGICA LIGHT: Usa variabile custom se c'è, altrimenti default */
    background: var(--art-bg-light, var(--container-bg)) !important;
    
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    padding: 3rem 4rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--glass-blur));
    position: relative;
    overflow: hidden; /* Importante per l'immagine */
}

/* LOGICA DARK */
[data-theme="dark"] .article-container {
    background: var(--art-bg-dark, var(--container-bg)) !important;
}

/* Immagine di Copertina */
.article-hero-image {
    width: calc(100% + 8rem); /* Compensa il padding per andare bordo a bordo */
    margin-left: -4rem;       /* Sposta a sinistra */
    margin-top: -3rem;        /* Sposta in alto */
    margin-bottom: 2rem;
    height: 300px;            /* Altezza fissa */
    object-fit: cover;        /* Taglia l'immagine bene */
    border-bottom: 1px solid var(--container-border);
    
    /* Maschera sfumata in basso (opzionale, molto elegante) */
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .article-container { padding: 2rem; }
    .article-hero-image {
        width: calc(100% + 4rem);
        margin-left: -2rem;
        margin-top: -2rem;
        height: 200px;
    }
}

/* =========================================
   PHASE 27: SPLIT AUTH LAYOUT (GIF Version)
   ========================================= */

.auth-split-container {
    display: flex;
    width: 95%;
    max-width: 1000px;
    min-height: 600px;
    margin: 4rem auto;
    
    /* Stile Vetro */
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

/* LATO SINISTRO (Media/GIF) */
.auth-side-media {
    width: 50%;
    position: relative;
    background: #FBEED3; /* Sfondo nero per far risaltare lo slime */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-gif {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Taglia l'immagine per riempire il box senza deformarla */
    opacity: 0.9;
}

/* LATO DESTRO (Form) */
.auth-side-form {
    width: 50%;
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* RESPONSIVE (Mobile) */
@media (max-width: 900px) {
    .auth-split-container {
        flex-direction: column; /* Impila verticale */
        height: auto;
    }
    
    .auth-side-media {
        width: 100%;
        height: 200px; /* Banner in alto su mobile */
    }
    
    .auth-side-form {
        width: 100%;
        padding: 2rem;
    }
}

/* =========================================
   PHASE 28: GUIDES INDEX (Image + Colors)
   ========================================= */

.guides-index-grid {
    display: grid;
    /* 2 Colonne su desktop, 1 su mobile */
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); 
    gap: 20px;
}

.guide-index-card {
    display: flex;
    align-items: center;
    
    /* LOGICA COLORI DINAMICI */
    /* Light Mode: Usa variabile custom se definita, altrimenti default */
    background: var(--guide-bg-light, var(--container-bg)) !important;
    
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    padding: 20px;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--glass-blur));
    overflow: hidden;
}

/* LOGICA DARK MODE */
[data-theme="dark"] .guide-index-card {
    background: var(--guide-bg-dark, var(--container-bg)) !important;
}

/* Hover Effect */
.guide-index-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary-accent);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* Immagine */
.guide-card-img {
    width: 80px;
    height: 80px;
    border-radius: 20px; /* Squircle accentuato */
    object-fit: cover;
    margin-right: 25px;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background-color: rgba(255,255,255,0.1);
}

/* Contenuto */
.guide-card-content {
    flex: 1;
}

.guide-card-title {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-color); /* Eredita dal tema */
}

.guide-card-desc {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.8;
    color: var(--text-color); /* Eredita dal tema */
    line-height: 1.5;
}

/* Freccetta destra */
.guide-card-arrow {
    opacity: 0.4;
    transition: transform 0.2s;
    color: var(--text-color);
    font-size: 1.2rem;
    margin-left: 15px;
}

.guide-index-card:hover .guide-card-arrow {
    opacity: 1;
    transform: translateX(5px);
    color: var(--primary-accent);
}

/* Mobile */
@media (max-width: 768px) {
    .guides-index-grid { grid-template-columns: 1fr; }
    .guide-card-img { width: 60px; height: 60px; margin-right: 15px; }
}

/* =========================================
   PHASE FINAL: ERROR PAGES (404, 403, etc)
   ========================================= */

.error-page-container {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-soft);
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.error-icon {
    font-size: 5rem;
    color: var(--primary-accent);
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.error-title {
    font-size: 6rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    background: linear-gradient(135deg, var(--text-color), var(--primary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-subtitle {
    font-size: 2rem;
    margin-top: 10px;
    color: var(--text-color);
}

.error-desc {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   PHASE FINAL: MAINTENANCE PAGE
   ========================================= */

#page-maintenance {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.maintenance-box {
    background: var(--glass-bg);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    padding: 4rem 2rem;
    text-align: center;
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 100%;
}

.maintenance-icon {
    font-size: 5rem;
    color: var(--primary-accent);
    margin-bottom: 20px;
    animation: spinSlow 10s linear infinite;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.maintenance-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.maintenance-message {
    font-size: 1.2rem;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.maintenance-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================
   PHASE FINAL: USER CP (Settings Dashboard)
   ========================================= */

/* Layout Griglia */
.usercp-container {
    display: grid;
    grid-template-columns: 280px 1fr; /* Menu fisso 280px, resto fluido */
    gap: 30px;
    align-items: start;
    margin-bottom: 40px;
}

/* Sidebar Menu */
.usercp-sidebar {
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--glass-blur));
}

.usercp-menu-header {
    font-size: 0.9rem;
    text-transform: uppercase;
    opacity: 0.6;
    font-weight: bold;
    padding: 10px 15px;
    margin-bottom: 5px;
}

.usercp-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-color);
    text-decoration: none !important;
    border-radius: 12px;
    margin-bottom: 5px;
    transition: all 0.2s;
    font-weight: 600;
}

.usercp-menu-item:hover {
    background: rgba(255,255,255,0.1);
}

.usercp-menu-item.active {
    background: var(--primary-accent);
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.usercp-menu-icon {
    width: 25px;
    text-align: center;
    margin-right: 10px;
    font-size: 1.1rem;
}

/* Content Box (Destra) */
.usercp-content {
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--glass-blur));
    min-height: 400px;
}

.usercp-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--container-border);
}

/* Mobile */
@media (max-width: 900px) {
    .usercp-container {
        grid-template-columns: 1fr; /* Colonna singola */
    }
    .usercp-sidebar {
        margin-bottom: 20px;
    }
}

/* =========================================
   PHASE FINAL: PROFILE POLISH
   ========================================= */

.profile-main-card {
    padding: 0 !important;
    overflow: hidden;
    margin-bottom: 3rem;
    border: 1px solid var(--container-border) !important;
}

/* Bottone Settings in alto a destra */
.profile-settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    color: white !important;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: bold;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.2);
}

.profile-settings-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* Pulizia Tabs */
.profile-tabs-container {
    text-align: center;
    border-bottom: 1px solid var(--container-border);
    background: rgba(0,0,0,0.02);
    padding-top: 10px;
}

.profile-tabs .item {
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    margin: 0 10px !important;
    border-radius: 0 !important;
    font-weight: bold;
    opacity: 0.6;
}

.profile-tabs .item.active {
    opacity: 1;
    border-bottom-color: var(--primary-accent) !important;
    color: var(--primary-accent) !important;
}

.profile-content-area {
    padding: 2rem;
}

/* Rimuovi bordi interni dei tab content */
.ui.bottom.attached.tab.segment {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin: 0;
}
/* =========================================
   PHASE FINAL: USERCP FORM POLISH
   ========================================= */

/* Campi Input (Squircle + Glass) */
.usercp-content .ui.form input:not([type]), 
.usercp-content .ui.form input[type="text"], 
.usercp-content .ui.form input[type="email"], 
.usercp-content .ui.form input[type="password"],
.usercp-content .ui.form select {
    background: rgba(255, 255, 255, 0.1) !important; /* Leggermente trasparente */
    border: 1px solid var(--container-border) !important;
    border-radius: 18px !important; /* Molto tondo */
    padding: 15px !important;
    color: var(--text-color) !important;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

/* Focus */
.usercp-content .ui.form input:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: var(--primary-accent) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

/* Etichette (Labels) */
.usercp-content .ui.form .field > label {
    color: var(--text-color) !important;
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: 700;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bottone Submit */
.usercp-content .ui.button {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-size: 1.1rem;
}

/* =========================================
   PHASE FINAL: MESSAGING (Chat Style)
   ========================================= */

/* Lista Messaggi (Inbox) */
.message-list-item {
    display: flex;
    align-items: center;
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 10px;
    text-decoration: none !important;
    color: var(--text-color) !important;
    transition: all 0.2s;
}

.message-list-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.message-list-item.unread {
    border-left: 4px solid var(--primary-accent);
    background: rgba(var(--primary-accent-rgb), 0.1); /* Se riesci a definire rgb, altrimenti usa un colore fisso */
    font-weight: bold;
}

.msg-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
}

.msg-content { flex: 1; }
.msg-title { font-size: 1.1rem; margin-bottom: 3px; }
.msg-preview { font-size: 0.9rem; opacity: 0.7; }
.msg-date { font-size: 0.8rem; opacity: 0.5; }

/* Visualizzazione Chat (Singola Conversazione) */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.chat-bubble {
    display: flex;
    max-width: 80%;
    padding: 15px;
    border-radius: 18px;
    position: relative;
    line-height: 1.5;
}

/* Messaggio Ricevuto (Sinistra) */
.chat-bubble.received {
    align-self: flex-start;
    background: rgba(0,0,0,0.05); /* Grigio chiaro */
    border-bottom-left-radius: 4px;
    color: var(--text-color);
}
[data-theme="dark"] .chat-bubble.received { background: rgba(255,255,255,0.1); }

/* Messaggio Inviato (Destra) */
.chat-bubble.sent {
    align-self: flex-end;
    background: var(--primary-accent); /* Colore tema (es. Viola) */
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-meta {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}
.chat-bubble.received .chat-meta { text-align: left; }

/* Quick Reply Box in basso */
.chat-reply-box textarea {
    border-radius: 18px !important;
    background: rgba(0,0,0,0.05) !important;
    border: none !important;
    padding: 15px !important;
    resize: none;
}

/* =========================================
   PHASE FINAL: ALERTS (Notifications)
   ========================================= */

.alert-item {
    display: flex;
    align-items: center;
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    text-decoration: none !important;
    color: var(--text-color) !important;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.alert-item:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* Notifica Non Letta (Unread) */
.alert-item.unread {
    background: rgba(var(--primary-accent-rgb), 0.05); /* Sfondo leggermente colorato */
    border-left: 5px solid var(--primary-accent);
}

/* Icona/Avatar */
.alert-icon {
    width: 45px;
    height: 45px;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 1.2rem;
    color: var(--primary-accent);
}

.alert-content {
    flex: 1;
}

.alert-text {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 5px;
}

.alert-meta {
    font-size: 0.8rem;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Bottone "Mark as Read" (se presente) */
.alert-action {
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 15px;
}
.alert-item:hover .alert-action { opacity: 1; }

/* =========================================
   PHASE FINAL: STORE COUNTDOWN
   ========================================= */

.store-countdown-wrapper {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--container-border);
    border-radius: var(--radius-squircle);
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-soft);
    margin-top: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.store-icon-floating {
    width: 80px;
    height: 80px;
    background: var(--primary-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 30px auto;
    box-shadow: 0 10px 30px rgba(98, 71, 170, 0.4);
    animation: float 4s ease-in-out infinite;
}

.store-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-color);
}

.store-subtitle {
    font-size: 1.3rem;
    opacity: 0.7;
    margin-bottom: 50px;
    line-height: 1.6;
}

/* Griglia Timer */
.countdown-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.time-box {
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    padding: 20px;
    border-radius: 18px;
    min-width: 120px;
    box-shadow: var(--shadow-soft);
}

.time-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-accent);
    line-height: 1;
    font-family: 'Minecraft', monospace; /* Font pixelato per i numeri è top */
}

.time-label {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    opacity: 0.6;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Mobile */
@media (max-width: 600px) {
    .time-number { font-size: 2rem; }
    .time-box { min-width: 80px; padding: 15px; }
}