:root {
  --bg: #0b1220;
  --bg-elevated: rgba(255, 255, 255, 0.12);
  --bg-elevated-soft: rgba(255, 255, 255, 0.08);
  --accent: #fb7185;
  --accent-soft: rgba(251, 113, 133, 0.18);
  --accent-strong: #f43f5e;
  --text: #f8fafc;
  --text-muted: rgba(248, 250, 252, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.18);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition-fast: 180ms ease-out;

  --neon-good: #22c55e;
  --neon-bad: #fb7185;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 33% 5%, rgba(156, 39, 176, 0.28) 0%, transparent 55%),
    radial-gradient(circle at 70% 90%, rgba(14, 165, 233, 0.26) 0%, transparent 52%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(251, 113, 133, 0.65), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(34, 197, 94, 0.55), transparent 40%);
  opacity: 0.6;
  pointer-events: none;
  filter: blur(28px);
  animation: drift 18s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(6px, -12px);
  }
}

.app-root {
  min-height: 100vh;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 960px) {
  .app-root {
    padding: 32px 18px 40px;
  }
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 18px 22px 16px;
  border-radius: 28px;
  background: radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.35), transparent 55%),
    radial-gradient(circle at 85% 35%, rgba(236, 72, 153, 0.35), transparent 55%),
    rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.header-main h1 {
  margin: 0 0 4px;
  font-size: clamp(1.6rem, 1.4rem + 0.5vw, 1.9rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
}

.search-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-group label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.search-group input {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 8px 12px 9px;
  font-size: 0.9rem;
  outline: none;
  min-width: min(260px, 80vw);
  box-shadow: 0 0 0 1px transparent;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), transform var(--transition-fast);
}

.search-group input::placeholder {
  color: rgba(148, 163, 184, 0.9);
}

.search-group input:focus-visible {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(248, 250, 252, 0.14),
    0 0 0 3px rgba(245, 158, 11, 0.24);
  background: rgba(15, 23, 42, 0.98);
  transform: translateY(-1px);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 18px 18px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.panel-header h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.panel-header p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.panel-header-list {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.results-summary {
  font-size: 0.82rem;
}

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tab-group {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  padding: 2px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.browse-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.view-toggle-group {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  padding: 2px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.bars-scroll-wrapper {
  padding: 12px 4px 14px 4px;
  flex: 1;
  min-height: 260px;
  max-height: none;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.7) transparent;
}

.bars-scroll-wrapper::-webkit-scrollbar {
  width: 8px;
}

.bars-scroll-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.bars-scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

.bars-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(248, 250, 252, 0.9);
}

.bars-list {
  list-style: none;
  margin: 0;
  padding: 4px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bars-list--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.bar-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 18px;
  border-radius: 18px;
  background: var(--bg-elevated-soft);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease-out, box-shadow 180ms ease-out, border-color 180ms,
    background-color 180ms;
  backdrop-filter: blur(12px);
}

.bar-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 26px 55px rgba(0, 0, 0, 0.45);
  border-color: rgba(251, 113, 133, 0.55);
  background-color: rgba(11, 17, 32, 0.6);
}

.bar-card--grid {
  aspect-ratio: 4 / 5;
}

.bar-card--list {
  max-width: 420px;
  margin: 0 auto;
}

.bar-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 20% 0, #bfdbfe 0, #fee2e2 45%);
  border: 1px solid rgba(209, 213, 219, 0.9);
}

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

.bar-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  align-items: center;
  text-align: center;
}

.bar-rating-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(11, 17, 32, 0.75);
  color: #fefce8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 18px var(--overlay-glow, rgba(251, 113, 133, 0.6)),
    0 10px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: box-shadow 280ms ease;
  animation: pulse 4.8s ease-in-out infinite;
}

.bar-rating-overlay:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 24px var(--overlay-glow, rgba(251, 113, 133, 0.65)),
    0 14px 40px rgba(0, 0, 0, 0.45);
}

@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.bar-rating-overlay-number {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.bar-rating-overlay-label {
  font-size: 0.75rem;
  opacity: 0.9;
}

.bar-description {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.bar-title {
  margin: 4px 0 0;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.bar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.77rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(252, 165, 165, 0.4);
}

.rating-pill-strong {
  background: radial-gradient(circle at 0 0, #f97316, #fb7185);
  color: #fff7ed;
  border-color: rgba(248, 250, 252, 0.7);
}

.rating-pill-mild {
  background: radial-gradient(circle at 0 0, #93c5fd, #22c55e);
  color: #0f172a;
}

.bar-rating-number {
  font-weight: 600;
}

.bar-rating-label {
  opacity: 0.9;
}

.created-at {
  opacity: 0.7;
}

.btn-ghost {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 23, 31, 0.55);
  color: var(--text);
  font-size: 0.78rem;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.btn-ghost:focus-visible {
  outline: 2px solid rgba(251, 113, 133, 0.7);
  outline-offset: 2px;
}

.btn-toggle {
  border-radius: 999px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.btn-toggle--active {
  background: #f97316;
  color: #fffbeb;
  border-color: #f97316;
}

.app-footer {
  margin-top: 8px;
  font-size: 0.78rem;
  text-align: center;
  color: var(--text-muted);
  opacity: 0.85;
}

@media (max-width: 600px) {
  .app-header {
    border-radius: 22px;
    align-items: flex-start;
  }

  .search-group input {
    min-width: 0;
    width: 100%;
  }

  .bars-list--grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bar-card--grid {
    aspect-ratio: auto;
  }

  .bar-media {
    aspect-ratio: auto;
  }

  .bar-image {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}

/* Game mode styling */
.panel-game {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.game-area {
  display: flex;
  justify-content: center;
  padding: 12px;
}

.game-card {
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.game-image {
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.05);
}

.game-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
}

.game-info h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.game-hint {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(248, 250, 252, 0.76);
}

.game-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: stretch;
}

#guessInput {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

#guessInput:focus {
  border-color: rgba(251, 113, 133, 0.8);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.2);
}

.guess-feedback {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.75);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

