:root {
      color-scheme: dark;
      /* Caseyland Dark Blue Palette */
      --bg-dark: #030814;
      --panel-bg: rgba(4, 13, 26, 0.95);
      --panel-border: rgba(19, 248, 241, 0.28);
      --bg-card: rgba(4, 13, 26, 0.92);
      --bg-card-hover: rgba(6, 20, 42, 0.98);
      --border-subtle: rgba(19, 248, 241, 0.28);
      --border-accent: #13f8f1;
      
      --text-main: #ffffff;
      --text-primary: #ffffff;
      --text-muted: #d1d5db;
      --text-dim: #9ca3af;
      --text-secondary: #9ca3af;
      
      --accent-pink: #ff00ff;        /* Electric Magenta Pink */
      --accent-cyan: #13f8f1;        /* Electric Cyan */
      --accent-yellow: #ffff00;      /* Electric Yellow */
      --accent-glow: rgba(255, 0, 255, 0.3);
      
      --font-heading: 'Varela Round', Arial, sans-serif;
      --font-body: 'Inconsolata', monospace, sans-serif;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    html, body {
      width: 100%;
      min-height: 100vh;
      background-color: var(--bg-dark);
      color: var(--text-main);
      font-family: var(--font-body);
      overflow-x: hidden;
    }

    body {
      background-color: var(--bg-dark);
      color: var(--text-main);
      font-family: var(--font-body);
      overflow-x: hidden;
      min-height: 100vh;
      background-image: 
        radial-gradient(at 10% 20%, rgba(19, 248, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(255, 0, 255, 0.08) 0px, transparent 50%);
      background-attachment: fixed;
    }

    .container {
      width: 100%;
      max-width: 1100px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      padding: 1.25rem 1.25rem 3rem 1.25rem;
      min-width: 0;
      box-sizing: border-box;
    }

    /* Floating App Header Card */
    .app-header {
      position: relative;
      z-index: 100;
      width: 100%;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1rem 1.5rem;
      background: var(--panel-bg);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid var(--border-subtle);
      border-radius: 0;
      margin-bottom: 1.25rem;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    .brand-group {
      display: flex;
      align-items: center;
      gap: 0.85rem;
      text-decoration: none;
    }

    .brand-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      background: rgba(19, 248, 241, 0.1);
      border: 1px solid rgba(19, 248, 241, 0.4);
      border-radius: 0;
      color: var(--accent-cyan);
      box-shadow: 0 0 14px rgba(19, 248, 241, 0.35) !important;
      flex-shrink: 0;
    }

    .brand-text {
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .brand-title {
      font-family: var(--font-heading);
      font-weight: 800;
      font-size: 1.25rem;
      color: #ffffff;
      letter-spacing: 0.04em;
      line-height: 1;
      margin: 0;
      display: flex;
      align-items: baseline;
      gap: 0.5rem;
    }

    .brand-title .brand-accent {
      color: var(--accent-cyan);
    }

    .brand-subtitle {
      font-family: var(--font-body);
      font-size: 0.72rem;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      line-height: 1;
      margin-top: 5px;
    }

    /* Header Actions & App Navigation Menu */
    .header-actions {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      position: relative;
      z-index: 100;
    }

    .header-action-btn {
      width: 34px;
      height: 34px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
      text-decoration: none;
      padding: 0;
      border-radius: 0;
    }

    .header-action-btn svg {
      width: 16px;
      height: 16px;
    }

    .header-action-btn:hover {
      background: rgba(19, 248, 241, 0.15);
      border-color: var(--accent-cyan);
      color: var(--accent-cyan);
      transform: translateY(-1px);
    }

    .header-action-btn.active {
      background: rgba(19, 248, 241, 0.2);
      border-color: var(--accent-cyan);
      color: var(--accent-cyan);
      box-shadow: 0 0 12px rgba(19, 248, 241, 0.35);
    }

    .app-nav-container {
      position: relative;
      display: inline-flex;
      align-items: center;
      z-index: 100;
    }

    .app-nav-modal {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      z-index: 200;
      background: rgba(4, 13, 26, 0.96);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid rgba(19, 248, 241, 0.3);
      padding: 10px 8px;
      width: 255px;
      max-width: calc(100vw - 2rem);
      opacity: 0;
      pointer-events: none;
      transform: translateY(-6px);
      transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      text-align: left;
      user-select: none;
      font-family: var(--font-body);
      border-radius: 0;
      box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65), 0 0 20px rgba(19, 248, 241, 0.15);
    }

    .app-nav-modal.visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }

    .app-nav-title {
      font-family: var(--font-heading);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--accent-cyan);
      padding: 3px 8px 6px 8px;
      border-bottom: 1px solid rgba(19, 248, 241, 0.2);
      margin-bottom: 5px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .app-nav-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .app-nav-item {
      margin: 0;
      padding: 0;
    }

    .app-nav-link {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 6px 8px;
      color: var(--text-primary);
      text-decoration: none;
      border: 1px solid transparent;
      transition: all 0.15s ease;
      cursor: pointer;
      border-radius: 0;
    }

    .app-nav-icon {
      width: 30px;
      height: 30px;
      margin-top: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: rgba(255, 255, 255, 0.04);
      border-radius: 0;
      transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    }

    .app-nav-icon svg {
      width: 22px;
      height: 22px;
      display: block;
    }

    .app-nav-icon.icon-1kx {
      color: #00f0ff;
      border-color: rgba(0, 240, 255, 0.25);
      background: rgba(0, 240, 255, 0.08);
    }

    .app-nav-icon.icon-1kx svg {
      width: 24px;
      height: 24px;
    }

    .app-nav-icon.icon-football {
      color: #33ff33;
      border-color: rgba(51, 255, 51, 0.25);
      background: rgba(51, 255, 51, 0.08);
    }

    .app-nav-icon.icon-football svg {
      width: 18px;
      height: 18px;
    }

    .app-nav-icon.icon-caseyland {
      color: #ff88ff;
      border-color: rgba(255, 0, 255, 0.25);
      background: rgba(255, 0, 255, 0.08);
    }

    .app-nav-icon.icon-caseyland svg {
      width: 28px;
      height: 28px;
    }

    .app-nav-icon.icon-liambot {
      color: #a5b4fc;
      border-color: rgba(165, 180, 252, 0.25);
      background: rgba(165, 180, 252, 0.08);
    }

    .app-nav-icon.icon-caseycase {
      color: #7ed2e6;
      border-color: rgba(79, 162, 184, 0.25);
      background: rgba(79, 162, 184, 0.08);
    }

    .app-nav-icon.icon-caseycase svg {
      width: 24px;
      height: 24px;
    }

    .app-nav-icon.icon-casey {
      color: #13f8f1;
      border-color: rgba(19, 248, 241, 0.25);
      background: rgba(19, 248, 241, 0.08);
    }

    .app-nav-icon.icon-casey svg {
      width: 20px;
      height: 20px;
    }

    .app-nav-link:hover .app-nav-icon.icon-1kx {
      border-color: rgba(0, 240, 255, 0.6);
      background: rgba(0, 240, 255, 0.16);
      box-shadow: 0 0 6px rgba(0, 240, 255, 0.3);
    }

    .app-nav-link:hover .app-nav-icon.icon-football {
      border-color: rgba(51, 255, 51, 0.6);
      background: rgba(51, 255, 51, 0.16);
      box-shadow: 0 0 6px rgba(51, 255, 51, 0.3);
    }

    .app-nav-link:hover .app-nav-icon.icon-caseyland {
      border-color: rgba(255, 0, 255, 0.6);
      background: rgba(255, 0, 255, 0.16);
      box-shadow: 0 0 6px rgba(255, 0, 255, 0.3);
    }

    .app-nav-link:hover .app-nav-icon.icon-liambot {
      border-color: rgba(165, 180, 252, 0.6);
      background: rgba(165, 180, 252, 0.16);
      box-shadow: 0 0 6px rgba(165, 180, 252, 0.3);
    }

    .app-nav-link:hover .app-nav-icon.icon-caseycase {
      border-color: rgba(79, 162, 184, 0.6);
      background: rgba(79, 162, 184, 0.16);
      box-shadow: 0 0 6px rgba(79, 162, 184, 0.3);
    }

    .app-nav-link:hover .app-nav-icon.icon-casey {
      border-color: rgba(19, 248, 241, 0.6);
      background: rgba(19, 248, 241, 0.16);
      box-shadow: 0 0 6px rgba(19, 248, 241, 0.3);
    }

    .app-nav-text-col {
      display: flex;
      flex-direction: column;
      gap: 2px;
      width: 100%;
    }

    .app-nav-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
    }

    .app-nav-name {
      font-family: var(--font-heading);
      font-size: 0.85rem;
      font-weight: 600;
      color: #ffffff;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .app-nav-sub {
      font-family: var(--font-body);
      font-size: 0.68rem;
      color: var(--text-secondary);
      line-height: 1.25;
      font-weight: 400;
      transition: color 0.15s ease;
    }

    .app-nav-link:hover {
      background: rgba(255, 255, 0, 0.12);
      border-color: var(--accent-yellow);
      transform: translateX(-2px);
    }

    .app-nav-link:hover .app-nav-name {
      color: var(--accent-yellow);
    }

    .app-nav-link:hover .app-nav-sub {
      color: #ffffff;
    }

    .app-nav-link:active {
      transform: scale(0.98);
    }

    .app-nav-ext {
      opacity: 0.6;
      color: var(--accent-yellow);
      transition: opacity 0.15s ease, transform 0.15s ease;
    }

    .app-nav-link:hover .app-nav-ext {
      opacity: 1;
      transform: translate(1px, -1px);
    }

    /* Main Content Container */
    main.error-container {
      position: relative;
      z-index: 2;
      width: 100%;
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    /* Cyber Card Box */
    .error-card {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px var(--accent-glow);
      padding: 3.5rem 2rem 3rem 2rem;
      width: 100%;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      margin-bottom: 1.25rem;
    }

    .error-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 4px;
      background: linear-gradient(90deg, 
        #13f8f1 0%, #13f8f1 33.33%, 
        #ffff00 33.33%, #ffff00 66.66%, 
        #ff00ff 66.66%, #ff00ff 100%);
    }

    /* Solid Bright Pink 404 Display */
    .error-code {
      font-family: var(--font-heading);
      font-size: clamp(6.5rem, 20vw, 12rem);
      font-weight: 800;
      line-height: 0.85;
      letter-spacing: 4px;
      color: var(--accent-pink);
      -webkit-text-fill-color: var(--accent-pink);
      text-shadow: 0 0 35px rgba(255, 0, 255, 0.5);
      margin-bottom: 0.75rem;
      user-select: none;
    }

    .error-title {
      font-family: var(--font-heading);
      font-size: clamp(1.4rem, 3.5vw, 2.2rem);
      letter-spacing: 2px;
      text-transform: uppercase;
      margin-bottom: 0.75rem;
      color: var(--text-main);
    }

    .error-desc {
      color: var(--text-muted);
      font-size: 1.1rem;
      max-width: 620px;
      line-height: 1.6;
      margin-bottom: 2.5rem;
    }

    /* Sub-App Navigation Grid */
    .apps-nav {
      margin-top: 1.5rem;
      width: 100%;
    }

    .apps-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1.25rem;
    }

    @media (max-width: 768px) {
      .container {
        padding: 0.75rem 0.75rem 2rem 0.75rem;
      }
      .app-header {
        padding: 0.85rem 1rem;
      }
      .error-card {
        padding: 2.25rem 1rem 2rem 1rem;
      }
      .error-title {
        font-size: 1.35rem;
        letter-spacing: 1px;
      }
      .apps-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 520px) {
      .apps-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
      }
    }

    .app-card {
      background: rgba(3, 8, 20, 0.88);
      border: 1px solid var(--border-subtle);
      padding: 1.15rem 1.15rem;
      text-decoration: none;
      color: var(--text-main);
      transition: all 0.2s ease-in-out;
      display: flex;
      flex-direction: row;
      align-items: center;
      text-align: left;
      gap: 0.85rem;
      position: relative;
    }

    .app-card:hover {
      border-color: var(--accent-yellow);
      background: var(--bg-card-hover);
      box-shadow: 0 0 20px rgba(255, 255, 0, 0.2);
      transform: translateY(-3px);
    }

    .app-card-icon {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: rgba(255, 255, 255, 0.04);
      border-radius: 0;
      transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    }

    .app-card-icon.icon-1kx {
      color: #00f0ff;
      border-color: rgba(0, 240, 255, 0.25);
      background: rgba(0, 240, 255, 0.08);
    }
    .app-card-icon.icon-1kx svg {
      width: 24px;
      height: 24px;
    }

    .app-card-icon.icon-football {
      color: #33ff33;
      border-color: rgba(51, 255, 51, 0.25);
      background: rgba(51, 255, 51, 0.08);
    }
    .app-card-icon.icon-football svg {
      width: 18px;
      height: 18px;
    }

    .app-card-icon.icon-caseyland {
      color: #ff88ff;
      border-color: rgba(255, 0, 255, 0.25);
      background: rgba(255, 0, 255, 0.08);
    }
    .app-card-icon.icon-caseyland svg {
      width: 26px;
      height: 26px;
    }

    .app-card-icon.icon-liambot {
      color: #a5b4fc;
      border-color: rgba(165, 180, 252, 0.25);
      background: rgba(165, 180, 252, 0.08);
    }
    .app-card-icon.icon-liambot svg {
      width: 20px;
      height: 20px;
    }

    .app-card-icon.icon-caseycase {
      color: #7ed2e6;
      border-color: rgba(79, 162, 184, 0.25);
      background: rgba(79, 162, 184, 0.08);
    }
    .app-card-icon.icon-caseycase svg {
      width: 24px;
      height: 24px;
    }

    .app-card-icon.icon-casey {
      color: #13f8f1;
      border-color: rgba(19, 248, 241, 0.25);
      background: rgba(19, 248, 241, 0.08);
    }
    .app-card-icon.icon-casey svg {
      width: 20px;
      height: 20px;
    }

    .app-card:hover .app-card-icon.icon-1kx {
      border-color: rgba(0, 240, 255, 0.6);
      background: rgba(0, 240, 255, 0.16);
      box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
    }

    .app-card:hover .app-card-icon.icon-football {
      border-color: rgba(51, 255, 51, 0.6);
      background: rgba(51, 255, 51, 0.16);
      box-shadow: 0 0 8px rgba(51, 255, 51, 0.35);
    }

    .app-card:hover .app-card-icon.icon-caseyland {
      border-color: rgba(255, 0, 255, 0.6);
      background: rgba(255, 0, 255, 0.16);
      box-shadow: 0 0 8px rgba(255, 0, 255, 0.35);
    }

    .app-card:hover .app-card-icon.icon-liambot {
      border-color: rgba(165, 180, 252, 0.6);
      background: rgba(165, 180, 252, 0.16);
      box-shadow: 0 0 8px rgba(165, 180, 252, 0.35);
    }

    .app-card:hover .app-card-icon.icon-caseycase {
      border-color: rgba(79, 162, 184, 0.6);
      background: rgba(79, 162, 184, 0.16);
      box-shadow: 0 0 8px rgba(79, 162, 184, 0.35);
    }

    .app-card:hover .app-card-icon.icon-casey {
      border-color: rgba(19, 248, 241, 0.6);
      background: rgba(19, 248, 241, 0.16);
      box-shadow: 0 0 8px rgba(19, 248, 241, 0.35);
    }

    .app-card-text {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      height: 36px;
      min-width: 0;
    }

    .app-name {
      font-family: var(--font-heading);
      font-size: 0.95rem;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      color: var(--text-main);
      line-height: 1.1;
      margin: 0;
      transition: all 0.2s ease-in-out;
    }

    .app-card:hover .app-name {
      color: var(--accent-yellow);
    }

    .app-sub {
      font-family: var(--font-body);
      font-size: 0.78rem;
      color: var(--text-dim);
      line-height: 1.1;
      margin: 0;
      transition: color 0.2s ease-in-out;
    }

    .app-card:hover .app-sub {
      color: #ffffff;
    }

    /* Standardized Footer */
    .app-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 1rem 0.5rem 2rem 0.5rem;
      margin-top: 1.25rem;
      border-top: none;
      font-size: 0.85rem;
      color: var(--text-dim);
      width: 100%;
      box-sizing: border-box;
    }

    .footer-left {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--text-dim);
    }

    .footer-right {
      display: flex;
      align-items: center;
      gap: 0.85rem;
    }

    .app-footer a {
      color: var(--text-dim);
      text-decoration: none;
      transition: all 0.2s ease;
      letter-spacing: 0.05em;
    }

    .app-footer a:hover {
      color: var(--accent-yellow);
      text-shadow: 0 0 8px rgba(255, 255, 0, 0.4);
    }
