body {
  margin: 0;
  font-family: sans-serif;
  background: #eddfd0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100svh;
  cursor: url("static/pointer.cur"), auto;
}

.pixelated {
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* URL Display Bar */
#url-display {
  width: 430px;
  height: 40px;
  display: block;
  line-height: 40px;
  position: relative;
  text-align: left;
  font-family: monospace;
  font-size: 16px;
  font-weight: bold;
  color: #4a4a4a;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  padding: 0 15px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #f0efe1;
  outline: 2px solid #f4f4e9;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.25);
}

#url-display.visible {
  opacity: 1;
}

#url-display::after {
  content: "|";
  animation: blink 1s infinite;
  color: #e3732d;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* Smaller Screen Size */
@media screen and (max-width: 462px) {
  #url-display {
    max-width: 360px;
    font-size: 14px;
    padding: 0 12px;
  }
}

@media screen and (max-width: 415px) {
  #url-display {
    display: none;
  }
}

#links-container {
  display: flex;
  width: auto;
  margin: 0.5rem;
  min-width: 0;
  max-width: 100%;
}

/* 6 x 4 Grid */
#links-grid {
  margin: 0 auto;
  display: inline-grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 60px));
  gap: 10px;
  max-width: 410px;
  background: #f0efe1;
  outline: 2px solid #f4f4e9;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.25);

  padding: 10px;
  border-radius: 10px;
  min-width: 0;
}

/* 5 x 5 Grid */
@media (max-width: 462px) {
  #links-grid {
    max-width: 360px;
  }
}

/* 4 x 6 Grid */
@media (max-width: 415px) {
  #links-grid {
    max-width: 290px;
  }
}

/* 3 x 8 Grid */
@media (max-width: 322px) {
  #links-grid {
    max-width: 220px;
  }
}

/* 2 x 12 Grid */
@media (max-width: 252px) {
  #links-grid {
    max-width: 150px;
  }
}

/* 1 x 24 Grid */
@media (max-width: 198px) {
  #links-grid {
    max-width: 80px;
  }
}

.bubble:has(div) {
  background: linear-gradient(180deg, #fff 75%, #e6e6e6 100%);
  border-radius: 10px;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.2);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  width: 60px;
  height: 60px;
  text-decoration: none;
  color: #222;
  position: relative;
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, outline 0.1s ease-out;
  will-change: transform;

  /* Disable dragging and text selection */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* Pop Out */
.bubble:has(div):hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.225);
}

/* Press In */
.bubble:has(div):active {
  transform: scale(0.95) translateY(2px);
  box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.15);
}

/* Focus Outline */
.bubble:has(div):focus {
  outline: 5px solid #52c66f;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 4px 8px 2px rgba(82, 198, 111, 0.65),
    0 8px 16px 0 rgba(82, 198, 111, 0.45);
  cursor: url("static/pointer_blue.cur") 10 1, pointer !important;
}

/* Focus Outline Shine */
.bubble:has(div):focus::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 4px;
  width: 20px;
  height: 2px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.4) 60%, transparent 100%);
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
  filter: blur(2px);
}

/* Overlay Shine */
.bubble:has(div)::after {
  z-index: 1;
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(200deg, rgba(255, 251, 185, 0.25) 0%, transparent 30%, rgba(0, 0, 0, 0.025) 80%);
}

/* Inner Icon */
.bubble .icon {
  width: 45px;
  height: 45px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 5px 0 rgba(0, 0, 0, 0.1);
}

.bubble .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  transform: translateZ(0);
  backface-visibility: hidden;

  /* Disable image dragging */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* Empty Bubble */
.bubble:not(:has(div)) {
  width: 60px;
  height: 60px;
  position: relative;
  cursor: default;
  pointer-events: none;
}

.bubble:not(:has(div))::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 5px;
  box-shadow: inset 0 1px 5px 0 rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.01);
}