:root {
    --bg: #05060a;
    --bg-soft: #0b0d16;
    --panel: #101320;
    --panel-soft: #16192a;
    --accent: #ff4fbf;
    --accent-soft: rgba(255, 79, 191, 0.16);
    --accent-alt: #41e4ff;
    --text-main: #f7f7ff;
    --text-muted: #a0a6c0;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-pill: 999px;
    --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.6);
    --transition-fast: 0.2s ease-out;
  }
  
  *, *::before, *::after {
    box-sizing: border-box;
  }
  
  html, body {
    margin: 0;
    padding: 0;
  }
  
  body {
    min-height: 100vh;
    background: radial-gradient(circle at top, #191b32 0, #05060a 45%, #020208 100%);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 12px 40px;
  }
  
  /* --- FIXED BACKGROUND (Star Field - Optimized) --- */
  .fixed-background {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0; 
    background-color: #020205; 
    overflow: hidden;
    pointer-events: none;
    /* PERFORMANCE FIX: Hardware Acceleration */
    transform: translateZ(0); 
    backface-visibility: hidden;
  }
  
  .fixed-background::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
      radial-gradient(circle at 25px 5px, white 1px, transparent 1.5px),
      radial-gradient(circle at 50px 25px, rgba(255,255,255,0.8) 1px, transparent 1.5px),
      radial-gradient(circle at 125px 20px, white 1px, transparent 1.5px),
      radial-gradient(circle at 200px 65px, rgba(255,255,255,0.6) 1px, transparent 1.5px),
      radial-gradient(circle at 300px 10px, white 1px, transparent 1.5px),
      radial-gradient(circle at 360px 45px, rgba(255,255,255,0.9) 1px, transparent 1.5px);
    background-size: 400px 400px;
    opacity: 0.6; 
    will-change: background-position; /* Hint to browser */
    animation: starIntro 40s linear infinite;
  }
  
  .fixed-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
      radial-gradient(circle at 75px 100px, white 1.5px, transparent 2.5px),
      radial-gradient(circle at 150px 250px, white 1px, transparent 2px),
      radial-gradient(circle at 320px 380px, white 1.5px, transparent 2.5px);
    background-size: 550px 550px; 
    opacity: 0.8; 
    will-change: background-position; /* Hint to browser */
    animation: starIntroFast 30s linear infinite;
  }
  
  @keyframes starIntro {
    from { background-position: 0 0; }
    to { background-position: 0 400px; }
  }
  
  @keyframes starIntroFast {
    from { background-position: 0 0; }
    to { background-position: 0 550px; }
  }
  
  /* SHELL */
  .arc-shell {
    width: 100%;
    max-width: 980px;
    /* PERFORMANCE FIX: Removed backdrop-filter to stop flashing */
    background: rgba(11, 13, 22, 0.95); /* Increased opacity to compensate */
    
    border-radius: 26px;
    border: 1px solid var(--border-subtle);
    padding: 22px 20px 26px;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 1; 
  }
  
  /* HEADER */
  .arc-header {
    text-align: center;
    margin-bottom: 18px;
  }
  
  .arc-header h1 {
    margin: 0;
    font-size: 1.9rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
  
  .arc-tagline {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
  }
  
  /* META */
  .arc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 8px 10px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(9, 11, 22, 0.9);
    border: 1px solid var(--border-subtle);
  }
  
  .arc-meta-item {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 4px 12px;
  }
  
  .arc-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.15em;
  }
  
  .arc-value {
    font-size: 0.85rem;
    margin-top: 3px;
  }
  
  /* FLEX GRID */
  .arc-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }
  
  /* CARD */
  .arc-card {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 14px;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
    width: 100%;
    z-index: 1; 
  }
  
  @media (min-width: 800px) {
    .arc-card { width: calc(50% - 7px); }
    .arc-card.arc-span-2 { width: 100%; }
  }
  
  /* SPECIAL: Colour Chains Card Adjustment */
  #card-chains {
    padding: 30px; 
  }
  
  .arc-card--live:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.65);
    background: radial-gradient(circle at top left, #1c2145 0, #101320 60%);
  }
  
  /* CARD CONTENT LAYERING */
  .arc-card-header, 
  .arc-card-body, 
  .arc-card-actions {
    position: relative;
    z-index: 10;
  }
  
  .arc-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .arc-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
  }
  
  /* ICONS */
  .arc-card-icon--chain { background: radial-gradient(circle at top, #8affc1 0, #00d64b 50%, #006622 100%); color: #02200a; }
  .arc-card-icon--light { background: radial-gradient(circle at top, #fff9c4 0, #ffd700 50%, #ff8f00 100%); color: #3e2700; }
  .arc-card-icon--mine { background: radial-gradient(circle at top, #ff8c6b 0, #ff3b3b 40%, #6b0f1a 100%); }
  .arc-card-icon--wild { background: radial-gradient(circle at top, #ff4fbf 0, #41e4ff 40%, #ffd86b 100%); }
  .arc-card-icon--cross { background: radial-gradient(circle at top left, #41e4ff 0, #0044ff 100%); color: #ff004c; }
  .arc-card-icon--neon { background: #FF9F2E; color: #FF4F70; } 
  
  .arc-card-header h2 { margin: 0; font-size: 1rem; }
  .arc-card-sub { margin: 2px 0 0; font-size: 0.8rem; color: var(--text-muted); }
  .arc-card-body { font-size: 0.8rem; color: var(--text-muted); }
  
  .arc-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }
  
  .arc-btn {
    flex: 1;
    min-width: 120px;
    white-space: nowrap;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-size: 0.8rem;
    padding: 8px 10px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
  }
  
  .arc-btn--primary { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4); font-weight: 500; color: #fff; }
  .arc-btn--primary:hover { background: rgba(255, 255, 255, 0.15); border-color: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.25); transform: translateY(-1px); }
  .arc-btn--disabled, .arc-btn--disabled:hover { 
    background: rgba(255, 255, 255, 0.08); 
    color: #9ca3af; 
    border-color: rgba(255, 255, 255, 0.15);
    opacity: 1; 
    cursor: default;
  }
  
  /* FOOTER */
  .arc-footer {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  
  .arc-footer p { margin: 0; }
  .arc-legal { font-size: 0.8rem; opacity: 0.9; color: #ffffff; }
  .arc-footer a { color: #ffffff; text-decoration: none; border-bottom: 1px dotted rgba(255, 255, 255, 0.5); transition: all var(--transition-fast); }
  .arc-footer a:hover { color: #ffffff; border-bottom-style: solid; border-bottom-color: #ffffff; opacity: 1; }
  
  /* MODIFIER: CENTER CONTENT */
  .arc-card--center-content { align-items: center; text-align: center; }
  .arc-card--center-content .arc-card-header { flex-direction: column; gap: 6px; margin-bottom: 4px; }
  .arc-card--center-content .arc-card-actions { justify-content: center; width: 100%; max-width: 500px; }
  
  /* CONTENT SECTION */
  .arc-content {
    width: 100%; max-width: 800px; margin: 40px auto 0; padding: 0 14px;
    color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; text-align: left;
    position: relative; z-index: 2;
  }
  .arc-content h2 { color: var(--text-main); font-size: 1.4rem; margin-bottom: 16px; margin-top: 32px; letter-spacing: 0.05em; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; text-align: center; }
  .arc-content h3 { color: #22e57f; font-size: 1.1rem; margin-bottom: 10px; margin-top: 24px; text-align: center; }
  .arc-content p { margin-bottom: 16px; }
  .arc-content ul { margin-bottom: 16px; padding-left: 0; list-style: none; }
  .arc-content li { margin-bottom: 8px; }
  .arc-content strong { color: #ffffff; }
  
  /* STATUS BADGES */
  .arc-status-badge {
    display: none; 
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    padding: 3px 8px; border-radius: 4px; margin-left: 8px; vertical-align: middle;
  }
  .arc-status-badge.visible { display: inline-block; animation: popIn 0.3s ease-out forwards; }
  @keyframes popIn { 0% { opacity: 0; transform: translateY(5px); } 100% { opacity: 1; transform: translateY(0); } }
  
  .status-solved { background: rgba(34, 229, 127, 0.15); color: #22e57f; border: 1px solid rgba(34, 229, 127, 0.4); box-shadow: 0 0 8px rgba(34, 229, 127, 0.2); }
  .status-failed { background: rgba(255, 79, 112, 0.15); color: #ff4f70; border: 1px solid rgba(255, 79, 112, 0.4); box-shadow: 0 0 8px rgba(255, 79, 112, 0.2); }
  
  /* FEATURE IMAGE */
  .arc-feature-img {
    width: 100%;
    max-width: 100%;
    height: auto;       
    max-height: 350px;
    object-fit: cover;  
    object-position: center top;
    border-radius: 12px;
    margin-top: 12px;
    margin-bottom: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
    cursor: pointer; 
    position: relative;
    z-index: 5; 
  }
  
  .arc-card:hover .arc-feature-img {
    transform: scale(1.02);
  }