*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
-webkit-tap-highlight-color:transparent;
}

:root{
--bg:#ffffff;
--bg-soft:#fafafa;
--card-hover:#f5f5f5;
--input-bg:#efefef;
--border:#dbdbdb;
--border-soft:#efefef;
--text:#262626;
--text-dim:#595959;
--text-muted:#737373;
--text-faint:#8e8e8e;
--text-faintest:#a8a8a8;
--accent:#0095f6;
--accent-dark:#1877f2;
--accent-ink:#ffffff;
--accent-soft:rgba(0,149,246,0.1);
--danger:#ed4956;
--danger-soft:rgba(237,73,86,0.1);
--topbar-bg:rgba(255,255,255,0.92);
--dock-bg:rgba(255,255,255,0.92);
--ring:rgba(0,149,246,0.35);
--shadow:0 1px 3px rgba(0,0,0,0.08);
}

[data-theme="dark"]{
--bg:#000000;
--bg-soft:#121212;
--card-hover:#1a1a1a;
--input-bg:#262626;
--border:#363636;
--border-soft:#262626;
--text:#f5f5f5;
--text-dim:#c7c7c7;
--text-muted:#a8a8a8;
--text-faint:#8e8e8e;
--text-faintest:#737373;
--accent:#0095f6;
--accent-dark:#1877f2;
--accent-ink:#ffffff;
--accent-soft:rgba(0,149,246,0.15);
--danger:#ed4956;
--danger-soft:rgba(237,73,86,0.15);
--topbar-bg:rgba(0,0,0,0.9);
--dock-bg:rgba(0,0,0,0.9);
--ring:rgba(0,149,246,0.5);
--shadow:0 1px 3px rgba(0,0,0,0.35);
}

body{
background:var(--bg);
color:var(--text);
font-size:14px;
line-height:1.5;
-webkit-font-smoothing:antialiased;
overflow-x:hidden;
transition:background 0.2s ease,color 0.2s ease;
}

[hidden]{
display:none !important;
}

a{
color:inherit;
text-decoration:none;
}

button{
font-family:inherit;
}

img{
max-width:100%;
display:block;
}

::-webkit-scrollbar{
width:10px;
height:10px;
}

::-webkit-scrollbar-thumb{
background:var(--border);
border-radius:20px;
border:2px solid var(--bg);
}

::-webkit-scrollbar-track{
background:transparent;
}

:focus-visible{
outline:2px solid var(--accent);
outline-offset:2px;
}

/* APP LAYOUT */

.app{
display:flex;
min-height:100vh;
}

/* SIDEBAR (desktop left rail) */

.sidebar{
width:275px;
background:var(--bg-soft);
border-right:1px solid var(--border-soft);
padding:16px 12px;
position:fixed;
height:100vh;
top:0;
left:0;
overflow-y:auto;
z-index:999;
display:flex;
flex-direction:column;
}

.logo{
display:flex;
align-items:center;
gap:12px;
padding:8px 12px;
margin-bottom:4px;
}

.logo-glyph{
flex-shrink:0;
color:var(--accent);
}

.logo-text h1{
font-size:23px;
font-weight:700;
letter-spacing:-0.5px;
color:var(--text);
}

.logo-text p{
color:var(--text-faint);
font-size:11px;
margin-top:1px;
}

.menu{
margin-top:12px;
display:flex;
flex-direction:column;
gap:4px;
}

.nav{
display:flex;
align-items:center;
gap:16px;
width:100%;
background:none;
border:none;
color:var(--text);
padding:12px 16px;
border-radius:999px;
text-align:left;
cursor:pointer;
font-size:17px;
font-weight:400;
transition:background 0.15s ease;
}

.nav:hover{
background:var(--border-soft);
}

.nav.active{
font-weight:700;
}

.nav-icon{
flex-shrink:0;
color:currentColor;
}

.nav.active .nav-icon{
color:var(--accent);
opacity:1;
}

.sidebar-foot{
margin-top:auto;
padding:16px 12px 4px;
font-size:11px;
color:var(--text-faintest);
border-top:1px solid var(--border-soft);
}

/* MENU TOGGLE (mobile only) */

.menu-toggle{
display:none;
background:none;
border:none;
color:var(--text);
font-size:24px;
cursor:pointer;
padding:4px 8px;
line-height:1;
border-radius:50%;
}

.menu-toggle:hover{
background:var(--border-soft);
}

/* BACKDROP */

.backdrop{
display:none;
position:fixed;
inset:0;
background:rgba(0,0,0,0.5);
z-index:998;
}

/* MAIN COLUMN */

.main{
margin-left:275px;
width:auto;
flex:1;
min-width:0;
padding:0 16px 80px;
min-height:100vh;
}

/* TOPBAR */

.topbar{
position:sticky;
top:0;
z-index:40;
display:flex;
justify-content:space-between;
align-items:center;
gap:12px;
max-width:600px;
width:100%;
margin:0 auto 12px;
padding:10px 4px;
background:var(--topbar-bg);
-webkit-backdrop-filter:blur(12px);
backdrop-filter:blur(12px);
border-bottom:1px solid var(--border-soft);
}

.topbar-actions{
display:flex;
align-items:center;
gap:6px;
flex-shrink:0;
}

.search-wrap{
flex:1;
position:relative;
max-width:360px;
}

.search-icon{
position:absolute;
left:14px;
top:50%;
transform:translateY(-50%);
color:var(--text-faint);
pointer-events:none;
}

.search{
width:100%;
padding:11px 14px 11px 40px;
background:var(--input-bg);
border:none;
border-radius:999px;
color:var(--text);
outline:none;
font-size:14px;
transition:background 0.2s ease,box-shadow 0.2s ease;
}

.search::placeholder{
color:var(--text-faint);
}

.search:focus{
background:var(--input-bg);
box-shadow:0 0 0 2px var(--accent);
}

.profile{
display:flex;
align-items:center;
gap:8px;
}

.profile-text{
display:flex;
flex-direction:column;
align-items:flex-end;
gap:0;
}

.profile-text .secondary-btn{
padding:6px 12px;
font-size:12px;
}

.profile p{
font-size:13px;
font-weight:700;
color:var(--text);
cursor:pointer;
}

.profile p:hover{
color:var(--accent);
}

.profile > img{
width:32px;
height:32px;
border-radius:50%;
border:1px solid var(--border);
object-fit:cover;
cursor:pointer;
transition:opacity 0.15s ease;
}

.profile > img:hover{
opacity:0.85;
}

#avatar{
width:32px;
height:32px;
flex:0 0 32px;
border-radius:50%;
border:1px solid var(--border);
object-fit:cover;
cursor:pointer;
transition:opacity 0.15s ease;
}

#avatar:hover{
opacity:0.85;
}

#notifications-btn,
#logout-btn{
display:inline-flex;
align-items:center;
justify-content:center;
position:relative;
width:34px;
height:34px;
padding:0;
border:1px solid var(--border-soft);
border-radius:50%;
background:var(--bg-soft);
color:var(--text-muted);
transition:background 0.15s ease,color 0.15s ease,border 0.15s ease,transform 0.15s ease;
}

#notifications-btn:hover,
#logout-btn:hover{
background:var(--accent-soft);
border-color:rgba(29,155,240,0.35);
color:var(--accent);
transform:translateY(-1px);
}

#notifications-count{
display:inline-flex;
min-width:20px;
height:20px;
padding:0 5px;
align-items:center;
justify-content:center;
background:var(--accent);
color:#ffffff;
border-radius:999px;
font-size:11px;
font-weight:700;
position:absolute;
top:-3px;
right:-3px;
border:2px solid var(--bg);
}

/* ANNOUNCEMENTS */

.announcement{
display:none;
max-width:600px;
width:100%;
margin:0 auto 16px;
background:var(--accent-soft);
color:var(--text);
border:1px solid rgba(29,155,240,0.3);
padding:12px 16px;
border-radius:16px;
font-size:14px;
line-height:1.5;
}

.announcement .secondary-btn{
margin-left:10px;
padding:6px 12px;
font-size:12px;
}

#verify-banner{
background:var(--danger-soft);
color:var(--danger);
border:1px solid rgba(244,33,46,0.35);
}

#verify-banner:not([hidden]){
display:block;
}

#verify-banner .secondary-btn{
color:var(--danger);
}

.auth-hint{
color:var(--text-muted);
font-size:13px;
margin-bottom:14px;
}

/* HERO */

.hero{
background:var(--bg-soft);
border:1px solid var(--border-soft);
border-radius:24px;
padding:40px 32px;
margin-bottom:20px;
text-align:center;
}

.hero-badge{
display:inline-block;
font-size:11px;
font-weight:700;
letter-spacing:1.5px;
color:var(--accent);
background:var(--accent-soft);
border-radius:999px;
padding:6px 14px;
margin-bottom:16px;
}

.hero h2{
font-size:34px;
line-height:1.15;
font-weight:800;
letter-spacing:-1px;
max-width:480px;
margin:0 auto;
}

.hero span{
color:var(--accent);
}

.hero p{
margin-top:14px;
color:var(--text-muted);
line-height:1.7;
max-width:460px;
margin-left:auto;
margin-right:auto;
font-size:15px;
}

.hero button{
margin-top:22px;
padding:12px 28px;
border:none;
border-radius:999px;
background:var(--accent);
color:var(--accent-ink);
font-size:15px;
font-weight:700;
cursor:pointer;
transition:background 0.15s ease,transform 0.15s ease;
}

.hero button:hover{
background:var(--accent-dark);
}

.hero button:active{
transform:scale(0.98);
}

/* PAGES */

.page{
display:none;
width:100%;
max-width:600px;
margin:0 auto;
}

.page.active{
display:block;
}

.page-intro{
margin-bottom:16px;
padding:20px 24px;
}

.page-intro h2{
font-size:20px;
font-weight:700;
margin-bottom:4px;
letter-spacing:-0.3px;
}

.page-intro p{
color:var(--text-muted);
font-size:14px;
}

.settings-card{
padding:24px;
}

.moderation-card{
padding:16px;
}

.moderation-card .post-time{
word-break:break-word;
}

.user-status{
display:inline-block;
margin-top:8px;
font-size:12px;
font-weight:700;
letter-spacing:0.3px;
color:var(--text-muted);
}

.user-status.is-active{
color:var(--accent);
}

.user-status.is-disabled{
color:var(--danger);
}

/* CREATE POST / FORMS */

.create-post{
background:var(--bg-soft);
border:1px solid var(--border-soft);
border-radius:16px;
padding:16px;
margin-bottom:16px;
}

.create-post input[type="text"],
.create-post textarea,
.create-post select{
width:100%;
padding:10px 14px;
border:1px solid var(--border-soft);
border-radius:12px;
background:var(--input-bg);
color:var(--text);
outline:none;
font-size:14px;
transition:border 0.2s ease,box-shadow 0.2s ease;
margin-bottom:12px;
}

.create-post input[type="text"]:focus,
.create-post textarea:focus,
.create-post select:focus{
border-color:var(--accent);
box-shadow:0 0 0 2px var(--ring);
}

.create-post form input[type="text"]:first-child{
font-size:16px;
font-weight:600;
}

.create-post textarea{
min-height:96px;
resize:none;
line-height:1.6;
}

.create-post input[type="datetime-local"],
.create-post input[type="number"],
.create-post input[type="text"][id^="event-"]{
border:1px solid var(--border-soft);
border-radius:12px;
padding:9px 14px;
background:var(--input-bg);
margin-bottom:12px;
}

.create-post button[type="submit"]{
padding:9px 24px;
background:var(--accent);
border:none;
border-radius:999px;
color:var(--accent-ink);
font-weight:700;
cursor:pointer;
font-size:15px;
transition:background 0.15s ease;
}

.create-post button[type="submit"]:hover{
background:var(--accent-dark);
}

.post-fab{
position:fixed;
right:28px;
bottom:28px;
z-index:700;
display:inline-flex;
align-items:center;
justify-content:center;
width:56px;
height:56px;
padding:0;
border:0;
border-radius:50%;
background:var(--accent);
color:var(--accent-ink);
box-shadow:0 10px 24px rgba(15,23,42,0.2);
cursor:pointer;
transition:transform 0.15s ease,box-shadow 0.15s ease,background 0.15s ease;
}

.post-fab:hover{
background:var(--accent-dark);
transform:translateY(-2px);
box-shadow:0 14px 28px rgba(15,23,42,0.24);
}

.post-fab:focus-visible,
.modal-close:focus-visible{
outline:3px solid var(--ring);
outline-offset:3px;
}

.post-modal{
position:fixed;
inset:0;
z-index:900;
display:flex;
align-items:center;
justify-content:center;
padding:24px;
}

.post-modal-backdrop{
position:absolute;
inset:0;
background:rgba(15,23,42,0.42);
backdrop-filter:blur(2px);
}

.post-modal-card{
position:relative;
width:min(100%,560px);
max-height:calc(100vh - 48px);
overflow:auto;
background:var(--bg);
border:1px solid var(--border-soft);
border-radius:18px;
box-shadow:0 24px 70px rgba(15,23,42,0.24);
}

.post-modal-header{
display:flex;
align-items:center;
justify-content:space-between;
padding:18px 20px 4px;
}

.post-modal-header h2{
margin:0;
font-size:18px;
}

.modal-close{
display:inline-flex;
align-items:center;
justify-content:center;
width:32px;
height:32px;
padding:0;
border:0;
border-radius:50%;
background:transparent;
color:var(--text-muted);
font-size:26px;
line-height:1;
cursor:pointer;
}

.modal-close:hover{
background:var(--bg-soft);
color:var(--text);
}

.post-modal .create-post{
margin:0;
padding:16px 20px 20px;
background:transparent;
border:0;
}

.form-row{
display:flex;
gap:10px;
margin-bottom:12px;
flex-wrap:wrap;
}

.form-row select{
flex:1;
min-width:140px;
border:1px solid var(--border-soft);
border-radius:12px;
background:var(--input-bg);
padding:9px 14px;
margin-bottom:0 !important;
}

.char-counter{
display:flex;
justify-content:flex-end;
margin:-4px 0 10px;
font-size:12px;
color:var(--text-muted);
}

.settings-card h3{
margin:20px 0 8px;
font-size:17px;
font-weight:700;
}

.settings-card .auth-hint{
margin:2px 0 12px;
font-size:13px;
color:var(--text-muted);
}

.checkbox-field{
display:flex;
align-items:center;
gap:8px;
margin:4px 0 12px;
color:var(--text-muted);
font-size:13px;
cursor:pointer;
}

.checkbox-field input{
accent-color:var(--accent);
width:16px;
height:16px;
flex-shrink:0;
}

/* POSTS */

.posts{
display:flex;
flex-direction:column;
gap:16px;
}

.events{
display:flex;
flex-direction:column;
gap:14px;
}

.card{
background:var(--bg-soft);
border:1px solid var(--border-soft);
border-radius:16px;
}

/* POST CARD */

.post-card{
overflow:hidden;
}

.post-header{
display:flex;
align-items:center;
gap:12px;
padding:14px 16px;
}

.post-avatar{
background:none;
border:none;
padding:0;
cursor:pointer;
flex-shrink:0;
width:44px;
height:44px;
border-radius:50%;
overflow:hidden;
transition:opacity 0.15s ease;
}

.post-avatar:hover{
opacity:0.85;
}

.post-avatar img{
width:44px;
height:44px;
border-radius:50%;
border:1px solid var(--border-soft);
object-fit:cover;
}

.post-avatar.anon{
cursor:default;
}

.post-user{
flex:1;
min-width:0;
display:flex;
flex-direction:column;
}

.post-username{
background:none;
border:none;
padding:0;
text-align:left;
font-size:15px;
font-weight:700;
color:var(--text);
cursor:pointer;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}

.post-username:hover{
text-decoration:underline;
}

.post-username.anon{
cursor:default;
}

.post-username.anon:hover{
text-decoration:none;
}

.post-school{
display:inline-flex;
align-items:center;
gap:6px;
flex-wrap:wrap;
font-size:12px;
color:var(--text-muted);
margin-top:2px;
}

.category-chip{
display:inline-flex;
align-items:center;
padding:2px 9px;
border-radius:999px;
font-size:11px;
font-weight:700;
letter-spacing:0.3px;
color:var(--accent);
background:var(--accent-soft);
}

.chip-tea{
color:var(--danger);
background:var(--danger-soft);
}

.post-expiry{
color:var(--text-faint);
font-size:11px;
}

.delete-post{
background:none;
border:none;
cursor:pointer;
color:var(--text-muted);
font-size:18px;
line-height:1;
padding:6px 10px;
border-radius:50%;
transition:color 0.15s ease,background 0.15s ease;
}

.delete-post:hover{
color:var(--danger);
background:var(--danger-soft);
}

.post-content{
padding:0 16px 10px;
}

.post-content h3{
font-size:16px;
font-weight:700;
margin-bottom:6px;
line-height:1.4;
}

.post-content p{
font-size:15px;
color:var(--text-dim);
line-height:1.6;
white-space:pre-wrap;
word-break:break-word;
}

.post-content img{
width:calc(100% + 32px);
max-width:calc(100% + 32px);
margin:12px -16px 0;
max-height:520px;
object-fit:cover;
}

.post-actions{
display:flex;
align-items:center;
justify-content:space-between;
padding:4px 8px 2px;
}

.post-actions-left{
display:flex;
align-items:center;
gap:4px;
}

.like-btn{
display:inline-flex;
align-items:center;
gap:6px;
background:none;
border:none;
cursor:pointer;
color:var(--text);
padding:8px;
border-radius:50%;
font-size:15px;
transition:color 0.15s ease,background 0.15s ease,transform 0.1s ease;
}

.like-btn:hover{
color:var(--danger);
background:var(--danger-soft);
}

.like-btn:active{
transform:scale(1.15);
}

.like-btn .heart{
font-size:20px;
line-height:1;
color:currentColor;
}

.like-btn.liked{
color:var(--danger);
}

.like-btn.liked .heart{
animation:pop 0.25s ease;
}

.comment-btn{
display:inline-flex;
align-items:center;
gap:6px;
background:none;
border:none;
cursor:pointer;
color:var(--text);
padding:8px;
border-radius:50%;
font-size:15px;
transition:color 0.15s ease,background 0.15s ease;
}

.comment-btn:hover{
color:var(--accent);
background:var(--accent-soft);
}

.comment-btn .comment-icon{
font-size:18px;
line-height:1;
}

.comment-btn .comment-count{
font-size:14px;
font-weight:700;
}

.report-btn{
background:none;
border:none;
cursor:pointer;
color:var(--text-muted);
font-size:13px;
padding:8px 10px;
border-radius:999px;
transition:color 0.15s ease,background 0.15s ease;
}

.report-btn:hover{
color:var(--danger);
background:var(--danger-soft);
}

.post-likes{
padding:2px 16px 0;
font-size:14px;
}

.post-likes b{
font-weight:700;
}

.comment-link{
display:block;
background:none;
border:none;
padding:4px 16px 0;
text-align:left;
color:var(--text-muted);
font-size:13px;
cursor:pointer;
transition:color 0.15s ease;
}

.comment-link:hover{
color:var(--accent);
}

.post-time{
padding:2px 16px 12px;
font-size:12px;
letter-spacing:0.3px;
color:var(--text-faint);
}

/* COMMENTS */

.comment-thread{
border-top:1px solid var(--border-soft);
padding:12px 16px 14px;
}

.comments-list{
max-height:220px;
overflow-y:auto;
display:flex;
flex-direction:column;
gap:10px;
margin-bottom:10px;
}

.comment{
display:flex;
flex-wrap:wrap;
gap:10px;
font-size:14px;
line-height:1.5;
}

.comment-author{
font-weight:700;
color:var(--text);
min-width:70px;
flex-shrink:0;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}

.comment-body{
color:var(--text-dim);
word-break:break-word;
}

.comment-signin{
color:var(--text-muted);
font-size:13px;
}

.comment-form{
display:flex;
gap:10px;
align-items:center;
}

.comment-form .comment-input{
flex:1;
padding:10px 14px;
background:var(--input-bg);
border:1px solid var(--border-soft);
border-radius:999px;
color:var(--text);
outline:none;
font-size:14px;
transition:border 0.2s ease,box-shadow 0.2s ease;
}

.comment-form .comment-input:focus{
border-color:var(--accent);
box-shadow:0 0 0 2px var(--ring);
}

.comment-send{
background:none;
border:none;
color:var(--accent);
font-size:14px;
font-weight:700;
cursor:pointer;
padding:8px;
border-radius:999px;
transition:background 0.15s ease;
}

.comment-send:hover{
background:var(--accent-soft);
}

.comment-send:disabled{
opacity:0.4;
}

.feed-sentinel{
height:1px;
}

/* EMOJI REACTIONS */

.reaction-bar{
display:flex;
align-items:center;
flex-wrap:wrap;
gap:6px;
padding:2px 16px 8px;
}

.comment .reaction-bar{
flex-basis:100%;
padding:2px 0 0;
}

.event-card .reaction-bar{
padding:8px 0 0;
}

.reaction-pill{
display:inline-flex;
align-items:center;
gap:5px;
padding:3px 9px;
border:1px solid var(--border-soft);
border-radius:999px;
background:var(--bg-soft);
cursor:pointer;
font-size:14px;
line-height:1.2;
transition:background 0.15s ease,border 0.15s ease,transform 0.1s ease;
}

.reaction-pill:hover{
background:var(--card-hover);
}

.reaction-pill.mine{
border-color:var(--accent);
background:var(--accent-soft);
}

.reaction-pill:active{
transform:scale(1.08);
}

.reaction-emoji{
font-family:'Noto Color Emoji','Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol',sans-serif;
font-size:16px;
line-height:1;
}

.reaction-count{
font-size:12px;
font-weight:700;
color:var(--text-muted);
}

.reaction-add{
width:28px;
height:28px;
display:inline-flex;
align-items:center;
justify-content:center;
border:1px dashed var(--border);
border-radius:999px;
background:transparent;
color:var(--text-muted);
cursor:pointer;
font-size:14px;
line-height:1;
transition:background 0.15s ease,color 0.15s ease,border 0.15s ease;
}

.reaction-add:hover{
background:var(--accent-soft);
color:var(--accent);
border-style:solid;
}

.reaction-picker{
display:flex;
flex-wrap:wrap;
gap:4px;
width:100%;
padding:6px;
margin-top:4px;
background:var(--card-hover);
border:1px solid var(--border-soft);
border-radius:14px;
}

.reaction-option{
width:34px;
height:34px;
display:inline-flex;
align-items:center;
justify-content:center;
border:none;
border-radius:50%;
background:transparent;
cursor:pointer;
font-family:'Noto Color Emoji','Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol',sans-serif;
font-size:20px;
line-height:1;
transition:transform 0.12s ease,background 0.15s ease;
}

.reaction-option:hover{
transform:scale(1.2);
background:var(--border-soft);
}

.reaction-option.mine{
background:var(--accent-soft);
}

/* FEED STATE */

.feed-state{
text-align:center;
padding:40px 20px;
}

.feed-state p{
color:var(--text-muted);
font-size:14px;
margin-bottom:14px;
}

.spinner{
width:24px;
height:24px;
border:2px solid var(--border-soft);
border-top-color:var(--accent);
border-radius:50%;
display:inline-block;
animation:spin 0.6s linear infinite;
margin-bottom:12px;
}

/* RANKINGS */

.rankings{
display:flex;
flex-direction:column;
gap:10px;
}

.rank-row{
display:flex;
align-items:center;
gap:14px;
background:var(--bg-soft);
border:1px solid var(--border-soft);
border-radius:16px;
padding:14px 16px;
transition:background 0.15s ease;
}

.rank-row:hover{
background:var(--card-hover);
}

.rank-number{
width:32px;
height:32px;
border-radius:50%;
background:var(--accent);
color:var(--accent-ink);
font-weight:700;
font-size:14px;
display:flex;
align-items:center;
justify-content:center;
flex-shrink:0;
}

.rank-info{
flex:1;
min-width:0;
}

.rank-info strong{
font-size:15px;
font-weight:700;
}

.rank-bar{
height:5px;
background:var(--border-soft);
border-radius:10px;
margin-top:8px;
overflow:hidden;
}

.rank-fill{
height:100%;
background:var(--accent);
border-radius:10px;
transition:width 0.5s ease;
}

.rank-count{
color:var(--text-muted);
font-size:13px;
flex-shrink:0;
}

/* EVENTS */

.event-heading{
font-size:12px;
font-weight:700;
color:var(--text-muted);
text-transform:uppercase;
letter-spacing:1px;
margin:20px 2px 10px;
}

.event-card{
padding:16px;
display:flex;
flex-direction:column;
gap:4px;
}

.event-card h3{
font-size:17px;
font-weight:700;
margin-top:6px;
letter-spacing:-0.3px;
}

.event-card p{
font-size:14px;
color:var(--text-dim);
line-height:1.6;
}

.event-location{
margin-top:8px;
color:var(--text-muted) !important;
font-size:13px;
}

.event-rsvp-count{
margin-top:8px;
color:var(--text-muted);
font-size:13px;
}

.event-actions{
display:flex;
flex-wrap:wrap;
gap:8px;
margin-top:12px;
}

.event-actions .secondary-btn,
.event-actions .danger-btn{
padding:7px 16px;
font-size:13px;
font-weight:700;
border-radius:999px;
}

.post-meta{
display:flex;
justify-content:space-between;
gap:10px;
flex-wrap:wrap;
font-size:13px;
color:var(--text-faint);
margin-bottom:10px;
}

.post-meta strong{
font-weight:700;
color:var(--text);
}

/* PROFILE */

.profile-head{
display:flex;
align-items:flex-start;
gap:24px;
padding:24px;
margin-bottom:16px;
}

.profile-avatar{
width:88px;
height:88px;
border-radius:50%;
border:1px solid var(--border-soft);
object-fit:cover;
flex-shrink:0;
}

.profile-info{
flex:1;
min-width:0;
}

.profile-topline{
display:flex;
align-items:center;
gap:16px;
flex-wrap:wrap;
margin-bottom:16px;
}

.profile-topline h2{
font-size:22px;
font-weight:700;
letter-spacing:-0.5px;
}

.profile-topline .secondary-btn{
padding:7px 16px;
font-size:13px;
}

.profile-stats{
display:flex;
gap:24px;
margin-bottom:12px;
}

.profile-stats span{
font-size:14px;
color:var(--text-muted);
}

.profile-stats b{
color:var(--text);
font-weight:700;
}

.profile-bio{
font-size:14px;
color:var(--text-dim);
line-height:1.5;
white-space:pre-wrap;
}

.profile-tabs{
display:flex;
justify-content:center;
border-top:1px solid var(--border-soft);
margin-bottom:4px;
}

.profile-tabs span{
padding:14px 24px;
font-size:12px;
font-weight:700;
letter-spacing:1px;
color:var(--text-muted);
text-transform:uppercase;
border-top:1px solid transparent;
margin-top:-1px;
}

.profile-tabs span.active{
color:var(--text);
border-top-color:var(--accent);
}

.profile-grid{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:3px;
}

.profile-tile{
aspect-ratio:1/1;
overflow:hidden;
background:var(--card-hover);
display:flex;
align-items:center;
justify-content:center;
cursor:pointer;
transition:opacity 0.15s ease;
border-radius:4px;
}

.profile-tile:hover{
opacity:0.85;
}

.profile-tile img{
width:100%;
height:100%;
object-fit:cover;
}

.profile-tile-text{
font-size:12px;
color:var(--text-muted);
padding:10px;
text-align:center;
line-height:1.4;
overflow:hidden;
display:-webkit-box;
-webkit-line-clamp:4;
-webkit-box-orient:vertical;
}

.profile-edit{
margin-bottom:16px;
}

.profile-edit h3{
font-size:16px;
font-weight:700;
margin-bottom:14px;
}

/* SETTINGS */

.field{
display:block;
margin-bottom:18px;
}

.field span{
display:block;
margin-bottom:8px;
color:var(--text-muted);
font-size:13px;
font-weight:600;
}

.field input,
.field textarea,
.field select{
width:100%;
padding:10px 14px;
border:1px solid var(--border-soft);
border-radius:12px;
background:var(--input-bg);
color:var(--text);
outline:none;
font-size:14px;
transition:border 0.2s ease,box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus{
border-color:var(--accent);
box-shadow:0 0 0 2px var(--ring);
}

.field textarea{
min-height:90px;
resize:none;
line-height:1.6;
}

.theme-row{
margin-top:20px;
}

/* AUTH GATE */

body.auth-mode{
background:var(--bg);
}

body.auth-mode .sidebar,
body.auth-mode .topbar,
body.auth-mode .mobile-nav{
display:none;
}

body.auth-mode .main{
margin-left:0;
display:flex;
align-items:center;
justify-content:center;
min-height:100vh;
padding:24px 16px;
}

.auth-card{
width:100%;
max-width:420px;
padding:32px;
text-align:center;
}

.auth-card .auth-brand{
margin-bottom:24px;
}

.auth-card .logo-glyph{
width:42px;
height:42px;
margin:0 auto 14px;
display:block;
color:var(--accent);
}

.auth-card .auth-brand h1{
font-size:28px;
font-weight:800;
letter-spacing:-1px;
}

.auth-card .auth-brand p{
color:var(--text-muted);
font-size:14px;
margin-top:8px;
line-height:1.6;
}

.auth-card form{
text-align:left;
}

.auth-card form .field span{
text-align:left;
}

.auth-card button{
width:100%;
border-radius:999px;
}

.auth-card input{
padding:12px 14px;
}

.auth-card .auth-actions{
display:flex;
flex-direction:column;
gap:10px;
margin-top:20px;
}

.auth-card h3{
text-align:left;
font-size:17px;
font-weight:700;
margin-bottom:8px;
}

.auth-card .auth-hint{
text-align:left;
}

.auth-hint{
color:var(--text-muted);
font-size:13px;
}

/* BUTTONS */

.secondary-btn{
padding:9px 16px;
border:1px solid var(--border);
border-radius:999px;
background:var(--bg-soft);
color:var(--text);
font-weight:700;
font-size:14px;
cursor:pointer;
transition:background 0.15s ease,border 0.15s ease;
}

.secondary-btn:hover{
background:var(--border-soft);
border-color:var(--border);
}

.danger-btn{
padding:9px 16px;
border:1px solid var(--danger);
border-radius:999px;
background:transparent;
color:var(--danger);
font-weight:700;
font-size:14px;
cursor:pointer;
transition:background 0.15s ease;
}

.danger-btn:hover{
background:var(--danger-soft);
}

.primary-btn{
padding:10px 20px;
border:none;
border-radius:999px;
background:var(--accent);
color:var(--accent-ink);
font-weight:700;
font-size:15px;
cursor:pointer;
transition:background 0.15s ease;
}

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

/* MOBILE BOTTOM NAV DOCK */

.mobile-nav{
position:fixed !important;
left:0;
right:0;
bottom:0;
display:none;
z-index:2000 !important;
background:var(--dock-bg);
-webkit-backdrop-filter:blur(12px);
backdrop-filter:blur(12px);
border-top:1px solid var(--border-soft);
padding:6px 8px calc(6px + env(safe-area-inset-bottom));
justify-content:space-around;
}

.mobile-nav .nav{
position:relative;
z-index:1;
flex-direction:column;
gap:2px;
align-items:center;
justify-content:flex-start;
width:auto;
flex:1;
padding:6px 4px;
border-radius:12px;
font-size:11px;
font-weight:600;
text-align:center;
min-width:0;
}

.mobile-nav .nav:hover{
background:var(--border-soft);
}

.mobile-nav .nav-icon{
width:22px;
height:22px;
}

.mobile-nav .nav span{
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
max-width:100%;
}

.mobile-nav .nav.active{
color:var(--accent);
}

/* TOAST */

.toast{
position:fixed;
bottom:calc(20px + env(safe-area-inset-bottom));
right:calc(20px + env(safe-area-inset-right));
background:var(--text);
color:var(--bg-soft);
padding:12px 18px;
border-radius:999px;
font-weight:600;
font-size:14px;
display:none;
z-index:9999;
animation:fadeToast 0.2s ease;
max-width:calc(100vw - 40px);
box-shadow:0 6px 20px rgba(0,0,0,0.25);
}

.post-fab{
right:18px;
bottom:calc(88px + env(safe-area-inset-bottom));
}

.post-modal{
padding:12px;
}

/* TABLET */

@media(max-width:1100px){

.sidebar{
width:250px;
}

.main{
margin-left:250px;
}
}

/* MOBILE */

@media(max-width:900px){

.sidebar{
transform:translateX(-105%);
transition:transform 0.3s ease;
box-shadow:none;
width:280px;
}

.sidebar.open{
transform:translateX(0);
box-shadow:0 0 40px rgba(0,0,0,0.35);
}

.backdrop.show{
display:block;
}

/* Keep the drawer dismissal surface beside the drawer itself. This avoids
   making the centered part of the backdrop sit underneath the open drawer. */
.backdrop{
left:280px;
}

body.sidebar-open{
overflow:hidden;
}

.menu-toggle{
display:block;
}

.main{
margin-left:0;
width:100%;
padding:0 12px calc(84px + env(safe-area-inset-bottom));
}

.topbar{
padding:10px 0;
margin-bottom:10px;
}

.hero{
padding:28px 20px;
}

.hero h2{
font-size:26px;
}

.mobile-nav{
display:flex;
}

.search-wrap{
flex:1;
min-width:0;
}

.profile-text{
display:none;
}
}

@media(max-width:600px){

.hero h2{
font-size:22px;
}

.hero p{
font-size:14px;
}

.hero button,
.create-post button,
.secondary-btn,
.danger-btn,
.primary-btn{
width:100%;
}

.form-row{
flex-direction:column;
}

.profile p{
display:none;
}

.profile-text .secondary-btn{
width:auto;
}

.profile > .secondary-btn{
width:auto;
}

.rank-row{
flex-wrap:wrap;
}

.rank-count{
width:100%;
margin-left:46px;
}

.search,
.create-post input,
.create-post textarea,
.create-post select,
.field input,
.field textarea,
.comment-form .comment-input{
font-size:16px;
}

.profile-head{
flex-direction:column;
align-items:center;
text-align:center;
gap:14px;
}

.profile-topline{
justify-content:center;
}

.profile-stats{
justify-content:center;
}

.profile-tile-text{
font-size:12px;
}

.toast{
left:calc(14px + env(safe-area-inset-left));
right:calc(14px + env(safe-area-inset-right));
bottom:calc(90px + env(safe-area-inset-bottom));
text-align:center;
}
}

@media(max-width:480px){

.main{
padding:0 10px calc(80px + env(safe-area-inset-bottom));
}

.menu-toggle{
font-size:22px;
padding:6px;
}

.search{
min-width:0;
}

.topbar{
gap:8px;
}

.mobile-nav .nav span{
font-size:10px;
}
}

/* ANIMATION */

@keyframes spin{
to{
transform:rotate(360deg);
}
}

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

@keyframes pop{
0%{
transform:scale(1);
}
40%{
transform:scale(1.35);
}
100%{
transform:scale(1);
}
}

@media(prefers-reduced-motion:reduce){
*{
animation-duration:0.001ms !important;
animation-iteration-count:1 !important;
transition-duration:0.001ms !important;
}
}
