  [x-cloak] { display: none !important; }

  /* ── Candlestick chart animation ── */
  @keyframes chartRise {
    0%   { transform: scaleY(1) translateY(0); }
    25%  { transform: scaleY(1.04) translateY(-4px); }
    50%  { transform: scaleY(1.08) translateY(-8px); }
    75%  { transform: scaleY(1.12) translateY(-10px); }
    100% { transform: scaleY(1.15) translateY(-12px); }
  }
  @keyframes pathDraw {
    from { stroke-dashoffset: 800; }
    to   { stroke-dashoffset: 0; }
  }
  @keyframes floatUp {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-3px); }
  }
  @keyframes balanceTick {
    0%   { opacity: 1; }
    50%  { opacity: 0.7; }
    100% { opacity: 1; }
  }
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  @keyframes overlayPop {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
  }
  @keyframes terminalBlink {
    0%,100% { opacity: 1; }
    50%     { opacity: 0; }
  }
  @keyframes glitchBar {
    0%   { background: #ef4444; }
    30%  { background: #dc2626; }
    60%  { background: #b91c1c; }
    100% { background: #ef4444; }
  }

  .fade-in-up { animation: fadeInUp 0.4s ease-out both; }
  .slide-in   { animation: slideIn 0.35s ease-out both; }

  /* Trading platform (victim view) */
  .trading-platform {
    background: #ffffff;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  }
  .platform-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #15295e 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .platform-balance {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
  }
  .profit-badge {
    background: #dcfce7;
    color: #15803d;
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
  }
  .activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
  }
  .activity-row:last-child { border-bottom: none; }
  .activity-amount { color: #15803d; font-weight: 600; }
  .activity-pct    { color: #22c55e; font-size: 0.75rem; }

  /* SVG chart line */
  .chart-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: pathDraw 2.5s ease-out forwards;
  }

  /* Toggle switch */
  .view-toggle {
    display: inline-flex;
    background: #111827;
    border-radius: 9999px;
    padding: 0.25rem;
    gap: 0;
    border: 1px solid #374151;
  }
  .view-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'Courier New', monospace;
  }
  .view-btn.active-victim  { background: #f3f4f6; color: #111827; }
  .view-btn.active-backend { background: #22c55e; color: #0a0f1e; }
  .view-btn.inactive       { background: transparent; color: #9ca3af; }
  .view-btn.inactive:hover { color: #d1d5db; }

  /* Backend overlay annotations */
  .annotation-overlay {
    position: relative;
    z-index: 10;
  }
  .code-tag {
    display: inline-block;
    background: rgba(56,139,253,0.1);
    border: 1px solid rgba(56,139,253,0.35);
    border-radius: 0.3rem;
    padding: 0.2rem 0.6rem;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: #79c0ff;
    margin: 0.2rem 0;
  }
  .code-comment { color: #8b949e; font-size: 0.65rem; font-style: italic; }
  .backend-note {
    background: rgba(15, 17, 23, 0.97);
    border: 1px solid rgba(249,115,22,0.25);
    border-left: 3px solid #f97316;
    border-radius: 0.4rem;
    padding: 0.45rem 0.7rem;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: #c9d1d9;
    margin: 0.35rem 0;
    animation: overlayPop 0.3s ease-out both;
  }
  .backend-note .label { color: #f97316; font-weight: bold; }
  .cursor-blink {
    display: inline-block;
    width: 0.5rem;
    height: 0.85em;
    background: #f97316;
    animation: terminalBlink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
  }

  /* Timeline */
  .timeline-track {
    position: relative;
    width: 100%;
    height: 6px;
    background: #1f2937;
    border-radius: 3px;
    cursor: pointer;
  }
  .timeline-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(to right, #3b82f6, #ef4444);
    border-radius: 3px;
    transition: width 0.2s;
  }
  .timeline-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: white;
    border: 3px solid #ef4444;
    border-radius: 50%;
    cursor: grab;
    transition: left 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  }
  .timeline-handle:active { cursor: grabbing; }

  .month-pip {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
  }
  .month-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #374151;
    background: #0d1625;
    transition: all 0.2s;
  }
  .month-dot.active  { border-color: #ef4444; background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.5); }
  .month-dot.passed  { border-color: #9ca3af; background: #374151; }
  .month-label { font-size: 0.65rem; color: #9ca3af; font-family: 'Courier New', monospace; }
  .month-label.active { color: #ef4444; }

  .event-card {
    background: #0d1625;
    border: 1px solid #1f2937;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    animation: fadeInUp 0.35s ease-out both;
  }
  .event-card.m0 { border-color: #3b82f6; }
  .event-card.m1 { border-color: #6366f1; }
  .event-card.m2 { border-color: #8b5cf6; }
  .event-card.m3 { border-color: #f59e0b; }
  .event-card.m4 { border-color: #f97316; }
  .event-card.m5 { border-color: #ef4444; }
  .event-card.m6 { border-color: #9ca3af; }

  /* Defender checklist */
  .check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .check-item:last-child { border-bottom: none; }
  .check-box {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.25rem;
    background: rgba(34,197,94,0.2);
    border: 1.5px solid #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
  }

  /* Modal */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }
  .modal-box {
    background: white;
    color: #111827;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    animation: overlayPop 0.25s ease-out both;
  }
  .modal-box h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
  .modal-divider { height: 1px; background: #e5e7eb; margin: 1rem 0; }

  /* Chat bubble */
  .chat-bubble {
    background: #f3f4f6;
    border-radius: 0 0.75rem 0.75rem 0.75rem;
    padding: 0.75rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    color: #111827;
    border: 1px solid #e5e7eb;
    animation: slideIn 0.3s ease-out both;
  }
  .chat-agent-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 0.25rem;
    font-family: -apple-system, sans-serif;
  }

  /* Deposit/withdraw buttons */
  .platform-btn {
    padding: 0.65rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  }
  .platform-btn.deposit  { background: #15803d; color: white; }
  .platform-btn.deposit:hover { background: #166534; }
  .platform-btn.withdraw { background: #1d4ed8; color: white; }
  .platform-btn.withdraw:hover { background: #1e40af; }

  /* Backend platform overlay */
  .backend-platform {
    background: #0d1117;
    color: #c9d1d9;
    font-family: 'Courier New', monospace;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.07);
  }
  .backend-header {
    background: #161b22;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* Stat strip */
  .stat-strip {
    background: #0d1625;
    border-top: 1px solid rgba(239,68,68,0.2);
    padding: 0.75rem 1.5rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
  }
  .stat-item { display: flex; flex-direction: column; gap: 0.1rem; }
  .stat-label { font-size: 0.6rem; color: #7eb5c8; text-transform: uppercase; letter-spacing: 0.1em; }
  .stat-value { font-size: 0.85rem; font-family: 'Courier New', monospace; }

  /* Deposit btn (backend) */
  .backend-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(251,191,36,0.3);
    background: rgba(251,191,36,0.08);
    color: #fbbf24;
    cursor: default;
  }

  /* Editable backend inputs */
  .backend-input {
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.45);
    border-radius: 0.25rem;
    color: #fbbf24;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    outline: none;
    vertical-align: middle;
  }
  .backend-input:focus {
    border-color: rgba(251,191,36,0.9);
    background: rgba(251,191,36,0.14);
    box-shadow: 0 0 6px rgba(251,191,36,0.2);
  }
  /* Remove browser number spinners */
  .backend-input::-webkit-outer-spin-button,
  .backend-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .backend-input[type=number] { -moz-appearance: textfield; }

  input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: transparent;
    cursor: pointer;
  }
  input[type=range]::-webkit-slider-runnable-track {
    height: 6px;
    background: #1f2937;
    border-radius: 3px;
  }
  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    border: 3px solid white;
    margin-top: -7px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    cursor: grab;
  }
  input[type=range]::-webkit-slider-thumb:active { cursor: grabbing; }
  input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    border: 3px solid white;
    cursor: grab;
  }

  /* Live chart path smooth interpolation (Chrome 93+, Firefox 69+) */
  .live-chart-line, .live-chart-fill {
    transition: d 0.4s ease-out;
  }

  /* Timeframe tab buttons */
  .tf-btn {
    font-size: 0.6rem;
    padding: 0.15rem 0.45rem;
    border-radius: 0.2rem;
    font-weight: 700;
    border: none;
    cursor: default;
    font-family: -apple-system, sans-serif;
  }
  .tf-btn.active  { background: #dcfce7; color: #15803d; }
  .tf-btn.inactive { background: transparent; color: #9ca3af; }
