:root {
  --bg: #000000;
  --glass: rgba(20, 20, 24, 0.55);
  --glass-light: rgba(255, 255, 255, 0.05);
  --glass-hover: rgba(255, 255, 255, 0.09);
  --sidebar-links: rgba(20, 20, 24, 0.65);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f0f0f2;
  --text-muted: #7c7c86;
  --accent: #5865f2;
  --spotify: #1db954;
  --online: #23a559;
  --idle: #f0b232;
  --dnd: #f23f43;
  --offline: #6d6f78;
  --radius: 16px;
  --font: "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: #000000;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: #000000;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.page {
  position: relative;
  z-index: 10;
  isolation: isolate;
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: start;
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: #000000;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-section {
  background: var(--sidebar-links);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
}

.profile-block {
  text-align: left;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1.25rem;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface);
}

.status-ring {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #000000;
  background: var(--offline);
  transition: background 0.3s;
}

.status-ring.online { background: var(--online); }
.status-ring.idle { background: var(--idle); }
.status-ring.dnd { background: var(--dnd); }
.status-ring.offline { background: var(--offline); }

.profile-block h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hobbies-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
}

.hobbies {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.social-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}

.social-link:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.16);
}

.social-link .icon-wrap {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.social-link img,
.social-link svg {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Main */
.main {
  padding: 2rem 1.75rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: transparent;
}

.top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

/* Discord "Playing" rich presence */
.discord-rich-presence {
  margin-top: 0.85rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
}

.discord-rich-presence.is-hidden {
  display: none;
}

.drp-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #b5bac1;
  margin-bottom: 0.45rem;
}

.drp-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.drp-art {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #2b2d31;
}

.drp-art.is-hidden {
  display: none;
}

.drp-text {
  flex: 1;
  min-width: 0;
}

.drp-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drp-subline {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--online);
}

.drp-controller {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.drp-detail {
  font-size: 0.72rem;
  color: #b5bac1;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drp-detail:empty {
  display: none;
}

.panel {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.panel-tag.spotify-tag {
  color: var(--spotify);
}

.panel-live {
  font-size: 0.65rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(35, 165, 89, 0.15);
  color: var(--online);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-live.is-hidden {
  display: none;
}

/* Discord */
.discord-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.discord-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.discord-username {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online { background: var(--online); }
.status-dot.idle { background: var(--idle); }
.status-dot.dnd { background: var(--dnd); }
.status-dot.offline { background: var(--offline); }

.discord-game {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: var(--glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.discord-game.is-hidden {
  display: none;
}

.discord-game-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

.discord-game-img.is-hidden {
  display: none;
}

.discord-game-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--online);
}

.discord-game-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discord-game-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discord-activity {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discord-activity.has-game {
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

.discord-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.platform-badge {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.platform-badge.active {
  color: var(--online);
  border-color: rgba(35, 165, 89, 0.35);
}

/* Spotify — card layout aligned with Discord */
.panel-spotify {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.spotify-card .spotify-empty {
  display: none;
}

.spotify-card:not(.visible) .spotify-empty {
  display: block;
}

.spotify-card:not(.visible) #spotify-content {
  display: none;
}

#spotify-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  flex: 1;
}

.spotify-inner {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
}

.spotify-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 4.5rem;
  padding-top: 0.1rem;
}

.spotify-cover {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #1a1a1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.spotify-song {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.spotify-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-progress-wrap {
  width: 100%;
  margin-top: 0.15rem;
}

.spotify-progress {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.spotify-progress-bar {
  height: 100%;
  background: var(--spotify);
  width: 0%;
  border-radius: 999px;
  transition: width 0.5s linear;
}

.spotify-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.spotify-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.15rem;
  width: 100%;
}

.spotify-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.52rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 10px;
}

.spotify-actions .btn-spotify {
  flex: 1.2 1 0;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn svg {
  width: 13px;
  height: 13px;
}

.btn-spotify {
  background: var(--spotify);
  color: #000;
  border-color: var(--spotify);
}

.btn-spotify:hover {
  background: #1ed760;
}

.btn-ghost {
  background: var(--glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-ghost[aria-pressed="true"] {
  background: rgba(29, 185, 84, 0.15);
  border-color: rgba(29, 185, 84, 0.4);
  color: var(--spotify);
}

.lyrics-box {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  height: 4.5rem;
  overflow: hidden;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.65;
  transition: height 0.3s, opacity 0.3s, margin 0.3s, padding 0.3s;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lyrics-box::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.lyrics-track {
  transition: transform 0.35s ease-out;
  will-change: transform;
}

.lyrics-box.collapsed {
  height: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  overflow: hidden;
  opacity: 0;
}

.lyrics-line.active {
  color: var(--text);
  font-weight: 500;
}

.spotify-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem 0;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Variant: open index-no-languages.html — only Games row */
body.no-languages .bottom-grid {
  grid-template-columns: 1fr;
}

.icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.icon-item {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
  cursor: default;
}

.icon-item:hover {
  transform: translateY(-2px);
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.16);
}

.icon-item img,
.icon-item svg {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.icon-brand {
  width: 22px;
  height: 22px;
}

.icon-lang {
  filter: none;
}

.social-link .icon-brand {
  width: 22px;
  height: 22px;
}

.icon-item .tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  background: rgba(20, 20, 24, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
  transition: opacity 0.15s;
  z-index: 10;
}

.icon-item:hover .tooltip {
  opacity: 1;
}

.setup-hint {
  padding: 0.85rem 1rem;
  background: rgba(88, 101, 242, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(88, 101, 242, 0.2);
  border-radius: var(--radius);
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.setup-hint a {
  color: var(--accent);
  text-decoration: none;
}

.setup-hint.hidden {
  display: none;
}

/* Player */
.player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.player-overlay.open {
  display: flex;
}

.player-modal {
  background: var(--glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 100%;
  max-width: 400px;
  position: relative;
}

.player-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.player-embed {
  border-radius: 12px;
  border: none;
  width: 100%;
  height: 152px;
}

@media (max-width: 960px) {
  .top-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page {
    grid-template-columns: 1fr;
    border: none;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
  }

  .main {
    padding: 1.25rem;
  }

  .top-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .social-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .social-link {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 140px;
  }
}
