/* =============================================================
   Shisha Vault — dark lounge theme
   ============================================================= */

:root {
  --bg-0: #0b0707;
  --bg-1: #14100e;
  --bg-2: #1c1614;
  --bg-3: #261d1a;
  --line: #3a2c26;
  --text: #f3e9d8;
  --text-dim: #b9a892;
  --text-faint: #7a6a5a;
  --gold: #d4a14a;
  --gold-bright: #f0c060;
  --gold-deep: #8a6024;
  --amber: #e08538;
  --danger: #d8484a;
  --success: #6abf69;
  --shadow: 0 10px 30px rgba(0,0,0,0.55);
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212,161,74,0.10), transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(160,60,40,0.08), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(80,40,20,0.10), transparent 50%),
    var(--bg-0);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--gold); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--gold-bright); }

button { font-family: inherit; cursor: pointer; }

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

/* ============================== Header ============================== */

.site-header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0,0,0,0.85), rgba(0,0,0,0.55));
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}
.logo:hover { color: var(--text); }
.logo-mark {
  width: 40px; height: 40px;
  filter: drop-shadow(0 0 12px rgba(240,192,96,0.25));
  flex-shrink: 0;
}
.logo-text {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
}
.logo-text em {
  color: var(--gold);
  font-style: italic;
  font-weight: 500;
}

.main-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s ease;
}
.main-nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.main-nav a.active { color: var(--gold); background: rgba(212,161,74,0.10); }

.auth-corner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}
.auth-corner .username {
  color: var(--gold);
  font-weight: 600;
  font-size: 14px;
}

/* ============================== Global search bar ============================== */

.search-bar-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px 14px;
  position: relative;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px 4px 16px;
  transition: all .15s ease;
}
.search-bar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212,161,74,0.10);
}
.search-icon {
  color: var(--text-faint);
  flex-shrink: 0;
}
.search-bar:focus-within .search-icon { color: var(--gold); }
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 12px 0;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.search-bar input::placeholder { color: var(--text-faint); }
.search-clear {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 22px;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.search-clear:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.search-results {
  position: absolute;
  left: 22px;
  right: 22px;
  top: calc(100% - 4px);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 40;
}
.search-results[hidden] { display: none; }
.search-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.search-section:last-child { border-bottom: none; }
.search-section-head {
  padding: 8px 16px 4px;
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.search-result:hover,
.search-result.focused {
  background: rgba(212,161,74,0.08);
}
.search-result .thumb {
  width: 36px; height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-2);
  display: grid;
  place-items: center;
}
.search-result .thumb img,
.search-result .thumb svg { width: 100%; height: 100%; object-fit: cover; }
.search-result .info { flex: 1; min-width: 0; }
.search-result .title {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result .sub {
  color: var(--text-faint);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result .right {
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.search-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-faint);
}

/* ============================== Buttons ============================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--gold-deep); background: var(--bg-3); }

.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a0f06;
  border-color: var(--gold);
  font-weight: 700;
}
.btn-primary:hover { background: linear-gradient(180deg, var(--gold-bright), var(--gold-bright)); }

.btn-ghost { background: transparent; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-danger { color: var(--danger); border-color: rgba(216,72,74,0.3); }
.btn-danger:hover { background: rgba(216,72,74,0.10); }

/* ============================== Main / view ============================== */

main {
  flex: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 32px 22px 60px;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  letter-spacing: -0.005em;
  font-variation-settings: 'opsz' 80;
}
h1 { font-size: 38px; line-height: 1.05; font-weight: 800; font-variation-settings: 'opsz' 144; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 17px; line-height: 1.3; font-weight: 600; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 32px 0 16px;
  gap: 16px;
}
.section-head h2 {
  margin: 0;
  position: relative;
  padding-left: 14px;
}
.section-head h2::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 4px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  border-radius: 2px;
}
.section-head .meta {
  color: var(--text-faint);
  font-size: 13px;
}

/* ============================== Hero ============================== */

.hero {
  background:
    radial-gradient(ellipse at 70% 50%, rgba(224,133,56,0.18), transparent 60%),
    linear-gradient(135deg, rgba(212,161,74,0.10), rgba(0,0,0,0));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 36px;
  text-align: left;
  margin-bottom: 8px;
}
.hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 56px;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 144;
}
.hero h1 em {
  color: var(--gold);
  font-style: italic;
  font-weight: 500;
}
.hero p {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 620px;
  margin: 0 0 22px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================== Cards & grids ============================== */

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  transition: all .15s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card:hover {
  border-color: var(--gold-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-clickable { cursor: pointer; }

/* ============================== Image thumbnails ============================== */

.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-wrap .strength-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  color: var(--gold-bright);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  border: 1px solid rgba(212,161,74,0.3);
}

.flavor-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.flavor-card .name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.flavor-card .brand {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.flavor-card .stars-line {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}
.flavor-card .review-count {
  color: var(--text-faint);
  font-size: 12px;
}

/* Brand cards */
.brand-card .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.brand-card .country {
  color: var(--text-faint);
  font-size: 12px;
}
.brand-card .blurb {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.4;
}
.brand-card .stat {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 10px;
  color: var(--text-faint);
  font-size: 12px;
  flex-wrap: wrap;
}
.brand-card .stat strong { color: var(--gold); font-weight: 600; }

.brand-thumb {
  width: 100%;
  aspect-ratio: 2 / 1;
  display: grid;
  place-items: center;
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.brand-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ============================== Stars ============================== */

.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 1px;
}
.stars .empty { color: var(--text-faint); }
.stars-large { font-size: 22px; }

.star-input {
  display: inline-flex;
  gap: 4px;
  font-size: 26px;
  cursor: pointer;
}
.star-input span {
  color: var(--text-faint);
  transition: color .1s ease;
}
.star-input span.active { color: var(--gold); }

/* ============================== Multi-dim rating bars ============================== */

.rating-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.rating-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 32px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.rating-bar-row .lbl {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 600;
}
.rating-bar-row .bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}
.rating-bar-row .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  border-radius: 3px;
  transition: width .25s ease;
}
.rating-bar-row .fill.strength {
  background: linear-gradient(90deg, #6abf69 0%, #d4a14a 50%, #d8484a 100%);
}
.rating-bar-row .fill.cloud {
  background: linear-gradient(90deg, #4a6a8a, #b9a892);
}
.rating-bar-row .val {
  color: var(--gold);
  font-weight: 700;
  text-align: right;
}

/* Compact bar set used inside review entries */
.review .rating-bars { max-width: 320px; margin-top: 8px; }
.review .rating-bar-row { grid-template-columns: 70px 1fr 28px; font-size: 12px; }

/* ============================== Tags/chips ============================== */

.chip {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(212,161,74,0.10);
  color: var(--gold);
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(212,161,74,0.25);
}
.chip-muted {
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  border-color: var(--line);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================== Filters bar ============================== */

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 20px;
  align-items: center;
}
.filters input[type="search"],
.filters select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
}
.filters input[type="search"] { min-width: 240px; flex: 1; }
.filters input[type="search"]:focus,
.filters select:focus {
  outline: none;
  border-color: var(--gold-deep);
}
.filters .label {
  color: var(--text-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================== Flavor / brand detail ============================== */

.flavor-detail {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}
.flavor-detail .main-col { min-width: 0; }
.flavor-detail .side-col {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
}
@media (max-width: 800px) {
  .flavor-detail { grid-template-columns: 1fr; }
}

/* Flavor / brand header with hero image */
.detail-header {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  align-items: start;
}
@media (max-width: 720px) {
  .detail-header { grid-template-columns: 1fr; }
}
.detail-header .hero-thumb {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.detail-header .hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-header .info .brand-link {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}
.detail-header .info h1 {
  font-size: 36px;
  margin: 4px 0 10px;
  line-height: 1.1;
}
.summary-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.big-rating {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--gold);
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.02em;
}
.big-rating small {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 14px;
}

.review {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.review .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.review .author {
  color: var(--gold);
  font-weight: 600;
}
.review .date {
  color: var(--text-faint);
  font-size: 12px;
}
.review .text { color: var(--text-dim); margin-bottom: 8px; }

/* ============================== Forms ============================== */

.review-form,
.mix-form {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.review-form h3, .mix-form h3 { margin-top: 0; }

.review-form textarea,
.mix-form input,
.mix-form textarea,
.mix-form select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  margin-top: 6px;
}
.review-form textarea { min-height: 90px; }
.review-form textarea:focus,
.mix-form input:focus,
.mix-form textarea:focus,
.mix-form select:focus {
  outline: none;
  border-color: var(--gold-deep);
}
.review-form label, .mix-form label {
  display: block;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 12px;
  font-weight: 500;
}
.review-form .actions, .mix-form .actions {
  display: flex; gap: 10px; align-items: center;
  margin-top: 8px;
}

/* Multi-rating inputs in review form */
.rating-inputs {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.rating-input-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 14px;
}
.rating-input-row .lbl {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
}
.rating-input-row .lbl small {
  display: block;
  color: var(--text-faint);
  font-weight: 400;
  font-size: 11px;
  margin-top: 2px;
}
.rating-input-row .star-input { font-size: 24px; }

.banner-info {
  background: rgba(212,161,74,0.08);
  border: 1px solid rgba(212,161,74,0.25);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.banner-info a { color: var(--gold-bright); }

/* ============================== Mix builder ============================== */

.mix-row {
  display: grid;
  grid-template-columns: 1fr 110px 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.mix-row select { margin: 0; }
.mix-row input[type="number"] { margin: 0; text-align: right; }
.mix-row .remove-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--danger);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
}
.mix-row .remove-btn:hover { background: rgba(216,72,74,0.10); }

.pct-bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  margin-top: 14px;
  border: 1px solid var(--line);
}
.pct-bar .seg {
  height: 100%;
  border-right: 1px solid var(--bg-1);
}
.pct-bar .seg:last-child { border-right: 0; }

.mix-card .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mix-card .components {
  color: var(--text-dim);
  font-size: 14px;
  margin: 6px 0;
}
.mix-card .components strong { color: var(--gold); }
.mix-card .notes { color: var(--text-dim); font-size: 14px; font-style: italic; }
.mix-card .footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-faint);
}
.mix-card .like-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.mix-card .like-btn.liked { color: var(--gold); border-color: var(--gold-deep); background: rgba(212,161,74,0.08); }

/* ============================== Modal ============================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 380px;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 10px; right: 14px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 24px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  background: transparent;
  border: none;
  color: var(--text-faint);
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.auth-form label {
  display: block;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-form input {
  display: block;
  width: 100%;
  margin-top: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
}
.auth-form input:focus { outline: none; border-color: var(--gold-deep); }
.auth-form button[type="submit"] { width: 100%; justify-content: center; margin-top: 8px; }
.auth-error { color: var(--danger); font-size: 13px; margin: 0 0 8px; }
.auth-hint { color: var(--text-faint); font-size: 12px; margin: 12px 0 0; text-align: center; }

/* ============================== Profile ============================== */

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-bright), var(--gold-deep));
  display: grid; place-items: center;
  font-size: 26px;
  font-weight: 700;
  color: #1a0f06;
}
.profile-stats {
  display: flex;
  gap: 26px;
  margin-left: auto;
}
.profile-stats .stat {
  text-align: center;
}
.profile-stats .stat .num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
}
.profile-stats .stat .lbl {
  color: var(--text-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================== Misc ============================== */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-faint);
}
.empty-state h3 { color: var(--text-dim); }

.breadcrumb {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--gold); }

/* ============================== Footer ============================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 22px 32px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  background: rgba(0,0,0,0.3);
}
.site-footer p { margin: 4px 0; }
.site-footer .fine-print { font-size: 12px; color: var(--text-faint); opacity: 0.7; }

/* ============================== Tier lists ============================== */

.tier-list-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: all .15s ease;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
}
.tier-list-card:hover {
  border-color: var(--gold-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--text);
}
.tier-list-card .icon {
  font-size: 32px;
  line-height: 1;
}
.tier-list-card h3 { margin: 6px 0 0; font-size: 17px; }
.tier-list-card .desc { color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.tier-list-card .count {
  margin-top: auto;
  padding-top: 10px;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.tier-row {
  display: grid;
  grid-template-columns: 60px 90px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all .15s ease;
}
.tier-row:hover {
  border-color: var(--gold-deep);
  background: var(--bg-2);
  color: var(--text);
}
.tier-row .rank {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-faint);
  text-align: center;
}
.tier-row.gold .rank { color: var(--gold-bright); font-size: 30px; }
.tier-row.silver .rank { color: #c0c0c0; }
.tier-row.bronze .rank { color: #cd7f32; }
.tier-row .thumb {
  width: 90px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 6px;
}
.tier-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tier-row .info { min-width: 0; }
.tier-row .info .brand {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.tier-row .info .name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tier-row .info .meta { color: var(--text-faint); font-size: 12px; margin-top: 2px; }
.tier-row .right { text-align: right; white-space: nowrap; }
.tier-row .right .big { font-size: 20px; font-weight: 800; color: var(--gold); }
.tier-row .right .small { color: var(--text-faint); font-size: 12px; }
@media (max-width: 600px) {
  .tier-row { grid-template-columns: 50px 70px 1fr; }
  .tier-row .right { display: none; }
}

.trending-section {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(212,161,74,0.06), rgba(0,0,0,0));
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}
.trending-section .pill {
  display: inline-block;
  padding: 2px 10px;
  background: var(--gold);
  color: #1a0f06;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 6px;
}

.skill-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid;
}
.skill-beginner    { color: #7ec8a8; border-color: rgba(126,200,168,0.4); background: rgba(126,200,168,0.08); }
.skill-intermediate{ color: #d4a14a; border-color: rgba(212,161,74,0.4); background: rgba(212,161,74,0.08); }
.skill-advanced    { color: #e08538; border-color: rgba(224,133,56,0.4); background: rgba(224,133,56,0.08); }
.skill-expert      { color: #e04848; border-color: rgba(224,72,72,0.4); background: rgba(224,72,72,0.08); }

.skill-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.skill-edit select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
}
.skill-edit select:focus { outline: none; border-color: var(--gold-deep); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}
.icon-btn:hover { border-color: var(--gold-deep); color: var(--text); }
.icon-btn.active {
  color: var(--gold);
  border-color: var(--gold-deep);
  background: rgba(212,161,74,0.08);
}
.icon-btn .heart::before { content: '♡'; font-size: 16px; }
.icon-btn.active .heart::before { content: '♥'; }
.icon-btn .bookmark::before { content: '☆'; font-size: 16px; }
.icon-btn.active .bookmark::before { content: '★'; }

.fav-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ============================== Responsive ============================== */

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .main-nav { order: 3; width: 100%; justify-content: space-around; }
  .main-nav a { padding: 6px 10px; font-size: 13px; }
  .hero { padding: 32px 22px; }
  .hero h1 { font-size: 32px; }
  .detail-header .info h1 { font-size: 28px; }
  .profile-header { flex-wrap: wrap; }
  .profile-stats { margin-left: 0; width: 100%; justify-content: space-around; }
  .rating-input-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ============================== Photo controls overlay ============================== */

.hero-thumb-wrap {
  position: relative;
}
.hero-thumb-wrap .photo-controls {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.photo-controls .icon-btn {
  font-size: 12px;
  padding: 5px 10px;
}

/* ============================== Add-flavor modal (large) ============================== */

.modal.modal-lg {
  max-width: 520px;
}
.modal-lg label {
  display: block;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
  font-weight: 500;
}
.modal-lg input[type="text"],
.modal-lg input[type="file"],
.modal-lg select {
  display: block;
  width: 100%;
  margin-top: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
}
.modal-lg input[type="file"] { padding: 6px; }
.modal-lg input:focus, .modal-lg select:focus {
  outline: none;
  border-color: var(--gold-deep);
}

/* ============================== Floating Action Button ============================== */

.fab-wrap {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 45;
}
.fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #1a0f06;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(212,161,74,0.45), 0 2px 8px rgba(0,0,0,0.5);
  transition: transform .2s ease, box-shadow .2s ease;
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(212,161,74,0.6), 0 2px 8px rgba(0,0,0,0.5);
}
.fab.open {
  transform: rotate(45deg);
}
.fab-menu {
  position: absolute;
  bottom: 72px;
  right: 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fab-pop .15s ease-out;
}
.fab-menu[hidden] { display: none; }
@keyframes fab-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.fab-item:hover {
  background: rgba(212,161,74,0.10);
  color: var(--gold);
}
.fab-icon { font-size: 18px; }

@media (max-width: 600px) {
  .fab-wrap { bottom: 18px; right: 18px; }
  .fab { width: 52px; height: 52px; font-size: 26px; }
}

/* ============================== Inline SVG icons ============================== */

.icn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -2px;
  width: 1em; height: 1em;
}
.icn svg { width: 100%; height: 100%; display: block; }
h2 .icn { color: var(--gold); margin-right: 4px; }

/* FAB icon size */
.fab-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.fab-icon svg { width: 100%; height: 100%; }
.fab > span { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; }
.fab > span svg { width: 100%; height: 100%; stroke: currentColor; fill: none; }

/* ============================== Hero kicker ============================== */

.hero .kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 12px;
}
.hero p {
  font-size: 18px;
  line-height: 1.55;
}

/* ============================== Quick Actions row ============================== */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 28px 0 36px;
}
@media (max-width: 880px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .quick-actions { grid-template-columns: 1fr; }
}

.qa-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .2s ease;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.qa-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(212,161,74,0.10), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.qa-card:hover {
  border-color: var(--gold-deep);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: var(--text);
}
.qa-card:hover::after { opacity: 1; }
.qa-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212,161,74,0.20), rgba(212,161,74,0.05));
  border: 1px solid rgba(212,161,74,0.25);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  margin-bottom: 8px;
}
.qa-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qa-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
}
.qa-desc {
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.45;
}

/* ============================== Section heads polish ============================== */

.section-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Tier list cards: use Fraunces for titles */
.tier-list-card h3 { font-family: 'Fraunces', Georgia, serif; font-size: 18px; font-weight: 700; }

/* Flavor card name: keep sans for readability */
.flavor-card .name { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }

/* Trending pill: use plain styled pill instead of emoji */
.trending-section .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Improve overall section spacing */
.section-head { margin: 40px 0 18px; }
.hero { margin-bottom: 24px; padding: 56px 40px 50px; }

/* Slightly tighter card grid for visual rhythm */
.grid { gap: 16px; }

/* Buttons get the new font feel too */
.btn { font-family: 'Inter', sans-serif; letter-spacing: 0; }
.btn-primary { letter-spacing: 0; }

/* ============================== Owner badge ============================== */

.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #1a0f06;
  background: linear-gradient(135deg, #fce28b, #f0c060 40%, #d4a14a 70%, #8a6024);
  border: 1px solid #f0c060;
  box-shadow: 0 0 0 1px rgba(240,192,96,0.3), 0 4px 14px rgba(212,161,74,0.35);
  position: relative;
  overflow: hidden;
}
.owner-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: owner-shimmer 3.5s ease-in-out infinite;
}
.owner-badge .icn { width: 14px; height: 14px; color: #1a0f06; }
@keyframes owner-shimmer {
  0%, 60% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Inline crown next to username (header + reviews) */
.owner-mark, .owner-mark-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  vertical-align: -2px;
}
.owner-mark { width: 16px; height: 16px; margin-right: 2px; }
.owner-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 0 4px rgba(240,192,96,0.6)); }
.owner-mark-sm { width: 13px; height: 13px; margin-right: 4px; }
.owner-mark-sm svg { width: 100%; height: 100%; filter: drop-shadow(0 0 3px rgba(240,192,96,0.5)); }

/* ============================== Live indicator pill ============================== */

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--success);
  background: rgba(106,191,105,0.1);
  border: 1px solid rgba(106,191,105,0.35);
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  vertical-align: middle;
  margin-left: 8px;
}
h2 .live-pill { font-size: 10px; padding: 2px 8px; }
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(106,191,105,0.8);
  animation: live-pulse 1.8s infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(106,191,105,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(106,191,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(106,191,105,0); }
}

/* ============================== Mobile hamburger ============================== */

.nav-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  cursor: pointer;
  padding: 0;
}
.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .2s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-hamburger { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 22px;
    flex-direction: column;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    gap: 2px;
    box-shadow: var(--shadow);
    min-width: 200px;
    z-index: 35;
  }
  .main-nav.open { display: flex; }
  .main-nav a { width: 100%; }
}

/* ============================== Review actions (helpful / edit / delete) ============================== */

.review-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.helpful-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}
.helpful-btn:hover {
  border-color: var(--gold-deep);
  color: var(--text);
}
.helpful-btn.voted {
  color: var(--gold-bright);
  border-color: var(--gold-deep);
  background: rgba(212,161,74,0.08);
}
.helpful-btn .icn { width: 12px; height: 12px; }

.link-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  font-family: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color .15s ease, color .15s ease;
}
.link-btn:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}
.link-btn.link-danger { color: var(--danger); }
.link-btn.link-danger:hover { color: var(--danger); text-decoration-color: var(--danger); }

/* ============================== Compare table ============================== */

.compare-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.compare-table th, .compare-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compare-table thead th {
  background: var(--bg-2);
  border-bottom: 2px solid var(--line);
  vertical-align: bottom;
}
.compare-table tbody th {
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  width: 130px;
  background: rgba(0,0,0,0.2);
}
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: none; }

.cmp-thumb {
  width: 100%;
  max-width: 140px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.cmp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cmp-brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 600;
}
.cmp-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
  line-height: 1.2;
}
.cmp-name a { color: var(--text); }
.cmp-remove { margin-top: 8px; padding-left: 0; }

.cmp-rating {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
}
.cmp-meta {
  color: var(--text-faint);
  font-size: 11px;
  margin-top: 2px;
}

.cmp-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  max-width: 140px;
}
.cmp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  border-radius: 3px;
}
.cmp-bar-val {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

/* ============================== Stats page ============================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
}
.stat-card .stat-num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-card .stat-lbl {
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.leader-list {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px 12px 36px;
  margin: 0 0 8px;
  list-style: decimal;
}
.leader-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
}
.leader-list li:last-child { border-bottom: none; }
.leader-list li a { color: var(--text); font-weight: 600; }
.leader-list li .meta { color: var(--text-faint); font-size: 13px; }

/* ============================== Misc small fix ============================== */

.review { padding-bottom: 14px; }

/* ============================== Redesigned profile ============================== */

.profile-page {
  --profile-theme: var(--gold);
  margin: -32px -22px 0;
  padding: 0 22px 24px;
}
.profile-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 1;
  max-height: 280px;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  margin-bottom: 0;
}
.profile-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-banner-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
    var(--profile-theme) 0%,
    color-mix(in srgb, var(--profile-theme) 50%, var(--bg-1)) 50%,
    var(--bg-1) 100%);
}
.profile-banner-fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.10), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(0,0,0,0.30), transparent 50%);
}
.profile-edit-btn {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 2;
}
.profile-identity {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  margin-top: -56px;
  padding-left: 14px;
  position: relative;
  z-index: 1;
}
@media (max-width: 600px) {
  .profile-identity { flex-direction: column; align-items: center; text-align: center; gap: 12px; padding-left: 0; margin-top: -48px; }
}
.avatar-xl {
  width: 120px; height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--bg-0);
  background: linear-gradient(135deg, var(--profile-theme), var(--bg-2));
  display: grid;
  place-items: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 50px;
  font-weight: 800;
  color: #1a0f06;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.profile-name-block {
  flex: 1;
  min-width: 0;
  padding-bottom: 14px;
}
.profile-name-block h1 { font-size: 32px; line-height: 1; }
.profile-bio {
  margin: 8px 0 6px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
  max-width: 600px;
}
.profile-bio-empty { font-style: italic; color: var(--text-faint); }
.profile-meta {
  color: var(--text-faint);
  font-size: 13px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .profile-stats-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .profile-stats-row { grid-template-columns: repeat(2, 1fr); }
}
.profile-stats-row .stat {
  text-align: center;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
}
.profile-stats-row .stat .num {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--profile-theme);
  line-height: 1;
}
.profile-stats-row .stat .lbl {
  display: block;
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* ============================== Achievements ============================== */

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.achievement {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
  position: relative;
  transition: all .2s ease;
}
.achievement.earned {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-color: rgba(212,161,74,0.35);
  box-shadow: 0 4px 16px rgba(212,161,74,0.10);
}
.achievement.earned:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.achievement.locked {
  opacity: 0.45;
  filter: grayscale(70%);
}
.achievement .ach-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 6px;
}
.achievement.earned .ach-icon {
  text-shadow: 0 0 12px rgba(240,192,96,0.4);
}
.achievement .ach-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.achievement .ach-desc {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.3;
}

/* ============================== Activity feed ============================== */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--line);
  margin-left: 14px;
  padding: 4px 0;
}
.activity-item {
  display: flex;
  gap: 14px;
  padding: 12px 0 12px 22px;
  position: relative;
}
.activity-item .ai-icon {
  position: absolute;
  left: -15px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--gold);
}
.activity-item .ai-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.activity-item .ai-body { flex: 1; min-width: 0; }
.activity-item .ai-line {
  font-size: 14px;
  color: var(--text);
}
.activity-item .ai-line a { font-weight: 600; }
.activity-item .ai-line .stars { font-size: 12px; margin-left: 8px; vertical-align: 1px; }
.activity-item .ai-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ============================== Edit profile theme swatches ============================== */

.theme-swatch {
  transition: transform .15s ease, border-color .15s ease;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.selected { transform: scale(1.1); }

/* Apply theme color through profile sections */
.profile-page .stat .num { color: var(--profile-theme); }
.profile-page h1 { color: var(--text); }

/* ============================== Copyright line ============================== */
.site-footer .copyright {
  color: var(--text-dim);
  font-size: 13px;
  margin: 8px 0 4px;
}
.site-footer .copyright a {
  color: var(--gold);
  font-weight: 600;
}
.site-footer .copyright a:hover { color: var(--gold-bright); }

/* ============================== Age gate ============================== */

.age-gate {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: age-gate-fade 0.3s ease-out;
}
.age-gate[hidden] { display: none; }
@keyframes age-gate-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.age-gate-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  padding: 36px 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow), 0 0 60px rgba(212,161,74,0.15);
}
.age-gate-card h1 { font-size: 28px; }

/* ============================== Toasts ============================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}
.toast {
  pointer-events: auto;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 240px;
  max-width: 360px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  animation: toast-slide-in 0.3s ease-out forwards;
  cursor: pointer;
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-warn    { border-left-color: var(--amber); }
.toast .toast-icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  background: var(--gold);
  color: #1a0f06;
}
.toast.toast-success .toast-icon { background: var(--success); }
.toast.toast-error   .toast-icon { background: var(--danger); color: #fff; }
.toast.toast-warn    .toast-icon { background: var(--amber); }
.toast.fade-out { animation: toast-fade-out 0.25s ease-in forwards; }
@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-fade-out {
  to { opacity: 0; transform: translateX(20px); }
}

/* ============================== Keyboard help ============================== */

#kbd-help-modal table { border-collapse: collapse; }
#kbd-help-modal td { padding: 8px 0; font-size: 14px; }
#kbd-help-modal td:first-child { width: 90px; }
kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  min-width: 28px;
  text-align: center;
}

/* Page transition: subtle fade-in on every route change */
#view {
  animation: view-fade 0.18s ease-out;
}
@keyframes view-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Focus visible — accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* Clickable chips */
.chip-link {
  cursor: pointer;
  transition: all .12s ease;
}
.chip-link:hover {
  background: rgba(212,161,74,0.20);
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* Better empty state */
.empty-state {
  background: var(--bg-1);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin: 12px 0;
}
.empty-state h3 { font-family: 'Fraunces', Georgia, serif; }
.empty-illustration {
  width: 60px; height: 60px;
  margin: 0 auto 12px;
  opacity: 0.45;
}
.empty-illustration svg { width: 100%; height: 100%; stroke: var(--text-faint); fill: none; stroke-width: 1.5; }

/* Animated rating bars on first paint */
.rating-bar-row .fill {
  animation: bar-grow 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left;
}
@keyframes bar-grow {
  from { width: 0 !important; }
}


/* ============================== Flavor of the Day ============================== */

.fotd-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid rgba(212,161,74,0.4);
  border-radius: var(--radius);
  padding: 22px;
  margin: 28px 0 36px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: all .2s ease;
  box-shadow: 0 6px 30px rgba(212,161,74,0.10);
}
.fotd-card::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(212,161,74,0.18), transparent 70%);
  pointer-events: none;
}
.fotd-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(212,161,74,0.20);
  color: var(--text);
}
.fotd-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.fotd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fotd-body { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.fotd-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 700;
}
.fotd-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.fotd-brand {
  color: var(--text-faint);
  font-size: 13px;
}
.fotd-rating {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
  font-size: 14px;
}
@media (max-width: 600px) {
  .fotd-card { grid-template-columns: 1fr; }
  .fotd-thumb { max-width: 200px; }
  .fotd-name { font-size: 26px; }
}

/* Footer links */
.site-footer .footer-links {
  margin: 4px 0 8px;
  font-size: 13px;
}
.site-footer .footer-links a {
  color: var(--text-dim);
  margin: 0 6px;
}
.site-footer .footer-links a:hover { color: var(--gold); }

/* About page details/summary */
details.card summary {
  list-style: none;
  position: relative;
  padding-right: 24px;
}
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after {
  content: '+';
  position: absolute;
  right: 0;
  color: var(--gold);
  font-size: 20px;
  font-weight: 700;
  transition: transform .2s;
}
details.card[open] summary::after { content: '−'; }

/* ============================== Light theme override ============================== */

html[data-theme="light"] {
  --bg-0: #faf6ee;
  --bg-1: #fff8e8;
  --bg-2: #fff2da;
  --bg-3: #ffe9c2;
  --line: #e2d4b0;
  --text: #2a1f12;
  --text-dim: #5a4a36;
  --text-faint: #8a7a60;
  --gold: #a47820;
  --gold-bright: #d4a14a;
  --gold-deep: #5a4216;
  --shadow: 0 6px 20px rgba(120,80,30,0.20);
}
html[data-theme="light"] body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212,161,74,0.20), transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(180,100,40,0.10), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(80,40,20,0.05), transparent 50%),
    var(--bg-0);
}
html[data-theme="light"] .site-header {
  background: linear-gradient(180deg, rgba(255,248,232,0.95), rgba(255,248,232,0.75));
}
html[data-theme="light"] .review-form,
html[data-theme="light"] .mix-form,
html[data-theme="light"] .filters,
html[data-theme="light"] .card,
html[data-theme="light"] .qa-card,
html[data-theme="light"] .modal,
html[data-theme="light"] .review {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

/* ============================== Theme toggle button ============================== */

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  transition: all .15s ease;
  margin-right: 4px;
}
.theme-toggle:hover {
  border-color: var(--gold);
  background: rgba(212,161,74,0.08);
}
.theme-toggle .icn { width: 14px; height: 14px; }

/* ============================== Print styles ============================== */

@media print {
  .site-header, .site-footer, .fab-wrap, .toast-container,
  .modal-backdrop, .age-gate, .nav-hamburger, .auth-corner,
  .review-form, .mix-form, .photo-controls, .review-actions,
  .like-btn, .save-btn, .icon-btn, .helpful-btn, .fav-row {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  main {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .card, .review, .detail-header, .mix-card, .compare-table {
    background: white !important;
    border: 1px solid #ccc !important;
    color: black !important;
    page-break-inside: avoid;
  }
  h1, h2, h3, .name, .brand, .author { color: black !important; }
  a { color: #333 !important; text-decoration: underline; }
  .stars, .big-rating, .qa-icon { color: #aa7a20 !important; }
}

/* ============================== Achievement progress bars ============================== */

.ach-progress {
  margin-top: 8px;
}
.ach-progress-bar {
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.ach-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  transition: width 0.6s ease;
}
.ach-progress-text {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  font-weight: 600;
}

/* ============================== Streak stat highlight ============================== */

.profile-stats-row .stat.streak-stat .num {
  background: linear-gradient(135deg, #ff8c42, #ff5722);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ff5722; /* fallback */
}

/* ============================== Glossary ============================== */

.glossary-card {
  transition: all .15s ease;
}
.glossary-card:hover {
  border-color: var(--gold-deep);
  transform: translateY(-1px);
}
.glossary-term {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.glossary-def {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

/* ============================== Backend status pill ============================== */

.backend-pill {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  vertical-align: middle;
  border: 1px solid;
}
.backend-pill.online {
  color: var(--success);
  border-color: rgba(106,191,105,0.4);
  background: rgba(106,191,105,0.10);
}
.backend-pill.offline {
  color: var(--amber);
  border-color: rgba(224,133,56,0.4);
  background: rgba(224,133,56,0.10);
}
.backend-pill.pending {
  color: var(--text-faint);
  border-color: var(--line);
  background: var(--bg-2);
}
