@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Nunito:wght@400;600&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark: #f0ede8;
  --card-bg: rgba(255,255,255,0.45);
  --border-color: rgba(164,166,171,0.3);
  --text-main: #2c2a27;
  --gold: #b8943f;
  --pink: #c4427a;
  --orange: #c45e00;
  --purple: #7b22cc;
  --blue: #0055cc;
  --green: #1a9900;
  --grey: #888888;
  --body-bg-1: #f0ede8;
  --body-bg-2: #ece8e2;
  --body-bg-3: #edeae5;
  --banner-fade: #f0ede8;
  --heading-color: #7a5c1e;
  --bio-color: #777;
  --bio-strong: #7a5c1e;
  --server-tag: #999;
  --social-color: #555;
  --card-text: #666;
  --th-color: #aaa;
  --footnote-color: #bbb;
  --footnote-span: #aaa;
  --org-name-color: #999;
  --org-link-color: #aaa;
  --boss-color: #444;
  --vod-label-active: #333;
  --vod-label-inactive: #aaa;
  --footer-color: #aaa;
  --footer-accent: #888;
}

[data-theme="dark"] {
  --bg-dark: #1a1917;
  --card-bg: rgba(38,36,33,0.75);
  --border-color: rgba(80,76,70,0.45);
  --text-main: #e8e4de;
  --gold: #d4a84b;
  --pink: #e05a8a;
  --orange: #e07020;
  --purple: #a050e0;
  --blue: #4a90e8;
  --green: #40bb30;
  --grey: #aaaaaa;
  --body-bg-1: #1a1917;
  --body-bg-2: #1e1c1a;
  --body-bg-3: #1c1a18;
  --banner-fade: #1a1917;
  --heading-color: #d4a84b;
  --bio-color: #a09890;
  --bio-strong: #d4a84b;
  --server-tag: #706860;
  --social-color: #c0b8b0;
  --card-text: #c0b8b0;
  --th-color: #706860;
  --footnote-color: #5a5450;
  --footnote-span: #706860;
  --org-name-color: #706860;
  --org-link-color: #807060;
  --boss-color: #c0b8b0;
  --vod-label-active: #e8e4de;
  --vod-label-inactive: #504840;
  --footer-color: #706860;
  --footer-accent: #908880;
}

/* ── Base ── */
body { background: linear-gradient(135deg, var(--body-bg-1) 0%, var(--body-bg-2) 40%, var(--body-bg-3) 100%); color: var(--text-main); font-family: 'Nunito', sans-serif; margin: 0; line-height: 1.5; transition: background 0.3s, color 0.3s; }
.hub-root { min-height: 100vh; padding: 0 0 60px; position: relative; }

/* ── Header ── */
.hub-header { text-align: center; padding: 32px 20px 28px; position: relative; z-index: 2; }
.hub-header h1 { font-family: 'Cinzel', serif; font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 600; color: var(--heading-color); letter-spacing: 0.04em; text-shadow: 0 0 40px rgba(184,148,63,0.2); }
.server-tag { font-size: 0.85rem; color: var(--server-tag); margin-top: 4px; letter-spacing: 2px; text-transform: uppercase; }
#cactuar-slider { width: 80px; accent-color: #aaa; cursor: pointer; display: block; margin: 4px auto 0; opacity: 0.5; }
#cactuar-slider:hover { opacity: 0.9; }
.job-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.job-tag { display: inline-block; font-size: 0.75rem; padding: 4px 14px; border-radius: 20px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; cursor: pointer; transition: opacity 0.15s, background 0.15s; }
.job-tag.inactive { opacity: 0.3; }
.job-tag.drk  { background: rgba(160,80,200,0.08);  border: 1px solid rgba(160,80,200,0.25); color: #9b3fcc; }
.job-tag.drk:not(.inactive) { background: rgba(160,80,200,0.15); }
.job-tag.pld  { background: rgba(0,85,204,0.07);    border: 1px solid rgba(0,85,204,0.2);    color: #0055cc; }
.job-tag.pld:not(.inactive) { background: rgba(0,85,204,0.13); }
.job-tag.tier { background: rgba(122,92,30,0.13);   border: 1px solid rgba(122,92,30,0.2);   color: #7a5c1e; }
.ult-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.ult-pill { display: inline-block; font-size: 0.65rem; padding: 3px 10px; border-radius: 20px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; cursor: default; }
.ult-pill.cleared { background: rgba(26,153,0,0.12); border: 1px solid rgba(26,153,0,0.35); color: #1a9900; }
.ult-pill.pending { background: transparent; border: 1px solid rgba(164,166,171,0.4); color: #aaa; }

/* ── Bio ── */
.hub-bio { max-width: 560px; margin: 0 auto 28px; padding: 0 20px; text-align: center; color: var(--bio-color); font-size: 0.92rem; line-height: 1.8; position: relative; z-index: 2; }
.hub-bio strong { color: var(--bio-strong); font-weight: 600; }

/* ── Socials ── */
.hub-socials { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 36px; position: relative; z-index: 2; }
.social-btn { display: flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 8px; border: 1px solid rgba(164,166,171,0.35); border-top: 1px solid rgba(255,255,255,0.7); background: var(--card-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: var(--social-color); font-family: 'Nunito', sans-serif; font-size: 0.82rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: border-color 0.2s, color 0.2s, background 0.2s; letter-spacing: 0.5px; box-shadow: 0 2px 16px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6); }
.social-btn svg { flex-shrink: 0; }
.social-btn.yt:hover { color: #fff; border-color: #ff0000; background: rgba(255,0,0,0.08); }
.social-btn.tw:hover { color: #fff; border-color: #9146ff; background: rgba(145,70,255,0.08); }
.social-btn.x:hover  { color: #fff; border-color: #555;    background: rgba(255,255,255,0.05); }
.social-btn.ig:hover { color: #fff; border-color: #e1306c; background: rgba(225,48,108,0.08); }
.social-btn.ll { color: #7eb8f7; border-color: rgba(100,170,255,0.25); background: rgba(100,170,255,0.07); cursor: pointer; }
.social-btn.ll:hover  { color: #fff; border-color: rgba(100,170,255,0.5); background: rgba(100,170,255,0.15); }
.social-btn.ll.copied { color: #fff; border-color: #7eb8f7; background: rgba(100,170,255,0.2); }

/* ── X cloud tooltip ── */
.x-tooltip-wrap { position: relative; display: inline-flex; }
.x-cloud-tip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) scale(0.88);
  width: 200px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-top: 1px solid rgba(255,255,255,0.8);
  border-radius: 18px;
  padding: 10px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--social-color);
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.7);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.x-cloud-tip::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 50% 50% 0 0;
  box-shadow: -22px -4px 0 -2px var(--card-bg), -22px -5px 0 -1px var(--border-color),
              22px -4px 0 -2px var(--card-bg),  22px -5px 0 -1px var(--border-color);
}
.x-cloud-tip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-top: none;
  border-left: none;
  border-radius: 0 0 50% 50%;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.4);
}
.x-tooltip-wrap:hover .x-cloud-tip { opacity: 1; transform: translateX(-50%) scale(1); }

/* ── Main two-column layout ── */
.main-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
  align-items: stretch;
}
@media (max-width: 680px) { .main-layout { grid-template-columns: 1fr; } }

.left-col  { display: flex; flex-direction: column; gap: 20px; }
.right-col { display: flex; flex-direction: column; gap: 20px; height: 100%; }
.right-col .hub-card       { flex: 1; display: flex; flex-direction: column; }
.right-col .vod-embed-wrap { flex: 1; display: flex; flex-direction: column; }
.right-col .vod-embed-slot { flex: 1; display: flex; flex-direction: column; }
.right-col iframe { flex: 1; aspect-ratio: unset !important; min-height: 0; }
.org-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Card base ── */
.hub-card { background: var(--card-bg); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); border: 1px solid var(--border-color); border-top: 1px solid rgba(255,255,255,0.8); border-radius: 14px; padding: 22px; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.7); transition: background 0.3s, border-color 0.3s; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.card-header h3 { font-family: 'Cinzel', serif; font-size: 0.94rem; font-weight: 600; color: var(--th-color); letter-spacing: 2.5px; text-transform: uppercase; }

/* ── Tier dropdown ── */
.tier-select { appearance: none; background: var(--card-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border-color); border-radius: 6px; color: var(--card-text); font-family: 'Nunito', sans-serif; font-size: 0.75rem; padding: 4px 28px 4px 10px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; transition: border-color 0.2s, color 0.2s; }
.tier-select:hover { border-color: rgba(122,92,30,0.4); color: var(--heading-color); }
.tier-select:focus { outline: none; border-color: rgba(122,92,30,0.5); }

/* ── Parse table ── */
.parse-table { width: 100%; border-collapse: collapse; }
.parse-table th { text-align: left; font-size: 0.68rem; color: var(--th-color); text-transform: uppercase; letter-spacing: 1px; padding: 6px 8px; border-bottom: 1px solid var(--border-color); }
.parse-table th:not(:first-child) { text-align: right; }
.parse-table td { padding: 11px 8px; border-bottom: 1px solid rgba(164,166,171,0.12); font-size: 0.88rem; }
.parse-table td:not(:first-child) { text-align: right; }
.parse-table tr:last-child td { border-bottom: none; }
.parse-table tr:hover td { background: rgba(0,0,0,0.03); }
.parse-table-wrap { overflow-y: auto; height: 234px; }
.parse-table-wrap::-webkit-scrollbar { width: 4px; }
.parse-table-wrap::-webkit-scrollbar-track { background: transparent; }
.parse-table-wrap::-webkit-scrollbar-thumb { background: rgba(164,166,171,0.4); border-radius: 4px; }
.boss-name { color: var(--boss-color); }
.boss-link { color: var(--boss-color); text-decoration: none; border-bottom: 1px solid rgba(164,166,171,0.3); transition: color 0.2s, border-color 0.2s; }
.boss-link:hover { color: var(--heading-color); border-bottom-color: rgba(122,92,30,0.4); }
.rdps-val { color: var(--th-color); font-size: 0.82rem; }

.rank-100    { color: var(--gold);   font-weight: 700; }
.rank-99     { color: var(--pink);   font-weight: 700; }
.rank-95     { color: var(--orange); font-weight: 700; }
.rank-purple { color: var(--purple); font-weight: 700; }
.rank-blue   { color: var(--blue);   font-weight: 700; }
.rank-green  { color: var(--green);  font-weight: 700; }
.rank-grey   { color: var(--grey);   font-weight: 700; }

.parse-footnote { font-size: 0.68rem; color: var(--footnote-color); text-align: right; margin-top: 10px; letter-spacing: 0.3px; }
.parse-footnote span { color: var(--footnote-span); }
.parse-error { color: #ff4d4d; font-size: 0.82rem; text-align: center; padding: 16px 0; }

/* ── Org cards ── */
.org-card { background: var(--card-bg); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); border: 1px solid var(--border-color); border-top: 1px solid rgba(255,255,255,0.8); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 8px 40px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.6); transition: background 0.3s, border-color 0.3s; }
.org-logo-banner { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: rgba(44,46,51,0.7); }
.org-card-footer { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border-color); }
.org-card-name { font-family: 'Cinzel', serif; font-size: 0.7rem; font-weight: 400; color: var(--org-name-color); letter-spacing: 1.5px; text-transform: uppercase; }
.org-card-link { font-size: 0.7rem; color: var(--org-link-color); text-decoration: none; letter-spacing: 0.5px; font-weight: 600; transition: color 0.2s; white-space: nowrap; }
.org-card-link:hover { color: var(--heading-color); }

/* ── VOD toggle ── */
.vod-toggle { display: inline-flex; align-items: center; background: rgba(255,255,255,0.4); backdrop-filter: blur(16px); border: 1px solid rgba(164,166,171,0.3); border-radius: 999px; padding: 3px; cursor: pointer; user-select: none; position: relative; width: 172px; height: 32px; }
[data-theme="dark"] .vod-toggle { background: rgba(255,255,255,0.06); border-color: rgba(80,76,70,0.45); }
.vod-pill { position: absolute; top: 3px; left: 3px; width: calc(50% - 3px); height: calc(100% - 6px); border-radius: 999px; background: rgba(255,255,255,0.7); border: 1px solid rgba(164,166,171,0.3); transition: transform 0.22s cubic-bezier(0.4,0,0.2,1); z-index: 0; }
[data-theme="dark"] .vod-pill { background: rgba(255,255,255,0.12); border-color: rgba(80,76,70,0.5); }
.vod-pill.right { transform: translateX(calc(100% + 3px)); }
.vod-tlabel { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; font-family: 'Nunito', sans-serif; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px; position: relative; z-index: 1; transition: color 0.2s; height: 100%; }
.vod-tlabel.active   { color: var(--vod-label-active); }
.vod-tlabel.inactive { color: var(--vod-label-inactive); }
.vod-embed-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.vod-embed-slot { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.vod-loading { aspect-ratio: 16/9; background: rgba(255,255,255,0.35); backdrop-filter: blur(16px); border: 1px dashed rgba(164,166,171,0.3); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 0.8rem; letter-spacing: 1px; }

/* ── Live badge ── */
.live-badge { display: flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(164,166,171,0.3); font-size: 0.68rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #aaa; transition: all 0.3s; }
.live-badge.is-live { border-color: rgba(230,48,48,0.4); color: #e63030; background: rgba(230,48,48,0.06); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ccc; flex-shrink: 0; transition: background 0.3s; }
.live-dot.is-live { background: #e63030; animation: livepulse 1.6s infinite; }
@keyframes livepulse {
  0%   { box-shadow: 0 0 0 0   rgba(230,48,48,0.6); }
  70%  { box-shadow: 0 0 0 5px rgba(230,48,48,0);   }
  100% { box-shadow: 0 0 0 0   rgba(230,48,48,0);   }
}

/* ── Dark mode toggle ── */
#dark-toggle {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--card-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color); border-radius: 40px; padding: 12px 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.1); cursor: pointer;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s; user-select: none;
}
#dark-toggle:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.18); }
.toggle-track { width: 22px; height: 42px; border-radius: 11px; background: rgba(164,166,171,0.25); border: 1px solid var(--border-color); position: relative; transition: background 0.3s; }
[data-theme="dark"] .toggle-track { background: rgba(184,148,63,0.2); border-color: rgba(184,148,63,0.3); }
.toggle-thumb { position: absolute; left: 50%; transform: translateX(-50%); top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.2); transition: top 0.25s cubic-bezier(0.4,0,0.2,1), background 0.3s; }
[data-theme="dark"] .toggle-thumb { top: calc(100% - 19px); background: var(--gold); }
.toggle-icon { font-size: 13px; line-height: 1; opacity: 0.4; transition: opacity 0.2s; }
.toggle-icon.active { opacity: 1; }

/* ── Fade-in reveal ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.content-reveal { opacity: 0; animation: fadeInUp 0.8s ease forwards; animation-delay: 3s; position: relative; z-index: 3; }
