*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

::selection {
  background: transparent;
  color: inherit;
}

::-moz-selection {
  background: transparent;
  color: inherit;
}

img {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

:root {
  --bg: #000000;
  --window-bg: rgba(16, 16, 20, 0.55);
  --window-bg-hover: rgba(22, 22, 28, 0.7);
  --text-main: #f4f4f5;
  --text-sub: #71717a;
  --text-dim: #52525b;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --theme-accent: #407bf2;
  --theme-r: 64;
  --theme-g: 123;
  --theme-b: 242;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.enter-screen {
  position: fixed;
  inset: 0;
  background: #000000;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.enter-screen.entered {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.enter-box {
  padding: 12px 24px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), inset 1px 1px 1px rgba(255, 255, 255, 0.15);
}

.enter-text {
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.75);
  animation: pulseEnter 2.2s ease-in-out infinite alternate;
}

@keyframes pulseEnter {
  0% { opacity: 0.4; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

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

.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  padding: 36px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  margin-bottom: 2px;
}

.avatar-holder {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 255, 255, 0.03);
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-main);
  line-height: 1.1;
}
.user-name-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.user-name-link:hover {
  opacity: 0.85;
  transform: scale(1.03);
}

.user-name-link:active {
  transform: scale(0.97);
}


.window {
  position: relative;
  background: var(--window-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-radius: 20px;
  box-shadow: 
    0 16px 36px -10px rgba(0, 0, 0, 0.85),
    inset 1px 1px 1px 0 rgba(255, 255, 255, 0.12),
    inset -1px -1px 1px 0 rgba(255, 255, 255, 0.03);
  border: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, box-shadow 0.25s ease;
}

.music-window {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.music-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cover-box {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 1px 1px 1px rgba(255, 255, 255, 0.15);
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.2s ease;
}

.cover-box:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 255, 255, 0.08), inset 1px 1px 1px rgba(255, 255, 255, 0.25);
}

.cover-box:active {
  transform: scale(0.97);
}

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

.equalizer {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.music-window.playing .equalizer {
  opacity: 1;
}

.bar {
  width: 2.5px;
  background: #ffffff;
  border-radius: 9999px;
  height: 4px;
}

.music-window.playing .bar-1 { animation: eq 0.8s ease-in-out infinite alternate; }
.music-window.playing .bar-2 { animation: eq 0.6s ease-in-out infinite 0.2s alternate; }
.music-window.playing .bar-3 { animation: eq 0.9s ease-in-out infinite 0.4s alternate; }
.music-window.playing .bar-4 { animation: eq 0.7s ease-in-out infinite 0.1s alternate; }

@keyframes eq {
  0% { height: 4px; }
  100% { height: 16px; }
}

.track-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
  cursor: pointer;
}

.track-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.track-artist {
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.track-meta:hover .track-title {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

.track-meta:hover .track-artist {
  color: var(--text-main);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vol-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.vol-btn:hover {
  color: #ffffff;
}

.vol-icon {
  width: 15px;
  height: 15px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

.volume-slider::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
}

.play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
  transition: transform 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.play-btn:hover {
  background: #ffffff;
  transform: scale(1.06);
}

.play-btn:active {
  transform: scale(0.96);
}

.play-icon,
.pause-icon {
  width: 13px;
  height: 13px;
}

.pause-icon {
  display: none;
}

.music-window.playing .play-icon {
  display: none;
}

.music-window.playing .pause-icon {
  display: block;
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.timeline-bar {
  position: relative;
  width: 100%;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  cursor: pointer;
  padding: 6px 0;
  background-clip: content-box;
}

.timeline-hover {
  position: absolute;
  top: 6px;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.timeline-bar:hover .timeline-hover {
  opacity: 1;
}

.timeline-fill {
  position: absolute;
  top: 6px;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: #ffffff;
  border-radius: 9999px;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.timeline-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 18px rgba(255, 255, 255, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.timeline-bar:hover .timeline-thumb,
.timeline-bar:active .timeline-thumb {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.35);
}

.timeline-tooltip {
  position: absolute;
  bottom: 18px;
  left: 0%;
  transform: translateX(-50%);
  font-size: 0.64rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  background: rgba(18, 18, 22, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2px 6px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 1px 1px 1px rgba(255, 255, 255, 0.15);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 10;
}

.timeline-bar:hover .timeline-tooltip {
  opacity: 1;
}

.time-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-family: var(--font);
}

.glass-dock-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.glass-dock {
  width: 100%;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.glass-dock:hover {
  background: var(--window-bg-hover);
  box-shadow: 
    0 20px 42px -6px rgba(0, 0, 0, 0.92),
    inset 1px 1px 1px 0 rgba(255, 255, 255, 0.2),
    inset -1px -1px 1px 0 rgba(255, 255, 255, 0.04);
}

.dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.dock-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  padding: 2px 0;
  border-radius: 12px;
}

.dock-icon-box {
  width: 100%;
  max-width: 54px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.14), 0 2px 6px rgba(0, 0, 0, 0.25);
  color: #d4d4d8;
  transition: background 0.2s ease, transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, color 0.18s ease;
  border: none;
  will-change: transform;
}

.dock-svg {
  width: 20px;
  height: 20px;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease, color 0.18s ease;
  will-change: transform, filter;
}

.dock-item:hover .dock-icon-box {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: translateY(-2px) scale(1.07);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.5),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.35),
    0 0 14px rgba(255, 255, 255, 0.12);
}

.dock-item:hover .dock-svg {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.75));
  transform: scale(1.05);
}

.dock-item:active .dock-icon-box {
  transform: translateY(0) scale(0.96);
}

.dock-status-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  overflow: hidden;
  position: relative;
}

.dock-status-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: -0.01em;
  text-align: center;
  will-change: transform, opacity;
}

#discord-user-item .success-icon {
  display: none;
  color: #ffffff;
}

#discord-user-item.copied .default-icon {
  display: none;
}

#discord-user-item.copied .success-icon {
  display: block;
  animation: checkPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes checkPop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.contact-window {
  padding: 13px 16px;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
}

.contact-toggle {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.18s ease;
}

.contact-toggle:hover {
  color: #ffffff;
}

.toggle-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.22s ease;
}

.contact-window.expanded .toggle-icon {
  transform: rotate(180deg);
}

.contact-form {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, margin-top 0.22s ease;
}

.contact-window.expanded .contact-form {
  max-height: 800px;
  opacity: 1;
  margin-top: 12px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text-main);
  font-family: var(--font);
  font-size: 0.8rem;
  outline: none;
  transition: box-shadow 0.18s ease;
}

.form-row textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 180px;
}

.form-row input:focus,
.form-row textarea:focus {
  box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.25), 0 0 10px rgba(255, 255, 255, 0.05);
}

.hp-input {
  display: none !important;
}

.form-row input.input-error,
.form-row textarea.input-error {
  border: 1px solid #ef4444 !important;
  box-shadow: none !important;
  animation: errorOutlineOnce 1.2s ease-in-out forwards;
}

@keyframes errorOutlineOnce {
  0% {
    border-color: rgba(255, 255, 255, 0.08);
  }
  25%, 75% {
    border-color: #ef4444;
  }
  100% {
    border-color: rgba(255, 255, 255, 0.08);
  }
}

.hold-button {
  --hb-radius: 15px;
  --hb-bg: #27272a;
  --hb-fill: var(--theme-accent);
  --hb-text: #f5f5f5;
  --hb-fill-text: #ffffff;
  --hb-hold: 1500ms;
  --hb-release: 200ms;
  --hb-press: 1;
  --hb-wave: 6px;
  --hb-w: 0px;
  --hb-h: 0px;
  --hb-cycles: 1.3636;
  --hb-p: 0;
  --hb-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --hb-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);

  position: relative;
  display: inline-grid;
  place-items: center;
  isolation: isolate;
  margin: 0;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: var(--hb-radius);
  background: var(--hb-bg);
  color: var(--hb-text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  line-height: 1;
  box-shadow: var(--hb-shadow);
  cursor: pointer;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform 160ms var(--hb-ease-out),
    background-color 160ms ease,
    box-shadow var(--hb-release) var(--hb-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .hold-button:not(:disabled):hover {
    background: color-mix(in srgb, var(--hb-bg) 92%, #fff);
  }
}

.hold-button[data-phase='holding'][data-input='pointer'] {
  transform: scale(var(--hb-press));
}

.hold-button:focus-visible {
  outline: 2px solid var(--hb-fill);
  outline-offset: 3px;
}

.hold-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: auto;
}

.hold-button__pulse {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: var(--hb-radius);
  pointer-events: none;
  opacity: 0;
}

.hold-button[data-phase='done'] .hold-button__pulse {
  animation: hb-pulse 600ms var(--hb-ease-out) forwards;
}

@keyframes hb-pulse {
  from {
    opacity: 1;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--hb-fill) 55%, transparent);
  }
  to {
    opacity: 0;
    box-shadow: 0 0 0 14px color-mix(in srgb, var(--hb-fill) 0%, transparent);
  }
}

.hold-button__label {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
}

.hold-button__label > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    opacity 200ms ease,
    filter 200ms ease;
}

.hold-button__icon {
  display: inline-flex;
  flex: none;
}

.hold-button__icon > svg {
  display: block;
}

.hold-button__done {
  opacity: 0;
  filter: blur(2px);
}

.hold-button[data-phase='done'] .hold-button__idle {
  opacity: 0;
  filter: blur(2px);
}

.hold-button[data-phase='done'] .hold-button__done {
  opacity: 1;
  filter: blur(0);
}

.hold-button__clip {
  position: absolute;
  inset: 0;
  z-index: 3;
  clip-path: inset(0 round var(--hb-radius));
  pointer-events: none;
}

.hold-button__fill {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--hb-fill);
  color: var(--hb-fill-text);
  clip-path: inset(
    0 calc((1 - var(--hb-p)) * (100% + 0.75 * var(--hb-wave)) - var(--hb-p) * 0.25 * var(--hb-wave)) 0 0
  );
}

.hold-button[data-direction='up'] .hold-button__fill {
  clip-path: inset(
    calc((1 - var(--hb-p)) * (100% + 0.75 * var(--hb-wave)) - var(--hb-p) * 0.25 * var(--hb-wave)) 0 0 0
  );
}

.hold-button__crest {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--hb-fill);
  color: var(--hb-fill-text);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='200' viewBox='0 0 20 200' preserveAspectRatio='none'%3E%3Cpath d='M0 0H10C18 8 18 25.3 10 33.3S2 58.7 10 66.7S18 92 10 100S2 125.3 10 133.3S18 158.7 10 166.7S2 192 10 200H0Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='200' viewBox='0 0 20 200' preserveAspectRatio='none'%3E%3Cpath d='M0 0H10C18 8 18 25.3 10 33.3S2 58.7 10 66.7S18 92 10 100S2 125.3 10 133.3S18 158.7 10 166.7S2 192 10 200H0Z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: repeat-y;
  mask-repeat: repeat-y;
  -webkit-mask-size: var(--hb-wave) calc(var(--hb-h) * 2);
  mask-size: var(--hb-wave) calc(var(--hb-h) * 2);
  -webkit-mask-position-x: calc(-1 * var(--hb-wave) + var(--hb-p) * (var(--hb-w) + var(--hb-wave)));
  mask-position-x: calc(-1 * var(--hb-wave) + var(--hb-p) * (var(--hb-w) + var(--hb-wave)));
  -webkit-mask-position-y: calc(-1 * var(--hb-p) * var(--hb-cycles) * var(--hb-h));
  mask-position-y: calc(-1 * var(--hb-p) * var(--hb-cycles) * var(--hb-h));
}

.hold-button__label--fill {
  z-index: auto;
}

.theme-palette-wrapper {
  position: fixed;
  top: 20px;
  right: 20px;
  left: auto;
  z-index: 100;
}

.palette-btn {
  width: auto;
  height: auto;
  padding: 6px;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  color: var(--theme-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.palette-btn:hover {
  transform: scale(1.15) rotate(12deg);
}

.palette-btn:active {
  transform: scale(0.95);
}

.palette-icon {
  width: 20px;
  height: 20px;
  color: var(--theme-accent);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.palette-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  width: 204px;
  background: rgba(14, 14, 18, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9), inset 1px 1px 1px rgba(255, 255, 255, 0.12);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
  pointer-events: none;
}

.theme-palette-wrapper.open .palette-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.custom-picker-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.color-plane {
  position: relative;
  width: 100%;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  background: #ff0000;
  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.4);
}

.plane-white {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0));
  pointer-events: none;
}

.plane-black {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #000000, rgba(0, 0, 0, 0));
  pointer-events: none;
}

.plane-handle {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8), inset 0 0 2px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hue-slider-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 9999px;
  cursor: pointer;
  touch-action: none;
  background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.hue-handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.picker-bottom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.picker-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--theme-accent);
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  transition: background 0.1s ease;
}

.picker-hex-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 550;
  padding: 6px 8px;
  text-transform: lowercase;
  outline: none;
  transition: border-color 0.15s ease;
}

.picker-hex-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

.picker-reset-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.picker-reset-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: rotate(-30deg);
}

.picker-reset-btn:active {
  transform: rotate(-90deg) scale(0.92);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(18, 18, 22, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.85), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 9999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
