﻿/* ============================================================
   ExoGoblin desktop app — 1:1 interactive HTML replica
   The app window is authored at its native 699×400 compact size,
   then scaled to fit the website. All app UI values below match
   the WPF app (DM Sans, #33D17A accent, panel colors, 64px rail).
   ============================================================ */

@font-face {
  font-family: 'DM Sans';
  src: url('fonts/DMSans-Variable.ttf') format('truetype');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

/* ---------- Section ---------- */

.app-preview-section {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 0 6rem;
}
.app-preview-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 50% 48%, rgba(51, 209, 122, 0.10), transparent 66%),
    radial-gradient(700px 420px at 82% 70%, rgba(255, 122, 69, 0.055), transparent 70%);
}
.app-preview-section > .shell {
  position: relative;
  z-index: 1;
}
.app-preview-head {
  text-align: center;
}
.app-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.15rem;
  padding: 0.38rem 0.85rem;
  border: 1px solid rgba(51, 209, 122, 0.22);
  border-radius: 999px;
  background: rgba(51, 209, 122, 0.055);
  color: #bef264;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.app-preview-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #33d17a;
  box-shadow: 0 0 10px rgba(51, 209, 122, 0.8);
}

/* Compact preview stacked under the hero live-session terminal. */
.hero-app-preview .app-stage {
  max-width: 100%;
  padding: 0.6rem 0 0.7rem;
  --app-scale: 0.88;
}
.hero-app-preview .app-stage::after {
  bottom: 0.1rem;
  height: 30px;
  width: 58%;
}
.hero-app-preview .app-stage-glow {
  animation: none;
  opacity: 0.55;
}
.hero-app-preview .app-hint {
  margin-top: 0.5rem;
}
.hero-app-preview .app-preview-note {
  margin-top: 0.35rem;
}
@media (max-width: 639px) {
  .hero-app-preview .app-stage {
    padding: 0.4rem 0 0.5rem;
  }
}

/* ---------- 3D stage ---------- */

.app-stage {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.2rem 0 2.6rem;
  --app-scale: 1;
}
.app-stage-glow {
  position: absolute;
  inset: 8% 12% 2%;
  z-index: 0;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(51, 209, 122, 0.18), transparent 68%),
    radial-gradient(closest-side at 75% 70%, rgba(255, 122, 69, 0.10), transparent 70%);
  filter: blur(52px);
  animation: appStageGlow 9s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes appStageGlow {
  from { opacity: 0.55; transform: scale(0.94); }
  to   { opacity: 0.95; transform: scale(1.06); }
}
.app-stage::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  z-index: 0;
  width: 62%;
  height: 44px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.85), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}
.app-fit {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  width: calc(699px * var(--app-scale));
  height: calc(400px * var(--app-scale));
  perspective: 1800px;
}
.app-scaler {
  --rx: 4deg;
  --ry: -3deg;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 699px;
  height: 400px;
  zoom: var(--app-scale);
  transform: translate(-50%, -50%) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--lift, 0px));
  transform-origin: center center;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.app-scaler.is-tilting {
  --lift: 14px;
  transition: transform 0.08s linear;
}
.app-depth-glow {
  position: absolute;
  inset: -54px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(51, 209, 122, 0.22), rgba(255, 122, 69, 0.08) 58%, transparent 76%);
  filter: blur(38px);
  transform: translateZ(-52px);
  pointer-events: none;
}
.app-depth-frame {
  position: absolute;
  inset: -9px;
  z-index: 0;
  border-radius: 22px;
  background: linear-gradient(145deg, #3b433b 0%, #171b17 38%, #080a08 76%, #111511 100%);
  box-shadow:
    0 42px 90px -26px rgba(0, 0, 0, 0.9),
    0 18px 34px -18px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7);
  transform: translateZ(-18px);
  pointer-events: none;
}
.app-depth-frame::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 21px;
  border: 1px solid rgba(51, 209, 122, 0.10);
  pointer-events: none;
}

/* ---------- Window shell ---------- */

.app-window {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: #141414;
  color: #f2f5f2;
  font-family: 'DM Sans', 'Segoe UI Variable Display', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-optical-sizing: auto;
  box-shadow:
    0 30px 70px -24px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.app-window::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 60;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

/* ---------- Title bar ---------- */

.app-titlebar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 9px 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(18, 20, 18, 0.94);
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.app-brand img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: block;
}
.app-brand-name {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f2f5f2;
}
.app-brand-version {
  margin-left: 2px;
  font-size: 9.5px;
  font-weight: 500;
  color: #7e8a7e;
  white-space: nowrap;
}
.app-title-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.app-title-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8a968a;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.app-title-btn svg {
  width: 12px;
  height: 12px;
}
.app-title-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f2f5f2;
}
.app-title-btn.app-close:hover {
  background: #e23b2e;
  color: #fff;
}

/* ---------- App body ---------- */

.app-body {
  position: relative;
  display: flex;
  height: calc(100% - 40px);
  padding: 8px 8px 8px 0;
  background:
    radial-gradient(680px 400px at 8% 0%, rgba(51, 209, 122, 0.19), transparent 62%),
    radial-gradient(620px 420px at 92% 100%, rgba(255, 122, 69, 0.14), transparent 62%),
    radial-gradient(500px 300px at 55% 30%, rgba(43, 184, 107, 0.05), transparent 70%),
    linear-gradient(135deg, #1a1a1a 0%, #151515 55%, #101010 100%);
}

/* ---------- Sidebar ---------- */

.app-sidebar {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 56px;
  margin: 0 8px 0 7px;
  padding: 4px 0;
  border: 1px solid #333333;
  border-radius: 16px;
  background: #99171717;
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.app-nav {
  position: relative;
  width: 42px;
  height: 44px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #8a968a;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.app-nav:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #d7e0d7;
}
.app-nav.active {
  border-color: rgba(84, 227, 154, 0.8);
  background: linear-gradient(135deg, #54e39a 0%, #2bb86b 100%);
  color: #07130b;
  box-shadow:
    0 0 20px rgba(51, 209, 122, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.app-nav.active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  width: 2.5px;
  height: 24px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: #33d17a;
  box-shadow: 0 0 8px rgba(51, 209, 122, 0.9);
}
.app-nav-icon {
  width: 20px;
  height: 20px;
  display: block;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.app-nav.active .app-nav-icon {
  color: #07130b;
}

/* ---------- Main column ---------- */

.app-main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-left: 7px;
}

/* ---------- Status bar ---------- */

.app-statusbar {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid #333333;
  border-radius: 12px;
  background:
    linear-gradient(100deg, rgba(51, 209, 122, 0.055), transparent 38%),
    linear-gradient(135deg, rgba(34, 38, 31, 0.90), rgba(26, 30, 25, 0.94));
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.app-welcome {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 190px;
  color: #33d17a;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.app-welcome > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  min-width: 0;
}
.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 10px;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 14px;
  white-space: nowrap;
}
.app-chip b {
  font-weight: 600;
}
.app-chip.gold { background: rgba(200, 155, 87, 0.10); color: #e2b273; }
.app-chip.amber { background: rgba(255, 215, 0, 0.10); color: #ffd7a0; }
.app-chip.green { background: rgba(43, 184, 107, 0.10); color: #33d17a; }
.app-chip.blue { background: rgba(84, 79, 107, 0.10); color: #9fa8c4; }
.app-clock-icon {
  width: 12px;
  height: 12px;
  display: inline-block;
  flex-shrink: 0;
  background: #ffffff;
  -webkit-mask: url('/icons/clock.png') center / contain no-repeat;
  mask: url('/icons/clock.png') center / contain no-repeat;
}

.app-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #33d17a;
  box-shadow: 0 0 7px rgba(51, 209, 122, 0.85);
}
.app-dot.red {
  background: #e23b2e;
  box-shadow: 0 0 7px rgba(226, 59, 46, 0.6);
}
.app-dot.green {
  background: #33d17a;
  box-shadow: 0 0 7px rgba(51, 209, 122, 0.85);
}
.app-statusbar .app-dot {
  width: 7px;
  height: 7px;
}

/* ---------- Cards ---------- */

.app-card {
  position: relative;
  z-index: 2;
  border: 1px solid #333333;
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(51, 209, 122, 0.035), transparent 42%),
    linear-gradient(135deg, rgba(34, 38, 31, 0.90), rgba(26, 30, 25, 0.95));
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.app-instance {
  flex: 0 0 143px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.app-instance-head {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  margin-bottom: 10px;
}
.app-instance-key {
  padding: 3px 8px;
  border: 1px solid rgba(51, 209, 122, 0.16);
  border-radius: 5px;
  background: rgba(0, 255, 0, 0.13);
  color: #f2f5f2;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 15px;
  white-space: nowrap;
}
.app-idle-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.10);
  color: #aeb9ae;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 9.5px;
  line-height: 15px;
  white-space: nowrap;
}
.app-idle-pill.is-farming {
  background: rgba(43, 184, 107, 0.12);
  color: #33d17a;
}
.app-toggle {
  position: relative;
  width: 92px;
  height: 24px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #d32f2f;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.25s;
  flex-shrink: 0;
}
.app-toggle-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-toggle-label {
  position: absolute;
  right: 5px;
  top: 0;
  z-index: 1;
  width: 66px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}
.app-toggle.is-on {
  background: #2e8b2e;
}
.app-toggle.is-on .app-toggle-thumb {
  transform: translateX(68px);
}
.app-toggle.is-on .app-toggle-label {
  right: auto;
  left: 5px;
}
.app-icon-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #99111111;
  color: #8a968a;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.app-icon-btn:hover {
  border-color: #4a524a;
  background: rgba(255, 255, 255, 0.04);
  color: #33d17a;
}
.app-icon-btn svg {
  width: 13px;
  height: 13px;
}
.app-delete {
  width: 24px;
  height: 24px;
  border-color: transparent;
  background: transparent;
}
.app-delete:hover {
  color: #ff747d;
  border-color: rgba(255, 116, 125, 0.25);
  background: rgba(255, 116, 125, 0.07);
}

/* ---------- Fields ---------- */

.app-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  transition: opacity 0.2s;
}
.app-fields.is-locked {
  opacity: 0.45;
  pointer-events: none;
}
.app-field {
  position: relative;
  min-width: 0;
}
.app-field label {
  display: block;
  margin-bottom: 3px;
  color: #7e8a7e;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 10px;
  text-transform: uppercase;
}
.app-field-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.app-select {
  flex: 1;
  min-width: 0;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #99111111;
  color: #f2f5f2;
  font-family: inherit;
  font-size: 10.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.app-select:hover {
  border-color: #4a524a;
  background: #aa151515;
}
.app-field > .app-select {
  width: 100%;
}
.app-select span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-select svg {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  color: #7e8a7e;
}
.app-edit {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8a968a;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}
.app-edit:hover {
  color: #33d17a;
  background: rgba(255, 255, 255, 0.05);
}
.app-refresh svg {
  width: 12px;
  height: 12px;
}
.app-refresh.is-spinning svg {
  animation: appSpin 0.7s linear infinite;
}
@keyframes appSpin {
  to { transform: rotate(360deg); }
}

/* ---------- Mode toggle ---------- */

.app-mode-row {
  display: flex;
  justify-content: center;
  transition: opacity 0.2s;
}
.app-mode-row.is-locked {
  opacity: 0.45;
  pointer-events: none;
}
.app-mode-toggle {
  position: relative;
  width: 80px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #2e8b2e;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.25s;
}
.app-mode-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-mode-label {
  position: absolute;
  right: 7px;
  top: 0;
  z-index: 1;
  width: 60px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.app-mode-toggle.is-ranked {
  background: #ff9a34;
}
.app-mode-toggle.is-ranked .app-mode-thumb {
  transform: translateX(56px);
}
.app-mode-toggle.is-ranked .app-mode-label {
  right: auto;
  left: 5px;
}

/* ---------- Bottom bar ---------- */

.app-home-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.app-home-view[hidden] {
  display: none;
}
.app-spacer {
  flex: 1;
}
.app-bottombar {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #333333;
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(51, 209, 122, 0.03), transparent 45%),
    linear-gradient(135deg, rgba(34, 38, 31, 0.90), rgba(26, 30, 25, 0.95));
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.app-plus {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffa64d, #ff7a45);
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 122, 69, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s, filter 0.15s;
}
.app-plus:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.app-plus:active {
  transform: translateY(0);
}
.app-start {
  flex: 1;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #54e39a, #2bb86b);
  color: #fff;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(51, 209, 122, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: filter 0.15s, transform 0.15s, background 0.25s;
}
.app-start:hover {
  filter: brightness(1.06);
}
.app-start:active {
  transform: translateY(1px);
}
.app-start.is-running {
  background: linear-gradient(135deg, #ffa64d, #e23b2e);
  box-shadow: 0 8px 18px rgba(226, 59, 46, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.app-ping {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  flex-shrink: 0;
  border: 1px solid #333333;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #aeb9ae;
  font-family: inherit;
  font-size: 9.5px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.app-ping:hover {
  border-color: #4a524a;
  background: rgba(255, 255, 255, 0.05);
  color: #f2f5f2;
}
.app-ping svg {
  width: 13px;
  height: 13px;
}
.app-ping.is-pinging svg {
  animation: appSpin 0.9s linear infinite;
}

/* ---------- Dropdowns ---------- */

.app-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 26px;
  z-index: 40;
  display: none;
  padding: 4px;
  border: 1px solid #3a3f3a;
  border-radius: 8px;
  background: #1b1f1b;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
}
.app-menu.is-open {
  display: block;
}
.app-field:last-child .app-menu {
  right: 0;
}
.app-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #aeb9ae;
  font-family: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}
.app-menu button:hover {
  background: rgba(51, 209, 122, 0.10);
  color: #f2f5f2;
}
.app-menu button.is-selected {
  color: #33d17a;
}
.app-menu button.is-selected::after {
  content: '✓';
  font-size: 10px;
}

/* ---------- Alternate views ---------- */

.app-alt-view {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-alt-view[hidden] {
  display: none;
}
.app-alt-card {
  width: 360px;
  padding: 24px;
  border: 1px solid #333333;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(34, 38, 31, 0.92), rgba(26, 30, 25, 0.96));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  text-align: center;
}
.app-alt-icon {
  width: 38px;
  height: 38px;
  margin: 0 auto;
  display: block;
  background: #33d17a;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  filter: drop-shadow(0 0 12px rgba(51, 209, 122, 0.4));
}
.app-alt-card h3 {
  margin: 12px 0 0;
  color: #f2f5f2;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.app-alt-card p {
  margin: 6px 0 0;
  color: #aeb9ae;
  font-size: 10.5px;
  line-height: 1.55;
}
.app-alt-card button {
  margin-top: 14px;
  height: 28px;
  padding: 0 14px;
  border: 1px solid rgba(51, 209, 122, 0.35);
  border-radius: 8px;
  background: rgba(51, 209, 122, 0.10);
  color: #33d17a;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}
.app-alt-card button:hover {
  background: rgba(51, 209, 122, 0.18);
}

/* ---------- Licenses view ---------- */

.app-licenses-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-licenses-view[hidden] {
  display: none;
}
.app-licenses-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-licenses-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.app-licenses-ico {
  width: 16px;
  height: 16px;
  display: block;
  background: currentColor;
  color: #33d17a;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.app-licenses-title h3 {
  margin: 0;
  color: #f2f5f2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
#appLicenseCount {
  color: #7e8a7e;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 9px;
  white-space: nowrap;
}
.app-licenses-back {
  height: 24px;
  padding: 0 8px;
  border: 1px solid #333333;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: #aeb9ae;
  font-family: inherit;
  font-size: 9px;
  cursor: pointer;
}
.app-licenses-back:hover {
  border-color: #4a524a;
  color: #f2f5f2;
}
.app-license-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.app-license-card {
  border: 1px solid #333333;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 38, 31, 0.9), rgba(26, 30, 25, 0.95));
  padding: 8px 10px;
}
.app-license-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-license-key {
  min-width: 0;
  color: #f2f5f2;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 9.5px;
  line-height: 1.4;
  word-break: break-all;
}
.app-license-status {
  flex-shrink: 0;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.app-license-status.is-active {
  background: rgba(51, 209, 122, 0.12);
  border-color: rgba(51, 209, 122, 0.25);
  color: #33d17a;
}
.app-license-status.is-inactive {
  background: rgba(255, 215, 0, 0.10);
  border-color: rgba(255, 215, 0, 0.2);
  color: #e2b273;
}
.app-license-status.is-expired,
.app-license-status.is-revoked {
  background: rgba(226, 59, 46, 0.10);
  border-color: rgba(226, 59, 46, 0.22);
  color: #ff9a9a;
}
.app-license-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #7e8a7e;
  font-size: 9px;
  line-height: 1.4;
}
.app-license-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: #7e8a7e;
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
  white-space: pre-line;
}
.app-license-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 7px;
}
.app-license-hint {
  min-width: 0;
  color: #7e8a7e;
  font-size: 9px;
  line-height: 1.35;
}
.app-license-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.app-license-download,
.app-license-signin {
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
}
.app-license-download {
  border: 1px solid rgba(84, 227, 154, 0.5);
  background: linear-gradient(135deg, #54e39a, #2bb86b);
  color: #07130b;
  box-shadow: 0 6px 14px rgba(51, 209, 122, 0.22);
}
.app-license-download:hover {
  filter: brightness(1.06);
}
.app-license-download:disabled {
  opacity: 0.6;
  cursor: wait;
}
.app-license-signin {
  border: 1px solid #333333;
  background: rgba(255, 255, 255, 0.04);
  color: #aeb9ae;
}
.app-license-signin:hover {
  border-color: #4a524a;
  color: #f2f5f2;
}
.app-license-download[hidden],
.app-license-signin[hidden] {
  display: none;
}

/* ---------- About view ---------- */

.app-about-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.app-about-view[hidden] { display: none; }
.app-about-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-about-head h3 {
  margin: 0;
  color: #f2f5f2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.app-about-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
  padding-bottom: 8px;
}
.app-about-scroll::-webkit-scrollbar { width: 4px; }
.app-about-scroll::-webkit-scrollbar-track { background: transparent; }
.app-about-scroll::-webkit-scrollbar-thumb { background: #3a3f3a; border-radius: 999px; }
.app-about-card {
  border: 1px solid #333333;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 38, 31, 0.9), rgba(26, 30, 25, 0.95));
  padding: 10px 12px;
}
.app-about-brand {
  text-align: center;
  padding: 14px 12px 12px;
}
.app-about-wordmark {
  color: #33d17a;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-shadow: 0 0 12px rgba(51, 209, 122, 0.5);
}
.app-about-version {
  margin-top: 4px;
  color: #7e8a7e;
  font-size: 9px;
}
.app-about-made {
  margin-top: 1px;
  color: #aeb9ae;
  font-size: 9px;
}
.app-about-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 10px;
}
.app-about-btn {
  height: 26px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #ffffff;
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.app-about-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.app-about-btn:active { transform: translateY(0); }
.app-about-btn.is-primary {
  background: linear-gradient(90deg, #8e2de2, #4a00e0);
  box-shadow: 0 4px 10px rgba(74, 0, 224, 0.25);
}
.app-about-btn.is-green {
  background: linear-gradient(90deg, #2fe38b, #0c8a44);
  box-shadow: 0 4px 10px rgba(51, 209, 122, 0.22);
}
.app-about-btn.is-orange {
  background: linear-gradient(90deg, #ffa64d, #e2572e);
  box-shadow: 0 4px 10px rgba(226, 87, 46, 0.22);
}
.app-about-btn.is-discord {
  background: #5865f2;
  box-shadow: 0 4px 10px rgba(88, 101, 242, 0.25);
}
.app-about-discord-ico { width: 11px; height: 11px; flex-shrink: 0; }
.app-about-status {
  margin-top: 6px;
  color: #7e8a7e;
  font-size: 9px;
  text-align: center;
}
.app-about-status[hidden] { display: none; }
.app-about-card-title {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  color: #33d17a;
  font-size: 11px;
  font-weight: 700;
}
.app-about-card-ico { font-size: 11px; line-height: 1; }
.app-about-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.app-about-list li {
  position: relative;
  padding-left: 9px;
  color: #e8eee8;
  font-size: 9px;
  line-height: 1.45;
}
.app-about-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #33d17a;
}
.app-about-tip {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  padding: 6px 7px;
  border-radius: 5px;
  background: #151515;
  color: #7e8a7e;
  font-size: 8.5px;
  line-height: 1.45;
}
.app-about-tip-ico { flex-shrink: 0; font-size: 9px; }
.app-about-faq { display: flex; flex-direction: column; gap: 6px; }
.app-about-faq b {
  display: block;
  color: #f2f5f2;
  font-size: 9.5px;
  line-height: 1.4;
}
.app-about-faq p {
  margin: 2px 0 0;
  color: #aeb9ae;
  font-size: 8.5px;
  line-height: 1.45;
}
.app-about-disclaimer { border-color: rgba(226, 59, 46, 0.32); }
.app-about-disclaimer .app-about-card-title { color: #ff7a72; }
.app-about-disclaimer p {
  color: #ff9a9a;
  font-size: 8.5px;
  line-height: 1.5;
}
.app-about-happy {
  margin: 2px 0 4px;
  color: #7e8a7e;
  font-size: 8.5px;
  text-align: center;
}

/* ---------- Profiles list view (1:1 with the desktop Profiles tab) ---------- */

.app-profiles-view {
  flex: 1;
  min-height: 0;
  display: flex;
}
.app-profiles-view[hidden] { display: none; }

.app-profiles-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid #333333;
  border-radius: 14px;
  background: #99181818;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-profiles-title {
  flex: 0 0 auto;
  color: #f2f5f2;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.app-profiles-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
  padding-right: 2px;
}
.app-profiles-scroll::-webkit-scrollbar { width: 4px; }
.app-profiles-scroll::-webkit-scrollbar-track { background: transparent; }
.app-profiles-scroll::-webkit-scrollbar-thumb { background: #3a3f3a; border-radius: 999px; }

.app-profile-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #333333;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(51, 209, 122, 0.075), transparent 42%),
    linear-gradient(135deg, rgba(34, 38, 31, 0.90), rgba(26, 30, 25, 0.95));
  box-shadow:
    0 5px 16px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  cursor: grab;
  transition: border-color 0.16s, opacity 0.16s;
}
.app-profile-row:hover { border-color: #4a524a; }
.app-profile-row.is-dragging { opacity: 0.5; cursor: grabbing; }
.app-profile-row.is-drop-target { border-color: rgba(51, 209, 122, 0.6); }

.app-profile-drag {
  width: 18px;
  flex: 0 0 18px;
  color: #7e8a7e;
  font-size: 14px;
  line-height: 1;
  user-select: none;
}

.app-profile-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f2f5f2;
  font-size: 12px;
  font-weight: 500;
}

.app-profile-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  margin-left: 8px;
}

.app-profile-btn {
  width: 28px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #aeb9ae;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.app-profile-btn:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.app-profile-btn.is-danger:hover { background: rgba(226, 59, 46, 0.14); color: #ff747d; }
.app-profile-btn svg { width: 13px; height: 13px; }
.app-profile-btn .is-copy { width: 12px; height: 12px; }

.app-profiles-add {
  flex: 0 0 28px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #54e39a 0%, #2bb86b 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    0 8px 22px rgba(51, 209, 122, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: filter 0.16s, transform 0.16s;
}
.app-profiles-add:hover { filter: brightness(1.07); transform: translateY(-1px); }
.app-profiles-add:active { transform: translateY(0); filter: brightness(0.96); }
.app-profiles-add svg { width: 13px; height: 13px; }

/* Status bar belongs to Home only (matches the desktop app). */
.app-statusbar[hidden] { display: none; }

/* ---------- Profile settings view ---------- */

.app-settings-view,
.app-stats-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.app-settings-view[hidden],
.app-stats-view[hidden] { display: none; }

.app-settings-head,
.app-stats-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.app-settings-heading h3,
.app-stats-heading h3 {
  margin: 0;
  color: #f2f5f2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.app-settings-heading span,
.app-stats-heading span {
  display: block;
  margin-top: 1px;
  color: #7e8a7e;
  font-size: 8.5px;
}
.app-settings-back {
  height: 22px;
  padding: 0 9px;
  border: 1px solid #333333;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  color: #aeb9ae;
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 600;
  cursor: pointer;
}
.app-settings-back:hover { color: #f2f5f2; border-color: #4a524a; }

.app-settings-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.app-settings-tabs button {
  height: 26px;
  border: 1px solid #333333;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #7e8a7e;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.app-settings-tabs button:hover { background: #14261a; }
.app-settings-tabs button.is-active {
  border-color: rgba(51, 209, 122, 0.55);
  background: rgba(51, 209, 122, 0.10);
  color: #54e39a;
}

.app-settings-scroll,
.app-stats-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 2px;
  padding-bottom: 4px;
}
.app-settings-scroll::-webkit-scrollbar,
.app-stats-scroll::-webkit-scrollbar { width: 4px; }
.app-settings-scroll::-webkit-scrollbar-track,
.app-stats-scroll::-webkit-scrollbar-track { background: transparent; }
.app-settings-scroll::-webkit-scrollbar-thumb,
.app-stats-scroll::-webkit-scrollbar-thumb { background: #3a3f3a; border-radius: 999px; }

.app-settings-pane {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.app-settings-pane[hidden] { display: none; }
.app-settings-card {
  border: 1px solid #333333;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 38, 31, 0.9), rgba(26, 30, 25, 0.95));
  padding: 7px 8px;
}
.app-settings-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  color: #33d17a;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
}
.app-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  padding: 1px 0;
}
.app-settings-row label {
  color: #aeb9ae;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
}
.app-settings-tag {
  margin-left: 4px;
  color: #ffc107;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.app-settings-input {
  width: 104px;
  height: 22px;
  border: 1px solid #333333;
  border-radius: 5px;
  background: #101010;
  color: #f2f5f2;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 9px;
  font-weight: 600;
  text-align: right;
  padding: 0 6px;
  outline: none;
}
.app-settings-input:focus { border-color: rgba(51, 209, 122, 0.6); }
.app-settings-select {
  min-width: 104px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  border: 1px solid #333333;
  border-radius: 5px;
  background: #101010;
  color: #f2f5f2;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  padding: 0 6px;
  cursor: pointer;
}
.app-settings-select:hover { border-color: #4a524a; }
.app-settings-select svg { width: 8px; height: 8px; color: #7e8a7e; flex-shrink: 0; }
.app-settings-inline { display: flex; align-items: center; gap: 5px; }
.app-mini-toggle {
  width: 28px;
  height: 15px;
  flex: 0 0 auto;
  position: relative;
  border: 0;
  border-radius: 999px;
  background: #3a3f3a;
  padding: 0;
  cursor: pointer;
  transition: background 0.18s;
}
.app-mini-toggle span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #aeb9ae;
  transition: transform 0.18s, background 0.18s;
}
.app-mini-toggle.is-on { background: #33d17a; }
.app-mini-toggle.is-on span { transform: translateX(13px); background: #07130b; }
.app-settings-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
.app-settings-details { padding: 0; overflow: hidden; }
.app-settings-details summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 8px;
  margin: 0;
}
.app-settings-details summary::-webkit-details-marker { display: none; }
.app-settings-chevron {
  color: #7e8a7e;
  font-size: 11px;
  transition: transform 0.18s;
}
.app-settings-details[open] .app-settings-chevron { transform: rotate(90deg); }
.app-settings-details-body { padding: 0 8px 7px; }
.app-settings-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding-top: 1px;
}
.app-settings-btn {
  height: 24px;
  padding: 0 12px;
  border: 1px solid #333333;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: #aeb9ae;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}
.app-settings-btn:hover { color: #f2f5f2; border-color: #4a524a; }
.app-settings-btn.is-primary {
  border-color: rgba(51, 209, 122, 0.5);
  background: linear-gradient(135deg, #54e39a, #2bb86b);
  color: #07130b;
}
.app-settings-btn.is-danger {
  border-color: rgba(226, 59, 46, 0.35);
  background: rgba(226, 59, 46, 0.10);
  color: #ff9a9a;
}

/* ---------- Statistics view ---------- */

.app-stats-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-stats-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.app-stats-reset {
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(226, 59, 46, 0.35);
  border-radius: 5px;
  background: rgba(226, 59, 46, 0.10);
  color: #ff9a9a;
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 600;
  cursor: pointer;
}
.app-stats-view-label { color: #7e8a7e; font-size: 8.5px; }
.app-stats-view-select {
  height: 22px;
  min-width: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  border: 1px solid #333333;
  border-radius: 5px;
  background: #101010;
  color: #f2f5f2;
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 600;
  padding: 0 6px;
  cursor: pointer;
}
.app-stats-view-select svg { width: 8px; height: 8px; color: #7e8a7e; flex-shrink: 0; }
.app-stats-ranges {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.app-stats-ranges > span { color: #7e8a7e; font-size: 8.5px; margin-right: 2px; }
.app-stats-ranges button {
  height: 20px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: #7e8a7e;
  font-family: inherit;
  font-size: 8px;
  font-weight: 600;
  cursor: pointer;
}
.app-stats-ranges button:hover { color: #d7e0d7; }
.app-stats-ranges button.is-active { background: #33d17a; color: #07130b; }
.app-stats-totals {
  border: 1px solid #333333;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 38, 31, 0.9), rgba(26, 30, 25, 0.95));
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.app-stats-totals-title { color: #33d17a; font-size: 9px; font-weight: 700; }
.app-stats-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.app-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #f2f5f2;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.app-stat-pill.is-gold { background: rgba(255, 215, 0, 0.10); color: #ffd7a0; }
.app-stat-pill.is-elixir { background: rgba(156, 39, 176, 0.10); color: #c9a9ff; }
.app-stat-pill.is-dark { background: rgba(91, 33, 182, 0.16); color: #c9a9ff; }
.app-stat-ico { width: 10px; height: 10px; flex: 0 0 auto; }
.app-stats-charts {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 5px;
}
.app-stats-chart-card {
  min-width: 0;
  border: 1px solid #333333;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 38, 31, 0.9), rgba(26, 30, 25, 0.95));
  padding: 6px 7px;
}
.app-stats-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
}
.app-stats-chart-title { color: #f2f5f2; font-size: 8.5px; font-weight: 600; }
.app-stats-legend { display: flex; align-items: center; gap: 4px; }
.app-stats-legend span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #7e8a7e;
  font-size: 7px;
}
.app-stats-legend i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.app-stats-legend .is-gold { color: #ffd7a0; }
.app-stats-legend .is-elixir { color: #c9a9ff; }
.app-stats-legend .is-dark { color: #c084fc; }
.app-stats-chart { display: block; width: 100%; height: 72px; overflow: visible; }
.app-stats-grid line { stroke: rgba(255, 255, 255, 0.055); stroke-width: 1; }
.app-stats-line {
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.app-stats-line.is-gold { stroke: #ffd7a0; }
.app-stats-line.is-elixir { stroke: #c9a9ff; }
.app-stats-line.is-dark { stroke: #c084fc; }
.app-stats-card {
  border: 1px solid #333333;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 38, 31, 0.9), rgba(26, 30, 25, 0.95));
  padding: 6px 8px;
}
.app-stats-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  color: #33d17a;
  font-size: 8.5px;
  font-weight: 700;
}
.app-stats-card-head span:last-child { color: #7e8a7e; font-weight: 500; font-size: 7.5px; }
.app-battle-list,
.app-donation-list { display: flex; flex-direction: column; gap: 3px; }
.app-battle-row,
.app-donation-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 8px;
  min-width: 0;
}
.app-battle-village {
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.app-battle-village.is-home { background: rgba(51, 209, 122, 0.12); color: #54e39a; }
.app-battle-village.is-builder { background: rgba(255, 166, 77, 0.12); color: #ffb273; }
.app-battle-time,
.app-donation-time { color: #7e8a7e; }
.app-battle-loot {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f2f5f2;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 7.5px;
  white-space: nowrap;
}
.app-battle-loot span { display: inline-flex; align-items: center; gap: 2px; }
.app-battle-loot .is-gold { color: #ffd7a0; }
.app-battle-loot .is-elixir { color: #c9a9ff; }
.app-battle-loot .is-dark { color: #c084fc; }
.app-stats-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.app-stat-tile {
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 5px;
  background: #991e221b;
}
.app-stat-tile-top {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #7e8a7e;
  font-size: 7px;
  font-weight: 600;
  line-height: 1.2;
}
.app-stat-tile b {
  display: block;
  margin-top: 2px;
  color: #f2f5f2;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 600;
}
.app-donation-troop { color: #e8eee8; font-size: 8px; }
.app-donation-row b {
  margin-left: auto;
  color: #f2f5f2;
  font-family: 'Cascadia Code', Consolas, ui-monospace, monospace;
  font-size: 8px;
}

/* ---------- Toast ---------- */

.app-toast {
  position: absolute;
  left: 50%;
  bottom: 58px;
  z-index: 50;
  max-width: 78%;
  padding: 7px 12px;
  border: 1px solid rgba(51, 209, 122, 0.32);
  border-radius: 8px;
  background: rgba(12, 16, 12, 0.97);
  color: #d7e0d7;
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}
.app-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Below-stage hint ---------- */

.app-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 1.2rem;
  color: #7e8a7e;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}
.app-hint svg {
  width: 15px;
  height: 15px;
  color: #33d17a;
}
.app-hint-mobile {
  display: none;
}
@media (max-width: 767px) {
  .app-hint-desktop { display: none; }
  .app-hint-mobile { display: inline; }
}
.app-preview-note {
  margin-top: 0.5rem;
  color: #5f6a60;
  font-size: 0.65rem;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .app-preview-section {
    padding: 4rem 0 4.5rem;
  }
  .app-stage {
    padding: 1.6rem 0 2rem;
  }
  .app-hint {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }
}
@media (max-width: 600px) {
  .app-preview-section {
    padding: 3.5rem 0 4rem;
  }
  .app-stage {
    padding: 1.2rem 0 1.5rem;
  }
  .app-hint {
    flex-direction: column;
    gap: 4px;
  }
  .app-preview-note {
    font-size: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-stage-glow,
  .app-scaler,
  .app-refresh svg,
  .app-ping svg {
    animation: none !important;
    transition: none !important;
  }
  .app-scaler {
    transform: translate(-50%, -50%) scale(var(--app-scale)) translateZ(0) !important;
  }
}
