:root{
  --bg:#0f1422;
  --bg2:#131c2f;
  --panel:#1b2438;
  --line:#26314a;
  --text:#e8edf7;
  --muted:#95a2bf;
  --gold:#f2b726;
  --gold2:#d89800;
  --ok:#59d66f;
}

svg {
    fill: currentColor;
    flex-shrink: 0;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:Arial, sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,#0c1322,#0e1628);
}
a{color:inherit;text-decoration:none}

.app{
  display:grid;
  grid-template-columns:64px 1fr 360px;
  min-height:100vh;
}

.wrapper{
  display:grid;
  grid-template-columns:64px 1fr;
  min-height:100vh;
}

/* left */
.leftbar{
  background:#0b1220;
  border-right:1px solid var(--line);
  padding:10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}
.logo-mini{
  width:40px;height:40px;border-radius:50%;
  display:grid;place-items:center;
  background:#18233a;
}
.leftbar nav{
  display:flex;flex-direction:column;gap:12px;margin-top:12px;
}
.leftbar nav a{
  width:36px;height:36px;border-radius:10px;
  display:grid;place-items:center;background:#151f33;
}

/* content */
.content{padding:12px 14px}
.topbar{
  background:var(--bg2);
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 14px;
  display:flex;align-items:center;gap:16px;
}
.brand {
    display: flex;
    align-items: center;
}
.brand span{color:var(--gold)}
.menu{display:flex;gap:14px;flex-wrap:wrap}
.menu a{color:var(--muted);font-weight:600}
.menu a:hover{color:#fff}
.auth{margin-left:auto;display:flex;gap:8px}

.btn{
  border:none;border-radius:10px;padding:10px 14px;
  font-weight:700;cursor:pointer;
}
.btn-dark{background:#27324a;color:#fff}
.btn-gold{background:var(--gold);color:#111}
.btn-gold:hover{background:var(--gold2)}
.btn.small{padding:8px 10px;font-size:13px}

.hero{
  margin-top:12px;
  display:grid;
  grid-template-columns:1.3fr 1fr;
  gap:12px;
}
.hero-left,.hero-stats{
  background:var(--bg2);
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
}
.hero-left h1{margin:0 0 10px}
.hero-left p{margin:0 0 12px;color:var(--muted)}
.hero-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.stat-card{
  background:#19243b;border:1px solid #2b3854;border-radius:12px;padding:14px;
}
.stat-card small{display:block;color:var(--muted);margin-bottom:6px}
.stat-card strong{font-size:30px;line-height:1.1}

.banner{
  margin-top:12px;
  background:var(--bg2);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
}
.banner img{
  width:100%;display:block;object-fit:cover;max-height:260px;
}

.games-row{
  margin-top:12px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.games-block{
  background:var(--bg2);
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
}
.games-head{
  display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;
}
.cards{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.card{
  background:#182338;border:1px solid #2a3650;border-radius:10px;overflow:hidden;
}
.card img{
  width:100%;height:110px;display:block;
}
.card span{
  display:block;padding:8px;font-weight:700;font-size:13px;
}
.footer{
  margin:12px 0 0;
  background:var(--bg2);
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  color:var(--muted);
  font-size:13px;
}

/* chat */
.chat-panel{
  background:#10192b;
  border-left:1px solid var(--line);
  display:flex;
  flex-direction:column;
}
.chat-head{
  padding:12px;
  border-bottom:1px solid var(--line);
  display:flex;justify-content:space-between;align-items:center;
}
.chat-toggle{
  border:none;background:#25324a;color:#fff;border-radius:8px;padding:6px 10px;cursor:pointer;
}
.chat-list{
  padding:10px;
  overflow:auto;
  height:calc(100vh - 60px);
  display:flex;flex-direction:column;gap:8px;
  scrollbar-color: #2E9AFF #9F9F9F;
  scrollbar-width: thin;
  
}
.msg{
  background:var(--panel);
  border:1px solid #2b3651;
  border-radius:10px;
  padding:8px;
}
.msg-top{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:#c9d3ea;
  margin-bottom:4px;
}
.role{
  padding:2px 6px;
  border-radius:6px;
  font-weight:700;
  font-size:11px;
}
.role.nick{background:#263a5d;color:#d8e6ff}
.role.модератор{background:#5e2a2a;color:#ffd6d6}
.role.информация{background:#1f4c2f;color:#d7ffe2}
.msg-text{font-size:13px;line-height:1.35}
.msg-time{font-size:11px;color:var(--muted);margin-top:4px}

/* mobile */
.mobile-chat-btn{
  display:none;
  position:fixed;
  right:14px; bottom:14px;
  width:52px; height:52px; border-radius:50%;
  border:none; font-size:22px;
  background:var(--gold); color:#111;
  z-index:30;
}

.btn{
  display:inline-block;
  text-decoration:none;
  border:none;
  border-radius:10px;
  padding:10px 14px;
  font-weight:700;
  cursor:pointer;
}

.brand, .logo-mini, .card, .stat-card, .games-head h3 a {
  text-decoration:none;
  color:inherit;
}

/* Основной контейнер контента */
.the_content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #e0e0e0; /* Светлый текст для темной темы */
    padding: 20px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

/* Стили для заголовков внутри контента */
.the_content h2 {
    font-size: 1.5em;
    color: #ffffff;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.the_content h3 {
    font-size: 1.2em;
    color: #bb86fc; /* Акцентный цвет (фиолетовый) */
    margin-top: 1.2em;
    margin-bottom: 0.5em;
}

/* Стили для параграфов */
.the_content p {
    margin-bottom: 1em;
    text-align: justify;
}

/* Стили для маркированных списков */
.the_content ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 1em;
}

.the_content li {
    margin-bottom: 0.5em;
    color: #cccccc;
}

/* Стили для жирного текста */
.the_content b, .the_content strong {
    color: #ffffff;
    font-weight: 600;
}

/* Класс для скрытия части текста (начальное состояние) */
.the_content.content-hidden {
    max-height: 400px; /* Высота видимой области */
}

/* Градиентный затемняющий слой снизу, когда текст скрыт */
.the_content.content-hidden::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #1a1a1a);
    pointer-events: none;
}

.read-more-toggle {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background-color: #333;
    color: #fff;
    border: 1px solid #444;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    user-select: none; /* Запрещает выделение текста при клике */
    transition: background-color 0.3s, border-color 0.3s;
    box-sizing: border-box; /* Чтобы padding не увеличивал ширину */
}

.read-more-toggle:hover {
    background-color: #444;
    border-color: #666;
}

@media (max-width: 1280px){
  .app{grid-template-columns:64px 1fr 320px}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 980px){
  .app{grid-template-columns:56px 1fr}
  .chat-panel{
    position:fixed; top:0; right:-100%; width:90%; max-width:360px; height:100%;
    z-index:40; transition:right .25s ease;
    box-shadow:-10px 0 30px rgba(0,0,0,.4);
  }
  .chat-panel.open{right:0}
  .mobile-chat-btn{display:block}
  .hero{grid-template-columns:1fr}
  .hero-stats{grid-template-columns:1fr}
  .games-row{grid-template-columns:1fr}
}
@media (max-width: 640px){
  .leftbar{display:none}
  .app{grid-template-columns:1fr}
  .topbar{flex-wrap:wrap}
  .auth{margin-left:0}
  .menu{width:100%}
}