/* General Styles */
body {
  font-family: 'Pixelify Sans', sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #1a1a1a;
  color: #eaeaea;
  min-height: 100vh;
  box-sizing: border-box;
  overscroll-behavior: none;
  line-height: 1.6;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 20px;
  width: 100%;
  padding: 20px 10px;
  box-sizing: border-box;
}

header h1 {
  font-size: 32px;
  font-weight: bold;
  margin: 0 0 10px 0;
}

header p {
  font-size: 18px;
  color: #aaa;
}

/* Main Content */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 800px;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Footer */
footer {
  margin-top: 20px;
  font-size: 16px;
  color: #555;
  text-align: center;
  width: 100%;
  padding: 20px 0;
  background-color: #1a1a1a;
}

footer a {
  color: #ff007a;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Tabs Styles */
#tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 360px;
  padding: 0 10px;
  box-sizing: border-box;
}

.tab {
  font-family: 'Pixelify Sans', sans-serif;
  background: #333;
  color: #eaeaea;
  border: none;
  padding: 15px 25px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.tab.active {
  background: #ff007a;
}

.tab:hover {
  background: #555;
  transform: scale(1.05);
}

/* XY Pad Styles */
#xy-pad {
  width: 100%;
  max-width: 400px;
  height: 400px;
  background: #2a2a2a;
  border-radius: 16px;
  border: 2px solid #444;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: linear-gradient(#333 1px, transparent 1px),
    linear-gradient(90deg, #333 1px, transparent 1px);
  background-size: 20px 20px;
  margin-top: 10px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#marker {
  width: 24px;
  height: 24px;
  background: #ff007a;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  transition: all 0.2s ease-out;
  box-shadow: 0 0 15px rgba(255, 0, 122, 0.8);
  pointer-events: none;
}

/* Axis Labels */
.axis-label {
  position: absolute;
  font-size: 16px;
  pointer-events: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  transition: color 0.3s ease;
}

.x-left {
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.x-right {
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.y-top {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.y-bottom {
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
}

/* Result Section */
#result {
  text-align: center;
  background: #2a2a2a;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  color: #eaeaea;
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  min-height: 120px;
}

#result h2 {
  font-size: 24px;
  margin: 0 0 10px 0;
  color: #ffffff;
}

#result p {
  font-size: 16px;
  color: #aaa;
  margin: 5px 0;
  line-height: 1.4;
}

#drink-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  min-height: 2.8em;
}

/* Drinks Toggle */
#drinks-toggle {
  width: 100%;
  max-width: 360px;
}

.toggle-button {
  font-family: 'Pixelify Sans', sans-serif;
  width: 100%;
  background: #333;
  color: #eaeaea;
  border: none;
  padding: 15px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-bottom: 10px;
}

.toggle-button.active {
  background: #ff007a;
}

/* Tags Container */
#tags-container {
  display: none;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
  padding: 10px 0;
}

#tags-container.visible {
  display: flex;
}

.tag {
  font-family: 'Pixelify Sans', sans-serif;
  background: #333;
  color: #eaeaea;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.tag.active {
  background: #ff007a;
}

.tag:hover {
  background: #555;
  transform: scale(1.1);
}

/* Drink Anchors */
.drink-anchor {
  width: 12px;
  height: 12px;
  background: #ff007a;
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(255, 0, 122, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1;
}

/* Tooltip Styles */
.tooltip {
  position: fixed;
  background: #333;
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  font-size: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsiveness */
@media (max-width: 768px) {
  header h1 {
    font-size: 28px;
  }

  header p {
    font-size: 16px;
  }

  .tab {
    padding: 12px 20px;
    font-size: 16px;
  }

  #xy-pad {
    max-width: 360px;
    height: 360px;
  }

  #marker {
    width: 20px;
    height: 20px;
  }

  .axis-label {
    font-size: 14px;
  }

  #result h2 {
    font-size: 20px;
  }

  #result p {
    font-size: 14px;
  }

  .toggle-button {
    font-size: 16px;
  }

  .tag {
    font-size: 14px;
  }

  .tooltip {
    font-size: 14px;
    padding: 6px 12px;
  }
}