/* ══════════════════════════════
   HOME PAGE
══════════════════════════════ */

/* Hero */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; text-align: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #070a0f 0%, #0a0d14 50%, #070a0f 100%);
}
.hero-bg-img {
  position: absolute; inset: 0;
  background: url('../images/screenshot2.png') center/cover no-repeat;
  opacity: .18; filter: blur(2px);
  transform: scale(1.05);
  animation: heroFloat 20s ease-in-out infinite alternate;
}
@keyframes heroFloat { from { transform: scale(1.05); } to { transform: scale(1.12) translateY(-10px); } }
.hero-gradient {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 60%, rgba(232,98,26,0.12) 0%, transparent 70%);
}
.hero-content { position: relative; z-index: 2; max-width: 900px; padding: 0 1.5rem; }
.hero-tag { margin-bottom: 1.5rem; }
.hero-title {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 900; line-height: 1;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 24px rgba(0,0,0,0.8);
}
.hero-sub { font-size: clamp(1rem, 2vw, 1.3rem); color: var(--text2); margin-bottom: 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  color: var(--text3); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
}
.scroll-line {
  width: 1px; height: 50px;
  background: linear-gradient(180deg, var(--accent), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine { 0%,100%{transform:scaleY(1);opacity:1} 50%{transform:scaleY(.5);opacity:.5} }

/* Stats bar */
.stats-bar {
  padding: 3rem 0;
  background: linear-gradient(90deg, var(--bg2), var(--bg3), var(--bg2));
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 2rem; text-align: center; }
.stat-item h3 { font-size: 2.5rem; background: linear-gradient(135deg,var(--accent2),var(--gold)); -webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text; }
.stat-item p { color: var(--text2); font-size: .85rem; margin-top: .25rem; }
@media(max-width:700px){.stats-grid{grid-template-columns:repeat(2,1fr);}}

/* About section */
.about-section { padding: 7rem 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.about-label { font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent2); margin-bottom: 1rem; }
.about-text h2 { font-size: clamp(2rem,3.5vw,2.8rem); margin-bottom: 1.25rem; }
.about-text p { color: var(--text2); margin-bottom: 1rem; }
.about-image { position: relative; border-radius: var(--r2); overflow: hidden; }
.about-image img { width: 100%; border-radius: var(--r2); display: block; }
.about-image::after {
  content: ''; position: absolute; inset: 0; border-radius: var(--r2);
  background: linear-gradient(135deg, rgba(232,98,26,0.15), transparent);
  border: 1px solid var(--border2);
}
@media(max-width:800px){ .about-grid{grid-template-columns:1fr;gap:2.5rem;} }

/* Features */
.features-section { padding: 6rem 0; background: var(--bg2); }
.features-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 2rem;
  transition: all .3s; position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .3s;
}
.feature-card:hover { border-color: var(--border2); transform: translateY(-6px); }
.feature-card:hover::before { opacity: 1; }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.3rem; margin-bottom: .75rem; }
.feature-card p { color: var(--text2); font-size: .9rem; }
@media(max-width:900px){.features-grid{grid-template-columns:1fr 1fr;}}
@media(max-width:600px){.features-grid{grid-template-columns:1fr;}}

/* Timeline / roadmap */
.roadmap-section { padding: 7rem 0; }
.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 1px; background: linear-gradient(180deg, transparent, var(--border2), transparent);
  transform: translateX(-50%);
}
.timeline-item { display: grid; grid-template-columns: 1fr 40px 1fr; gap: 1.5rem; align-items: start; margin-bottom: 3rem; }
.timeline-content { padding: 1.5rem; }
.timeline-content.right { text-align: left; }
.timeline-content.left { text-align: right; }
.timeline-dot {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg2); border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; color: var(--accent2); font-weight: 700; flex-shrink: 0;
  position: relative; z-index: 1;
}
.timeline-dot.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--glow); }
.timeline-content h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.timeline-content p { color: var(--text2); font-size: .85rem; }
.timeline-tag { font-size: .75rem; color: var(--accent2); font-weight: 600; margin-bottom: .5rem; display: block; }
@media(max-width:700px){
  .timeline::before { left: 20px; }
  .timeline-item { grid-template-columns: 40px 1fr; }
  .timeline-content.left { display: none; }
}

/* ══════════════════════════════
   GAME PAGE
══════════════════════════════ */
.game-hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.game-hero-bg {
  position: absolute; inset: 0;
  background: url('../images/sh_icon.png') center/cover no-repeat;
  opacity: .25; transform: scale(1.05);
}
.game-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(7,10,15,.7) 50%, rgba(7,10,15,.3) 100%);
}
.game-hero-content { position: relative; z-index: 2; padding: 5rem 0 4rem; width: 100%; }
.game-hero-content .container { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: end; }
.game-title { font-size: clamp(3.5rem,6vw,5.5rem); font-weight: 900; line-height: 1; }
.game-title span { display: block; font-size: .4em; letter-spacing: .2em; text-transform: uppercase; color: var(--accent2); margin-bottom: .5rem; }
.game-meta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0; }
.meta-badge {
  padding: .3rem .9rem; border-radius: 2rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .05em;
  background: var(--surface); border: 1px solid var(--border);
}
.meta-badge.alpha { border-color: var(--accent2); color: var(--accent2); }
.game-desc { color: var(--text2); margin-bottom: 1.5rem; max-width: 500px; }
.game-download-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--r2); padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.download-version { font-size: .85rem; color: var(--text2); }
.download-version span { color: var(--accent2); font-weight: 600; }
@media(max-width:800px){ .game-hero-content .container{grid-template-columns:1fr;} }

/* Characters */
.characters-section { padding: 7rem 0; background: var(--bg2); }
.chars-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.char-card {
  position: relative; border-radius: var(--r2); overflow: hidden;
  aspect-ratio: 3/4; cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color .3s, transform .3s;
}
.char-card:hover { border-color: var(--border2); transform: scale(1.02); }
.char-card img { width:100%;height:100%;object-fit:cover;transition:transform .5s; }
.char-card:hover img { transform: scale(1.08); }
.char-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 2rem 1.25rem 1.25rem;
  background: linear-gradient(0deg, rgba(7,10,15,.95) 0%, transparent 100%);
}
.char-info h3 { font-size: 1.4rem; }
.char-info p { color: var(--text2); font-size: .8rem; margin-top: .25rem; }
@media(max-width:800px){.chars-grid{grid-template-columns:1fr 1fr;}}
@media(max-width:500px){.chars-grid{grid-template-columns:1fr;}}

/* Gallery */
.gallery-section { padding: 6rem 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-auto-rows: 220px;
  gap: 1rem;
}
.gallery-item { border-radius: var(--r); overflow: hidden; position: relative; cursor: pointer; }
.gallery-item img { width:100%;height:100%;object-fit:cover;transition:transform .5s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item.wide { grid-column: span 2; }
.gallery-item.tall { grid-row: span 2; }
@media(max-width:700px){.gallery-grid{grid-template-columns:1fr 1fr;} .gallery-item.wide,.gallery-item.tall{grid-column:span 1;grid-row:span 1;}}

/* Changelog */
.changelog-section { padding: 6rem 0; background: var(--bg2); }
.changelog-box {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--r2); padding: 2.5rem;
  max-width: 800px; margin: 0 auto;
}
.changelog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.changelog-header h3 { font-size: 1.5rem; }
.changelog-body { color: var(--text2); font-size: .9rem; line-height: 1.8; white-space: pre-line; }

/* ══════════════════════════════
   PROFILE PAGE
══════════════════════════════ */
.profile-page { padding-top: 90px; min-height: 100vh; }
.profile-header {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border-bottom: 1px solid var(--border); padding: 3rem 0;
}
.profile-header-inner { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.profile-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 700; font-family: 'Rajdhani',sans-serif;
  flex-shrink: 0; border: 3px solid var(--border2);
  box-shadow: var(--glow);
}
.profile-info h2 { font-size: 2rem; }
.profile-info p { color: var(--text2); font-size: .9rem; }
.profile-badge {
  display: inline-block; padding: .2rem .8rem;
  background: rgba(232,98,26,0.15); border: 1px solid var(--border2);
  border-radius: 2rem; font-size: .75rem; color: var(--accent2);
  margin-top: .5rem; font-weight: 600;
}
.profile-badge.role-admin { background: rgba(220,38,38,0.15); border-color: #dc2626; color: #fca5a5; }
.profile-badge.role-mod { background: rgba(37,99,235,0.15); border-color: #2563eb; color: #93c5fd; }

/* Notifications */
.nav-notif-btn { position: relative; margin-right: .5rem; display: flex; align-items: center; }
.nav-notif-btn .btn { font-size: 1.2rem; padding: 0 .5rem; }
.notif-badge {
  position: absolute; top: 0; right: 0;
  background: #ff4d4d; color: #fff; font-size: .65rem;
  min-width: 16px; height: 16px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; border: 2px solid var(--bg);
  padding: 0 4px;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 15px); right: -10px;
  width: 320px; background: #1a1d21; border: 1px solid var(--border2);
  border-radius: var(--r); box-shadow: 0 15px 50px rgba(0,0,0,.8);
  display: none; flex-direction: column; z-index: 2000;
  overflow: hidden;
}
.notif-dropdown.open { display: flex; animation: slideDown .2s ease-out; }
.notif-header { padding: .75rem 1rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-header h4 { font-size: .9rem; margin: 0; }
.notif-list { max-height: 350px; overflow-y: auto; }
.notif-item {
  padding: .9rem 1rem; border-bottom: 1px solid var(--border);
  display: flex; gap: .75rem; transition: background .2s; cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(232,98,26,0.05); }
.notif-item.unread::before { content: ''; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.notif-content { flex: 1; font-size: .82rem; line-height: 1.4; color: var(--text2); }
.notif-time { font-size: .7rem; color: var(--text3); margin-top: .3rem; }
.notif-footer { padding: .75rem; text-align: center; background: var(--bg); }
.notif-footer a { font-size: .8rem; color: var(--accent); font-weight: 600; }

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

/* Messenger */
.messenger-container {
  display: grid; grid-template-columns: 280px 1fr;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); height: 600px; overflow: hidden;
  max-height: 80vh; /* Don't exceed screen height */
}
.dialogs-list { border-right: 1px solid var(--border); overflow-y: auto; background: rgba(255,255,255,0.01); height: 100%; }
.dialog-item {
  padding: 1rem; border-bottom: 1px solid var(--border);
  display: flex; gap: .75rem; cursor: pointer; transition: background .2s;
}
.dialog-item:hover { background: rgba(255,255,255,0.03); }
.dialog-item.active { background: rgba(232,98,26,0.08); border-left: 3px solid var(--accent); }
.dialog-avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.dialog-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dialog-info { flex: 1; min-width: 0; }
.dialog-name { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.dialog-last { font-size: .75rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-area { 
  display: flex; flex-direction: column; background: var(--bg2); 
  position: relative; height: 100%; overflow: hidden; /* Prevents overflow */
}
.chat-header { padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.chat-messages { 
  flex: 1; overflow-y: auto; padding: 1.5rem; 
  display: flex; flex-direction: column; gap: 1rem; 
  max-height: 100%; /* Important for scrolling */
}
.message-bubble {
  max-width: 80%; padding: .75rem 1rem; border-radius: 1rem;
  font-size: .9rem; line-height: 1.4; position: relative; word-wrap: break-word;
}
.message-bubble.mine {
  align-self: flex-end; background: var(--accent); color: #fff;
  border-bottom-right-radius: .2rem;
}
.message-bubble.other {
  align-self: flex-start; background: var(--bg3); border: 1px solid var(--border);
  border-bottom-left-radius: .2rem;
}
.message-time { font-size: .65rem; opacity: .7; margin-top: .3rem; text-align: right; }

.chat-input-area { 
  padding: 1rem; border-top: 1px solid var(--border); 
  display: flex; gap: .75rem; flex-shrink: 0; background: var(--bg2); 
}
.chat-input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: .75rem 1rem; color: var(--text); outline: none; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text3); font-style: italic; }

/* Social Actions in Profile */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1.5rem;
}
.profile-actions .btn {
  height: 44px;
  width: 100%;
  border-radius: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: all .2s;
}
.profile-actions .btn-message {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text);
}
.profile-actions .btn-message:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--text3);
}
.profile-actions .btn-friend-remove {
  background: rgba(220,38,38,0.1);
  border: 1px solid rgba(220,38,38,0.25);
  color: #fca5a5;
}
.profile-actions .btn-friend-remove:hover {
  background: rgba(220,38,38,0.2);
  border-color: #dc2626;
}
.profile-actions .btn-friend-add, .profile-actions .btn-friend-accept {
  background: var(--accent);
  color: #fff;
  border: none;
}

/* Chat Header Role */
.chat-role-badge {
  font-size: .65rem;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}
.chat-role-badge.admin { background: #7f1d1d; color: #fca5a5; }
.chat-role-badge.mod { background: #1e3a5f; color: #93c5fd; }
.chat-role-badge.player { background: #7c2d12; color: #fdba74; }
.profile-actions .btn-friend-add:hover, .profile-actions .btn-friend-accept:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 15px rgba(232,98,26,0.4);
}
.profile-body { padding: 3rem 0; }
.profile-grid { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; }
.profile-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.profile-nav-item {
  padding: .9rem 1.25rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text2); font-size: .9rem; text-align: left;
  transition: all .2s; display: flex; align-items: center; gap: .75rem;
}
.profile-nav-item:hover, .profile-nav-item.active {
  background: rgba(232,98,26,0.1); border-color: var(--border2); color: var(--text);
}
.profile-nav-item.danger:hover { background: rgba(192,57,43,0.1); border-color: var(--red); color: #f87171; }
.profile-content-area { display: flex; flex-direction: column; gap: 1.5rem; }
.profile-section-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 2rem;
}
.profile-section-card h3 { font-size: 1.3rem; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.stats-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.stat-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.25rem; text-align: center;
}
.stat-card .value { font-size: 2rem; font-family: 'Rajdhani',sans-serif; font-weight: 700; color: var(--accent2); }
.stat-card .label { font-size: .8rem; color: var(--text2); margin-top: .25rem; }
.launcher-token-box {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem;
}
.launcher-token-box p { color: var(--text2); font-size: .9rem; }
.token-display {
  display: flex; align-items: center; gap: .75rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r); padding: .75rem 1rem;
  font-family: 'Courier New', monospace; font-size: .85rem;
  color: var(--accent2); word-break: break-all;
}
@media(max-width:800px){ 
  .profile-grid{grid-template-columns:1fr;} 
  .stats-cards{grid-template-columns:1fr 1fr;} 
  .messenger-container { grid-template-columns: 1fr; height: 80vh; }
  .dialogs-list { display: block; border-right: none; border-bottom: 1px solid var(--border); max-height: 30vh; }
  .chat-area { height: 50vh; }
}
@media(max-width:500px){ 
  .stats-cards{grid-template-columns:1fr;} 
  .messenger-container { grid-template-columns: 1fr; height: 85vh; }
  .dialogs-list { max-height: 25vh; }
  .chat-area { height: 60vh; }
}
