:root {
  --text: #eff6ff;
  --muted: #d8e4ff;
  --glass: rgba(8, 28, 50, 0.34);
  --glass-strong: rgba(7, 22, 44, 0.52);
  --border: rgba(186, 225, 255, 0.33);
  --shadow: 0 24px 45px rgba(0, 6, 18, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  background: #030f1f;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  background: transparent;
  overscroll-behavior: contain;
}

#oceanCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.ocean-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 10%, rgba(123, 214, 255, 0.16), transparent 52%),
    radial-gradient(circle at 80% 80%, rgba(161, 135, 255, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(2, 10, 24, 0.35), rgba(2, 10, 24, 0.7));
}

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 2rem 1rem;
}

@supports (min-height: 100dvh) {
  .layout {
    min-height: 100dvh;
  }
}

.profile-card {
  width: fit-content;
  max-width: min(780px, 95vw);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), var(--glass));
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.8rem 1.7rem 1.6rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(225, 245, 255, 0.85);
  box-shadow: 0 10px 30px rgba(0, 20, 40, 0.5);
  flex-shrink: 0;
}

.pseudo {
  margin: 0 0 0.2rem;
  color: #b9dcff;
  letter-spacing: 0.03em;
  font-weight: 600;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
}

.bio {
  margin: 0.65rem 0 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 60ch;
}

.badges {
  display: flex;
  gap: 0.7rem;
}

.badge-tile {
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #cdebff;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.badge-tile svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.badge-label {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  overflow: hidden;
  transition: max-width 0.32s ease, opacity 0.25s ease, margin-left 0.32s ease;
}

@media (hover: hover) {
  .badge-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(220, 245, 255, 0.72);
    background: rgba(13, 44, 76, 0.65);
    box-shadow: 0 12px 28px rgba(0, 12, 28, 0.45);
    color: #ffffff;
  }

  .badge-tile:hover .badge-label {
    max-width: 140px;
    margin-left: 0.55rem;
    opacity: 1;
  }
}

@media (hover: none) {
  .badge-label {
    max-width: 140px;
    margin-left: 0.55rem;
    opacity: 1;
  }
}

.badge-tile:focus-visible {
  outline: 2px solid rgba(220, 245, 255, 0.85);
  outline-offset: 3px;
}

.badge-dropdown {
  position: relative;
  display: inline-flex;
}

.badge-dropdown-trigger {
  font: inherit;
  cursor: pointer;
}

.badge-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-left: 0.35rem;
  opacity: 0.75;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.badge-dropdown-trigger[aria-expanded="true"] .badge-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.badge-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.10), var(--glass-strong));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 5;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.badge-dropdown-trigger[aria-expanded="true"] + .badge-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.badge-dropdown-menu li {
  margin: 0;
}

.badge-dropdown-menu a {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  color: #cdebff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.93rem;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.badge-dropdown-menu a:hover,
.badge-dropdown-menu a:focus-visible {
  background: rgba(13, 44, 76, 0.7);
  color: #ffffff;
  outline: none;
  transform: translateX(2px);
}

@media (max-width: 600px) {
  .layout {
    padding: 1.4rem 0.85rem;
    gap: 0.9rem;
  }

  .profile-card {
    padding: 1.4rem 1.1rem 1.2rem;
    border-radius: 20px;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 0.9rem;
  }

  .avatar {
    width: 108px;
    height: 108px;
  }

  h1 {
    font-size: clamp(1.4rem, 6vw, 1.85rem);
  }

  .pseudo {
    font-size: 0.95rem;
  }

  .bio {
    font-size: 0.92rem;
    line-height: 1.5;
    margin-top: 0.55rem;
  }

  .badges {
    gap: 0.55rem;
  }

  .badge-tile {
    height: 48px;
    padding: 0 0.75rem;
  }

  .badge-tile svg {
    width: 22px;
    height: 22px;
  }

  .badge-label {
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) and (hover: none) {
  .badge-label {
    margin-left: 0.45rem;
  }
}

@media (max-width: 380px) {
  .bio br {
    display: none;
  }
}
