/**
 * PocketSkills - Panels (backpack, skills, dex, bounties, shops, stylist, menu).
 */

.panel-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(var(--sat) + 10px) calc(var(--sar) + 10px) calc(var(--sab) + 10px) calc(var(--sal) + 10px);
  background: rgba(5, 3, 2, 0.55);
  z-index: 50;
}

/* Confirmation dialog (above the panels) */
.dialog-layer { z-index: 60; }
.death-layer { z-index: 65; background: rgba(40, 0, 0, 0.55); }
.panel.dialog.death { text-align: center; }
.dialog.death h2 { color: #ff6a5a; font-family: var(--font-title, serif); font-size: 26px; margin: 0 0 8px; text-shadow: 0 2px 0 #000; }

.panel.dialog {
  width: min(100%, 360px);
  padding: 16px;
  gap: 14px;
  text-align: center;
}

.dialog p { color: var(--text); font-size: 14px; line-height: 1.45; }

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.dialog-actions .stone-btn { min-width: 110px; }

.panel {
  display: flex;
  flex-direction: column;
  width: min(100%, 520px);
  max-height: min(100%, 760px);
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--frame-dark);
  box-shadow: inset 0 0 0 2px var(--frame), inset 0 3px 0 var(--bevel-hi), 0 12px 32px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: panel-in 0.14s ease-out;
}

@keyframes panel-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  background: linear-gradient(180deg, var(--frame-light), var(--frame));
  border-bottom: 2px solid var(--frame-dark);
}

.panel-head h2 {
  flex: 1;
  font-family: var(--font-title);
  font-size: 17px;
  color: #fff3d0;
  text-shadow: 0 1px 0 #000;
}

.panel-close {
  width: 32px;
  height: 32px;
  font-size: 22px;
  border-radius: 4px;
  color: #fff3d0;
  background: rgba(0, 0, 0, 0.25);
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.panel-body > * + * { margin-top: 10px; }

.section-title {
  font-family: var(--font-title);
  font-size: 14px;
  color: var(--gold);
  border-bottom: 1px solid var(--frame);
  padding-bottom: 3px;
}

.card {
  padding: 10px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--frame-dark);
  box-shadow: inset 0 1px 0 var(--bevel-hi);
}

.npc-line {
  display: flex;
  gap: 10px;
  align-items: center;
  font-style: italic;
  color: var(--text-dim);
}

.npc-line canvas {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: #1a130d;
  border: 1px solid var(--frame-dark);
}

/* Progress bars */
.bar {
  height: 10px;
  border-radius: 3px;
  border: 1px solid #000;
  background: #140e09;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(180deg, #f2cf6a, #b8861a);
}

.bar.thin { height: 6px; }
.bar.hp > i { background: linear-gradient(180deg, #3cdc3c, #1c8a1c); }
.bar.mp > i { background: linear-gradient(180deg, #4a8cff, #1c4ab0); }
.skill-row + .skill-row { margin-top: 6px; }

.preview-stage .grow { flex: 1; min-width: 0; }
.big-name { display: block; font-family: var(--font-title); font-size: 18px; color: #9dff9d; }

.equip-grid {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  justify-content: center;
  gap: 6px;
}

.slot.equip.empty .px-icon { opacity: 0.45; }

.bar.fishing > i { background: linear-gradient(180deg, #8fd0ff, #2f7ab0); }
.bar.mining > i { background: linear-gradient(180deg, #d9d2c0, #7d776e); }
.bar.woodcutting > i { background: linear-gradient(180deg, #9dff7a, #3f8a2a); }
.bar.firemaking > i { background: linear-gradient(180deg, #ffb46a, #c2410c); }
.bar.cooking > i { background: linear-gradient(180deg, #fff08a, #b8860b); }

/* Item slots (backpack, depot, trade, dex, aging): compact Tibia-style container grids */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 3px;
}

.container-frame {
  padding: 5px;
  border-radius: 6px;
  background: linear-gradient(180deg, #2a1d13, #1a120c);
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px var(--frame), inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.container-frame.locker { background: linear-gradient(180deg, #24201c, #15110e); }

/* containers (backpack, depot): columns set by UIManager.containerGrid to fill the panel */
.container-frame .slot-grid { gap: 4px; touch-action: none; }

/* drag & drop (SlotDrag.js) */
.slot.dragging { opacity: 0.35; }
.slot.drop-target { box-shadow: inset 0 0 0 2px var(--gold), 0 0 8px rgba(232, 184, 58, 0.5); }
.drag-ghost {
  position: fixed;
  z-index: 300;
  width: 52px;
  height: 52px;
  pointer-events: none;
  transform: translate(-50%, -60%) scale(1.1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
}

.drag-ghost.ground-ghost { box-shadow: none; opacity: 0.9; transform: translate(-50%, -60%); }

/* Sort: Name · Amount · Rarity */
.sort-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.sort-bar > span { font-size: 11px; color: var(--text-muted); margin-right: 2px; }
.sort-bar .tab { padding: 3px 8px; font-size: 11px; }
.qty-pick > * + * { margin-top: 6px; }

/* slots that are buttons (the loot bag's gold, the quick slot picker) look like any slot */
button.slot { padding: 0; font: inherit; color: inherit; }

/* World map (WorldMapPanel): the map with its fog, the floor / zoom bar, what you tapped, the legend */
.worldmap-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.worldmap-frame { padding: 3px; border-radius: 6px; background: linear-gradient(180deg, #5a4430, #2e2218); border: 1px solid var(--frame-dark); }
.worldmap-canvas { display: block; width: 100%; aspect-ratio: 5 / 4; border-radius: 3px; background: #0d0a07; image-rendering: pixelated; touch-action: none; cursor: grab; }
.worldmap-marks { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.worldmap-marks small { margin-left: auto; color: var(--text-muted); font-size: 11px; }
.mark-tool { display: grid; place-items: center; width: 34px; height: 30px; padding: 0; border-radius: 6px; border: 1px solid var(--frame-dark); background: linear-gradient(180deg, #4a3826, #2a1f15); box-shadow: inset 0 1px 0 var(--bevel-hi); }
.mark-tool.active { border-color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold), 0 0 8px rgba(232, 184, 58, 0.45); }
.mark-tool.erase { font-size: 18px; font-weight: 700; color: #ffb8a8; }
.worldmap-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.worldmap-bar [data-wm-me] { margin-left: auto; }
.worldmap-info { min-height: 18px; margin: 8px 0 4px; font-size: 12px; color: #f0e6d0; }
.worldmap-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--text-muted); }
.worldmap-legend span { display: inline-flex; align-items: center; gap: 4px; }
.worldmap-legend i { display: inline-block; width: 9px; height: 9px; border: 1px solid #000; }
.worldmap-legend .lg-you { background: #ff3a3a; }
.worldmap-legend .lg-npc { background: #ffe14d; }
.worldmap-legend .lg-monster { background: #ff9a2a; }
.worldmap-legend .lg-player { background: #ffffff; }
.worldmap-legend .lg-guild { background: #c79aff; }

/* Guild window */
.guild-members .friend { gap: 6px; }
.chip.rank-leader { color: #ffe27a; border-color: #8a6a1a; }
.chip.rank-vice { color: #e0e4f0; border-color: #6a6e7a; }
.chip.rank-officer { color: #9ac0ff; border-color: #2a4a8a; }
.chip.rank-veteran { color: #ffd84a; border-color: #8a6a1a; }
.chip.rank-member { color: #c79aff; border-color: #5a3a8a; }
.chip.rank-recruit { color: #a8f08a; border-color: #2e6a24; }
/* the rank cascade */
.rank-menu { position: relative; }
.rank-menu > summary { list-style: none; cursor: pointer; }
.rank-menu > summary::-webkit-details-marker { display: none; }
.rank-options { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: grid; gap: 2px; min-width: 150px; padding: 4px;
  border-radius: 6px; border: 1px solid var(--frame-dark); background: linear-gradient(180deg, #3a2c20, #1e150e); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55); }
.rank-option { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 4px; font-size: 12px; color: #f0e6d0; text-align: left; }
.rank-option:hover, .rank-option.active { background: rgba(232, 184, 58, 0.18); }
.worldmap-legend .lg-portal { background: #c78aff; transform: rotate(45deg); }
.worldmap-legend .lg-stairs { background: #ffd84a; border-radius: 50%; }
.worldmap-legend .lg-fog { background: #0d0a07; border-color: #5a4430; }

/* small square windows (the loot bag) */
.panel.compact { width: min(100%, 340px); }

/* how long the bag stays: a bar that drains to its last second */
.loot-timer { height: 4px; border-radius: 2px; background: #140e09; border: 1px solid #000; overflow: hidden; }
.loot-timer > i { display: block; height: 100%; background: linear-gradient(90deg, #c89a2a, #f2cf6a); animation: loot-drain linear forwards; }
@keyframes loot-drain { to { width: 0; } }

.container-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.container-head .grow { flex: 1; min-width: 0; }
.bar.full > i { background: linear-gradient(180deg, #ff7a5a, #b0281a); }

.slot {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #160f0a;
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px var(--frame), inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.slot.filled { cursor: pointer; }
.slot .count {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: -1px -1px 0 #000, 1px 1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.slot.rarity-uncommon { box-shadow: inset 0 0 0 1px var(--r-uncommon), inset 0 2px 4px rgba(0, 0, 0, 0.6); }
.slot.rarity-rare { box-shadow: inset 0 0 0 1px var(--r-rare), inset 0 2px 4px rgba(0, 0, 0, 0.6); }
.slot.rarity-epic { box-shadow: inset 0 0 0 1px var(--r-epic), inset 0 2px 4px rgba(0, 0, 0, 0.6); }
.slot.rarity-legendary { box-shadow: inset 0 0 0 1px var(--r-legendary), 0 0 6px rgba(255, 200, 61, 0.4); }
.slot.unknown .px-icon { filter: brightness(0); opacity: 0.55; }

/* Item stacks: aging badge and glow (+8 and up), broken items, selection */
.slot .aging {
  position: absolute;
  left: 2px;
  top: 1px;
  font-size: 10px;
  font-weight: 700;
  color: #ffe9a8;
  text-shadow: -1px -1px 0 #000, 1px 1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

/* aging aura ON the item: its outline glows in the tier colour; +20 crackles in every colour */
.slot.aged .px-icon { animation: aging-pulse 1.4s ease-in-out infinite alternate; }

@keyframes aging-pulse {
  from { filter: drop-shadow(0 0 1px var(--glow)); }
  to { filter: drop-shadow(0 0 1px var(--glow)) drop-shadow(0 0 3px var(--glow)) drop-shadow(0 0 1px #fff); }
}

.slot.aging-max .px-icon { animation: aging-max 0.9s steps(6) infinite; }

@keyframes aging-max {
  0% { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #7ff6ff) drop-shadow(1px -1px 1px #ff7af0); }
  33% { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #ff7af0) drop-shadow(-1px 1px 1px #fff27a); }
  66% { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #fff27a) drop-shadow(1px 1px 1px #7ff6ff); }
  100% { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #7ff6ff) drop-shadow(-1px -1px 1px #ff7af0); }
}

.slot.broken .px-icon { filter: grayscale(1) brightness(0.6); }
.slot.broken::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: repeating-linear-gradient(45deg, rgba(196, 50, 30, 0.35) 0 3px, transparent 3px 7px);
}

.slot.selected { box-shadow: inset 0 0 0 2px var(--gold), 0 0 8px rgba(232, 184, 58, 0.6); }
.slot.offered { box-shadow: inset 0 0 0 2px #7fd7ff; opacity: 0.55; }

/* locked items (item panel > Lock): a small padlock in the corner */
.slot .lock-badge {
  position: absolute;
  left: 1px;
  bottom: 1px;
  line-height: 0;
  filter: drop-shadow(0 0 1px #000);
}

.slot.item-locked { box-shadow: inset 0 0 0 1px #c8a24a, inset 0 2px 4px rgba(0, 0, 0, 0.6); }

/* Trade window: both offers, then your backpack */
.trade-side {
  padding: 8px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--frame-dark);
}

.trade-side > * + * { margin-top: 6px; }
.trade-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
/* attack, trade, friend, party and guild: one grid, every button the same size */
.player-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.player-actions .stone-btn { width: 100%; min-height: 40px; padding: 6px 4px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; line-height: 1.1; text-align: center; }
.slot.missing { box-shadow: inset 0 0 0 2px var(--bad); }

/* Dex: every item with its five rarity pips */
.dex-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
.dex-cell { display: grid; justify-items: center; gap: 3px; }
.pips { display: inline-flex; gap: 2px; vertical-align: middle; }
.pip { width: 7px; height: 7px; border-radius: 50%; border: 1px solid #000; background: #2a2018; }
.r-bg-common { background: var(--r-common); }
.r-bg-uncommon { background: var(--r-uncommon); }
.r-bg-rare { background: var(--r-rare); }
.r-bg-epic { background: var(--r-epic); }
.r-bg-legendary { background: var(--r-legendary); }
.text-good { color: var(--good); }

/* Aging bench (Priston Tale style) */
.aging-bench {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.aging-bench .slot { width: 54px; height: 54px; }
.aging-bench .plus { font-size: 20px; font-weight: 700; color: var(--gold); }
.aging-chance { color: var(--good); }
.text-bad { color: var(--bad); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list + .pager { margin-top: 10px; }

/* Staff control panel */
.staff-body { margin-top: 10px; }

.cmd-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-row + .cmd-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(0, 0, 0, 0.3); }
.cmd-row .grow { flex: 1; min-width: 0; }
.cmd-row code { color: var(--gold); font-size: 12px; font-weight: 700; }
.cmd-row small { display: block; color: var(--text-muted); font-size: 11px; }

.staff-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staff-items { margin-top: 8px; }
.friend-add input[type="number"] { flex: none; width: 96px; }
.staff-items .slot { cursor: pointer; }

/* Friend list (Tibia VIP) */
.friend-add {
  display: flex;
  gap: 6px;
}

.friend-add input {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.friend {
  display: flex;
  align-items: center;
  gap: 6px;
}

.friend + .friend { margin-top: 6px; }
.friend .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text-muted); }
.friend.online .grow { color: #7dff7d; }

.presence {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid #000;
  background: #5a4a3a;
}

.friend.online .presence { background: #3cdc3c; box-shadow: 0 0 6px rgba(60, 220, 60, 0.7); }

.news-lines {
  margin-top: 4px;
  padding-left: 18px;
  color: var(--text-dim);
}

.news-lines li + li { margin-top: 3px; }
.log-player { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.log-player:hover { text-decoration: underline; }
.panel-layer.held .panel-body { pointer-events: none; } /* the forge playing: nothing can be switched mid-way */
.news-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 5px; border-top: 1px solid rgba(0, 0, 0, 0.3); font-size: 10px; color: var(--text-muted); }

/* Rows (skills, shop lines, settings) */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row .grow { flex: 1; min-width: 0; }
.row + .row { margin-top: 8px; }

.list > .card + .card { margin-top: 8px; }

.title-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.title-line strong { font-size: 13px; }

.price {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.price.short { color: var(--bad); }

.chip {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-dim);
}

/* Character creator / stylist */
.preview-stage {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-stage canvas {
  width: 112px;
  height: 112px;
  border-radius: 6px;
  border: 1px solid var(--frame-dark);
  background: radial-gradient(circle at 50% 40%, #4a8a30, #2a5a1c);
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
}

.field input[type="text"], .friend-add input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid var(--frame-dark);
  background: #0c0805;
  font-size: 16px;
}

.swatches, .options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 2px solid #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.swatch.active { outline: 2px solid var(--gold); outline-offset: 1px; }

.option {
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: var(--panel-3);
  border: 1px solid var(--frame-dark);
  color: var(--text-dim);
}

.option.active { color: #2a1a06; background: linear-gradient(180deg, #f2cf6a, #c89a2a); }

/* Settings */
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.setting > span { flex: 1 1 0; min-width: 0; } /* the label wraps first, the buttons keep their row */
.setting .tabs { justify-content: flex-end; }
.setting.stacked { flex-wrap: wrap; } /* many choices (zoom): the buttons get a line of their own */
.setting.stacked > span { flex-basis: 100%; }
.setting.stacked .tabs { flex: 1; justify-content: stretch; }
.setting.stacked .tab { flex: 1; }
.setting + .setting { border-top: 1px solid rgba(0, 0, 0, 0.3); }
.setting small { display: block; color: var(--text-muted); font-size: 10px; }
.range-setting { display: flex; align-items: center; gap: 6px; }
.range-setting input { width: 110px; accent-color: var(--gold); }
.range-setting b { min-width: 34px; text-align: right; font-size: 11px; color: var(--gold); }

.legal-text h3 { margin: 10px 0 4px; color: var(--gold); font-size: 13px; }
.legal-text p, .legal-text li { color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.legal-text ul { padding-left: 18px; }

/* Level up */
.levelup {
  text-align: center;
}

.levelup .big {
  font-family: var(--font-title);
  font-size: 30px;
  color: var(--gold);
  text-shadow: 0 2px 0 #000;
}

/* Item detail */
.item-hero {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-hero .slot { width: 72px; flex: none; }

.stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  font-size: 12px;
}

.stats span { color: var(--text-muted); }
.stats b { text-align: right; }

.footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
}

/* --- Quests: board cards and the RuneScape-style log (red locked, yellow active, green done) --- */
/* board cards never overflow on small phones: titles and rewards wrap, the claim button stays whole */
.quest-card .title-line { flex-wrap: wrap; align-items: center; }
.quest-card .title-line strong { flex: 1 1 60%; min-width: 0; overflow-wrap: anywhere; }
.quest-card .title-line .price { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; overflow-wrap: anywhere; font-size: 11px; }
.quest-card .title-line > .stone-btn, .quest-card .title-line > .chip { flex: none; margin-left: auto; }
.quest-card p { overflow-wrap: anywhere; }
.quest-card.done { opacity: 0.6; }
.quest-card.ready { border-color: var(--gold); }
.quest-card .q-monster, .quest-row .q-monster { color: #ff6a5a; }
.quest-card .q-skill { color: #7fd7ff; }

.quest-list {
  display: grid;
  gap: 4px;
}

.quest-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-weight: 700;
  text-align: left;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--frame-dark);
}

.quest-row small { color: var(--text-dim); font-weight: 400; }
.quest-row.locked span, .q-status.locked { color: #ff6a5a; }
.quest-row.active span, .q-status.active { color: #ffd84a; }
.quest-row.ready span, .q-status.ready { color: #ffb03a; }
.quest-row.done span, .q-status.done { color: #6dff8a; }

/* --- Ranking (highscores): gold / silver / bronze for the top 3, your own row highlighted --- */
.rank-select {
  padding: 4px 8px;
  font: inherit;
  color: var(--text);
  background: var(--panel-2, #2a1f15);
  border: 1px solid var(--frame-dark);
  border-radius: 4px;
}

.rank-list { display: grid; gap: 2px; }

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
}

.rank-pos { min-width: 26px; text-align: center; }
.rank-crown { width: 20px; flex: none; } /* no crown: the names stay in line with the top three */
.rank-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { display: grid; justify-items: end; text-align: right; line-height: 1.15; }
.rank-value small { font-size: 10px; color: var(--text-muted); }
.rank-row.gold .rank-pos { color: #ffd84a; }
.rank-row.silver .rank-pos { color: #d8dce6; }
.rank-row.bronze .rank-pos { color: #d8945a; }
.rank-row.me { outline: 1px solid var(--gold); }

/* --- Staff panel: forms, item spawner and the audit log --- */
.staff-form { display: grid; gap: 6px; }
.staff-form input, .staff-aging input {
  padding: 6px 8px;
  font: inherit;
  color: var(--text);
  background: #120c07;
  border: 1px solid var(--frame-dark);
  border-radius: 4px;
}
.staff-form .tabs input { width: 72px; }
.staff-aging { display: flex; align-items: center; gap: 2px; font-weight: 700; color: var(--gold); }
.staff-aging input { width: 56px; }

.log-list { display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.log-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 4px 6px;
  font-size: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}
.log-row time { color: var(--text-dim); font-size: 11px; }
.log-row .log-text { flex-basis: 100%; overflow-wrap: anywhere; }
.chip.log-denied, .chip.log-unknown { color: #ff6a5a; }
.chip.log-usage { color: #ffb03a; }
.chip.log-done { color: #6dff8a; }

/* Aging: the forge animation over the bench (AgingPanel.forge) */
.aging-card { position: relative; overflow: hidden; }
.aging-forge { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; align-content: center; gap: 10px; border-radius: inherit;
  background: radial-gradient(circle at 50% 45%, rgba(110, 56, 20, 0.97), rgba(16, 10, 6, 0.98) 70%); animation: forge-in 0.2s ease-out; }
@keyframes forge-in { from { opacity: 0; } }
.aging-stage { position: relative; width: 150px; height: 92px; }
.aging-anvil { position: absolute; left: 43px; bottom: 0; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.6)); }
.aging-item { position: absolute; left: 51px; bottom: 34px; transform: scale(0.82); animation: forge-glow 0.5s ease-in-out infinite alternate; }
@keyframes forge-glow { to { filter: drop-shadow(0 0 8px rgba(255, 190, 90, 0.9)) brightness(1.15); } }
.aging-hammer { position: absolute; right: 6px; top: -8px; transform-origin: 20% 80%; animation: forge-hammer 0.5s ease-in 3; }
@keyframes forge-hammer { 0% { transform: rotate(-35deg); } 70% { transform: rotate(28deg); } 100% { transform: rotate(-35deg); } }
.aging-sparks { position: absolute; left: 70px; bottom: 50px; width: 4px; height: 4px; border-radius: 50%; opacity: 0;
  box-shadow: -18px -10px 0 1px #ffd84a, 16px -14px 0 0 #fff6c8, -8px -22px 0 0 #ff9a2a, 22px -4px 0 1px #ffd84a, 6px -26px 0 0 #ffffff, -24px 2px 0 0 #ff9a2a; }
.aging-forge.strike .aging-sparks { animation: forge-sparks 0.38s ease-out; }
@keyframes forge-sparks { 0% { opacity: 1; transform: scale(0.3); } 100% { opacity: 0; transform: scale(1.5) translateY(-6px); } }
.aging-bar { width: 70%; height: 8px; border-radius: 4px; background: #140e09; border: 1px solid #000; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.aging-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c8601e, #ffd84a); animation: forge-bar 1.6s linear forwards; }
@keyframes forge-bar { to { width: 100%; } }
.aging-result { opacity: 0; font: 900 34px/1 var(--font); letter-spacing: 2px; transform: scale(0.4) rotateX(60deg); }
.aging-result.good { color: #8aff7a; text-shadow: 0 1px 0 #3ac040, 0 2px 0 #2a9a30, 0 3px 0 #1e7a24, 0 4px 0 #145a18, 0 6px 8px rgba(0, 0, 0, 0.7), 0 0 18px rgba(120, 255, 110, 0.55); }
.aging-result.bad { color: #ff7a6a; text-shadow: 0 1px 0 #d8402e, 0 2px 0 #b02a1e, 0 3px 0 #8a1e14, 0 4px 0 #64140c, 0 6px 8px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 90, 70, 0.5); }
.aging-forge.reveal .aging-result { animation: forge-result 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
.aging-forge.reveal .aging-hammer, .aging-forge.reveal .aging-sparks { opacity: 0; transition: opacity 0.2s; }
@keyframes forge-result { to { opacity: 1; transform: scale(1) rotateX(0); } }

/* --- PocketSkills VIP › Skins: a big preview of you in each outfit, the worn one framed in VIP pink --- */
.skin-preview {
  width: 72px;
  height: 72px;
  flex: none;
  image-rendering: pixelated;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 35%, #4a2a5c, #140c1a 75%);
  border: 1px solid rgba(255, 19, 240, 0.35);
  box-shadow: inset 0 0 12px rgba(255, 19, 240, 0.18);
}
.skin-card.worn { border-color: #ff13f0; box-shadow: 0 0 10px rgba(255, 19, 240, 0.35); }

/* --- The cooking bench (ProductionPanels.js): a bar for the dish on the fire --- */
.cooking-bar { margin: 6px 0; }
.cooking-bar > i { width: 0; background: linear-gradient(180deg, #ffd27a, #e0702a); animation: cook-fill linear forwards; }
@keyframes cook-fill { from { width: 0; } to { width: 100%; } }

/* Shops (ShopPanels.js): the deal of the day, the quantity bar, three cards a row and the info card */
.shop-deal {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  color: var(--text);
  background: linear-gradient(90deg, #5a1e0e, #2e1608);
  border: 1px solid #e67e22;
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.25), inset 0 1px 0 var(--bevel-hi);
  cursor: pointer;
}

.shop-deal b { display: block; font-family: var(--font-title); font-size: 14px; color: var(--legend); }
.shop-deal .grow > span { font-size: 12px; color: var(--text-dim); }

.shop-qty { align-items: center; }

.shop-qty-input {
  width: 72px;
  padding: 4px 6px;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--frame-dark);
  border: 1px solid var(--frame);
  border-radius: 4px;
}

.shop-qty-input.active { border-color: var(--gold); }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.shop-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  text-align: center;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  border: 1px solid var(--frame-dark);
  box-shadow: inset 0 1px 0 var(--bevel-hi), 0 2px 4px var(--bevel-lo);
}

/* the ware on offer: an orange frame and a ribbon across the corner */
.shop-card.deal {
  border: 1.5px solid #f39c12;
  background: linear-gradient(180deg, #44240e, #241206);
  box-shadow: 0 0 8px rgba(243, 156, 18, 0.3), inset 0 1px 0 var(--bevel-hi);
}

.shop-ribbon {
  position: absolute;
  top: 7px;
  right: -22px;
  width: 78px;
  padding: 1px 0;
  transform: rotate(45deg);
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #e74c3c, #a8281c);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.shop-pedestal {
  width: 50px;
  height: 50px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: radial-gradient(circle, rgba(241, 196, 15, 0.22), rgba(12, 6, 3, 0.85));
  border: 1px solid rgba(229, 142, 38, 0.35);
  cursor: pointer;
}

.shop-name {
  min-height: 2.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.shop-badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; font-size: 10px; }
.shop-have { display: inline-flex; align-items: center; gap: 2px; color: var(--text-dim); }
.shop-was { font-size: 10px; color: var(--text-muted); }
.shop-card .stone-btn { width: 100%; padding-left: 2px; padding-right: 2px; }

/* the info card floats over the shop; a tap anywhere closes it */
.info-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}

.info-card { width: min(100%, 340px); max-height: 80%; overflow-y: auto; }
.info-card > * + * { margin-top: 8px; }

/* between the market's deal windows: the banner only says when the next deals open */
.shop-deal.closed { cursor: default; border-color: var(--frame); background: linear-gradient(90deg, var(--panel-3), var(--panel)); box-shadow: inset 0 1px 0 var(--bevel-hi); }
.shop-deal.closed b { color: var(--text-dim); }

/* the cooking bench's verdict: the aging forge's raised SUCCESS / BURNT! popping over the bench, then fading */
.cooking-bench { position: relative; }
.cook-verdict { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; perspective: 240px; border-radius: inherit;
  background: radial-gradient(ellipse at 50% 50%, rgba(16, 10, 6, 0.82), rgba(16, 10, 6, 0.35) 75%); animation: cook-verdict-out 0.5s ease-in 1.6s forwards; }
.cook-verdict .aging-result { animation: forge-result 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes cook-verdict-out { to { opacity: 0; } }
