/* ============================================
   🐱 PIXEL ART DESIGN SYSTEM — NYA EDITION ✨
   ============================================ */

@font-face {
  font-family: 'Press Start 2P';
  src: url('/static/PressStart2P-Regular.woff2') format('woff2'),
       url('/static/PressStart2P-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PixelAE';
  src: url('/PixelAE-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PixelAE';
  src: url('/PixelAE-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* ── Color Palette ─────────────────────────── */
:root, body {
  /* Backgrounds */
  --bg-deep: #0d0f1a;
  --bg-main: #141627;
  --bg-card: #1a1d33;
  --bg-card-hover: #1f2340;
  --bg-elevated: #232749;

  /* Accent colors — kawaii pastels */
  --accent-mint: #7efcca;
  --accent-pink: #ff7eb3;
  --accent-lavender: #b197fc;
  --accent-peach: #ffb380;
  --accent-cyan: #67e8f9;
  --accent-yellow: #ffd43b;
  --accent-red: #ff6b6b;
  --accent-green: #69db7c;

  /* Muted accents for borders/shadows */
  --accent-mint-dim: rgba(126, 252, 202, 0.2);
  --accent-pink-dim: rgba(255, 126, 179, 0.2);
  --accent-lavender-dim: rgba(177, 151, 252, 0.2);
  --accent-peach-dim: rgba(255, 179, 128, 0.2);
  --accent-cyan-dim: rgba(103, 232, 249, 0.15);

  /* Text */
  --text-primary: #e8e6f0;
  --text-secondary: #9994b8;
  --text-muted: #928cb2;

  /* Pixel border colors */
  --border-light: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(126, 252, 202, 0.3);

  /* Font */
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'Press Start 2P', monospace;

  /* Sizes */
  --pixel: 4px;
  --radius-pixel: 0px;

  /* Custom stepped pixel-art clip-paths */
  --clip-card: polygon(
    8px 0px, 8px 4px, 4px 4px, 4px 8px, 0px 8px,
    0px calc(100% - 8px), 4px calc(100% - 8px), 4px calc(100% - 4px), 8px calc(100% - 4px), 8px 100%,
    calc(100% - 8px) 100%, calc(100% - 8px) calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) calc(100% - 8px), 100% calc(100% - 8px),
    100% 8px, calc(100% - 4px) 8px, calc(100% - 4px) 4px, calc(100% - 8px) 4px, calc(100% - 8px) 0px
  );

  --clip-button: polygon(
    4px 0px, 4px 4px, 0px 4px,
    0px calc(100% - 4px), 4px calc(100% - 4px), 4px 100%,
    calc(100% - 4px) 100%, calc(100% - 4px) calc(100% - 4px), 100% calc(100% - 4px),
    100% 4px, calc(100% - 4px) 4px, calc(100% - 4px) 0px
  );

  /* 3D Bevel border tokens */
  --bevel-light: rgba(255, 255, 255, 0.12);
  --bevel-dark: rgba(0, 0, 0, 0.3);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --inset-light: rgba(255, 255, 255, 0.05);
  --inset-dark: rgba(0, 0, 0, 0.2);

  /* Button styling overrides */
  --btn-primary-bg-1: #2a6d5a;
  --btn-primary-bg-2: #1a4d3e;
  --btn-primary-border: #0d2920;
  --btn-primary-text: var(--accent-mint);

  --btn-danger-bg-1: #6d2a2a;
  --btn-danger-bg-2: #4d1a1a;
  --btn-danger-border: #200d0d;
  --btn-danger-text: var(--accent-red);

  --btn-pink-bg-1: #5a2a4d;
  --btn-pink-bg-2: #3d1a35;
  --btn-pink-border: #1a0d16;
  --btn-pink-text: var(--accent-pink);
}



:root.light {
  --bg-deep: #f5eedc;
  --bg-main: #fdfbf7;
  --bg-card: #ffffff;
  --bg-card-hover: #faf7f0;
  --bg-elevated: #ebdcb9;

  --text-primary: #2d2a3a;
  --text-secondary: #625c75;
  --text-muted: #655e78;

  --accent-mint: #00875a;
  --accent-pink: #c026d3;
  --accent-lavender: #553c9a;
  --accent-peach: #c25100;
  --accent-cyan: #008094;
  --accent-yellow: #a27200;
  --accent-red: #d32f2f;
  --accent-green: #2e7d32;

  --accent-mint-dim: rgba(0, 135, 90, 0.12);
  --accent-pink-dim: rgba(192, 38, 211, 0.12);
  --accent-lavender-dim: rgba(85, 60, 154, 0.12);
  --accent-peach-dim: rgba(194, 81, 0, 0.12);
  --accent-cyan-dim: rgba(0, 128, 148, 0.12);

  --border-light: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(0, 135, 90, 0.25);

  --bevel-light: rgba(255, 255, 255, 0.95);
  --bevel-dark: rgba(0, 0, 0, 0.12);
  --shadow-color: rgba(0, 0, 0, 0.08);
  --inset-light: rgba(255, 255, 255, 0.7);
  --inset-dark: rgba(0, 0, 0, 0.06);

  --btn-primary-bg-1: #69db7c;
  --btn-primary-bg-2: #2b8a3e;
  --btn-primary-border: #1a5c28;
  --btn-primary-text: #ffffff;

  --btn-danger-bg-1: #ff8787;
  --btn-danger-bg-2: #c92a2a;
  --btn-danger-border: #7c1a1a;
  --btn-danger-text: #ffffff;

  --btn-pink-bg-1: #faa2c1;
  --btn-pink-bg-2: #d6336c;
}
 
/* ── Static Light Theme Rules for Legacy Engines ── */
html.light, body.light {
  background-color: #f5eedc !important;
  background: #f5eedc !important;
  color: #2d2a3a !important;
}

.light .header {
  background-color: #fdfbf7;
  background: #fdfbf7;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.light .brand-name {
  color: #2d2a3a;
}

.light .icon-btn {
  background-color: #ffffff;
  color: #2d2a3a;
  border-color: rgba(0, 0, 0, 0.15);
}

.light .pixel-card {
  background-color: #ffffff;
  background: #ffffff;
  color: #2d2a3a;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.95),
    inset -2px -2px 0 rgba(0, 0, 0, 0.06),
    0 4px 0 rgba(0, 0, 0, 0.06);
}

.light .stat-card {
  background-color: #fdfbf7;
  background: #fdfbf7;
  border-color: rgba(0, 0, 0, 0.08);
}

.light .stat-card .stat-label {
  color: #655e78;
}

.light .stat-card .stat-value {
  color: #2d2a3a;
}

.light .platform-tab-btn {
  background-color: #ffffff;
  background: #ffffff;
  color: #625c75;
  border-color: rgba(0, 0, 0, 0.12);
}

.light .platform-tab-btn.active {
  background-color: #ebdcb9;
  background: #ebdcb9;
  color: #00875a;
  border-color: #00875a;
  box-shadow: 0 0 8px rgba(0, 135, 90, 0.15);
}

.light .app-btn {
  background-color: #ffffff;
  background: #ffffff;
  color: #625c75;
  border-color: rgba(0, 0, 0, 0.12);
}

.light .app-btn.active {
  background-color: #ebdcb9;
  background: #ebdcb9;
  color: #00875a;
  border-color: #00875a;
}

.light .modal-content {
  background-color: #ffffff;
  background: #ffffff;
  color: #2d2a3a;
}

.light .footer-text {
  color: #655e78;
}

.light .step-block {
  background: #fdfbf7;
}

.light .block-desc {
  color: #625c75;
}

.light .pixel-btn-action.copy-link-btn {
  background-color: #ffffff;
  background: #ffffff;
  color: #00875a;
  border-color: #00875a;
}



/* ── Reset & Base ──────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: #0d0f1a;
  background: #0d0f1a;
  color: #e8e6f0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: #0d0f1a;
  background: #0d0f1a;
  background: var(--bg-deep);
  color: #e8e6f0;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Pixel Grid Background ─────────────────── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(126, 252, 202, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(126, 252, 202, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* ── Ambient Glow ──────────────────────────── */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(126, 252, 202, 0.04), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 126, 179, 0.04), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scanline Overlay ──────────────────────── */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 0, 0, 0.03) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 9999;
}

/* ── Pixel Bevel Mixins (via class) ────────── */
.pixel-border {
  border: 3px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow:
    inset 2px 2px 0 var(--inset-light),
    inset -2px -2px 0 var(--inset-dark);
}

.pixel-border-accent {
  border: 3px solid;
  border-color: var(--accent-mint) var(--bevel-dark) var(--bevel-dark) var(--accent-mint);
  box-shadow:
    inset 2px 2px 0 var(--accent-mint-dim),
    inset -2px -2px 0 var(--inset-dark);
}

/* ── Pixel Card ────────────────────────────── */
.pixel-card {
  background-color: #1a1d33;
  background: #1a1d33;
  background: var(--bg-card);
  color: #e8e6f0;
  color: var(--text-primary);
  border: 3px solid;
  border-color: rgba(255, 255, 255, 0.12) rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.3) rgba(255, 255, 255, 0.12);
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow:
    inset 2px 2px 0 var(--inset-light),
    inset -2px -2px 0 var(--inset-dark),
    0 4px 0 var(--shadow-color);
  padding: 20px;
  position: relative;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
}

/* ── Stats Grid ────────────────────────────── */
.stats-grid {
  display: flex;
  flex-direction: column;
}

.stats-grid > * + * {
  margin-top: 12px;
}

@media (min-width: 640px) {
  .stats-grid {
    flex-direction: row;
  }
  .stats-grid > * {
    flex: 1;
  }
  .stats-grid > * + * {
    margin-top: 0;
    margin-left: 14px;
  }
  [dir="rtl"] .stats-grid > * + * {
    margin-left: 0;
    margin-right: 14px;
  }
}

/* ── Pixel Button ──────────────────────────── */
.pixel-btn {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 3px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow:
    inset 1px 1px 0 var(--inset-light),
    0 3px 0 var(--shadow-color);
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  position: relative;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
}

.pixel-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 1px 1px 0 var(--inset-light),
    0 4px 0 var(--shadow-color);
}

.pixel-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 1px 1px 0 var(--inset-dark),
    0 1px 0 var(--shadow-color);
}

.pixel-btn.primary {
  background: linear-gradient(180deg, var(--btn-primary-bg-1) 0%, var(--btn-primary-bg-2) 100%);
  color: var(--btn-primary-text);
  border-color: var(--accent-mint) var(--btn-primary-border) var(--btn-primary-border) var(--accent-mint);
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.45);
}

.pixel-btn.danger {
  background: linear-gradient(180deg, var(--btn-danger-bg-1) 0%, var(--btn-danger-bg-2) 100%);
  color: var(--btn-danger-text);
  border-color: var(--accent-red) var(--btn-danger-border) var(--btn-danger-border) var(--accent-red);
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.45);
}

.pixel-btn.pink {
  background: linear-gradient(180deg, var(--btn-pink-bg-1) 0%, var(--btn-pink-bg-2) 100%);
  color: var(--btn-pink-text);
  border-color: var(--accent-pink) var(--btn-pink-border) var(--btn-pink-border) var(--accent-pink);
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.45);
}

/* ── Pixel Tab ─────────────────────────────── */
.pixel-tab {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-tab) var(--radius-tab) 0 0;
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
}

.pixel-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.pixel-tab.active {
  background: var(--bg-elevated);
  color: var(--accent-mint);
  border-color: var(--accent-mint);
  box-shadow: 0 0 8px rgba(126, 252, 202, 0.2);
}

/* ── HP / MP Bar ───────────────────────────── */
.pixel-bar-container {
  width: 100%;
  height: 16px;
  background: #0a0c15;
  border: 2px solid;
  border-color: rgba(0,0,0,0.5) rgba(255,255,255,0.08) rgba(255,255,255,0.08) rgba(0,0,0,0.5);
  border-radius: var(--radius-bar);
  position: relative;
  overflow: hidden;
}

.pixel-bar-fill {
  height: 100%;
  position: relative;
  transition: width 0.5s ease;
  border-radius: var(--radius-bar);
  image-rendering: pixelated;
}

.pixel-bar-fill.hp {
  background: linear-gradient(180deg, #69db7c 0%, #2b8a3e 50%, #1a5c28 100%);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.2);
}

.pixel-bar-fill.mp {
  background: linear-gradient(180deg, #67e8f9 0%, #0e7490 50%, #083b4d 100%);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.2);
}

.pixel-bar-fill.warning {
  background: linear-gradient(180deg, #ffd43b 0%, #c27803 50%, #7c4d02 100%);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.2);
}

.pixel-bar-fill.danger {
  background: linear-gradient(180deg, #ff6b6b 0%, #c92a2a 50%, #7c1a1a 100%);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.2);
}

/* Bar shine effect */
.pixel-bar-fill::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.15);
}

/* ── Pixel Stat Card ───────────────────────── */
.stat-card {
  background-color: #141627;
  background: #141627;
  background: var(--bg-main);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-button);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.stat-card .stat-icon {
  margin-right: 12px;
  flex-shrink: 0;
}

[dir="rtl"] .stat-card .stat-icon {
  margin-right: 0;
  margin-left: 12px;
}

.stat-card:hover {
  border-color: rgba(255,255,255,0.12);
  background: var(--bg-card-hover);
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card .stat-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

.stat-card .stat-value {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text-primary);
  line-height: 1.4;
  margin-top: 4px;
  word-break: break-all;
}

/* Color variants for stat cards */
.stat-card.mint { border-left: 3px solid var(--accent-mint); }
.stat-card.mint .stat-icon { color: var(--accent-mint); }
.stat-card.pink { border-left: 3px solid var(--accent-pink); }
.stat-card.pink .stat-icon { color: var(--accent-pink); }
.stat-card.peach { border-left: 3px solid var(--accent-peach); }
.stat-card.peach .stat-icon { color: var(--accent-peach); }
.stat-card.cyan { border-left: 3px solid var(--accent-cyan); }
.stat-card.cyan .stat-icon { color: var(--accent-cyan); }
.stat-card.lavender { border-left: 3px solid var(--accent-lavender); }
.stat-card.lavender .stat-icon { color: var(--accent-lavender); }
.stat-card.green { border-left: 3px solid var(--accent-green); }
.stat-card.green .stat-icon { color: var(--accent-green); }
.stat-card.red { border-left: 3px solid var(--accent-red); }
.stat-card.red .stat-icon { color: var(--accent-red); }
.stat-card.yellow { border-left: 3px solid var(--accent-yellow); }
.stat-card.yellow .stat-icon { color: var(--accent-yellow); }

/* ── Floating Sparkles Animation ───────────── */
@keyframes sparkle-float {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
  20% { opacity: 1; transform: translateY(-10px) scale(1); }
  80% { opacity: 0.8; transform: translateY(-30px) scale(0.8); }
}

@keyframes pixel-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes bounce-in {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pixel-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(126, 252, 202, 0.2); }
  50% { box-shadow: 0 0 12px rgba(126, 252, 202, 0.4); }
}

/* ── Header Top Bar ────────────────────────── */
.header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-main);
  background: color-mix(in srgb, var(--bg-main) 92%, transparent);
  border-bottom: 4px solid var(--border-light);
  box-shadow: 0 4px 16px var(--shadow-color);
  width: 100%;
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .header {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
  min-height: 74px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
  -webkit-user-select: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-mint);
  filter: drop-shadow(0 0 8px rgba(126, 252, 202, 0.4));
  animation: pixel-bounce 1.2s ease-in-out infinite;
  flex-shrink: 0;
  margin-right: 14px;
}

[dir="rtl"] .logo-icon {
  margin-right: 0;
  margin-left: 14px;
}

.brand-logo-img {
  margin-right: 14px;
}

[dir="rtl"] .brand-logo-img {
  margin-right: 0;
  margin-left: 14px;
}

.logo-icon svg {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--accent-mint);
  text-shadow: 0 0 10px rgba(126, 252, 202, 0.35);
  letter-spacing: 1px;
}

.header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.header-actions > * + * {
  margin-left: 10px;
}

[dir="rtl"] .header-actions > * + * {
  margin-left: 0;
  margin-right: 10px;
}

.header-btn {
  width: 42px;
  height: 42px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 2px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-button);
  transition: all 0.15s ease;
}

.header-btn:hover {
  color: var(--accent-mint);
  border-color: var(--accent-mint);
  background: rgba(126, 252, 202, 0.08);
  box-shadow: 0 0 8px var(--accent-mint-dim);
}

.header-btn:active {
  transform: scale(0.95);
}

.header-btn .pixel-icon {
  width: 18px;
  height: 18px;
}

.pixel-icon {
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.stat-icon .pixel-icon {
  width: 18px;
  height: 18px;
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tab-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Bandwidth Unlimited Bar ───────────────── */
@keyframes infinite-stripes {
  0% { background-position: 0 0; }
  100% { background-position: 16px 0; }
}

.bandwidth-bar-fill.unlimited {
  width: 100% !important;
  background-color: var(--accent-mint) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpolygon points='0,0 8,0 0,8' fill='black' fill-opacity='0.22'/%3E%3Cpolygon points='16,0 0,16 8,16 16,8' fill='black' fill-opacity='0.22'/%3E%3C/svg%3E") !important;
  background-size: 16px 16px !important;
  animation: infinite-stripes 1s linear infinite !important;
  box-shadow: 0 0 10px var(--accent-mint-dim);
}

.infinity-icon {
  display: inline-block;
  height: 9px;
  width: auto;
  vertical-align: middle;
  margin-left: 4px;
  position: relative;
  top: -1px;
  fill: currentColor;
}

/* ── App Picker in Guides ──────────────────── */
.app-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
}

.app-btn {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 8px 12px;
  background-color: #1a1d33;
  background: #1a1d33;
  background: var(--bg-card);
  color: #9994b8;
  color: var(--text-secondary);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border: 2px solid var(--border-light);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  margin-bottom: 8px;
}

[dir="rtl"] .app-btn {
  margin-right: 0;
  margin-left: 8px;
}

.app-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.app-btn.active {
  background: var(--bg-elevated);
  color: var(--accent-mint);
  border-color: var(--accent-mint);
  box-shadow: 0 0 8px var(--accent-mint-dim);
}

.app-btn.featured {
  border-color: rgba(255, 212, 59, 0.35);
}

.app-btn.featured.active {
  border-color: var(--accent-mint);
}

.featured-star {
  font-size: 8px;
  color: var(--accent-yellow);
}

.app-panel {
  display: none;
}

.app-panel.active {
  display: block;
}

/* ── Language Picker ───────────────────────── */
.lang-picker {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
}

.lang-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.lang-btn {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 8px 14px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 2px solid var(--border-light);
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 4px;
}

.lang-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.lang-btn.active {
  color: var(--accent-mint);
  border-color: var(--accent-mint);
  background: var(--bg-elevated);
  box-shadow: 0 0 8px var(--accent-mint-dim);
}

/* ── Layout Container ──────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

/* ── Pixel Section Title ───────────────────── */
.section-title {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--accent-mint);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.05);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(126, 252, 202, 0.2);
}

/* ── Modal Overlay ─────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fade-in 0.15s ease;
}

@supports (backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px)) {
  .modal-overlay {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border: 3px solid;
  border-color: var(--accent-mint) var(--bevel-dark) var(--bevel-dark) var(--accent-mint);
  box-shadow:
    0 0 20px var(--accent-mint-dim),
    0 8px 0 var(--shadow-color);
  border-radius: var(--radius-card);
  padding: 24px;
  max-width: 380px;
  width: 100%;
  position: relative;
  animation: bounce-in 0.2s ease;
}

/* ── Key Item Row ──────────────────────────── */
.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-button);
  transition: background 0.15s, border-color 0.15s;
}

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

.key-actions > * + * {
  margin-left: 6px;
}

[dir="rtl"] .key-actions > * + * {
  margin-left: 0;
  margin-right: 6px;
}

.key-item:hover {
  background: rgba(126, 252, 202, 0.03);
  border-color: rgba(126, 252, 202, 0.1);
}

/* ── Icon Buttons (small actions) ──────────── */
.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 2px solid rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: all 0.1s;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--accent-mint);
  border-color: var(--accent-mint);
  background: rgba(126, 252, 202, 0.05);
}

.icon-btn:active {
  transform: scale(0.9);
}

.icon-btn.copied {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

/* ── Tooltip ───────────────────────────────── */
.pixel-tooltip {
  font-family: var(--font-pixel);
  font-size: 8px;
  background: var(--bg-elevated);
  color: var(--accent-mint);
  padding: 6px 10px;
  border: 2px solid var(--accent-mint);
  position: absolute;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 640px) {
  .container {
    padding: 0 12px;
  }

  .pixel-card {
    padding: 14px;
  }

  .section-title {
    font-size: 10px;
  }

  .stat-card .stat-value {
    font-size: 9px;
  }

  .sparkles-container {
    display: none;
  }

  body::after {
    display: none;
  }

  .scanlines {
    display: none;
  }
}

/* ── Compatibility Fallbacks for Older Browsers & WebViews ── */
.content-stack > * + * {
  margin-top: 28px;
}

.steps-timeline > * + * {
  margin-top: 14px;
}

.step-buttons > * {
  margin-right: 8px;
  margin-bottom: 8px;
}

[dir="rtl"] .step-buttons > * {
  margin-right: 0;
  margin-left: 8px;
}

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

.platform-tabs {
  -webkit-overflow-scrolling: touch;
}

.platform-tab-btn {
  margin-right: 8px;
}

[dir="rtl"] .platform-tab-btn {
  margin-right: 0;
  margin-left: 8px;
}

.platform-tab-btn:last-child {
  margin-right: 0;
  margin-left: 0;
}

.pixel-icon {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.pixel-btn-action .pixel-icon,
.platform-tab-btn .pixel-icon,
.app-btn .pixel-icon {
  margin-right: 6px;
}

[dir="rtl"] .pixel-btn-action .pixel-icon,
[dir="rtl"] .platform-tab-btn .pixel-icon,
[dir="rtl"] .app-btn .pixel-icon {
  margin-right: 0;
  margin-left: 6px;
}

/* Only apply clip-path if the browser supports polygon() basic shapes */
@supports (clip-path: polygon(0 0, 0 1px, 1px 1px)) or (-webkit-clip-path: polygon(0 0, 0 1px, 1px 1px)) {
  .pixel-card {
    -webkit-clip-path: var(--clip-card);
    clip-path: var(--clip-card);
  }
  .pixel-btn {
    -webkit-clip-path: var(--clip-button);
    clip-path: var(--clip-button);
  }
}


