/* ─── Design Tokens ──────────────────────────────────────────────────── */
:root {
  --bg: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --accent-cyan: #00f5ff;
  --accent-green: #39ff14;
  --accent-pink: #ff006e;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --font-display: 'Orbitron', 'Bebas Neue', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ─── Base Reset ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
}

input {
  font-family: var(--font-body);
  font-size: 1rem;
  width: 100%;
}

/* ─── Utility ────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* ─── Tier Lane ──────────────────────────────────────────────────────── */
.tier-lane {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  min-height: 80px;
}

.tier-lane__label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  min-width: 56px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  border-radius: 4px;
  align-self: stretch;
}

.tier-lane__cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
}

/* ─── Drink Card ─────────────────────────────────────────────────────── */
.drink-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 80px;
}

.drink-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
}

.drink-card__name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  word-break: break-word;
}

/* ─── Autocomplete Dropdown ──────────────────────────────────────────── */
.autocomplete-dropdown {
  position: absolute;
  z-index: 100;
  background: #1a1a1a;
  border: 1px solid var(--accent-cyan);
  border-radius: 4px;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
}

.autocomplete-dropdown__item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text-primary);
}

.autocomplete-dropdown__item:hover,
.autocomplete-dropdown__item:focus {
  background: rgba(0, 245, 255, 0.1);
  outline: none;
}

/* ─── User Section ───────────────────────────────────────────────────── */
#user-section {
  max-width: 500px;
  margin: 2rem auto;
  padding: 0 1rem;
}

#user-section h2 {
  font-family: var(--font-display);
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.input-wrapper {
  position: relative;
  width: 100%;
  z-index: 1000;
}

#user-submit-btn,
#drink-submit-btn {
  position: relative;
  z-index: 1;
}

#user-name-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  box-sizing: border-box;
}

#user-autocomplete.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0d0d1a;
  border: 1px solid var(--accent-cyan);
  border-radius: 0 0 8px 8px;
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  margin: 0;
  padding: 0;
}

#user-autocomplete li {
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.9rem;
}

#user-autocomplete li:hover,
#user-autocomplete li.active {
  background: rgba(0, 245, 255, 0.15);
}

#user-submit-btn {
  margin-top: 0.75rem;
  padding: 0.6rem 1.5rem;
  background: transparent;
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-display);
  cursor: pointer;
  border-radius: 6px;
  transition: box-shadow 0.2s ease;
}

#user-submit-btn:hover {
  box-shadow: 0 0 12px var(--accent-cyan), 0 0 24px rgba(0, 245, 255, 0.3);
}

#current-user-display {
  margin-top: 0.75rem;
  color: var(--accent-green);
  font-weight: 600;
}

/* ─── Auth Overlay ───────────────────────────────────────────────────── */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent-cyan);
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1.5rem;
}

#auth-password-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#auth-password-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.3);
}

#auth-submit-btn {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

#auth-submit-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.5);
}

.auth-error {
  color: var(--accent-pink);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.75rem;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

.shake {
  animation: shake 0.4s ease;
}

/* ─── Drink Section ──────────────────────────────────────────────────── */
#drink-section {
  max-width: 500px;
  margin: 2rem auto;
  padding: 0 1rem;
}

#drink-section h2 {
  font-family: var(--font-display);
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

#drink-name-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#drink-name-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.3);
}

#drink-autocomplete.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0d0d1a;
  border: 1px solid var(--accent-cyan);
  border-radius: 0 0 8px 8px;
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  margin: 0;
  padding: 0;
}

#drink-autocomplete li {
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.9rem;
}

#drink-autocomplete li:hover,
#drink-autocomplete li.active {
  background: rgba(0, 245, 255, 0.15);
}

#drink-submit-btn {
  margin-top: 0.75rem;
  padding: 0.6rem 1.5rem;
  background: transparent;
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-display);
  cursor: pointer;
  border-radius: 6px;
  transition: box-shadow 0.2s ease;
}

#drink-submit-btn:hover {
  box-shadow: 0 0 12px var(--accent-cyan), 0 0 24px rgba(0, 245, 255, 0.3);
}

.dedup-prompt {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--accent-pink);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.dedup-prompt p {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

#dedup-yes-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 2px solid var(--accent-green);
  color: var(--accent-green);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s, color 0.2s;
}

#dedup-yes-btn:hover {
  background: var(--accent-green);
  color: #000;
}

#dedup-no-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 2px solid var(--text-secondary);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  margin-left: 0.5rem;
  transition: background 0.2s, color 0.2s;
}

#dedup-no-btn:hover {
  background: var(--text-secondary);
  color: #000;
}

#selected-drink-display {
  color: var(--accent-green);
  font-weight: 600;
  margin-top: 0.75rem;
}

/* ─── Image Picker Modal ─────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.modal-content {
  position: relative;
  z-index: 1;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  padding: 2rem;
  box-sizing: border-box;
}

.modal-title {
  font-family: var(--font-display);
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.image-option {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.image-option:hover {
  border-color: var(--accent-cyan);
}

.image-option img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #111;
}

.modal-footer p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.manual-url-row {
  display: flex;
  gap: 0.5rem;
}

#manual-image-url {
  flex: 1;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

#manual-url-submit-btn {
  padding: 0.6rem 1rem;
  background: transparent;
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

#manual-url-submit-btn:hover {
  background: var(--accent-cyan);
  color: #000;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.image-grid .no-results {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
  grid-column: 1 / -1;
}

/* ─── Ranking Section ────────────────────────────────────────────────── */
#ranking-section {
  max-width: 500px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.ranking-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.ranking-drink-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #111;
}

.ranking-header h2 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1.5rem;
}

.tier-badge {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  transition: color 0.3s;
}

.tier-s { color: #ffd700; }
.tier-a { color: var(--accent-green); }
.tier-b { color: var(--accent-cyan); }
.tier-c { color: #ff8c00; }
.tier-d { color: var(--accent-pink); }
.tier-f { color: #666; }

.score-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.score-field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.score-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent-cyan);
  min-width: 2ch;
  text-align: right;
}

input[type=range] {
  width: 100%;
  accent-color: var(--accent-cyan);
  height: 6px;
  cursor: pointer;
}

.average-display {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.average-display span {
  color: var(--text-primary);
  font-weight: 700;
}

#ranking-submit-btn {
  width: 100%;
  padding: 0.875rem;
  background: transparent;
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

#ranking-submit-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
}

/* ─── Tier Tabs ──────────────────────────────────────────────────────── */
.tier-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.tab-btn {
  padding: 0.5rem 1.5rem;
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* ─── Tier List Container & Lanes ────────────────────────────────────── */
.tier-list-container {
  padding: 0 1rem;
}

.tier-lane {
  display: flex;
  align-items: stretch;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  min-height: 60px;
  gap: 0;
}

.tier-label {
  width: 60px;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
}

.tier-lane-S .tier-label { background: linear-gradient(135deg, #ffd700, #ff8c00); }
.tier-lane-A .tier-label { background: linear-gradient(135deg, #39ff14, #00a300); }
.tier-lane-B .tier-label { background: linear-gradient(135deg, #00f5ff, #007acc); }
.tier-lane-C .tier-label { background: linear-gradient(135deg, #ff8c00, #cc4400); }
.tier-lane-D .tier-label { background: linear-gradient(135deg, #ff006e, #8b0057); }
.tier-lane-F .tier-label { background: linear-gradient(135deg, #555, #222); }

.tier-drinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  flex: 1;
  align-items: flex-start;
}

/* ─── Drink Cards ─────────────────────────────────────────────────────── */
.drink-card {
  width: 110px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
  display: block;
  padding: 0;
  min-width: 0;
  flex-direction: unset;
  align-items: unset;
  gap: 0;
}

.drink-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
}

.drink-card-img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
  background: #111;
}

.drink-card-info {
  padding: 0.4rem 0.5rem;
}

.drink-card-name {
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drink-card-scores {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-bottom: 0.1rem;
}

.drink-card-avg {
  font-size: 0.65rem;
  color: var(--accent-cyan);
}

.drink-card-count {
  font-size: 0.6rem;
  color: var(--text-secondary);
}

.drink-card.unranked {
  opacity: 0.7;
}

.rank-cta-btn {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.3rem 0.4rem;
  background: transparent;
  border: 1px solid var(--accent-pink);
  color: var(--accent-pink);
  font-size: 0.65rem;
  font-family: var(--font-display);
  cursor: pointer;
  border-radius: 4px;
}

.rank-cta-btn:hover {
  background: var(--accent-pink);
  color: #fff;
}

/* ─── Unranked Section ────────────────────────────────────────────────── */
#unranked-section {
  margin-top: 1.5rem;
  padding: 0 1rem;
}

#unranked-section h3 {
  font-family: var(--font-display);
  color: var(--text-secondary);
  font-size: 1rem;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

#unranked-drinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   === DESIGN POLISH ===
   Task 10110 — Dark Neon Aesthetic & Mobile Responsiveness
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Global Layout ──────────────────────────────────────────────────────── */
body {
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,245,255,0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(57,255,20,0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

#app h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
}

/* ─── Neon Glow Text Utilities ───────────────────────────────────────────── */
.neon-cyan {
  text-shadow: 0 0 8px rgba(0,245,255,0.8), 0 0 20px rgba(0,245,255,0.4);
}

.neon-green {
  text-shadow: 0 0 8px rgba(57,255,20,0.8), 0 0 20px rgba(57,255,20,0.4);
}

.neon-pink {
  text-shadow: 0 0 8px rgba(255,0,110,0.8), 0 0 20px rgba(255,0,110,0.4);
}

.tier-label {
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ─── Animated Tier Lane Borders ─────────────────────────────────────────── */
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

.tier-lane {
  position: relative;
}

.tier-lane::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  background-size: 200% 100%;
  animation: gradient-shift 3s ease infinite;
}

/* ─── Button Global Enhancement ──────────────────────────────────────────── */
button {
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.97);
}

/* ─── Input Focus Global Enhancement ─────────────────────────────────────── */
input:focus {
  outline: none;
}

input[type=text],
input[type=url] {
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* ─── Clickable Global Drink Cards ──────────────────────────────────────── */
.drink-card--clickable:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 245, 255, 0.2);
}

/* ─── Drink Detail Modal ─────────────────────────────────────────────────── */
.drink-detail-content {
  max-width: 560px;
  width: 100%;
}

.drink-detail-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.drink-detail-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #111;
  flex-shrink: 0;
}

.drink-detail-meta h2 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.drink-detail-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.drink-detail-stats .tier-badge {
  font-size: 1.4rem;
  line-height: 1;
}

.detail-avg {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.detail-avg strong {
  color: var(--text-primary);
}

.detail-count {
  color: var(--text-secondary);
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Rankings table */
.drink-detail-rankings {
  max-height: 400px;
  overflow-y: auto;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.detail-table thead th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  border-bottom: 1px solid rgba(0, 245, 255, 0.2);
}

.detail-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}

.detail-table tbody tr:last-child {
  border-bottom: none;
}

.detail-table tbody tr:hover {
  background: rgba(0, 245, 255, 0.05);
}

.detail-table td {
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.detail-name-cell {
  font-weight: 600;
  color: var(--text-primary);
}

.detail-table .tier-badge {
  font-size: 1rem;
  font-family: var(--font-display);
  font-weight: 900;
}

.detail-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-size: 0.9rem;
}

/* ─── Range Input Polish ─────────────────────────────────────────────────── */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,245,255,0.6);
  transition: transform 0.15s;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(0,245,255,0.6);
}

/* ─── Custom Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: var(--accent-cyan); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-green); }

/* ─── Selection ──────────────────────────────────────────────────────────── */
::selection { background: var(--accent-cyan); color: #000; }

/* ─── FadeIn Animation ───────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp 0.35s ease forwards;
}

/* ─── Glassmorphism Card Utility ─────────────────────────────────────────── */
.glass-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
}

/* ─── App Header ─────────────────────────────────────────────────────────── */
.app-header {
  text-align: center;
  padding: 2rem 0 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.app-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(0,245,255,0.5), 0 0 40px rgba(0,245,255,0.2);
}

/* ─── Img Fallback ───────────────────────────────────────────────────────── */
img {
  background: #111;
}

.image-search-fallback {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
}

.google-images-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.google-images-btn:hover {
  background: var(--accent-cyan);
  color: #000;
}

.fallback-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.fallback-hint strong {
  color: var(--text-primary);
}

/* ─── Mobile Responsive — 768px ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #app { padding: 1rem; }
  .tier-lane { flex-direction: column; }
  .tier-label { width: 100%; height: 44px; font-size: 1.5rem; min-width: unset; }
  .tier-drinks { padding: 0.5rem; }
  .drink-card { width: calc(50% - 0.25rem); }
  .image-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-content { padding: 1.25rem; }
  .ranking-header { flex-direction: column; text-align: center; }
  .tier-tabs { flex-wrap: wrap; }
}

/* ─── Mobile Responsive — 480px ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .drink-card { width: 100%; }
  .auth-card { padding: 1.5rem; }
  .app-title { font-size: 1.6rem; }
  input[type=text], input[type=password], input[type=url] { font-size: 16px; } /* prevent iOS zoom */
  .tab-btn { flex: 1; text-align: center; }
}
