/* levels.css — Levels modal (opened from Total GB card on dashboard).
   Wine Me palette: bordeaux #5e0c23, gold #c9a550, cream #fdf8f0. Matches the rest of the
   dashboard so the modal feels native rather than bolted-on. */

.lvl-overlay{
  position:fixed;inset:0;
  background:rgba(40,5,15,0.72);
  backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
  z-index:322;
  display:none;
  align-items:flex-end;justify-content:center;
}
.lvl-overlay.open{display:flex}
@media (min-width:560px){
  .lvl-overlay{align-items:center}
}

.lvl-modal{
  background:#fdf8f0;
  width:100%;max-width:520px;
  height:92vh;
  border-top:2px solid #c9a550;
  border-radius:24px 24px 0 0;   /* matches every other white card (2026-08-28) */
  box-shadow:0 -8px 40px rgba(0,0,0,0.45);
  display:flex;flex-direction:column;
  overflow:hidden;
  color:#5e0c23;
  font-family:'Helvetica Neue',Arial,sans-serif;
  animation:lvlSlideUp .35s cubic-bezier(.2,.8,.2,1);
}
@media (min-width:560px){
  .lvl-modal{border-radius:24px;border:2px solid #c9a550;max-height:88vh}
}
@keyframes lvlSlideUp{
  from{transform:translateY(40px);opacity:0}
  to{transform:translateY(0);opacity:1}
}

/* ---- Header — bordeaux band like dash-play-btn ---- */
.lvl-header{
  position:relative;
  display:flex;align-items:center;justify-content:space-between;
  padding:9px 18px;
  background:linear-gradient(135deg,#5e0c23,#8a1538);
  color:#e8d5a0;
  flex-shrink:0;
  border-bottom:2px solid #c9a550;
}
.lvl-header-titles{flex:1;min-width:0;text-align:center;padding-left:36px}
.lvl-header-title{
  font-family:var(--font-display);
  font-size:18px;letter-spacing:1.4px;
  color:#e8d5a0;
}
/* Tab bar (Total GB / Active GB) under the modal header. */
.lvl-tabs{display:flex;flex-shrink:0;background:#fdf8f0;border-bottom:1.5px solid #ecdcc0;padding:0 10px}
.lvl-tab{
  flex:1;padding:11px 6px;background:none;border:none;border-bottom:2.5px solid transparent;
  font-family:'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:500;
  text-transform:uppercase;letter-spacing:1.6px;color:#b29c74;
  cursor:pointer;transition:color .15s,border-color .15s;
}
.lvl-tab.on{color:#5e0c23;border-bottom-color:#c9a550;font-weight:700}
.lvl-tab:active{transform:scale(0.98)}
/* Active GB explainer panel — scrolls within the modal like the levels list. */
#lvlTabActive{
  flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
  flex-direction:column;padding:18px 20px 26px;background:#fdf8f0;
}
.agb-balance{text-align:center;margin-bottom:14px}
.agb-balance-num{display:block;font-family:var(--font-display);font-size:34px;color:#c9a550;line-height:1}
.agb-balance-lbl{display:block;font-size:9px;color:#888;letter-spacing:1.5px;text-transform:uppercase;margin-top:3px}
/* Intro: framed box, with the GB full name (Grape Bucks) spelled out. */
/* Same info box, sitting above the Total-GB player card (2026-08-30). */
/* Frameless on the Total tab (requested 2026-08-30) — just quiet text, no box, less room. */
/* The wrapper carries the side margins the paragraph used to; the paragraph itself just sits
   under its button now (2026-08-30). */
.lvl-intro-wrap{margin:10px 20px 0}
.lvl-intro-wrap .agb-acc-head{width:100%;font-size:13px;padding:9px 18px;text-transform:none;letter-spacing:0.3px}
/* Capsule ends (requested 2026-08-30). main.css opts every .agb-acc-head OUT of the app-wide
   pill radius with an !important of its own — that keeps the EARN / SPEND pair on the GB ACTIFS
   tab rectangular, and only a MORE specific !important brings this one head back to the pill. */
.lvl-intro-wrap .agb-acc-head{border-radius:999px!important}
.agb-intro.lvl-total-intro{margin:8px 0 0;padding:0;border:0;background:none;font-size:11.5px;line-height:1.5;color:#8a7a5a}
.agb-intro{
  margin:0 0 14px;padding:12px 14px;
  border:1.5px solid #c9a550;border-radius:10px;background:#fff;
  font-size:13px;line-height:1.55;font-style:italic;color:#5e0c23;text-align:center;
}
/* Collapsible earn / spend — two buttons in a row; each expands its list (full-width) below. */
.agb-acc-row{display:flex;gap:8px;margin-bottom:8px}
.agb-acc-head{
  flex:1;padding:11px 8px;cursor:pointer;background:#fff;
  border:1.5px solid #ecdcc0;border-radius:10px;
  font-family:'Helvetica Neue',Arial,sans-serif;font-size:13px;font-weight:700;letter-spacing:0.5px;
  text-transform:uppercase;color:#5e0c23;line-height:1.2;
  display:flex;align-items:center;justify-content:center;gap:5px;text-align:center;
}
.agb-acc-head.agb-earn{color:#3B6D11;border-color:#cfe0bf}
.agb-acc-head.agb-spend{color:#ae182b;border-color:#eccaca}
.agb-acc-head.open{box-shadow:inset 0 0 0 1.5px currentColor}
.agb-acc-arrow{display:inline-block;transition:transform .18s;font-size:10px}
.agb-acc-head.open .agb-acc-arrow{transform:rotate(90deg)}
.agb-acc-body{
  margin:0 0 10px;padding:10px 16px 12px 30px;
  border:1px solid #ecdcc0;border-radius:10px;background:#fff;
  font-size:13.5px;line-height:1.55;color:#3a0a15;
}
.agb-acc-body li{margin-bottom:7px}
.agb-acc-body strong{color:#5e0c23}
/* Recent activity (mini-history of earnings / spendings). */
.agb-hist-title{font-family:var(--font-display);font-size:16px;letter-spacing:1px;text-transform:uppercase;color:#5e0c23;margin:18px 0 8px}
.agb-hist-empty{font-size:13px;color:#999;font-style:italic}
.agb-hist-row{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:10px 2px;border-bottom:1px solid #efe6d4;font-size:14px}
.agb-hist-row:last-child{border-bottom:none}
.agb-hist-label{color:#3a0a15}
.agb-hist-time{color:#aaa;font-size:12px}
.agb-hist-amt{font-family:var(--font-display);font-size:15px;white-space:nowrap}
.agb-hist-amt.pos{color:#3B6D11}
.agb-hist-amt.neg{color:#ae182b}
.lvl-close{
  background:rgba(255,255,255,0.12);
  border:1.5px solid rgba(232,213,160,0.5);
  color:#e8d5a0;
  width:28px;height:28px;border-radius:50%;
  /* Perfectly-centred X: SVG lines (not the × glyph, whose optical centre drifts by font). */
  display:flex;align-items:center;justify-content:center;padding:0;
  line-height:1;cursor:pointer;
  flex-shrink:0;
  transition:background .15s,transform .15s;
}
@media (hover: hover){.lvl-close:hover{background:rgba(232,213,160,0.2)}}
.lvl-close:active{transform:scale(0.92)}

/* ---- Player card (current level summary) — sits on the cream body, white inner card ---- */
.lvl-player-card{
  margin:14px 16px 12px;
  padding:14px 16px;
  background:#fff;
  border:1.5px solid #c9a550;
  border-radius:12px;
  box-shadow:0 2px 8px rgba(94,12,35,0.08);
  flex-shrink:0;
}
.lvl-player-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.lvl-player-left{min-width:0;flex:1}
.lvl-player-lvl{font-family:var(--font-display);font-size:26px;letter-spacing:1px;line-height:1.05}
.lvl-player-name{font-size:13px;color:#5e0c23;margin-top:2px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lvl-player-gb{text-align:right;flex-shrink:0}
.lvl-player-gb-num{font-family:var(--font-display);font-size:26px;color:#5e0c23;font-feature-settings:'tnum';line-height:1.05}
.lvl-player-gb-unit{font-size:9px;color:#c9a550;letter-spacing:1.2px;text-transform:uppercase;margin-top:2px;font-weight:700;white-space:nowrap}
.lvl-progress-bar{
  height:8px;background:#f0e8d8;border-radius:4px;overflow:hidden;
  border:1px solid #eadcb8;
}
.lvl-progress-fill{
  height:100%;border-radius:3px;
  transition:width .5s ease;
}
.lvl-progress-next{
  font-size:10.5px;color:#7a6a4a;margin-top:7px;text-align:right;letter-spacing:0.3px;font-weight:500;
}
.lvl-progress-max{
  text-align:center;font-size:13px;color:#c9a550;font-style:italic;
  letter-spacing:2px;margin-top:6px;font-family:var(--font-display);
}

/* ---- Tier filter chips — compact so they don't crowd the list. Single row on most viewports;
   wraps to a second short row if needed. ---- */
.lvl-tiers{
  display:grid;grid-template-columns:repeat(3,1fr);gap:6px;
  margin:0;padding:10px 16px 12px;   /* footer bar below the list; 16px inset keeps tiers at card width */
  border-top:1px solid #ecdcc0;background:#fdf8f0;
  flex-shrink:0;
}
.lvl-tier-btn{
  padding:6px 8px;
  background:#fff;
  border:1px solid #ddd;
  border-radius:14px;
  color:#888;
  font-size:11.5px;font-family:inherit;font-weight:600;line-height:1.3;text-align:center;
  cursor:pointer;white-space:nowrap;
  transition:background .15s,border-color .15s,color .15s,transform .15s;
}
@media (hover: hover){.lvl-tier-btn:hover{background:#fff8e8;border-color:#c9a550}}
.lvl-tier-btn:active{transform:scale(0.95)}
.lvl-tier-btn.active{
  background:#5e0c23;
  border-color:#5e0c23;
  color:#e8d5a0;
}

/* ---- Level list (scrollable) ---- */
.lvl-list{
  flex:1;min-height:0;
  overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:8px 14px 18px;
  display:flex;flex-direction:column;gap:5px;
  background:#fdf8f0;
}
.lvl-list::-webkit-scrollbar{width:6px}
.lvl-list::-webkit-scrollbar-track{background:transparent}
.lvl-list::-webkit-scrollbar-thumb{background:rgba(201,165,80,0.45);border-radius:3px}
@media (hover: hover){.lvl-list::-webkit-scrollbar-thumb:hover{background:rgba(201,165,80,0.7)}}

.lvl-row{
  display:flex;align-items:center;gap:11px;
  padding:10px 12px;
  background:#fff;
  border:1.5px solid #f0e8d8;
  border-radius:10px;
  transition:all .15s ease;
  position:relative;
}
.lvl-row.is-achieved{
  background:#fff;
  border-color:#e8d5a0;
  box-shadow:0 1px 3px rgba(201,165,80,0.12);
}
/* Locked = not yet earned. Distinct GRAY palette so it doesn't read as "warmly cream" like the
   achieved gold-bordered rows. Goal: at a glance, gray = future, cream/gold = past. */
.lvl-row.is-locked{
  background:#ececec;
  border-color:#d6d6d6;
}
.lvl-row.is-player{
  /* inline style sets background+border from the tier color (see levels.js) */
  box-shadow:0 2px 10px rgba(94,12,35,0.15);
  border-width:2px;
  transform:scale(1.015);
}

/* Plain level number (no circle), first in the row. */
.lvl-num{
  min-width:22px;flex-shrink:0;text-align:center;
  font-family:var(--font-display);font-size:16px;font-weight:700;color:#8a6a20;
}
.lvl-row.is-locked .lvl-num{color:#a8a8a8}
.lvl-row.is-legend .lvl-num{color:#c9a550}

/* Badge is now the EARNED AVATAR circle (art has its own ring → no extra border/bg). */
.lvl-badge{
  min-width:38px;width:38px;height:38px;
  border-radius:50%;overflow:hidden;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
.lvl-avatar{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
/* Locked = not yet earned → show the avatar as a dimmed grey preview of what's to come. */
.lvl-row.is-locked .lvl-avatar{filter:grayscale(0.9);opacity:0.45}
/* Exception: level 80 (Légende) stays in FULL colour + a golden glow — the goal to strive for,
   even while still locked. Declared after the locked rule so it wins on the locked-legend row. */
.lvl-row.is-legend .lvl-avatar{filter:drop-shadow(0 0 6px rgba(201,165,80,0.7));opacity:1}
.lvl-row.is-player .lvl-badge{box-shadow:0 2px 8px rgba(94,12,35,0.28)}

.lvl-info{flex:1;min-width:0}
.lvl-name{
  font-size:14px;color:#5e0c23;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  letter-spacing:0.3px;font-weight:600;
}
.lvl-row.is-locked .lvl-name{color:#888;font-weight:500}
.lvl-row.is-player .lvl-name{font-weight:700;font-size:15px}
.lvl-row.is-legend .lvl-name{
  font-family:var(--font-display);
  letter-spacing:2px;text-transform:uppercase;font-size:14px;
  color:#5e0c23;
}
.lvl-tier-label{
  font-size:10px;color:#a89060;margin-top:2px;letter-spacing:0.4px;font-weight:500;
}
.lvl-row.is-locked .lvl-tier-label{color:#a8a8a8}
/* Unlocked rows: the level's citation replaces the tier label — italic, a shade warmer, and
   allowed to wrap (the phrases run longer than one word). */
.lvl-citation{font-style:italic;font-size:10.5px;color:#8a6e2a;letter-spacing:0.2px;line-height:1.35;white-space:normal}

.lvl-gb{text-align:right;flex-shrink:0;min-width:78px}
.lvl-gb-num{
  font-family:var(--font-display);font-size:14px;
  color:#a89060;font-feature-settings:'tnum';
}
.lvl-row.is-achieved .lvl-gb-num{color:#5e0c23}
.lvl-row.is-locked .lvl-gb-num{color:#9a9a9a}
.lvl-row.is-player .lvl-gb-num{color:#5e0c23;font-size:15px}
.lvl-row.is-legend .lvl-gb-num{color:#c9a550}
.lvl-gb-unit{
  font-size:7.5px;color:#c9a550;letter-spacing:0.8px;text-transform:uppercase;margin-top:2px;font-weight:700;white-space:nowrap;
}
.lvl-row.is-locked .lvl-gb-unit{color:#a8a8a8}

/* Total GB stat card on dashboard — hover styling is inherited from .dash-stat-clickable */
