.popup {
  font-family: var(--font-family--sans-serif);
  min-height: var(--height--body);
  max-width: var(--width--body);
  min-width: var(--width--body);
  user-select: none;
  padding: 0 4px;
  background: var(--color--chrome-bg);

  div.popup-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    height: 100%;
    width: 100%;
    gap: 2px;
    padding: 0 2px;
  }

  .container {
    flex: 1;
    height: 100%;
    align-items: center;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    gap: 2px;
    position: relative;
  }

  #marquee {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    min-width: var(--width--marquee);
    max-width: var(--width--marquee);

    .notification {
      height: 100%;
      width: var(--width--marquee);
      position: absolute;
      display: flex;
      align-items: center;
      top: 0;
      left: 0;
      background: var(--color--chrome-bg);
      color: #000;
      animation: marqueeSlideIn 2s ease forwards, notificationGlow 0.4s ease-out;
      padding-left: 2px;
      font-weight: 800;
      font-size: 13px;
      letter-spacing: -1px;
    }
  }

  .logo {
    position: relative;
    font-family: var(--font-family--display);
    font-weight: 900;
    font-size: 28px;
    letter-spacing: -2px;
    padding: 0 4px;
    color: #000;
    cursor: pointer;
    text-decoration: underline;

    .lite {
      position: absolute;
      font-size: 9px;
      top: 4px;
      right: -2px;
      letter-spacing: 0;
    }
  }
}

button {
  outline: none;
}

.btn-format {
  aspect-ratio: 1/1;
  width: 46px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.5px;
  position: relative;
  text-transform: lowercase;
  padding-top: 3px;

  .btn-format-label {
    transition: all 0.1s ease;
  }
}

.btn-semicolon {
  position: relative;
  aspect-ratio: 1/1;
  width: var(--height--keys);
  font-size: 16px;
  font-weight: 900;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgba(0, 0, 0, 0.7);

  span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  &::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 200%;
    background: red;
    transform: rotate(-45deg) translateX(50%);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  }

  &.selected {
    &::before {
      display: none;
    }
  }
}

.btn-spacebar {
  position: relative;
  width: var(--width--spacebar);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: -0.05rem;

  &::before {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 30%;
    border-radius: 4px;
    border: solid 1px rgba(0,0,0,0.2);
    background: var(--current-color) !important;
  }

  &::after {
    left: 50% !important;
    transform: translateX(-50%);
  }
}

.btn-key {
  position: relative;
  cursor: pointer;
  height: var(--height--keys);
  background: var(--background--07-mac);
  box-shadow: var(--box-shadow--07-mac);
  border: var(--border--07-mac);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.1s ease;
  border-radius: var(--border-radius--keyboard);
  
  @supports (corner-shape: squircle) {
    corner-shape: squircle;
    border-radius: var(--border-radius--keyboard-squircle);
  }
  &::after {
    content: attr(data-key); 
    position: absolute;
    top: 1px; 
    right: 4px;
    text-transform: uppercase;
    letter-spacing: -0.02rem;
    font-size: 8px;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.6);
  }

  &:hover {
    transform: scale(0.96);
  }
}

.flash-hover {
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

@keyframes marqueeSlideIn {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  10% {
    transform: translateY(0);
    opacity: 1;
  }
  95% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-20%);
    opacity: 0;
    display: none;
  }
}

@keyframes notificationGlow {
  0% {
    text-shadow: 0 0 0 rgba(255, 255, 0, 0);
  }
  50% {
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8), 0 0 20px rgba(255, 255, 0, 0.6);
  }
  100% {
    text-shadow: 0 0 0 rgba(255, 255, 0, 0);
  }
}

@keyframes spacebarPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.98);
  }
}