/* ════════════════════════════════════════════════════════════
   Sunflower Land Dashboard — Win95 Theme
   Single unified stylesheet — no !important cascade fights
   ════════════════════════════════════════════════════════════ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  /* Win95 chrome */
  --grey:           #C0C0C0;
  --navy:           #000080;
  --win-border-out: inset -1px -1px 0 #000, inset 1px 1px 0 #fff,
                    inset -2px -2px 0 #7f7f7f, inset 2px 2px 0 #dfdfdf;
  --win-border-in:  inset -1px -1px 0 #fff, inset 1px 1px 0 #808080,
                    inset -2px -2px 0 #dfdfdf, inset 2px 2px 0 #000;
  --btn-border:     inset -1px -1px 0 #000, inset 1px 1px 0 #c1c1c1,
                    inset -2px -2px 0 #818181, inset 2px 2px 0 #fff;
  --btn-pressed:    inset -1px -1px 0 #fff, inset 1px 1px 0 #000,
                    inset -2px -2px 0 #c4c4c4, inset 2px 2px 0 #808080;
  --radius: 0px;

  /* Semantic tokens — Win95-tuned; also used in JS-rendered HTML */
  --bg:          #C0C0C0;
  --card:        #C0C0C0;
  --card-alt:    #dfdfdf;
  --border:      #808080;
  --accent:      #000080;
  --accent-light:#d8d8e8;
  --accent-dim:  #000060;
  --text:        #000000;
  --text-dim:    #444444;
  --green:       #008000;
  --green-light: #c8e0c8;
  --red:         #800000;
  --blue:        #000080;
  --blue-light:  #d0d0e8;
  --shadow:      none;
  --shadow-md:   none;
}

/* ── Reset & globals ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { font-family: 'Tahoma', 'Arial', sans-serif; -webkit-font-smoothing: subpixel-antialiased; }
img { image-rendering: pixelated; }
body {
  background: #008080;
  color: var(--text);
  font-size: 11px;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Page layout ─────────────────────────────────────────── */
.page {
  width: 100vw;
  height: 100dvh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
#desktop {
  flex: 1;
  display: flex;
  overflow: hidden;
  padding: 6px;
  gap: 6px;
  background: transparent;
}
#desktop .dashboard {
  flex: 1;
  width: auto;
  height: 100%;
  display: flex;
  background: transparent;
}

/* ── Taskbar ─────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: stretch;
  height: 42px;
  min-height: 42px;
  background: #C0C0C0;
  border-top: 2px solid #fff;
  box-shadow: none;
  padding: 3px 4px 3px 6px;
  gap: 4px;
  flex-shrink: 0;
  z-index: 1001;
}
#start-btn {
  height: 34px;
  padding: 0 8px;
  background: #C0C0C0;
  box-shadow: var(--btn-border);
  border: none;
  border-radius: 0;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
#start-btn:active, #start-btn.pressed { box-shadow: var(--btn-pressed); }
#start-btn.pressed { outline: 1px dotted #000; outline-offset: -3px; }
.header-resources { flex: 1; display: flex; gap: 6px; }
.hres {
  background: #C0C0C0;
  box-shadow: var(--btn-border);
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: 0;
  gap: 5px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  cursor: default;
  position: relative;
}
.hres.tip-open { box-shadow: var(--btn-pressed); outline: 1px dotted #000; outline-offset: -3px; }
.hres.tip-open > *:not(.tip) { transform: translate(1px, 1px); }
.hres img   { width: 16px; height: 16px; object-fit: contain; }
.hres-val   { font-size: 16px; color: #000; font-weight: bold; }
.hres-sub   { font-size: 14px; color: #444; }
.bal-delta  { font-size: 0.8rem; font-weight: 600; margin-top: 0; }
.bal-delta.up   { color: var(--green); }
.bal-delta.down { color: var(--red); }
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #C0C0C0;
  border: none;
  border-radius: 0;
  padding: 0 6px;
  height: 34px;
  flex-shrink: 0;
}
.last-updated { font-size: 13px; color: #000; white-space: nowrap; }
#farm-select {
  min-width: 100px;
}
.lang-toggle {
  background: #C0C0C0;
  box-shadow: var(--btn-border);
  border: none;
  border-radius: 0;
  color: #000;
  font-size: 12px;
  padding: 1px 6px;
  height: 25px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-toggle:active { box-shadow: var(--btn-pressed); }

.refresh-btn {
  background: #C0C0C0;
  box-shadow: var(--btn-border);
  border: none;
  border-radius: 0;
  color: #000;
  font-size: 14px;
  padding: 1px 8px;
  height: 25px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.refresh-btn:active { box-shadow: var(--btn-pressed); }
.refresh-btn.cooldown { opacity: 0.55; cursor: default; }
.refresh-btn.filling  { cursor: progress; opacity: 1; }
.refresh-btn.filling::after {
  content: '';
  position: absolute;
  inset: 0; right: auto;
  width: 0%;
  background: rgba(0,0,128,0.35);
  animation: btn-force-fill 3s linear forwards;
  pointer-events: none;
}
@keyframes btn-force-fill { from { width: 0%; } to { width: 100%; } }

/* ── Start Menu ──────────────────────────────────────────── */
#start-menu {
  position: absolute;
  left: 0; top: 42px;
  z-index: 2000;
  background: #C0C0C0;
  box-shadow: var(--win-border-out);
  padding: 3px;
  display: flex;
  flex-direction: row;
}
#start-menu.hidden { display: none; }
.start-menu-sidebar {
  background: linear-gradient(to top, #000080, #1084d0);
  width: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  flex-shrink: 0;
}
.start-menu-sidebar span {
  color: #C0C0C0;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.start-menu-items {
  padding: 2px 0;
  min-width: 170px;
}
.start-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 24px 8px 10px;
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.start-menu-item img { width: 28px; height: 28px; image-rendering: pixelated; }
.start-menu-sep { border-top: 1px solid #808080; border-bottom: 1px solid #fff; margin: 3px 6px; }

/* ── Win chrome ──────────────────────────────────────────── */
.win {
  background: #C0C0C0;
  box-shadow: var(--win-border-out);
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: stretch;
  max-height: calc(100% - 2.5rem);
}
.win-bar {
  background: #000080;
  color: #fff;
  height: 28px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: bold;
  margin: 4px 4px 0 4px;
  border-radius: 0;
  flex-shrink: 0;
  border: none;
  box-shadow: none;
  cursor: grab;
  user-select: none;
  outline: none;
}
.win-bar:active { cursor: grabbing; }
.win-bar::before, .win-bar::after,
.card-title::before, .card-title::after { display: none; content: none; }
#sidebar-panel.inactive .win-bar,
#game-pane.inactive .win-bar { background: #808080; }
.win-bar-title {
  flex: 1;
  color: #fff;
  font-size: 14px;
  padding: 0;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
}
#sp-title { border: none; color: #fff; }
.help-btn {
  background: #c0c0c0;
  border: none;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  margin-left: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  touch-action: manipulation;
}
.help-btn:active { box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #808080; }
.view-toggle-btn {
  background: #c0c0c0;
  border: none;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  color: #000;
  font-size: 12px;
  width: 18px;
  height: 18px;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  touch-action: manipulation;
}
.view-toggle-btn:active { box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #808080; }
.help-key { color: #000; font-weight: 700; }
.win-bar-icon { width: 16px; height: 16px; image-rendering: pixelated; object-fit: contain; margin-right: 4px; flex-shrink: 0; vertical-align: middle; }
.win-controls {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0;
  gap: 2px;
  margin: 0;
}
.win-btn {
  width: 26px; height: 26px;
  background: #C0C0C0;
  box-shadow: var(--win-border-out);
  border: none; border-radius: 0;
  color: #000; font-size: 14px;
  cursor: pointer; padding: 0 0 5px 0;
  display: flex; justify-content: center; align-items: center;
  flex-shrink: 0;
}
.win-btn:active          { box-shadow: var(--win-border-in); }
.win-body { overflow-y: auto; overflow-x: hidden; }


/* ── Tab bar (System Properties style) ──────────────────── */
.win-tabs {
  display: flex;
  padding: 0 4px;
  margin-top: 4px;
  gap: 2px;
  flex-shrink: 0;
  z-index: 10;
}
.win-tab {
  background: #C0C0C0;
  padding: 3px 10px;
  font-size: 11px;
  border: 1px solid #fff;
  border-right-color: #000;
  border-bottom: none;
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
  cursor: pointer;
  position: relative;
  top: 1px;
}
.win-tab.active { padding: 4px 12px 5px; margin-top: -2px; top: 2px; z-index: 11; font-weight: bold; }
.win-tab::after { content: ""; position: absolute; inset: 0; border-right: 1px solid #808080; pointer-events: none; }

/* ── List view (Explorer style) ──────────────────────────── */
.win-list {
  background: #fff;
  border: 2px solid #808080;
  border-right-color: #fff;
  border-bottom-color: #fff;
  box-shadow: inset 1px 1px 0 #000, 1px 1px 0 #dfdfdf;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.win-list-header {
  display: flex;
  background: #C0C0C0;
  border-bottom: 1px solid #000;
  flex-shrink: 0;
  user-select: none;
}
body.col-resizing { user-select: none; }
body.col-resizing * { cursor: col-resize !important; }

/* Column context menu */
.col-ctx-menu {
  position: fixed; z-index: 10000;
  background: #C0C0C0; padding: 2px;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff, 2px 2px 0 rgba(0,0,0,0.3);
  font-size: 13px; min-width: 120px;
  user-select: none;
}
.col-ctx-row {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 4px; cursor: pointer;
}
.col-ctx-check { width: 16px; text-align: center; font-size: 12px; flex-shrink: 0; }
.col-ctx-label { white-space: nowrap; }
.win-list-col {
  padding: 2px 6px;
  font-size: 13px;
  font-weight: normal;
  border-right: 1px solid #808080;
  box-shadow: inset 1px 1px 0 #fff;
}
.win-list-col:last-child {
  border-right: none;
  background: #C0C0C0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.win-list-col:active { box-shadow: inset 1px 1px 0 #000; }
.win-list-col[draggable="true"] { cursor: grab; }
.win-list-col.col-dragging { opacity: 0.4; }
.win-list-col.col-drag-over-left  { box-shadow: inset 3px 0 0 var(--navy); }
.win-list-col.col-drag-over-right { box-shadow: inset -3px 0 0 var(--navy); }
.win-list-body { flex: 1; overflow-y: auto; background: #fff; }
.win-list-row {
  display: flex;
  font-size: 16px;
  color: #000;
  cursor: default;
  align-items: center;
  min-height: 26px;
}
.win-list-cell {
  padding: 3px 6px;
  border-right: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Stats tab --- */
.stats-toolbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 4px;
  flex-shrink: 0;
  background: var(--grey);
}
.stats-toolbar-label {
  font-size: 15px;
  color: #000;
  flex-shrink: 0;
  width: 68px;
  min-width: 68px;
  max-width: 68px;
}
.stats-toolbar-label.compact {
  width: auto;
  min-width: auto;
  max-width: none;
}
.stats-cat-select {
  flex: 1;
}
.stats-range-select {
  flex: 1;
}
.stats-custom-range {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px 4px;
  font-size: 11px;
  background: var(--grey);
  margin-left: 74px;
}
.stats-custom-range.hidden { display: none; }
.stats-custom-range .win-input {
  font-size: 11px;
  padding: 1px 4px;
  font-family: Tahoma, Arial, sans-serif;
}


/* Stock number in grid view */
.wiki-stock { font-size: 11px; color: var(--text-dim); margin-top: -2px; }

/* Column widths */
.stats-col-fav    { width: 28px; text-align: center; flex-shrink: 0; }
.stats-col-produce { width: 28px; text-align: center; flex-shrink: 0; }
.stats-col-name   { flex: 1; }
.stats-col-stock  { width: 65px; flex-shrink: 0; }
.stats-col-target { width: 90px; flex-shrink: 0; }
.stats-col-change { width: 65px; flex-shrink: 0; }
.stats-col-price  { width: 70px; flex-shrink: 0; }
.stats-col-sflval { width: 75px; flex-shrink: 0; }
.stats-col-bait, .stats-row-bait { width: 90px; padding: 0 4px; }
.stats-col-tier, .stats-row-tier { width: 60px; padding: 0 4px; }
.stats-col-seed, .stats-row-seed { width: 80px; padding: 0 4px; }
.stats-col-time, .stats-row-time { width: 60px; padding: 0 4px; text-align: right; }
.stats-col-station, .stats-row-station { width: 80px; padding: 0 4px; color: var(--text-dim); font-size: 11px; }

/* Sortable header interaction */
.win-list-col[data-sort] { cursor: pointer; }
.win-list-col[data-sort]:active {
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
}

/* Stats row cells */
.stats-row-fav {
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 4px 0;
}
.stats-row-produce {
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 4px 0;
}
.stats-row-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  overflow: hidden;
}
.stats-row-name img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.stats-row-stock {
  width: 70px;
  text-align: right;
  padding: 4px 6px;
  flex-shrink: 0;
}
.stats-row-target {
  width: 90px;
  text-align: right;
  padding: 4px 6px;
  flex-shrink: 0;
  color: var(--text-dim);
}
.stats-row-target.hidden { display: none; }
.stats-target-input {
  width: 100%;
  font-size: inherit;
  font-family: Tahoma, Arial, sans-serif;
  padding: 1px 3px;
  text-align: right;
  box-shadow: var(--win-border-in);
  border: none;
  background: #fff;
}
.stats-settings-btn {
  font-size: 13px;
  padding: 1px 5px;
  min-width: 22px;
  cursor: pointer;
}
.stats-settings-btn.pressed {
  box-shadow: var(--btn-pressed);
  background: #d0d0d0;
}
.stats-row-change {
  width: 70px;
  text-align: right;
  padding: 4px 6px;
  font-weight: bold;
  flex-shrink: 0;
}
.stats-row-price {
  width: 70px;
  text-align: right;
  padding: 4px 6px;
  flex-shrink: 0;
  color: var(--text-dim);
}
.stats-row-sflval {
  width: 75px;
  text-align: right;
  padding: 4px 6px;
  flex-shrink: 0;
  font-weight: 600;
}

/* Selected row */
.win-list-row.stats-selected {
  background: #000080;
  color: #fff;
}
.win-list-row.stats-selected .stats-row-change {
  color: #fff !important;
}

/* ── Income column widths ── */
.income-col-item   { flex: 1; min-width: 60px; }
.income-col-qty    { width: 70px; flex-shrink: 0; }
.income-col-stock  { width: 65px; flex-shrink: 0; }
.income-col-target { width: 70px; flex-shrink: 0; }
.income-col-price  { width: 70px; flex-shrink: 0; }
.income-col-net    { width: 70px; flex-shrink: 0; }
.income-col-sfl    { width: 80px; flex-shrink: 0; }

.income-cell-item {
  flex: 1; min-width: 60px;
  display: flex; align-items: center; gap: 6px; padding: 4px 6px;
  overflow: hidden;
}
.income-cell-qty    { width: 70px; text-align: right; padding: 4px 6px; flex-shrink: 0; }
.income-cell-stock  { width: 65px; text-align: right; padding: 4px 6px; flex-shrink: 0; }
.income-cell-target { width: 70px; text-align: right; padding: 4px 6px; flex-shrink: 0; color: var(--text-dim); }
.income-cell-price  { width: 70px; text-align: right; padding: 4px 6px; flex-shrink: 0; color: var(--text-dim); }
.income-cell-net    { width: 70px; text-align: right; padding: 4px 6px; flex-shrink: 0; }
.income-cell-sfl    { width: 80px; text-align: right; padding: 4px 6px; flex-shrink: 0; font-weight: 600; }

/* ── Checklist column widths ── */
.checklist-col-item    { flex: 1; min-width: 60px; }
.checklist-col-stock   { width: 65px; flex-shrink: 0; }
.checklist-col-target  { width: 65px; flex-shrink: 0; }
.checklist-col-need    { width: 65px; flex-shrink: 0; }
.checklist-col-station { width: 80px; flex-shrink: 0; }

.checklist-cell-item {
  flex: 1; min-width: 60px;
  display: flex; align-items: center; gap: 6px; padding: 4px 6px;
  overflow: hidden;
}
.checklist-cell-stock   { width: 65px; text-align: right; padding: 4px 6px; flex-shrink: 0; }
.checklist-cell-target  { width: 65px; text-align: right; padding: 4px 6px; flex-shrink: 0; color: var(--text-dim); }
.checklist-cell-need    { width: 65px; text-align: right; padding: 4px 6px; flex-shrink: 0; font-weight: 600; }
.checklist-cell-station { width: 80px; padding: 4px 6px; flex-shrink: 0; color: var(--text-dim); font-size: 11px; }

/* ── Delivery column widths ── */
.del-col-npc     { flex: 1; min-width: 80px; }
.del-col-reward  { width: 100px; flex-shrink: 0; }
.del-col-cost    { width: 80px; flex-shrink: 0; }

.del-cell-npc {
  flex: 1; min-width: 80px;
  display: flex; align-items: center; gap: 6px; padding: 4px 6px;
  overflow: hidden;
}
.del-cell-reward  { width: 100px; text-align: right; padding: 4px 6px; flex-shrink: 0; }
.del-cell-cost    { width: 80px; text-align: right; padding: 4px 6px; flex-shrink: 0; }

/* Daily checklist */
.daily-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--win-border);
  cursor: pointer;
  font-size: 16px;
  min-height: 26px;
  color: #000;
}
.daily-check-row:last-child { border-bottom: none; }
.daily-check-row { cursor: pointer; user-select: none; }
.daily-check-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex-shrink: 0;
  border: 1px solid #808080; background: #fff;
  font-size: 12px; font-weight: 700; line-height: 1;
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #dfdfdf;
}
.daily-check-row.done .daily-check-icon { color: var(--green); }
.daily-check-row.done span:last-child { text-decoration: line-through; color: var(--text-dim); }
.daily-check-row.skip .daily-check-icon { color: var(--red); }
.daily-check-row.skip span:last-child { text-decoration: line-through; color: var(--text-dim); font-style: italic; }

/* ── Checklist calendar (Win95 Date/Time style) ─────────── */
.cal-grid {
  margin: 6px 8px;
  border: 2px groove #c0c0c0;
  padding: 6px 8px;
  background: #c0c0c0;
  position: relative;
}
.cal-grid-label {
  position: absolute;
  top: -8px;
  left: 8px;
  background: #c0c0c0;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 400;
  color: #000;
}
.cal-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12px;
  padding: 0 0 3px;
  color: #000;
}
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fff;
  border: 1px solid #808080;
  box-shadow: inset 1px 1px 0 #404040;
}
.cal-day-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #000;
  padding: 2px 0;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
}
.cal-cell {
  text-align: center;
  font-size: 11px;
  padding: 2px 0;
  min-height: 18px;
  line-height: 18px;
  color: #000;
  background: #fff;
  cursor: default;
}
.cal-cell.empty { }
.cal-cell.cal-done {
  background: #c0e8c0;
  font-weight: 700;
}
.cal-cell.cal-partial {
  background: #f0e8b0;
}
.cal-cell.cal-today {
  background: #000080;
  color: #fff;
  font-weight: 700;
}
.cal-cell.cal-today.cal-done {
  background: #006400;
  color: #fff;
}
.cal-cell.cal-today.cal-partial {
  background: #8B8000;
  color: #fff;
}
.cal-streak {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 0 0;
  color: #000;
}

/* Status bar */
/* stats-status-bar removed — stats info now in shared win-status */

/* ── Status bar ──────────────────────────────────────────── */
.win-status {
  background: #C0C0C0;
  box-shadow: var(--win-border-in);
  margin: 0 4px 4px 4px;
  padding: 2px 4px;
  font-size: 14px;
  color: #000;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-sizing: border-box;
}
.win-status-left { flex: 1; }
.win-status-right {
  display: flex; align-items: center; gap: 4px;
  font-weight: bold; margin-right: 4px;
}
.win-status-right img {
  width: 14px; height: 14px;
  image-rendering: pixelated;
}
.win-status-grip { display: none; }

/* ── Sidebar panel ───────────────────────────────────────── */
#sidebar-panel {
  display: flex;
  flex-direction: column;
  background: transparent;
  position: relative;
  width: 400px;
  max-width: none;
  flex-shrink: 0;
  z-index: 50;
  box-shadow: none;
  margin: 0;
  padding: 0;
  max-height: 100%;
}
#sidebar-panel.hidden { display: none; }
#sidebar-panel .win { max-height: 100%; display: flex; flex-direction: column; }
#sidebar-panel .win-body {
  background: #fff;
  box-shadow: var(--win-border-in);
  overflow-y: auto;
  flex: 1;
  padding: 16px;
  margin: 4px;
}
#sidebar-panel .card {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  margin-bottom: 24px;
}
#sidebar-panel .card > *:not(.card-title) { background: transparent; padding: 0; box-shadow: none; }
.sp { display: none; }
.sp.active { display: block; }
#sp-wiki.active { display: flex; flex-direction: column; gap: 0; }

/* ── Game pane ───────────────────────────────────────────── */
#game-pane {
  padding: 0;
  background: #C0C0C0;
  box-shadow: var(--win-border-out);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.game-body {
  flex: 1;
  min-height: 0;
  margin: 0 4px 4px;
  position: relative;
  overflow: hidden;
}
#game-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: default;
}
.game-body::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: var(--win-border-in);
  pointer-events: none;
  z-index: 1;
}
.game-body iframe,
#game-pane iframe {
  display: block;
  border: none;
  width: 100%;
  height: 100%;
  box-shadow: var(--win-border-in);
  border-radius: 0;
  background: #000;
}

/* ── Game zoom controls ──────────────────────────────────── */
.game-zoom-btn {
  background: #c0c0c0;
  border: none;
  color: #000;
  font-size: 0.9rem;
  font-weight: 700;
  width: 20px;
  height: 18px;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
}
.game-zoom-btn:active { box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #808080; }
.game-zoom-label {
  font-size: 0.75rem;
  color: #fff;
  min-width: 28px;
  text-align: center;
  display: inline-block;
  padding: 0 2px;
}
.game-body { overflow: hidden; }

/* ── Resizable window ────────────────────────────────────── */
.win-resizable { display: flex; max-width: none; }
.win-resizable .win-body { flex: 1; min-height: 0; overflow: hidden; }
.win-resizable .win-body iframe { display: block; border: none; width: 100%; height: 100%; }
.win-resize-handle { display: none; }

/* ── Cards ───────────────────────────────────────────────── */
.card, .bal-card {
  background: transparent;
  box-shadow: none;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-title {
  background: transparent;
  color: #000;
  height: auto; min-height: 0;
  padding: 0;
  display: flex; align-items: center;
  font-size: 11px; font-weight: bold;
  gap: 4px;
  margin: 0;
  border-radius: 0;
  letter-spacing: 0;
  border-bottom: 1px solid #C0C0C0;
  cursor: pointer;
  user-select: none;
}
.card-title span { display: flex; align-items: center; gap: 0.4rem; }
.card-title .toggle-icon { color: #000; font-size: 9px; transition: transform 0.2s; }
.card.collapsed > *:not(.card-title) { display: none; }
.card.collapsed .card-title { margin-bottom: 0; }
.card.collapsed .toggle-icon { transform: rotate(-90deg); }
.card > *:not(.card-title) { margin-top: 0; background: transparent; padding: 0; color: #000; box-shadow: none; }

/* ── Buttons ─────────────────────────────────────────────── */
.filter-btn, .pace-toggle-btn {
  background: #C0C0C0;
  box-shadow: var(--win-border-out);
  border: none; border-radius: 0;
  color: #000; cursor: pointer;
  font-size: 11px;
  padding: 4px 12px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  min-width: 60px;
}
.filter-btn:active, .filter-btn.active { box-shadow: var(--btn-pressed); background: #C0C0C0; }
.filter-btn.active::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed #000;
  pointer-events: none;
}
.pace-toggle-btn.active { box-shadow: var(--btn-pressed); background: #C0C0C0; color: #000; }

/* Radio / check — strip chrome, native widget look */
.filter-btn.radio-btn,
.filter-btn.check-btn {
  background: transparent;
  box-shadow: none;
  border: none;
  height: auto; min-width: 0;
  padding: 1px 6px 1px 20px;
  justify-content: flex-start;
  cursor: pointer;
}
.filter-btn.radio-btn:active, .filter-btn.radio-btn.active,
.filter-btn.check-btn:active,  .filter-btn.check-btn.active { box-shadow: none; background: transparent; }
.filter-btn.radio-btn::before {
  content: ""; position: absolute;
  left: 2px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  background: #fff; box-shadow: var(--win-border-in); border-radius: 50%; inset: unset;
}
.filter-btn.radio-btn.active::after {
  content: ""; position: absolute;
  left: 6px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px;
  background: #000; border-radius: 50%; border: none; inset: unset;
}
.filter-btn.check-btn::before {
  content: ""; position: absolute;
  left: 2px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  background: #fff; box-shadow: var(--win-border-in); border-radius: 0; inset: unset;
}
.filter-btn.check-btn.active::after {
  content: "✓"; position: absolute;
  left: 3px; top: 50%; transform: translateY(-50%);
  font-size: 11px; line-height: 1; color: #000; border: none; inset: unset;
}
.fav-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; padding: 0 0 0 0.3rem; line-height: 1;
  color: var(--border); transition: color 0.12s;
  vertical-align: middle; flex-shrink: 0;
}
.fav-btn.fav-active { color: var(--accent); }

/* ── Group boxes ─────────────────────────────────────────── */
fieldset.win95-group {
  border: 2px solid #dfdfdf;
  border-right-color: #808080;
  border-bottom-color: #808080;
  box-shadow: 1px 1px 0 #fff, inset 1px 1px 0 #808080;
  padding: 12px 8px 8px;
  margin: 8px 0;
  position: relative;
}
fieldset.win95-group legend {
  background: #C0C0C0;
  padding: 0 4px;
  font-size: 11px; font-weight: bold; color: #000;
  position: absolute; top: -8px; left: 8px;
}

.wiki-filter-label {
  font-size: 15px;
  color: #000;
  flex-shrink: 0;
}
.wiki-filter-label.first {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
}
.wiki-filter-row {
  display: inline-flex; align-items: center;
  gap: 6px; font-size: 15px; color: #000; cursor: default;
}
/* ── Win95-style custom select ──────────────────────────── */
.win-select {
  display: inline-flex;
  align-items: stretch;
  background: #fff;
  box-shadow: var(--win-border-in);
  height: 25px;
  padding: 0;
  cursor: pointer;
  user-select: none;
  position: relative;
  min-width: 105px;
}
.win-select-text {
  flex: 1;
  font-size: 14px;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 20px 0 6px;
  display: flex;
  align-items: center;
}
.win-select-arrow {
  position: absolute;
  right: 2px; top: 2px; bottom: 2px;
  width: 16px;
  background: #C0C0C0;
  box-shadow: var(--btn-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #000;
}
.win-select:active .win-select-arrow {
  box-shadow: var(--btn-pressed);
}
.win-select-dropdown {
  display: none;
  position: fixed;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  z-index: 9999;
  max-height: none;
}
.win-select-dropdown.open { display: block; }
.win-select-option {
  padding: 3px 8px;
  font-size: 14px;
  color: #000;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select-icon { width:14px;height:14px;object-fit:contain;image-rendering:pixelated;vertical-align:middle;margin-right:4px; }
.wiki-filter-row input[type="checkbox"] {
  width: 15px; height: 15px;
  box-shadow: var(--win-border-in);
  border: none; border-radius: 0;
  accent-color: #000; cursor: pointer;
}
#sp-wiki .wiki-content { padding: 6px; }

/* ── Wiki grid ───────────────────────────────────────────── */
.wiki-content { flex: 1; min-width: 0; overflow-y: auto; }
.wiki-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 4px;
  column-gap: 8px;
  padding: 8px 6px;
}
.wiki-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; cursor: pointer; padding: 6px 4px 6px;
}
.wiki-item.active .wiki-label { background: #000080; color: #fff; }
.wiki-circle {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.wiki-circle img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.wiki-label {
  font-size: 14px; color: #000; text-align: center;
  max-width: 75px; padding: 1px 3px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  word-break: normal; overflow-wrap: normal;
}
.sp-wiki-detail { min-width: 210px; }
.chip-icon { width: 14px; height: 14px; object-fit: contain; vertical-align: middle; margin-right: 2px; }
.section-icon { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; margin-right: 2px; }
.bal-icon     { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }

/* ── Snap status ─────────────────────────────────────────── */
.snap-dot {
  display: inline-block; width: 9px; height: 9px;
  border-radius: 50%; margin: 0 1px; vertical-align: middle; cursor: default;
}
.snap-dot.ok   { background: var(--green); }
.snap-dot.bad  { background: var(--red); }
.snap-dot.grey { background: var(--text-dim); }
.snap-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: var(--text-dim); cursor: default;
}
.snap-status .tip { min-width: 200px; }
.tip-section { font-size: 1.05rem; font-weight: 600; color: var(--text); padding: 0.25rem 0 0.15rem; position: relative; }
.tip-help-btn {
  background: #c0c0c0;
  border: none;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
  margin-left: 4px;
}
.tip-help-btn:active { box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #808080; }
.tip-help-text {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.4;
  padding: 4px 0 2px;
  white-space: normal;
  max-width: 220px;
}
.tip-section:first-child { padding-top: 0; }

/* ── Crop rows ───────────────────────────────────────────── */
.crop-groups { display: block; }
.crop-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.38rem 0; border-bottom: 1px dotted #808080; gap: 0.5rem;
}
.crop-row:last-child { border-bottom: none; }
.crop-left  { display: flex; align-items: center; gap: 0.4rem; flex: 1; }
.crop-icon  { width: 20px; height: 20px; }
.crop-name  { font-size: 0.875rem; color: var(--text); }
.crop-grow  { font-size: 0.75rem; color: var(--text-dim); padding-right: 0.5rem; }
.crop-boost { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; min-width: 3.5rem; text-align: right; }
.crop-boost.hot { color: var(--accent); }
.crop-boost.dim { color: var(--text-dim); font-weight: 500; }

/* ── Tool economy ────────────────────────────────────────── */
.tools-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0; border-top: 1px dotted #808080;
}
.tools-row:first-child { border-top: none; }
.tools-left { display: flex; align-items: center; gap: 0.5rem; }
.tools-name { font-size: 0.87rem; font-weight: 600; color: var(--text); }
.tools-icon {
  width: 34px; height: 34px; border-radius: 0;
  background: var(--card-alt); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tools-icon img { width: 19px; height: 19px; }
.tools-sub   { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.1rem; }
.tools-right { text-align: right; font-size: 0.87rem; font-weight: 600; flex-shrink: 0; min-width: 2.8rem; }
#sp-wiki .card + .card { padding-top: 0.25rem; }
.win-placeholder { color: var(--text-dim); font-size: 0.85rem; padding: 0.75rem 0; }


/* ── Prices ──────────────────────────────────────────────── */
.prices-item-bar    { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.prices-item-btn    { font-size: 0.78rem; padding: 0.22rem 0.6rem; border-radius: 0; background: var(--card-alt); border: 1px solid var(--border); cursor: pointer; display: flex; align-items: center; gap: 0.35rem; color: var(--text); }
.prices-item-btn img { width: 16px; height: 16px; }
.prices-item-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.prices-now-row     { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.prices-now-val     { font-size: 1.5rem; font-weight: 700; }
.prices-season-badge { font-size: 0.75rem; padding: 0.2rem 0.55rem; border-radius: 0; font-weight: 600; }
.prices-season-badge.in      { background: var(--green-light); color: var(--green); }
.prices-season-badge.out     { background: #fef9c3; color: #a16207; }
.prices-season-badge.neutral { background: var(--card-alt); color: var(--text-dim); }
.prices-avgs        { margin-bottom: 1rem; }
.prices-avg-row     { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.prices-avg-row:last-child { border-bottom: none; }
.prices-avg-row span:first-child { color: var(--text-dim); }
.prices-avg-row span:last-child  { font-weight: 600; }
.prices-bar-wrap    { margin-bottom: 1rem; }
.prices-bar-track   { position: relative; height: 12px; border-radius: 0; margin-bottom: 0.4rem; background: #fff; box-shadow: var(--win-border-in); }
.prices-bar-dot     { position: absolute; width: 14px; height: 14px; border-radius: 0; top: 50%; transform: translate(-50%, -50%); background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.prices-bar-labels  { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-dim); }
.prices-verdict     { font-size: 0.85rem; font-weight: 600; padding: 0.6rem 0.8rem; border-radius: 0; background: #C0C0C0; border: none; box-shadow: var(--btn-border); color: #000; }
.prices-verdict.pos { color: #000080; font-weight: bold; }
.prices-verdict.neg { color: #808080; }
.prices-empty       { font-size: 0.85rem; color: var(--text-dim); text-align: center; padding: 2rem 0; }
.prices-loading     { font-size: 0.85rem; color: var(--text-dim); text-align: center; padding: 2rem 0; }
.prices-cat-label   { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; color: var(--text-dim); margin: 0.8rem 0 0.3rem; }
.prices-cat-label:first-child { margin-top: 0; }
.ph-fly-tip { position: absolute; z-index: 100; background: #C0C0C0; box-shadow: var(--win-border-out); border: none; border-radius: 0; padding: 0; min-width: 220px; max-width: 280px; display: none; }
.ph-fly-tip > * { color: #000; }

/* ── Sidebar fly-tooltip ─────────────────────────────────── */
.sp-fly-tip {
  position: fixed; z-index: 500;
  background: #ffffca;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 #000;
  border-radius: 0;
  padding: 8px 10px;
  min-width: 185px;
  pointer-events: auto;
  transform: translateY(-50%);
  opacity: 0;
  transition: none;
}
.sp-fly-tip.visible    { opacity: 1; }
.sp-fly-tip .tip-label { font-size: 0.88rem; }
.sp-fly-tip .tip-val   { font-size: 0.92rem; }

/* ── Wiki detail panel (Win95 mini-window) ───────────────── */
.sp-fly-tip.sp-wiki-detail {
  background: #C0C0C0;
  box-shadow: var(--win-border-out);
  border: none;
  padding: 0;
  min-width: 200px;
  max-width: 240px;
  transform: none;
}
.sp-wiki-detail .wiki-tip-bar {
  background: #000080;
  color: #fff;
  height: 22px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: bold;
  margin: 3px 3px 0 3px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-wiki-detail .wiki-tip-bar img {
  width: 16px; height: 16px;
  object-fit: contain; image-rendering: pixelated;
  flex-shrink: 0;
}
.sp-wiki-detail .wiki-tip-body {
  background: #ffffe1;
  margin: 3px;
  padding: 6px 8px;
  box-shadow: var(--win-border-in);
}
.sp-wiki-detail .wiki-tip-offseason {
  margin-top: 0.4rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #808080;
}
.sp-wiki-detail .wiki-tip-toggle {
  margin-top: 0.3rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #000080;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.sp-wiki-detail .wiki-tip-extra { display: none; margin-top: 0.3rem; padding-top: 0.25rem; border-top: 1px solid #808080; }
.sp-wiki-detail.expanded .wiki-tip-extra { display: block; }
.sp-wiki-detail.expanded .wiki-tip-toggle-show { display: none; }
.sp-wiki-detail:not(.expanded) .wiki-tip-toggle-hide { display: none; }
.sp-wiki-detail .tip-label { font-size: 0.82rem; }
.sp-wiki-detail .tip-val   { font-size: 0.85rem; }
.sp-inline-arc { display: inline-block; width: 11px; height: 11px; vertical-align: middle; margin-left: 0.4rem; overflow: visible; }
.sp-inline-arc .arc-track { fill: none; stroke: var(--border); stroke-width: 2; }
.sp-inline-arc .arc-fill  { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 31.4; stroke-dashoffset: 31.4; animation: sp-arc-fill 0.5s linear 1 forwards; }
@keyframes sp-arc-fill { to { stroke-dashoffset: 0; } }
.delta-zero { color: var(--text-dim); font-weight: 400; }

/* ── Hover tooltip ───────────────────────────────────────── */
.has-tip { position: relative; cursor: pointer; }
.tip {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #ffffca;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 #000;
  border-radius: 0;
  padding: 4px 6px;
  z-index: 9999;
  min-width: 140px;
  pointer-events: auto;
  transform: none;
  transition: none;
}
.has-tip.tip-open .tip { display: block; }
.tip-row   { display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; padding: 0.15rem 0; }
.tip-label { font-size: 0.82rem; color: var(--text-dim); font-weight: 500; }
.tip-val   { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.tip-val.hot { color: var(--accent); }
.tip-spinner { flex-shrink: 0; transform: rotate(-90deg); opacity: 0; pointer-events: none; transition: opacity 0.1s 0s; }
.tip-track { fill: none; stroke: var(--border); stroke-width: 2; }
.tip-arc   { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 31.4; stroke-dashoffset: 31.4; }
@keyframes tip-charge { to { stroke-dashoffset: 0; } }

/* ── Tip edit mode ─────────────────────────────────────── */
.tip-season-btn {
  position: absolute; top: 2px; right: 30px;
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; padding: 4px; line-height: 1;
  color: var(--text-dim); opacity: 0.7;
  min-width: 28px; min-height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.tip-editing .tip-season-btn { display: none; }
.tip-edit-btn {
  position: absolute; top: 2px; right: 2px;
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; padding: 4px; line-height: 1;
  color: var(--text-dim); opacity: 0.7;
  min-width: 28px; min-height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.tip-editing .tip-edit-btn { display: none; }
.tip-save-btn {
  position: absolute; top: 2px; right: 2px;
  background: var(--bg); border: 1px solid #000;
  box-shadow: var(--btn-border);
  font-size: 0.85rem; padding: 4px 10px; cursor: pointer;
  font-family: inherit; color: var(--text);
  min-height: 28px;
}
.tip-save-btn:active { box-shadow: var(--btn-pressed); }
.tip-save-btn:disabled { opacity: 0.4; cursor: default; }
.tip-save-btn { display: none; }
.tip-editing .tip-save-btn { display: block; }
.tip-edit-row {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.15rem 0; font-size: 0.82rem; color: var(--text);
  cursor: pointer;
}
.tip-edit-row input[type="checkbox"] { margin: 0; cursor: pointer; }
.tip-edit-row img { width: 16px; height: 16px; image-rendering: pixelated; object-fit: contain; }
.tip-normal { display: block; }
.tip-editing .tip-normal { display: none; }
.tip-edit-list { display: none; }
.tip-editing .tip-edit-list { display: block; }

/* ── XP / progress bars ──────────────────────────────────── */
.xp-bar-wrap { background: #fff; box-shadow: var(--win-border-in); height: 12px; border: none; border-radius: 0; overflow: hidden; margin-top: 0.6rem; }
.xp-bar      { height: 100%; background: #000080; border-radius: 0; }

/* ── Loading / error ─────────────────────────────────────── */
.status-msg { text-align: center; padding: 3rem; color: var(--text-dim); }
.spinner {
  display: inline-block; width: 26px; height: 26px;
  border: 3px solid #808080; border-top-color: #000080;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-msg { color: var(--red); }

/* ── Animations ──────────────────────────────────────────── */
@keyframes jiggle {
  0%   { transform: rotate(0deg); }  20%  { transform: rotate(-5deg); }
  40%  { transform: rotate(4deg); }  60%  { transform: rotate(-3deg); }
  80%  { transform: rotate(2deg); }  100% { transform: rotate(0deg); }
}
@keyframes text-bob {
  0%   { transform: translateY(0); }   25%  { transform: translateY(-2px); }
  75%  { transform: translateY(1px); } 100% { transform: translateY(0); }
}
@keyframes wave-char {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-4px); }
  70%      { transform: translateY(1px); }
}

/* ── Scrollbars ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: #dfdfdf url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQIW2NkYGD4z8DAwMgAI0AMDA4A/8OpEFAAAAAASUVORK5CYII='); }
::-webkit-scrollbar-thumb { background: #C0C0C0; box-shadow: var(--btn-border); }

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

/* ── Touch-action for drag surfaces ────────────────────── */
.win-resize-handle { touch-action: none; }
.win-bar { touch-action: none; }
.win-list-header { touch-action: none; }
.win-list-col[data-col-key] { touch-action: none; }

/* ── Hover styles (mouse/trackpad only) ────────────────── */
@media (hover: hover) {
  .refresh-btn:hover  { background: #C0C0C0; }
  .start-menu-item:hover { background: #000080; color: #fff; }
  .win-btn:hover           { background: #C0C0C0; }
  .win-btn.win-close:hover { background: #C0C0C0; color: #000; }
  .col-ctx-row:hover { background: #000080; color: #fff; }
  .win-list-row:hover { background: #000080; color: #fff; }
  .win-list-col[data-sort]:hover { background: #d0d0d0; }
  .win-select-option:hover { background: #000080; color: #fff; }
  .wiki-item:hover .wiki-label { background: #000080; color: #fff; }
  .sp-wiki-detail .wiki-tip-toggle:hover { text-decoration: underline; }
  .has-tip:hover .tip-spinner { opacity: 1; }
  .has-tip:hover .tip-arc { animation: tip-charge 0.9s linear forwards; }
  .tip-season-btn:hover { opacity: 1; }
  .tip-edit-btn:hover { opacity: 1; }
  .has-tip:hover .wave-char { animation: wave-char 0.9s ease-in-out 1 forwards; display: inline-block; }
  .has-tip:hover .crop-icon { animation: spin 0.9s ease-in-out 1 forwards; display: inline-block; }
}
