:root {
  --gold: #cca97a;
  --gold-soft: #e0c7a6;
  --brown: #4a2c00;
  --ink: #050505;
  --bg-0: #07090c;
  --bg-1: #0e131b;
  --bg-2: #1a1712;
  --card: rgba(14, 18, 25, 0.86);
  --card-border: rgba(204, 169, 122, 0.36);
  --text: #f7efe4;
  --muted: #bea98f;
  --ok: #33d17a;
  --idle: #f0c35b;
  --dnd: #f25f5c;
  --offline: #808898;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.5);
}

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

html,
body {
  min-height: 100%;
}

body {
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  background: linear-gradient(130deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  overflow-x: hidden;
}

.page-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.grid-layer {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(204, 169, 122, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204, 169, 122, 0.1) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 75%);
}

.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(58px);
  opacity: 0.35;
  animation: float 16s ease-in-out infinite;
}

.glow-a {
  width: 26rem;
  height: 26rem;
  background: #9a6f35;
  top: -6rem;
  left: -7rem;
}

.glow-b {
  width: 20rem;
  height: 20rem;
  background: #6c4b1f;
  right: -4rem;
  bottom: -5rem;
  animation-delay: -7s;
}

.shell {
  position: relative;
  z-index: 2;
  width: min(980px, 92vw);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0 2rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(204, 169, 122, 0.3);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.02);
}

.brand img {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-size: 0.9rem;
  letter-spacing: 0.4px;
}

.brand small {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.4px;
}

.logout-btn {
  text-decoration: none;
  color: var(--gold-soft);
  border: 1px solid rgba(204, 169, 122, 0.45);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.logout-btn:hover {
  transform: translateY(-1px);
  background: rgba(204, 169, 122, 0.12);
}

.panel {
  margin: auto 0;
  border: 1px solid var(--card-border);
  border-radius: 1.2rem;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.005));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.guest-panel {
  max-width: 700px;
  width: 100%;
  padding: 2.2rem;
  display: grid;
  gap: 1rem;
}

.panel-tag {
  font-size: 0.75rem;
  color: var(--gold-soft);
  letter-spacing: 2.6px;
  text-transform: uppercase;
}

.guest-panel h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 1.05;
}

.panel-text {
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.65;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: fit-content;
  text-decoration: none;
  padding: 0.85rem 1.2rem;
  border-radius: 0.9rem;
  color: #100f0c;
  background: linear-gradient(130deg, #e5cba8 0%, #cca97a 55%, #9f7649 100%);
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 30px rgba(204, 169, 122, 0.26);
}

.login-btn svg {
  width: 1rem;
  height: 1rem;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(204, 169, 122, 0.32);
}

.login-btn.disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.alert {
  border-radius: 0.85rem;
  padding: 0.8rem 0.95rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.alert-error {
  border: 1px solid rgba(242, 95, 92, 0.35);
  background: rgba(242, 95, 92, 0.12);
  color: #ffd3d3;
}

.alert-warn {
  border: 1px solid rgba(240, 195, 91, 0.35);
  background: rgba(240, 195, 91, 0.1);
  color: #fbe9b8;
}

.dashboard-panel {
  width: 100%;
  padding: 1rem;
}

.loading {
  width: 100%;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.profile-card {
  border: 1px solid rgba(204, 169, 122, 0.32);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--card);
  animation: rise 0.55s ease both;
}

.card-banner {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  background:
    radial-gradient(140% 90% at 10% 5%, rgba(204, 169, 122, 0.4), rgba(204, 169, 122, 0) 58%),
    linear-gradient(145deg, rgba(10, 12, 20, 0.95) 0%, rgba(40, 24, 14, 0.78) 70%, rgba(8, 8, 8, 0.95) 100%);
}

.card-banner.has-gif-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--gif-overlay-url);
  background-size: cover;
  background-position: center;
  opacity: 0.34;
  mix-blend-mode: screen;
  z-index: 0;
}

.card-banner.animated {
  background-size: 180% 180%, 100% 100%;
  animation: shimmer 9s ease-in-out infinite;
}

.card-banner.with-image {
  background-size: cover;
  background-position: center;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.52));
  z-index: 1;
}

.brand-mark {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 2;
}

.brand-mark img {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
}

.brand-mark span {
  font-size: 0.7rem;
  letter-spacing: 0.6px;
}

.card-main {
  padding: 1.05rem;
  display: grid;
  gap: 1rem;
}

.identity-row {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.avatar-wrap {
  position: relative;
  width: 4.6rem;
  height: 4.6rem;
  flex: 0 0 auto;
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(204, 169, 122, 0.36);
  object-fit: cover;
  background: #111;
}

.presence-dot {
  position: absolute;
  right: -0.1rem;
  bottom: -0.1rem;
  width: 1.02rem;
  height: 1.02rem;
  border-radius: 50%;
  border: 2px solid rgba(14, 18, 25, 0.95);
  background: var(--offline);
}

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

.identity-copy h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.2rem, 4vw, 1.65rem);
  line-height: 1.06;
  word-break: break-word;
}

.identity-copy p {
  color: var(--muted);
  line-height: 1.45;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.status-pill {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  color: #fff;
}

.status-pill.online { background: rgba(51, 209, 122, 0.18); border-color: rgba(51, 209, 122, 0.4); }
.status-pill.idle { background: rgba(240, 195, 91, 0.2); border-color: rgba(240, 195, 91, 0.45); }
.status-pill.dnd { background: rgba(242, 95, 92, 0.2); border-color: rgba(242, 95, 92, 0.42); }
.status-pill.offline { background: rgba(128, 136, 152, 0.2); border-color: rgba(128, 136, 152, 0.44); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.info-block {
  border: 1px solid rgba(204, 169, 122, 0.24);
  border-radius: 0.8rem;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.02);
}

.info-block label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--gold-soft);
  margin-bottom: 0.5rem;
}

.banner-field {
  display: flex;
  gap: 0.42rem;
}

.banner-field input {
  width: 100%;
  border: 1px solid rgba(204, 169, 122, 0.26);
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.26);
  color: #fef3e4;
  padding: 0.58rem 0.62rem;
  font-size: 0.8rem;
}

.banner-field button {
  border: 1px solid rgba(204, 169, 122, 0.46);
  border-radius: 0.6rem;
  background: rgba(204, 169, 122, 0.1);
  color: var(--gold-soft);
  padding: 0 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.banner-field button:hover {
  background: rgba(204, 169, 122, 0.2);
}

.banner-field button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-link {
  color: var(--gold-soft);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(204, 169, 122, 0.35);
  padding-bottom: 1px;
}

.profile-link:hover {
  color: #f9e8cf;
}

.hidden {
  display: none !important;
}

@keyframes float {
  0%,
  100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, 20px, 0); }
}

@keyframes shimmer {
  0% { background-position: 0% 50%, center; }
  50% { background-position: 100% 50%, center; }
  100% { background-position: 0% 50%, center; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 680px) {
  .shell {
    width: min(980px, 94vw);
    padding-top: 0.8rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .guest-panel,
  .dashboard-panel {
    padding: 0.85rem;
  }

  .brand-mark span {
    display: none;
  }

  .identity-row {
    align-items: flex-start;
  }

  .banner-field {
    flex-direction: column;
  }

  .banner-field button {
    height: 2.2rem;
  }
}
