/* 프로즌 — 회원 화면(index.html)의 게임 포털 배치.
   style.css · gm.css 위에 얹는다. 로그인 화면(.glue)과 관리자 화면은 건드리지 않는다 —
   모든 규칙이 .portal 아래이거나 회원 화면에만 있는 이름이다.

   배치: 왼쪽 고정 메뉴(.sidebar) + 오른쪽 본문(.main-col). 본문 맨 위 .topbar 는 붙어 다닌다.
   쌓임 순서는 style.css 의 사다리를 그대로 따른다 — .topbar 50 < .sidebar 55 < .modal 60 < 토스트 70. */

:root{
  --gold-1: #f3d98b;
  --gold-2: #c9a95a;
  --gold-3: #6b5a33;
  --panel-top: rgba(17,31,52,.94);
  --panel-bot: rgba(8,15,27,.96);
  --line: #2c4767;
  --line-soft: rgba(44,71,103,.45);
  --role-user: #6fe0a0;
  --role-gm: #ffc94d;
  --role-bot: #8aa2b8;
  --font-kr: 'Noto Sans KR', 'Inter', system-ui, sans-serif;
}

/* 로그인한 뒤에는 배경 효과를 한 단계 눌러 글자가 먼저 읽히게 한다 (눈은 그대로 내린다) */
body.logged-in .aurora{ opacity: .38; }
body.logged-in .bg-veil{
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(20,70,95,.18), transparent 55%),
    linear-gradient(180deg, rgba(3,7,12,.62) 0%, rgba(3,7,12,.74) 50%, rgba(2,5,9,.9) 100%);
}

.ico{
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ══ 뼈대 ═══════════════════════════════════════════════════════ */
.portal{
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
  font-family: var(--font-kr);
  font-size: 14px;
}
.main-col{ min-width: 0; display: flex; flex-direction: column; }

/* ── 왼쪽 메뉴 ───────────────────────────────────────────────── */
.sidebar{
  position: sticky; top: 0; z-index: 55;
  height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px 18px;
  background:
    linear-gradient(180deg, rgba(7,14,25,.97), rgba(3,8,15,.98));
  border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(201,169,90,.14), 6px 0 30px rgba(0,0,0,.45);
}
.sidebar .brand{
  flex-direction: column; gap: 6px; padding: 2px 4px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.sidebar .brand-logo{ height: auto; width: 168px; }
.sidebar .brand-name{
  font-family: var(--font-display), var(--font-kr); font-size: 13px; letter-spacing: .32em;
  color: var(--gold-1); text-shadow: 0 0 12px rgba(243,217,139,.35);
}

/* 실시간 접속 현황 */
.side-live{
  border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(180deg, rgba(20,38,62,.55), rgba(6,12,22,.6));
  padding: 10px;
}
.side-live-head{ display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #cfe0ee; margin: 0 2px 9px; }
.side-live-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.side-count{
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: rgba(0,0,0,.35); border: 1px solid transparent; border-radius: 4px;
  padding: 7px 2px 6px; cursor: pointer; font: inherit; color: var(--muted);
  transition: border-color .12s, background .12s;
}
.side-count:hover{ border-color: currentColor; background: rgba(255,255,255,.04); }
.side-count .ico{ width: 15px; height: 15px; }
.side-count b{ font-size: 17px; line-height: 1.25; color: #fff; font-variant-numeric: tabular-nums; }
.side-count span{ font-size: 10.5px; letter-spacing: .04em; }
.side-count.user{ color: var(--role-user); }
.side-count.gm{ color: var(--role-gm); }
.side-count.bot{ color: var(--role-bot); }

/* 메뉴 */
.portal .topnav{
  display: flex; flex-direction: column; gap: 3px; margin: 0;
}
.nav-group{
  font-size: 10.5px; letter-spacing: .14em; color: #6f88a1; font-weight: 700;
  padding: 8px 10px 4px;
}
.portal .navbtn{
  position: relative;
  display: flex; align-items: center; gap: 11px; width: 100%;
  text-align: left; font-family: var(--font-kr); font-size: 14px; font-weight: 500;
  color: #a9bdd0; padding: 10px 12px; border-radius: 5px; border: 1px solid transparent;
  transition: color .12s, background .12s, border-color .12s;
}
.portal .navbtn .ico{ width: 19px; height: 19px; opacity: .85; }
.portal .navbtn:hover{ color: #fff; background: rgba(143,217,240,.07); }
.portal .navbtn.on{
  color: var(--gold-1);
  border-color: rgba(201,169,90,.45);
  background: linear-gradient(90deg, rgba(201,169,90,.2), rgba(61,143,219,.12) 60%, transparent);
  box-shadow: inset 0 0 18px rgba(201,169,90,.08);
}
.portal .navbtn.on::before{
  content: ''; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--gold-2); box-shadow: 0 0 10px var(--gold-2);
}
.portal .navbtn.on .ico{ opacity: 1; }
.portal .navbtn.gm-nav{ color: #e5c77d; }
.portal .navbtn.gm-nav.on{ color: var(--gold-1); }
.portal .navbtn i{ margin-left: auto; }

/* 런처 받기 — 메뉴 맨 아래 */
.side-launch{
  margin-top: auto;
  display: flex; align-items: center; gap: 11px;
  padding: 12px 13px; border-radius: 6px; text-decoration: none;
  color: var(--gold-1);
  background: linear-gradient(180deg, #2d7cc6 0%, #1a5ea4 50%, #0f3f78 100%);
  border: 1px solid #9aa7b1;
  box-shadow: 0 0 0 2px #070c12, inset 0 1px 0 rgba(255,255,255,.35), 0 6px 18px rgba(0,0,0,.5);
  transition: filter .12s;
}
.side-launch:hover{ filter: brightness(1.15); }
.side-launch .ico{ width: 22px; height: 22px; color: #fff; }
.side-launch span{ display: flex; flex-direction: column; line-height: 1.35; }
.side-launch b{ font-size: 14px; text-shadow: 0 1px 2px #000; }
.side-launch small{ font-size: 11px; color: #d6e6f5; }

/* ── 본문 머리글 ─────────────────────────────────────────────── */
.portal .topbar{
  position: sticky; top: 0;
  padding: 14px 32px;
  background: linear-gradient(180deg, rgba(5,11,20,.95), rgba(5,11,20,.82));
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(201,169,90,.12), 0 8px 24px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
}
.page-head{ display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.crumb{ font-size: 11.5px; color: #7f97ae; letter-spacing: .08em; }
.page-title{
  margin: 2px 0 0; font-size: 21px; font-weight: 700; letter-spacing: .02em;
  color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6);
}

.avatar-btn{
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 14px 3px 3px; cursor: pointer; font: inherit; color: #dbe8f3;
  transition: border-color .12s, background .12s;
}
.avatar-btn:hover{ border-color: var(--gold-3); background: rgba(201,169,90,.08); }
.avatar-btn .avatar{ width: 34px; height: 34px; cursor: inherit; }
.avatar-name{ font-size: 13.5px; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal .avatar{
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid #8a7742;
  background: linear-gradient(180deg, #2f6ba8, #123a68);
  box-shadow: 0 0 0 2px #070c12, 0 2px 8px rgba(0,0,0,.6);
}
.portal .avatar.sm{
  width: 22px; height: 22px; border-width: 1px; font-size: 11px; font-weight: 700;
  color: var(--gold-1); box-shadow: 0 0 0 1px #070c12; vertical-align: middle;
}
.usermenu-item{ display: flex; align-items: center; gap: 9px; }
.usermenu-item .ico{ width: 15px; height: 15px; opacity: .8; }
.portal .lv-badge{ font-family: var(--font-kr); }

/* ══ 본문 · 카드 ════════════════════════════════════════════════ */
.portal .dash{
  max-width: 1340px; width: 100%; margin: 0 auto;
  padding: 24px 32px 64px; gap: 20px;
}
.portal .dash.dash-grid{
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start;
}
.span-4{ grid-column: span 4; } .span-5{ grid-column: span 5; } .span-7{ grid-column: span 7; }
.span-8{ grid-column: span 8; } .span-12{ grid-column: 1 / -1; }
.hero-card, .start-card{ align-self: stretch; }

.portal .dash-card{
  position: relative;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 1px solid var(--line); border-radius: 7px;
  padding: 18px 20px 20px;
  backdrop-filter: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 14px 34px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.05);
}
/* 금테 모서리 장식 */
.portal .dash-card::before,
.portal .dash-card::after{
  content: ''; position: absolute; width: 16px; height: 16px; pointer-events: none;
  border: 2px solid var(--gold-2); opacity: .75;
}
.portal .dash-card::before{ top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 7px 0 0 0; }
.portal .dash-card::after{ bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 7px 0; }

/* 카드 머리 — 위쪽 띠 */
.portal .dash-card > .card-head{
  margin: -18px -20px 16px; padding: 12px 20px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, rgba(48,78,116,.42), rgba(18,32,52,.15));
  border-bottom: 1px solid rgba(201,169,90,.26);
  align-items: center;
}
.portal .card-head h2{
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-kr); font-size: 15.5px; font-weight: 700;
  letter-spacing: .03em; text-transform: none;
  color: var(--gold-1); text-shadow: 0 1px 2px #000, 0 0 14px rgba(243,217,139,.18);
}
.portal .card-head h2 .ico{ width: 18px; height: 18px; color: var(--gold-2); }
.portal .meta{ font-size: 12px; color: #8ea6bc; }
.portal .card-note{ font-size: 13px; color: #97adc2; }
.portal .card-note.top{ margin: 0 0 16px; }

/* 수치 칸 */
.portal .stat-grid{ grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.portal .stat{
  background: linear-gradient(180deg, rgba(30,52,80,.38), rgba(3,8,16,.55));
  border: 1px solid var(--line-soft); border-radius: 5px; padding: 12px 14px;
}
.portal .stat-label{ font-size: 12px; letter-spacing: .02em; text-transform: none; color: #8ea6bc; }
.portal .stat-value{ font-size: 1.35rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.25; }
.portal .stat.big .stat-value{ color: var(--role-user); }
.stat-sub{ font-size: 12px; color: #8ea6bc; }
.stat-sub:empty{ display: none; }

/* 게임 시작하기 */
.steps{ list-style: none; margin: 0 0 16px; padding: 0; counter-reset: s; display: flex; flex-direction: column; gap: 10px; }
.steps li{ counter-increment: s; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; font-size: 13px; }
.steps li::before{
  content: counter(s); grid-row: span 2;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 700 13px var(--font-display); color: #04070d;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 0 0 2px #070c12, 0 0 10px rgba(201,169,90,.35);
}
.steps b{ color: #fff; font-weight: 600; }
.steps span{ color: #8ea6bc; font-size: 12.5px; }
.wow-btn.wide-btn{ width: 100%; padding: 11px 18px; font-size: 15px; }
.start-card .start-row{ flex-direction: column; align-items: stretch; gap: 8px; }
.start-card .start-note{ text-align: center; font-size: 12px; }

/* ── 접속 중 — 사용자 · GM · 봇 ─────────────────────────────── */
.portal .online-split{ grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.portal .online-split .split-col{
  --c: var(--role-user);
  display: flex; flex-direction: row; align-items: center; gap: 14px;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: linear-gradient(180deg, rgba(30,52,80,.3), rgba(3,8,16,.55));
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 12px 14px;
  box-shadow: inset 3px 0 0 var(--c);
  transition: border-color .12s, background .12s, transform .08s;
}
.portal .online-split .split-col:hover{ border-color: var(--c); }
.portal .online-split .split-col.on{ border-color: var(--c); background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(3,8,16,.5)); }
.portal .online-split .split-col.gm{ --c: var(--role-gm); }
.portal .online-split .split-col.bot{ --c: var(--role-bot); }
.split-icon{
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: var(--c); border: 1px solid var(--c); background: rgba(0,0,0,.35);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 35%, transparent);
}
.split-icon .ico{ width: 20px; height: 20px; }
.split-body{ display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.portal .split-title{ font-size: 12.5px; letter-spacing: .02em; text-transform: none; color: var(--c); font-weight: 600; }
.portal .split-total{ font-size: 1.6rem; line-height: 1.15; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.portal .split-detail{ font-size: 12px; }

/* 구분 배지 */
.role-badge{
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 54px; padding: 2px 9px; border-radius: 3px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
  border: 1px solid currentColor;
}
.role-badge.r1{ color: var(--role-user); background: rgba(111,224,160,.1); }
.role-badge.r2{ color: #1a1204; background: linear-gradient(180deg, #ffe08a, #e0a92b); border-color: #ffe7a3; box-shadow: 0 0 10px rgba(255,201,77,.35); }
.role-badge.r2::before{ content: '♛'; font-size: 11px; }
.role-badge.r0{ color: var(--role-bot); background: rgba(138,162,184,.08); }
.thread-top .role-badge{ min-width: 0; padding: 0 6px; font-size: 10.5px; }

/* ── 표 ─────────────────────────────────────────────────────── */
.portal .table-wrap{ border: 1px solid var(--line-soft); border-radius: 5px; background: rgba(0,0,0,.18); }
.portal .data-table{ font-size: 13.5px; }
.portal .data-table th{
  font-size: 12px; text-transform: none; letter-spacing: .02em; color: #9fb6cb;
  padding: 10px 12px; background: rgba(30,52,80,.35); border-bottom: 1px solid var(--line);
}
.portal .data-table td{ padding: 9px 12px; border-bottom: 1px solid rgba(44,71,103,.28); }
.portal .data-table tbody tr:nth-child(even) td{ background: rgba(255,255,255,.015); }
.portal .data-table tbody tr:hover td{ background: rgba(143,217,240,.06); }
.portal .data-table td.num, .portal .data-table th.num{ text-align: right; font-variant-numeric: tabular-nums; }
.roster tr.role-2 td{ background: rgba(255,201,77,.07) !important; }
.roster tr.role-2 td:first-child{ box-shadow: inset 3px 0 0 var(--role-gm); }
.roster tr.role-2 .pl-name{ color: #ffe08a; }
.roster tr.role-0 td{ color: #9fb3c6; }
.pl-name{ font-weight: 600; color: #fff; }
.cls-name{ font-weight: 500; }
.role-cell{ width: 1%; }

/* 순위 메달 */
.rank-table td.rank{ width: 1%; font-weight: 700; color: #8ea6bc; text-align: center; }
.rank-table td.rank-1, .rank-table td.rank-2, .rank-table td.rank-3{ color: #04070d; }
.rank-table td.rank-1::before, .rank-table td.rank-2::before, .rank-table td.rank-3::before{ content: none; }
.rank-table td.rank-1{ background: radial-gradient(circle, #ffe08a 0 11px, transparent 12px) !important; }
.rank-table td.rank-2{ background: radial-gradient(circle, #d7e1ea 0 11px, transparent 12px) !important; }
.rank-table td.rank-3{ background: radial-gradient(circle, #d8955a 0 11px, transparent 12px) !important; }

/* 분포 */
.portal .dist-row{ grid-template-columns: 82px 1fr 92px; font-size: 13px; }
.portal .dist-name{ color: #cfe0ee; }
.portal .dist-bar{ height: 10px; border-radius: 5px; }
.portal .dist-n{ color: #9fb6cb; font-variant-numeric: tabular-nums; white-space: pre; }

/* ── 내 캐릭터 — 캐릭터 선택 화면처럼 ───────────────────────── */
.char-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.char-card{
  --cls: #8fd9f0;
  position: relative; display: flex; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 6px;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--cls) 16%, transparent), transparent 55%),
    rgba(3,8,16,.55);
  box-shadow: inset 3px 0 0 var(--cls);
}
.char-card.is-online{ border-color: rgba(111,224,160,.5); }
.char-lv{
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 16px var(--font-display); color: #fff;
  border: 2px solid var(--cls); background: rgba(0,0,0,.45);
  box-shadow: 0 0 12px color-mix(in srgb, var(--cls) 40%, transparent);
}
.char-body{ display: flex; flex-direction: column; min-width: 0; flex: 1; }
.char-name{ font-size: 15px; color: var(--cls); display: flex; align-items: center; gap: 7px; }
.char-cls{ font-size: 12.5px; color: #cfe0ee; }
.char-sub{ font-size: 12px; color: #8ea6bc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-foot{ display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 12px; color: #8ea6bc; }
.char-foot .gold{ color: #ffd56b; font-weight: 600; }
.live-tag{
  font-style: normal; font-size: 10.5px; font-weight: 700; color: #06200f;
  background: var(--role-user); border-radius: 3px; padding: 0 6px;
}
.char-card.horde .char-lv{ background: radial-gradient(circle at 50% 30%, rgba(184,64,47,.35), rgba(0,0,0,.5)); }
.char-card.alliance .char-lv{ background: radial-gradient(circle at 50% 30%, rgba(63,127,214,.35), rgba(0,0,0,.5)); }

/* ── 도구 막대 · 검색 ───────────────────────────────────────── */
.search-box{
  position: relative; display: flex; align-items: center; flex: 1 1 220px; min-width: 180px; max-width: 420px;
}
.search-box.grow{ max-width: none; }
.search-box .ico{ position: absolute; left: 11px; width: 15px; height: 15px; color: #7f97ae; pointer-events: none; }
.search-box .search-input{ width: 100%; padding-left: 33px; }
.portal .search-input{ font-size: 13.5px; padding-top: 9px; padding-bottom: 9px; border-radius: 5px; border-color: #36557c; }
.portal .seg-tabs{ border-radius: 5px; border-color: #36557c; background: rgba(0,0,0,.25); }
.portal .seg{ font-size: 13px; padding: 8px 14px; font-family: var(--font-kr); }
.portal .seg.on{ color: var(--gold-1); background: linear-gradient(180deg, rgba(61,143,219,.38), rgba(15,67,128,.32)); box-shadow: inset 0 -2px 0 var(--gold-2); }
.portal .list-bar{ gap: 10px; margin-bottom: 14px; }
.portal .page-btn{ padding: 7px 18px; font-size: 13px; border-radius: 4px; }
.portal .page-info{ font-size: 13px; }
.portal .wow-btn.compact{ padding: 8px 18px; font-size: 14px; }

/* ══ 게시판 ════════════════════════════════════════════════════ */
.post-list{ display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 6px; overflow: hidden; }
.post-list > .empty, .file-list > .empty{ margin: 0; padding: 40px 16px; text-align: center; color: #8ea6bc; }
.post-row{
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: rgba(3,8,16,.35); border: 0; border-bottom: 1px solid rgba(44,71,103,.32);
  padding: 13px 16px; transition: background .1s;
}
.post-row:last-child{ border-bottom: 0; }
.post-row:nth-child(even){ background: rgba(255,255,255,.018); }
.post-row:hover{ background: rgba(143,217,240,.07); }
.post-row:hover .post-title-line b{ color: var(--gold-1); }
.post-row.notice{ background: linear-gradient(90deg, rgba(201,169,90,.16), rgba(201,169,90,.04)); box-shadow: inset 3px 0 0 var(--gold-2); }
.post-no{ text-align: center; color: #7f97ae; font-size: 13px; font-variant-numeric: tabular-nums; }
.notice-badge{
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 3px;
  color: #1a1204; background: linear-gradient(180deg, #ffe08a, #e0a92b);
}
.post-main{ display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.post-title-line{ display: flex; align-items: center; gap: 7px; min-width: 0; }
.post-title-line b{ font-size: 14.5px; font-weight: 600; color: #f0f6fb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .1s; }
.cmt-badge{ flex: none; font-size: 11px; font-weight: 700; color: var(--ice); border: 1px solid var(--ice-dim); border-radius: 999px; padding: 0 7px; }
.new-badge{ flex: none; font-size: 10px; font-weight: 800; color: #fff; background: #d0452f; border-radius: 3px; padding: 0 5px; line-height: 16px; }
.post-preview{ font-size: 12.5px; color: #7f97ae; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-side{ display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }
.post-who{ display: flex; align-items: center; gap: 7px; font-size: 13px; color: #cfe0ee; }
.post-stat{ font-size: 12px; color: #7f97ae; }

/* 글 읽기 */
.post-card{ padding-top: 16px; }
.post-top{ display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.back-btn{
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(0,0,0,.3); border: 1px solid var(--line); color: #cfe0ee; border-radius: 4px;
  padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer;
}
.back-btn:hover{ border-color: var(--gold-3); color: var(--gold-1); }
.back-btn .ico{ width: 15px; height: 15px; }
.portal .post-actions{ margin: 0; }
.post-title{ margin: 0 0 10px; font-size: 22px; font-weight: 700; color: #fff; line-height: 1.4; word-break: keep-all; }
.portal .post-meta{ display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; color: #8ea6bc; flex-wrap: wrap; }
.portal .post-meta b{ color: #dbe8f3; font-weight: 600; }
.post-meta .sep{ color: #4f6780; }
.portal .post-body{ font-size: 15px; line-height: 1.95; color: #e3eef7; padding: 20px 2px; margin-top: 10px; min-height: 140px; }
.portal .sub-head{ font-family: var(--font-kr); font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: .02em; }
.portal .comment{ padding: 11px 14px; border-radius: 5px; }
.portal .comment-head{ gap: 8px; }
.portal .comment p{ font-size: 14px; padding-left: 30px; }

/* ══ 자료실 ════════════════════════════════════════════════════ */
.file-list{ display: flex; flex-direction: column; gap: 8px; }
.file-row{
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 16px;
  background: linear-gradient(180deg, rgba(30,52,80,.22), rgba(3,8,16,.5));
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 12px 16px;
  transition: border-color .12s;
}
.file-row:hover{ border-color: #4a6f95; }
.file-icon{
  --x: #8fd9f0;
  width: 48px; height: 54px; border-radius: 4px 12px 4px 4px; display: grid; place-items: end center;
  padding-bottom: 7px; font: 800 10.5px var(--font-body); letter-spacing: .04em; color: #04070d;
  background: linear-gradient(180deg, color-mix(in srgb, var(--x) 85%, #fff), var(--x));
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.4);
  overflow: hidden; text-overflow: ellipsis;
}
.file-icon.ext-arc{ --x: #e8b34a; } .file-icon.ext-img{ --x: #7fd38f; } .file-icon.ext-doc{ --x: #7fb3ff; }
.file-icon.ext-code{ --x: #c79bff; } .file-icon.ext-media{ --x: #ff8f7a; } .file-icon.ext-etc{ --x: #9fb3c6; }
.file-main{ display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.file-title{ font-size: 15px; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-note{ font-size: 13px; color: #b6c8d8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-meta{ font-size: 12px; color: #7f97ae; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-acts{ display: flex; align-items: center; gap: 10px; }
.file-dl-n{ font-size: 12px; color: #7f97ae; white-space: nowrap; }
.file-acts .wow-btn{ text-decoration: none; }

/* ══ 명령어 (GM) ═══════════════════════════════════════════════ */
.split-layout{ display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.cat-side{
  position: sticky; top: 96px;
  border: 1px solid var(--line-soft); border-radius: 6px; background: rgba(0,0,0,.25);
  padding: 8px; max-height: calc(100vh - 120px); overflow-y: auto;
}
.cat-side-head{ display: block; font-size: 11px; letter-spacing: .14em; color: #6f88a1; font-weight: 700; padding: 4px 8px 8px; }
.cat-list{ display: flex; flex-direction: column; gap: 2px; }
.cat-item{
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; cursor: pointer; font: inherit; font-size: 13px;
  color: #b6c8d8; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 7px 9px;
}
.cat-item:hover{ background: rgba(143,217,240,.07); color: #fff; }
.cat-item.on{ color: var(--gold-1); border-color: rgba(201,169,90,.4); background: rgba(201,169,90,.12); }
.cat-item i{ font-style: normal; font-size: 11px; color: #7f97ae; background: rgba(0,0,0,.35); border-radius: 999px; padding: 0 7px; }
.cat-select{ display: none; }

.portal .cmd-grid, .portal .atlas-grid{ grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.portal .cmd-card, .portal .atlas-card{
  border-radius: 6px; padding: 15px 16px;
  background: linear-gradient(180deg, rgba(30,52,80,.28), rgba(3,8,16,.6));
  border-color: var(--line-soft);
  transition: border-color .12s, transform .12s;
}
.portal .cmd-card{ box-shadow: inset 3px 0 0 var(--lv); }
.portal .cmd-card:hover, .portal .atlas-card:hover{ border-color: #4a6f95; }
.portal .cmd-card h3, .portal .atlas-card h3{ font-size: 15px; }
.portal .cmd-name{ font-size: 13px; }
.portal .copycmd{ border-radius: 4px; padding: 9px 11px; }
.portal .copycmd code{ font-size: 13px; }
.portal .mini-btn{ font-size: 12px; padding: 4px 10px; border-radius: 4px; margin-left: 0; }

/* ══ 도감 (GM) — 분류 타일 ═════════════════════════════════════ */
.atlas-tabs{ display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.atlas-tile.seg{
  display: flex; align-items: center; gap: 13px; text-align: left;
  padding: 14px 16px; border-radius: 7px;
  border: 1px solid var(--line); color: #cfe0ee;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.atlas-tile .ico{
  width: 40px; height: 40px; padding: 9px; border-radius: 50%;
  color: var(--gold-2); border: 1px solid var(--gold-3); background: rgba(0,0,0,.4);
}
.atlas-tile span{ display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.atlas-tile b{ font-size: 14.5px; color: #fff; font-weight: 600; }
.atlas-tile small{ font-size: 12px; color: #8ea6bc; }
.atlas-tile.seg:hover{ border-color: #4a6f95; background: linear-gradient(180deg, rgba(30,52,80,.9), var(--panel-bot)); }
.atlas-tile.seg.on{
  border-color: var(--gold-2); background: linear-gradient(180deg, rgba(201,169,90,.22), var(--panel-bot));
  box-shadow: 0 0 0 1px rgba(201,169,90,.3), 0 8px 24px rgba(0,0,0,.4);
}
.atlas-tile.seg.on .ico{ color: #1a1204; background: linear-gradient(180deg, #ffe08a, #e0a92b); border-color: #ffe7a3; }
.atlas-tile.seg.on b{ color: var(--gold-1); }

/* ══ 대화 ══════════════════════════════════════════════════════ */
.portal .chat-wrap{ grid-template-columns: 250px minmax(0, 1fr); min-height: 540px; }
.portal .thread-list{ max-height: 520px; }
.portal .thread{ border-radius: 5px; padding: 9px 11px; }
.portal .chat-log{
  max-height: 460px; min-height: 380px; padding: 12px;
  background: rgba(0,0,0,.28); border: 1px solid var(--line-soft); border-radius: 6px;
}
.portal .bubble{ font-size: 14px; }

/* ══ 창 ════════════════════════════════════════════════════════ */
.portal .modal{ backdrop-filter: blur(3px); }
.portal .modal-box{ border-radius: 7px; border-color: var(--gold-3); }
.portal .modal-box .card-head h2{ font-family: var(--font-kr); text-transform: none; font-size: 16px; }
.portal .field > span{ text-transform: none; letter-spacing: .02em; font-size: 12.5px; }

/* ══ 좁은 화면 ═════════════════════════════════════════════════ */
@media (max-width: 1180px){
  .span-4, .span-8, .span-5, .span-7{ grid-column: 1 / -1; }
  .hero-card, .start-card{ align-self: auto; }
}

@media (max-width: 900px){
  .portal{ grid-template-columns: 1fr; }
  /* 메뉴는 위쪽 띠로 — 메뉴만 가로로 밀어 본다 */
  .sidebar{
    height: auto; overflow: visible;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .sidebar .brand{ flex-direction: row; border: 0; padding: 0; }
  .sidebar .brand-logo{ width: 92px; }
  .side-live{ margin-left: auto; padding: 4px; border: 0; background: none; }
  .side-live-head{ display: none; }
  .side-live-grid{ gap: 4px; }
  .side-count{ flex-direction: row; gap: 5px; padding: 4px 8px; }
  .side-count b{ font-size: 14px; }
  .side-count span{ display: none; }
  .portal .topnav{
    flex-direction: row; width: 100%; order: 3; overflow-x: auto; gap: 4px;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .portal .topnav::-webkit-scrollbar{ display: none; }
  .nav-group{ display: none !important; }
  .portal .navbtn{ width: auto; flex: none; padding: 8px 12px; font-size: 13.5px; }
  .portal .navbtn.on::before{ display: none; }
  .side-launch{ display: none; }
  .portal .topbar{ position: relative; padding: 12px 16px; }
  .page-title{ font-size: 18px; }
  .avatar-name{ display: none; }
  .avatar-btn{ padding: 3px; }
  .portal .dash{ padding: 16px 16px 48px; gap: 14px; }
  .split-layout{ grid-template-columns: 1fr; }
  .cat-side{ display: none; }
  .cat-select{ display: block; }
  .portal .chat-wrap{ grid-template-columns: 1fr; }
}

@media (max-width: 640px){
  .portal .online-split{ grid-template-columns: 1fr; gap: 8px; }
  .portal .online-split .split-col{ padding: 9px 12px; }
  .split-icon{ width: 34px; height: 34px; }
  .post-row{ grid-template-columns: 1fr; gap: 6px; }
  .post-no{ display: none; }
  .post-row.notice .post-no{ display: block; text-align: left; }
  .post-side{ flex-direction: row; align-items: center; gap: 10px; }
  .file-row{ grid-template-columns: 44px minmax(0, 1fr); }
  .file-icon{ width: 42px; height: 48px; }
  .file-acts{ grid-column: 1 / -1; justify-content: flex-end; }
  .portal .dash-card{ padding: 16px 14px 18px; }
  .portal .dash-card > .card-head{ margin: -16px -14px 14px; padding: 11px 14px; }
  .search-box{ max-width: none; }
}

/* 사이드바 스크롤 막대 — 기본 흰 막대가 어두운 화면에서 튀지 않게 */
.sidebar{ scrollbar-width: thin; scrollbar-color: #2c4767 transparent; }
.sidebar::-webkit-scrollbar{ width: 6px; }
.sidebar::-webkit-scrollbar-thumb{ background: #2c4767; border-radius: 3px; }
.sidebar::-webkit-scrollbar-track{ background: transparent; }

/* 좁은 화면: 메뉴 띠가 칸 너비를 밀어내지 않게 — 1fr 은 내용 최소폭까지 늘어나서
   메뉴 버튼 전체 길이만큼 화면이 가로로 넘쳤다. 메뉴는 그 안에서 가로로 밀어 본다. */
@media (max-width: 900px){
  .portal{ grid-template-columns: minmax(0, 1fr); }
  .sidebar, .portal .topnav{ min-width: 0; }
}

/* 캐릭터 이름 뒤 복사 버튼 — 게임에서 /누구 · 귓속말로 찾을 때 */
.name-copy{
  margin-left: 6px; padding: 0 5px; vertical-align: 1px;
  font: inherit; font-size: 10.5px; font-weight: 500; line-height: 16px;
  color: var(--muted, #8aa2b8); background: rgba(143,217,240,.06);
  border: 1px solid rgba(143,217,240,.25); border-radius: 3px; cursor: pointer;
  opacity: .7;
}
.name-copy:hover{ opacity: 1; color: #8fd9f0; border-color: #8fd9f0; }
.name-copy.done{ opacity: 1; color: #7fe0ab; border-color: #2f6b4d; }
