:root{
  --bg: #000000;
  --panel: #000000;
  --panel-2: #000000;
  --line: #262626;
  --accent: #b44aff;
  --accent-soft: #b44aff33;
  --status: #43f5a3;
  --discord: #5865f2;
  --guns: #ff4d4d;
  --tiktok: #25f4ee;
  --instagram: #e1306c;
  --text: #e9e8f2;
  --muted: #8b8a9e;
  --bio: #c7c6d8;
  --hover: #2a1638;
  --press: #3d1f58;
  --avatar-bg: #111111;
  --shadow: #00000066;
  --slider: #b44aff;
  --mono: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  --sans: 'Outfit', system-ui, sans-serif;
}

html[data-theme="light"]{
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --line: #d9d9d9;
  --accent: #9b4dff;
  --accent-soft: #9b4dff2e;
  --text: #111111;
  --muted: #6b6b78;
  --bio: #3a3a44;
  --hover: #f3e8ff;
  --press: #e4c8ff;
  --avatar-bg: #eeeeee;
  --shadow: #0000001a;
  --slider: #9b4dff;
}

*{ box-sizing: border-box; }

html{
  height: 100%;
}

html,body{
  margin:0; padding:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height:100%;
  min-height:100dvh;
  overflow-x: hidden;
  transition: background .2s ease, color .2s ease;
}

body{
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 32px 16px 32px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
}

.bg-video{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.bg-shade{
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0,0,0,0.42);
  pointer-events: none;
}

html[data-theme="light"] .bg-shade{
  background: rgba(255,255,255,0.38);
}

.enter-screen{
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 0;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
}

html[data-theme="light"] .enter-screen{
  background: rgba(255,255,255,0.78);
  color: #111;
}

.enter-screen[hidden]{
  display: none;
}

.theme-toggle{
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 30;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--shadow);
  padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus-visible{
  border-color: var(--accent);
  background: var(--hover);
  outline: none;
}

.theme-toggle .icon-moon{ display: none; }
html[data-theme="light"] .theme-toggle .icon-sun{ display: none; }
html[data-theme="light"] .theme-toggle .icon-moon{ display: block; }

.frame{
  position: relative;
  z-index: 2;
  width:100%;
  max-width: 460px;
  perspective: 900px;
  min-width: 0;
}

.visits{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 12px;
  color: var(--text);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.visits svg{
  color: var(--accent);
  flex-shrink: 0;
}

/* --- card --- */
.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow:hidden;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}

.card-shine{
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--shine-x, 50%) var(--shine-y, 50%),
    rgba(255,255,255,0.16),
    transparent 42%
  );
  transition: opacity .25s ease;
}

.card.tilting .card-shine{
  opacity: 1;
}

.banner{
  height: clamp(112px, 36vw, 168px);
  width:100%;
  overflow: hidden;
  position:relative;
  background: #0a0014;
}

.banner img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.identity{
  padding: 0 20px 20px;
  position:relative;
}

.avatar{
  width: clamp(68px, 19vw, 88px);
  height: clamp(68px, 19vw, 88px);
  border-radius: 20px;
  background: var(--avatar-bg);
  border: 4px solid var(--panel);
  margin-top: calc(clamp(68px, 19vw, 88px) / -2);
  overflow: hidden;
  box-shadow: 0 6px 20px var(--shadow);
}

.avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.name-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top: 14px;
}

.name{
  font-family: var(--mono);
  font-weight:700;
  font-size: 22px;
  letter-spacing: 0.5px;
}

.status-pill{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--status);
  background: #43f5a318;
  border: 1px solid #43f5a340;
  padding: 3px 8px;
  border-radius: 999px;
  display:flex; align-items:center; gap:6px;
}
.status-pill .d{
  width:6px; height:6px; border-radius:50%;
  background: var(--status);
}

.handle{
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  margin-top:2px;
}

.bio{
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--bio);
}

/* --- command panel --- */
.divider{
  margin: 20px 0 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}
.divider::before,
.divider::after{
  content:"";
  flex:1;
  border-top: 1px dashed var(--line);
}

.commands{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.cmd{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  text-decoration:none;
  color: var(--text);
  min-width: 0;
  transition: border-color .15s ease, background .15s ease;
}
@media (hover: hover) and (pointer: fine){
  .cmd{
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
  }
  .cmd:hover, .cmd:focus-visible{
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--hover);
    outline: none;
  }
}
.cmd:focus-visible{
  border-color: var(--accent);
  background: var(--hover);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.cmd:active{
  background: var(--press);
  border-color: var(--accent);
}

.cmd .icon{
  width: 34px; height:34px;
  border-radius: 8px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.cmd.discord .icon{ background:#5865f222; color: var(--discord); }
.cmd.guns .icon{ background:#ff4d4d22; color: var(--guns); }
.cmd.tiktok .icon{ background:#25f4ee22; color: var(--tiktok); }
.cmd.instagram .icon{ background:#e1306c22; color: var(--instagram); }

.cmd .label{
  display:flex; flex-direction:column; gap:1px;
  min-width: 0;
}
.cmd .slash{
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.cmd .title{
  font-weight:700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd .go{
  margin-left:auto;
  font-family: var(--mono);
  color: var(--muted);
  font-size: 13px;
}

/* --- music player --- */
.music-player{
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  padding: 10px 12px;
  border-radius: 14px;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-top: 14px;
  box-shadow: 0 6px 20px var(--shadow);
}
.music-info{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width: 0;
}
.music-title{
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 4px;
  flex-wrap: wrap;
  width: 100%;
}
.music-ctrl{
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding: 0;
  flex-shrink: 0;
}
.music-ctrl:hover, .music-ctrl:focus-visible{
  border-color: var(--accent);
  background: var(--hover);
  outline: none;
}
.music-ctrl.play{
  background: var(--hover);
  border-color: var(--line);
}
.music-ctrl .icon-pause{ display: none; }
.music-player:not(.paused) .music-ctrl .icon-play{ display: none; }
.music-player:not(.paused) .music-ctrl .icon-pause{ display: block; }
.volume-wrap{
  display:flex;
  align-items:center;
  gap: 2px;
  margin-left: 6px;
}
#volumeSlider{
  width: 72px;
  height: 4px;
  accent-color: var(--slider);
  cursor: pointer;
}
.bars{
  display:flex; align-items:flex-end; gap:2px; height:12px;
  flex-shrink: 0;
}
.bars span{
  width:2px; background: var(--accent); display:block;
  animation: bar 1s ease-in-out infinite;
}
.bars span:nth-child(2){ animation-delay: .2s; }
.bars span:nth-child(3){ animation-delay: .4s; }
.music-player.paused .bars span{ animation-play-state: paused; height:3px; }
@keyframes bar{
  0%,100%{ height:3px; }
  50%{ height:12px; }
}

@media (prefers-reduced-motion: reduce){
  .bars span{ animation: none; }
  .card{ transform: none !important; }
  .card-shine{ display: none; }
}

@media (max-width: 640px){
  body{
    align-items: flex-start;
    padding-top: 16px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }
  .identity{
    padding: 0 16px 16px;
  }
  .name{
    font-size: 20px;
  }
  .bio{
    font-size: 13px;
  }
  .cmd{
    padding: 11px 12px;
    gap: 10px;
  }
  .music-player{
    width: 100%;
  }
  .theme-toggle{
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
}

@media (max-width: 420px){
  .name{ font-size: 18px; }
  .avatar{ border-radius: 16px; }
  .cmd .icon{ width: 30px; height: 30px; }
  .volume-wrap .music-ctrl{ display: none; }
  #volumeSlider{ width: 64px; }
}

@media (max-height: 700px){
  body{ align-items: flex-start; }
}
