:root {
      --bg: #000000;
      --bg-gradient: linear-gradient(135deg, #000000 0%, #111111 30%, #1a0000 100%);
      --card: #111111;
      --card-hover: #1a1a1a;
      --primary: #ff0000;
      --primary-hover: #cc0000;
      --secondary: #ff3333;
      --accent: #ff6666;
      --text: #ffffff;
      --text-muted: #cccccc;
      --input-bg: #1a1a1a;
      --input-focus: #222222;
      --border: #333333;
      --border-glow: rgba(255, 0, 0, 0.4);
      --shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
      --shadow-glow: 0 4px 16px rgba(255, 0, 0, 0.2);
      --timestamp: #ff0000;
      --copy-bg: #2a2a2a;
      --copy-hover: #3a3a3a;
      --glass-bg: rgba(17, 17, 17, 0.9);
      --glass-border: rgba(255, 0, 0, 0.2);
    }

    [data-theme="light"] {
      --bg: #fafafa;
      --bg-gradient: linear-gradient(135deg, #ffffff 0%, #fafafa 50%, #f5f5f5 100%);
      --card: #ffffff;
      --card-hover: #f7f7f7;
      --primary: #d40000;
      --primary-hover: #a80000;
      --secondary: #ff4444;
      --accent: #cc0000;
      --text: #111111;
      --text-muted: #444444;
      --input-bg: #ffffff;
      --input-focus: #f2f2f2;
      --border: #e0e0e0;
      --border-glow: rgba(212, 0, 0, 0.25);
      --shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
      --shadow-glow: 0 4px 16px rgba(212, 0, 0, 0.1);
      --timestamp: #d40000;
      --copy-bg: #f0f0f0;
      --copy-hover: #e6e6e6;
      --glass-bg: rgba(255, 255, 255, 0.92);
      --glass-border: rgba(0, 0, 0, 0.08);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Segoe UI', system-ui, sans-serif;
      transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    }

    body {
      background: var(--bg-gradient);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      overflow-x: hidden;
    }

    header {
      padding: 1.2rem;
      text-align: center;
      background: var(--glass-bg);
      backdrop-filter: blur(10px) saturate(140%);
      -webkit-backdrop-filter: blur(10px) saturate(140%);
      border-bottom: 1px solid var(--glass-border);
      box-shadow: var(--shadow-glow);
      z-index: 10;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      position: relative;
    }

    header h1 {
      font-size: 1.8rem;
      font-weight: 600;
      letter-spacing: -0.5px;
    }

    .tagline {
      font-size: 0.9rem;
      opacity: 0.7;
      margin-top: 0.3rem;
    }

    .theme-toggle,
    .timestamp-toggle,
    .beatbox-toggle,
    .contact-awi-toggle {
      position: absolute;
      top: 1rem;
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #0f0f1a;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-glow);
      width: 50px;
      height: 50px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.05rem;
      z-index: 20;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .theme-toggle:hover,
    .timestamp-toggle:hover,
    .beatbox-toggle:hover,
    .contact-awi-toggle:hover {
      transform: translateY(-1px) scale(1.03);
      box-shadow: 0 4px 16px var(--border-glow);
    }

    .theme-toggle { right: 1rem; }
    .timestamp-toggle { right: 70px; }
    .beatbox-toggle { right: 130px; }
    .contact-awi-toggle {
      right: 190px;
      background: linear-gradient(135deg, #ff4757, #ff3838);
      width: 100px;
      height: 50px;
      border-radius: 25px;
      font-size: 0.75rem;
      font-weight: 600;
      color: white;
      text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }

    .contact-awi-toggle:hover {
      background: linear-gradient(135deg, #ff3838, #ff2828);
      box-shadow: 0 4px 16px rgba(255, 71, 87, 0.4);
    }

    /* Story Mode Indicator - Futuristic HUD Style */
    .story-mode-hud {
      position: absolute;
      top: 1rem;
      left: 1rem;
      width: 240px;
      height: 80px;
      background: linear-gradient(135deg, rgba(255, 0, 0, 0.06), rgba(128, 0, 0, 0.08));
      border: 2px solid transparent;
      border-radius: 12px;
      backdrop-filter: blur(10px);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 16px;
      z-index: 21;
      cursor: pointer;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
      box-shadow:
        0 4px 20px rgba(255, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .story-mode-hud::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 0, 0, 0.15) 50%,
        transparent 70%);
      transform: translateX(-100%);
      transition: transform 0.6s ease;
    }

    .story-mode-hud:hover::before {
      transform: translateX(100%);
    }

    .story-mode-hud.enabled {
      border-color: #ff0000;
      box-shadow:
        0 0 20px rgba(255, 0, 0, 0.35),
        0 0 40px rgba(255, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
      background: linear-gradient(135deg, rgba(255, 0, 0, 0.12), rgba(128, 0, 0, 0.1));
    }

    .story-mode-hud.disabled {
      border-color: #662222;
      box-shadow:
        0 0 15px rgba(102, 34, 34, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
      background: linear-gradient(135deg, rgba(51, 0, 0, 0.2), rgba(17, 17, 17, 0.08));
    }

    .story-mode-content {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
    }

    .story-mode-icon {
      position: relative;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      transition: all 0.3s ease;
    }

    .story-mode-hud.enabled .story-mode-icon {
      background: radial-gradient(circle, rgba(255, 0, 0, 0.25), transparent);
      color: #ff0000;
      animation: pulse-glow 2s infinite;
    }

    .story-mode-hud.disabled .story-mode-icon {
      background: radial-gradient(circle, rgba(102, 34, 34, 0.25), transparent);
      color: #aa4444;
    }

    @keyframes pulse-glow {
      0%, 100% {
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.35);
        transform: scale(1);
      }
      50% {
        box-shadow: 0 0 16px rgba(255, 0, 0, 0.6);
        transform: scale(1.05);
      }
    }

    .story-mode-text {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .story-mode-label {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 1px;
      opacity: 0.8;
    }

    .story-mode-status {
      font-size: 14px;
      font-weight: 700;
      transition: all 0.3s ease;
    }

    .story-mode-hud.enabled .story-mode-status {
      color: #ff1a1a;
      text-shadow: 0 0 8px rgba(255, 0, 0, 0.45);
    }

    .story-mode-hud.disabled .story-mode-status {
      color: #aa4444;
    }

    .story-mode-toggle {
      width: 20px;
      height: 20px;
      border-radius: 3px;
      border: 1px solid currentColor;
      position: relative;
      transition: all 0.3s ease;
      flex-shrink: 0;
    }

    .story-mode-hud.enabled .story-mode-toggle {
      background: linear-gradient(45deg, #ff0000, #cc0000);
      border-color: #ff0000;
      box-shadow: 0 0 8px rgba(255, 0, 0, 0.35);
    }

    .story-mode-hud.disabled .story-mode-toggle {
      background: transparent;
      border-color: #aa4444;
    }

    .story-mode-toggle::after {
      content: '';
      position: absolute;
      width: 8px;
      height: 4px;
      border: 2px solid #0f0f1a;
      border-top: none;
      border-right: none;
      transform: rotate(-45deg);
      top: 4px;
      left: 4px;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    .story-mode-hud.enabled .story-mode-toggle::after {
      opacity: 1;
    }


    /* Responsive adjustments */
    @media (max-width: 768px) {
      .story-mode-hud {
        width: 200px;
        height: 70px;
        padding: 0 12px;
      }

      .story-mode-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
      }

      .story-mode-label {
        font-size: 10px;
      }

      .story-mode-status {
        font-size: 13px;
      }
    }

    [data-theme="light"] .theme-toggle,
    [data-theme="light"] .timestamp-toggle,
    [data-theme="light"] .beatbox-toggle,
    [data-theme="light"] .contact-awi-toggle {
      color: var(--primary);
      background: #f0f0f0;
    }

    main {
      flex: 1;
      display: flex;
      flex-direction: column;
      max-width: 1200px;
      width: 100%;
      margin: 0 auto;
      padding: 1rem;
    }

    .chat-container {
      flex: 1;
      display: flex;
      flex-direction: column;
      background: var(--glass-bg);
      border-radius: 16px;
      overflow: hidden;
      border: 1px solid var(--glass-border);
      box-shadow: var(--shadow);
      position: relative;
    }

    .messages {
      flex: 1;
      padding: 1.2rem;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 1.2rem;
      scroll-behavior: smooth;
      max-height: calc(100vh - 220px);
    }

    .message {
      max-width: 85%;
      padding: 1rem 1.3rem;
      border-radius: 18px;
      line-height: 1.5;
      position: relative;
      animation: fadeIn 0.4s ease-out;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .user {
      align-self: flex-end;
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #0f0f1a;
      border-bottom-right-radius: 4px;
      box-shadow: var(--shadow-glow);
    }

    .ai {
      align-self: flex-start;
      background: var(--card);
      border: 1px solid var(--glass-border);
      border-bottom-left-radius: 4px;
    }

    [data-theme="light"] .ai {
      background: #ffffff;
      border: 1px solid var(--border);
    }

    .message-footer {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 0.5rem;
      margin-top: 0.5rem;
      font-size: 0.75rem;
      opacity: 0.6;
    }

    .timestamp {
      color: var(--timestamp);
    }

    .copy-btn {
      background: var(--copy-bg);
      color: var(--text);
      border: 1px solid var(--glass-border);
      padding: 0.2rem 0.5rem;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.75rem;
      transition: background 0.2s ease, box-shadow 0.2s ease;
    }

    .copy-btn:hover { background: var(--copy-hover); box-shadow: var(--shadow-glow); }

    .typing {
      font-style: italic;
      opacity: 0.7;
    }

    .input-area {
      display: flex;
      padding: 0.8rem;
      background: var(--glass-bg);
      border-top: 1px solid var(--glass-border);
      gap: 0.8rem;
      position: sticky;
      bottom: 0;
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }

    input {
      flex: 1;
      padding: 1rem;
      border: 1px solid var(--glass-border);
      background: var(--card);
      color: var(--text);
      border-radius: 12px;
      outline: none;
      font-size: 1rem;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

    input:focus {
      background: var(--input-focus);
      border-color: var(--border);
      box-shadow: 0 0 0 3px var(--border-glow);
    }

    button {
      border: 1px solid var(--border);
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #0f0f1a;
      width: 50px;
      height: 50px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
      box-shadow: var(--shadow-glow);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    button:hover { transform: scale(1.05); box-shadow: 0 4px 16px var(--border-glow); }

    [data-theme="light"] button {
      color: #0f0f1a;
    }

    button:hover {
      transform: scale(1.05);
    }

    .speak-btn {
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #0f0f1a;
      font-size: 1rem;
      width: auto;
      padding: 0 1rem;
      border-radius: 12px;
      margin-top: 0.5rem;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-glow);
    }

    [data-theme="light"] .speak-btn {
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #0f0f1a;
    }

    .context-modal {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0) rotateY(90deg);
      background: linear-gradient(135deg, rgba(15, 15, 26, 0.98) 0%, rgba(30, 5, 5, 0.98) 100%);
      color: var(--text);
      padding: 1rem 1.5rem;
      border-radius: 12px;
      border: 2px solid var(--primary);
      box-shadow:
        0 0 20px rgba(255, 0, 0, 0.3),
        0 8px 25px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
      font-weight: 700;
      font-size: 0.95rem;
      text-align: center;
      z-index: 10000;
      opacity: 0;
      visibility: hidden;
      transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
      backdrop-filter: blur(10px);
      min-width: 260px;
      max-width: 320px;
      position: relative;
      overflow: visible;
    }

    .context-modal::before {
      content: '';
      position: absolute;
      top: -1px;
      left: -1px;
      right: -1px;
      bottom: -1px;
      background: linear-gradient(45deg,
        transparent,
        rgba(255, 0, 0, 0.25),
        transparent,
        rgba(255, 100, 100, 0.3),
        transparent);
      border-radius: 12px;
      z-index: -1;
      animation: modalBorderPulse 1.6s ease-in-out infinite alternate;
    }

    .context-modal::after {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg,
        transparent,
        rgba(255, 0, 0, 0.2),
        transparent);
      animation: modalScanline 3s ease-in-out infinite;
    }

    @keyframes modalBorderPulse {
      0% { opacity: 0.3; }
      100% { opacity: 0.8; }
    }

    @keyframes modalScanline {
      0% { left: -100%; }
      50% { left: 100%; }
      100% { left: 100%; }
    }

    @keyframes modalAppear {
      0% {
        transform: translate(-50%, -50%) scale(0) rotateY(90deg);
        opacity: 0;
      }
      60% {
        transform: translate(-50%, -50%) scale(1) rotateY(8deg);
        opacity: 1;
      }
      100% {
        transform: translate(-50%, -50%) scale(1) rotateY(0deg);
        opacity: 1;
      }
    }

    .context-modal.show {
      opacity: 1;
      visibility: visible;
      transform: translate(-50%, -50%) scale(1) rotateY(0deg);
      animation: modalAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

    /* Enhanced Context Modal inner elements */
    .context-modal .modal-inner {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      max-width: 280px;
    }

    .context-modal .modal-header {
      font-size: 1.05rem;
      font-weight: 800;
      letter-spacing: 0.06em;
      color: var(--accent);
      text-shadow: 0 0 12px rgba(255,0,0,0.35);
      white-space: nowrap;
    }

    /* container for flying sparks */
    .context-modal .spark-container {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      pointer-events: none;
      overflow: visible;
    }

    .context-modal .spark {
      position: absolute;
      width: 4px; height: 4px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255,200,200,1) 0%, rgba(255,0,0,0.8) 60%, rgba(255,0,0,0) 100%);
      box-shadow: 0 0 10px rgba(255,0,0,0.7);
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.6);
      animation: none;
    }

    @keyframes sparkFly {
      0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
      10% { opacity: 1; }
      100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.8); }
    }

    .context-modal .modal-text {
      margin: 0.25rem 0 0.5rem 0;
      line-height: 1.4;
      color: var(--text);
      opacity: 0.95;
    }

    .context-modal .modal-divider {
      width: 100%;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255,0,0,0.5), transparent);
      margin: 0.25rem 0 0.5rem 0;
    }

    .context-modal .modal-close {
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #0f0f1a;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 0.4rem 0.9rem;
      font-weight: 700;
      cursor: pointer;
      box-shadow: var(--shadow-glow);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .context-modal .modal-close:hover {
      transform: translateY(-1px) scale(1.04);
      box-shadow: 0 0 0 2px rgba(255,0,0,0.15), 0 10px 30px rgba(255,0,0,0.25);
    }

    .context-modal .modal-glow {
      position: absolute;
      inset: -10%;
      background: radial-gradient(60% 60% at 50% 40%, rgba(255,0,0,0.15), transparent 60%);
      pointer-events: none;
      filter: blur(8px);
      opacity: 0.7;
      animation: modalGlowPulse 2.8s ease-in-out infinite;
    }

    @keyframes modalGlowPulse {
      0%, 100% { opacity: 0.45; transform: scale(1); }
      50% { opacity: 0.8; transform: scale(1.05); }
    }

    /* FX sparkle ring on show */
    .context-modal.fx .modal-inner::after {
      content: '';
      position: absolute;
      inset: -4px;
      border-radius: 18px;
      background: radial-gradient(120px 120px at center, rgba(255,120,120,0.35), transparent 60%);
      filter: blur(10px);
      animation: fxSpark 700ms ease-out forwards;
      pointer-events: none;
    }

    @keyframes fxSpark {
      0% { opacity: 0; transform: scale(0.6); }
      50% { opacity: 1; transform: scale(1.05); }
      100% { opacity: 0; transform: scale(1.2); }
    }

    .footer {
      text-align: center;
      padding: 1rem;
      font-size: 0.85rem;
      opacity: 0.6;
    }

    /* Image-specific styles */
    .image-container {
      margin-top: 0.5rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      background: var(--card);
      border: 1px solid var(--glass-border);
      border-radius: 12px;
      padding: 0.5rem;
      box-shadow: var(--shadow-glow);
    }

    .generated-image {
      max-width: 100%;
      max-height: 420px;
      border-radius: 10px;
      border: 1px solid var(--glass-border);
      box-shadow: var(--shadow);
      border-radius: 12px;
      object-fit: contain;
    }

    .download-btn {
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #0f0f1a;
      font-size: 1rem;
      width: auto;
      padding: 0 1rem;
      border-radius: 12px;
      margin-top: 0.5rem;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-glow);
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    [data-theme="light"] .download-btn {
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #0f0f1a;
    }

    .download-btn:hover {
      transform: scale(1.05);
      box-shadow: 0 4px 16px var(--border-glow);
    }

    /* Video Integration Overlay Styles */
    .video-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: var(--glass-bg);
      backdrop-filter: blur(15px);
      -webkit-backdrop-filter: blur(15px);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 100;
      border-radius: 16px;
      border: 1px solid var(--glass-border);
    }

    .video-overlay.hidden {
      display: none;
    }

    .enter-chat-btn {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.6rem;
      background:
        linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 45%, var(--primary) 100%),
        linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
      color: #0b0f13;
      border: 2px solid transparent;
      background-clip: padding-box;
      padding: 1.05rem 2.2rem;
      border-radius: 18px;
      font-size: clamp(0.95rem, 2.2vw, 1.15rem);
      font-weight: 900;
      cursor: pointer;
      text-transform: uppercase;
      letter-spacing: 1px;
      white-space: nowrap;
      line-height: 1.2;
      box-sizing: border-box;
      min-width: 220px;
      max-width: 90vw;
      overflow: hidden;
      box-shadow:
        0 0 0 1px var(--primary),
        0 0 20px var(--border-glow),
        0 15px 40px rgba(0,0,0,0.3),
        inset 0 3px 0 rgba(255,255,255,0.2),
        inset 0 -4px 0 rgba(0,0,0,0.5),
        inset 0 0 80px rgba(255,255,255,0.05);
      transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
      text-shadow:
        0 1px 0 rgba(0,0,0,0.4),
        0 0 10px rgba(255,255,255,0.1);
      animation: pulseGlow 3s ease-in-out infinite alternate;
    }

    @keyframes pulseGlow {
      0% {
        box-shadow:
          0 0 0 1px var(--primary),
          0 0 20px var(--border-glow),
          0 15px 40px rgba(0,0,0,0.3),
          inset 0 3px 0 rgba(255,255,255,0.2),
          inset 0 -4px 0 rgba(0,0,0,0.5),
          inset 0 0 80px rgba(255,255,255,0.05);
      }
      100% {
        box-shadow:
          0 0 0 1px var(--primary),
          0 0 35px var(--border-glow),
          0 15px 40px rgba(0,0,0,0.3),
          inset 0 3px 0 rgba(255,255,255,0.25),
          inset 0 -4px 0 rgba(0,0,0,0.5),
          inset 0 0 80px rgba(255,255,255,0.08);
      }
    }

    @keyframes shimmer {
      0% { transform: translateX(-100%); }
      100% { transform: translateX(100%); }
    }

    @keyframes holographic {
      0%, 100% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
      }
      50% {
        background-position: 100% 50%;
        filter: hue-rotate(20deg);
      }
    }

    .enter-chat-btn::before {
      content: '';
      position: absolute;
      top: -2px;
      left: -2px;
      right: -2px;
      bottom: -2px;
      background: linear-gradient(
        45deg,
        var(--primary) 0%,
        #ff006e 25%,
        #ff8500 50%,
        var(--primary) 75%,
        #ff006e 100%
      );
      background-size: 300% 300%;
      border-radius: 22px;
      z-index: -1;
      animation: holographic 4s ease-in-out infinite;
      opacity: 0.6;
    }

    .enter-chat-btn::after {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.4) 50%,
        transparent 100%
      );
      border-radius: inherit;
      pointer-events: none;
      animation: shimmer 2.5s ease-in-out infinite;
      z-index: 1;
    }

    .enter-chat-btn .btn-icon {
      font-size: 1em;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transform-origin: center;
      filter: drop-shadow(0 0 6px rgba(255,255,255,0.25));
      animation: iconPulse 2.4s ease-in-out infinite alternate;
    }

    @keyframes iconPulse {
      0% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(255,255,255,0.3)); }
      100% { transform: scale(1.1); filter: drop-shadow(0 0 12px rgba(255,255,255,0.5)); }
    }

    .enter-chat-btn .btn-label { position: relative; z-index: 2; font-weight: 800; letter-spacing: 0.6px; }
    .enter-chat-btn .particles { position: absolute; inset: -8px; pointer-events: none; z-index: 0; }
    .enter-chat-btn .particles::before,
    .enter-chat-btn .particles::after { content: ''; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle at center, #fff, rgba(255,255,255,0) 70%); box-shadow: 0 0 10px rgba(255,255,255,0.6), 0 0 20px var(--border-glow); animation: floatSpark 3.2s ease-in-out infinite; }
    .enter-chat-btn .particles::before { top: 10%; left: 12%; animation-delay: 0.2s; }
    .enter-chat-btn .particles::after { bottom: 8%; right: 15%; animation-delay: 1.3s; }
    @keyframes floatSpark { 0% { transform: translateY(0) translateX(0); opacity: 0.9; } 50% { transform: translateY(-6px) translateX(4px); opacity: 0.6; } 100% { transform: translateY(0) translateX(0); opacity: 0.9; } }

    .enter-chat-btn:hover {
      transform: translateY(-3px) scale(1.03);
      box-shadow:
        0 0 0 1px var(--primary),
        0 0 50px var(--border-glow),
        0 25px 60px rgba(0,0,0,0.4),
        inset 0 4px 0 rgba(255,255,255,0.3),
        inset 0 -5px 0 rgba(0,0,0,0.6),
        inset 0 0 100px rgba(255,255,255,0.1);
      filter: brightness(1.1) saturate(1.15);
      animation: pulseGlow 1.8s ease-in-out infinite alternate;
    }

    .enter-chat-btn:hover::before {
      animation: holographic 2s ease-in-out infinite;
      opacity: 0.8;
    }

    .enter-chat-btn:hover::after {
      animation: shimmer 1.2s ease-in-out infinite;
    }

    .enter-chat-btn:active {
      transform: translateY(-1px) scale(1.02);
      box-shadow:
        0 0 0 1px var(--primary),
        0 0 30px var(--border-glow),
        0 8px 25px rgba(0,0,0,0.5),
        inset 0 6px 15px rgba(0,0,0,0.6),
        inset 0 0 50px rgba(255,255,255,0.05);
      filter: brightness(0.95);
      animation: none;
    }

    .enter-chat-btn:focus-visible {
      outline: none;
      box-shadow:
        0 0 0 3px rgba(255,255,255,0.15),
        0 0 0 6px var(--border-glow),
        0 0 60px var(--border-glow),
        0 20px 50px rgba(0,0,0,0.4),
        inset 0 3px 0 rgba(255,255,255,0.25),
        inset 0 -4px 0 rgba(0,0,0,0.5),
        inset 0 0 80px rgba(255,255,255,0.08);
    }

    .choice-modal {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background:
        linear-gradient(135deg, rgba(15,15,26,0.98) 0%, rgba(24,24,40,0.96) 100%),
        radial-gradient(circle at center, rgba(255,49,49,0.03) 0%, transparent 70%);
      border: 2px solid var(--primary);
      border-radius: 20px;
      padding: 2.5rem 2rem;
      display: none;
      flex-direction: column;
      gap: 1.5rem;
      z-index: 200;
      min-width: 420px;
      max-width: 90vw;
      box-shadow:
        0 0 0 1px var(--primary),
        0 0 60px rgba(255,49,49,0.4),
        0 25px 80px rgba(0,0,0,0.6),
        inset 0 2px 0 rgba(255,255,255,0.1),
        inset 0 -3px 0 rgba(0,0,0,0.4);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      animation: modalAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes modalAppear {
      0% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.8);
        filter: blur(4px);
      }
      100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0);
      }
    }

    .choice-modal.show {
      display: flex;
    }

    .choice-modal h3 {
      text-align: center;
      color: var(--primary);
      margin-bottom: 0.5rem;
      font-size: 1.4rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1.2px;
      text-shadow:
        0 0 15px rgba(255,49,49,0.6),
        0 2px 0 rgba(0,0,0,0.5);
      animation: textGlow 3s ease-in-out infinite alternate;
    }

    .choice-modal p {
      text-align: center;
      color: rgba(255,255,255,0.85);
      font-size: 1rem;
      margin-bottom: 1rem;
      letter-spacing: 0.5px;
    }

    @keyframes textGlow {
      0% { text-shadow: 0 0 15px rgba(255,49,49,0.6), 0 2px 0 rgba(0,0,0,0.5); }
      100% { text-shadow: 0 0 25px rgba(255,49,49,0.8), 0 2px 0 rgba(0,0,0,0.5); }
    }

    .choice-actions { display: grid; grid-template-columns: 1fr; gap: 1rem; }
    .choice-actions .choice-btn { width: 100%; }

    .choice-btn {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.6rem;
      padding: 0.9rem 1.6rem;
      border-radius: 16px;
      border: 2px solid transparent;
      background-clip: padding-box;
      color: #0b0f13;
      font-weight: 800;
      letter-spacing: 0.8px;
      cursor: pointer;
      overflow: hidden;
      transition: all 0.25s ease;
      box-shadow: 0 0 0 1px var(--primary), 0 0 20px var(--border-glow), 0 10px 30px rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.18), inset 0 -3px 0 rgba(0,0,0,0.5);
    }
    .choice-btn .btn-icon { font-size: 1rem; line-height: 1; filter: drop-shadow(0 0 6px rgba(255,255,255,0.25)); }
    .choice-btn .btn-label { font-size: 1rem; white-space: nowrap; }
    .choice-btn.watch { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 60%, var(--primary) 100%); }
    .choice-btn.goto { background: linear-gradient(135deg, #f7b733 0%, #fc4a1a 60%, #f7b733 100%); }
    .choice-btn::before { content: ''; position: absolute; inset: -2px; background: linear-gradient(45deg, var(--primary) 0%, #ff006e 50%, var(--primary) 100%); background-size: 300% 300%; border-radius: 18px; z-index: -1; opacity: 0.6; animation: holographic 4s ease-in-out infinite; }
    .choice-btn::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%); pointer-events: none; border-radius: inherit; animation: shimmer 2.5s ease-in-out infinite; }
    .choice-btn:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.08) saturate(1.1); box-shadow: 0 0 0 1px var(--primary), 0 0 40px var(--border-glow), 0 15px 40px rgba(0,0,0,0.4), inset 0 3px 0 rgba(255,255,255,0.22), inset 0 -4px 0 rgba(0,0,0,0.6); }
    .choice-btn:active { transform: translateY(0) scale(0.99); box-shadow: 0 0 0 1px var(--primary), 0 0 20px var(--border-glow), inset 0 2px 0 rgba(255,255,255,0.15), inset 0 -3px 0 rgba(0,0,0,0.55); }
    .choice-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.15), 0 0 0 6px var(--border-glow), 0 0 50px var(--border-glow), 0 15px 40px rgba(0,0,0,0.45), inset 0 3px 0 rgba(255,255,255,0.18), inset 0 -4px 0 rgba(0,0,0,0.55); }
    .choice-btn .particles { position: absolute; inset: -8px; pointer-events: none; }
    .choice-btn .particles::before, .choice-btn .particles::after { content: ''; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle at center, #fff, rgba(255,255,255,0) 70%); box-shadow: 0 0 8px rgba(255,255,255,0.5), 0 0 18px var(--border-glow); animation: floatSpark 3s ease-in-out infinite; }
    .choice-btn .particles::before { top: 12%; left: 10%; animation-delay: 0.1s; }
    .choice-btn .particles::after { bottom: 10%; right: 12%; animation-delay: 1.1s; }

    @media (max-width: 768px) {
      .choice-modal { min-width: unset; width: 92vw; padding: 1.6rem 1.2rem; }
      .choice-actions { grid-template-columns: 1fr; gap: 0.8rem; }
      .choice-btn { padding: 0.8rem 1.2rem; border-radius: 14px; }
      .choice-btn .btn-label { font-size: 0.95rem; }
      .choice-btn .btn-icon { font-size: 0.95rem; }
    }

    /* Video Container Styles */
    .video-container {
      margin-top: 0.5rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      background: var(--card);
      border: 1px solid var(--glass-border);
      border-radius: 12px;
      padding: 0.5rem;
      box-shadow: var(--shadow-glow);
    }

    .video-message {
      max-width: 100%;
      max-height: 420px;
      border-radius: 10px;
      border: 1px solid var(--glass-border);
      box-shadow: var(--shadow);
      object-fit: contain;
    }

    /* Video Replay Bubble */
    .video-replay-bubble {
      position: fixed;
      bottom: 20px;
      right: 20px;
      width: 60px;
      height: 60px;
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      border: 2px solid var(--border);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      cursor: pointer;
      box-shadow: var(--shadow-glow);
      transition: all 0.3s ease;
      z-index: 50;
      color: #0f0f1a;
    }

    .video-replay-bubble:hover {
      transform: scale(1.1);
      box-shadow: 0 6px 20px var(--border-glow);
    }

    .video-replay-bubble.hidden {
      display: none;
    }

    /* Responsive adjustments */
    @media (max-width: 768px) {
      .enter-chat-btn {
        padding: 0.8rem 1.4rem;
        font-size: 0.95rem;
        border-radius: 16px;
        letter-spacing: 0.8px;
        min-width: 200px;
        max-width: 92vw;
      }
      .enter-chat-btn .btn-icon { font-size: 0.95em; }
      .enter-chat-btn::before { border-radius: 18px; }

      .video-replay-bubble {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
      }

      .choice-modal {
        padding: 1.5rem;
        max-width: 90vw;
      }
    }

  /* Contact Modal */
  .contact-modal.hidden { display: none; }
  .contact-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
  .contact-inner { position: relative; width: min(760px, 90vw); max-height: 90vh; overflow: auto; padding: 20px 20px 24px; border-radius: 16px; background: radial-gradient(1200px 300px at top, rgba(255,0,80,0.12), transparent), linear-gradient(180deg, rgba(20,20,28,0.95), rgba(12,12,18,0.98)); border: 1px solid rgba(255,80,100,0.35); box-shadow: 0 10px 35px rgba(255,0,80,0.25), inset 0 1px 0 rgba(255,255,255,0.06); }
  .contact-glow { position: absolute; inset: -2px; border-radius: 18px; pointer-events: none; box-shadow: 0 0 0 1px rgba(255,70,90,0.5), 0 0 25px rgba(255,70,90,0.35), inset 0 0 20px rgba(255,70,90,0.08); }
  .contact-inner h3 { margin: 0 0 10px; text-transform: uppercase; letter-spacing: 1px; font-size: 1rem; color: #ff6b81; text-shadow: 0 0 8px rgba(255,60,80,0.6); }
  #contactForm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  #contactForm .form-grid { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  #contactForm .yn-grid { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  #contactForm .span-2 { grid-column: 1 / -1; }
  #contactForm label span { display: block; font-size: 0.8rem; opacity: 0.8; margin-bottom: 4px; }
  #contactForm input[type="text"],
  #contactForm input[type="email"],
  #contactForm input[type="tel"],
  #contactForm select,
  #contactForm textarea { width: 100%; padding: 10px 12px; border-radius: 10px; background: rgba(12,12,18,0.85); border: 1px solid rgba(255,80,100,0.3); color: #f5f8ff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); }
  #contactForm textarea { resize: vertical; min-height: 110px; }
  #contactForm input:focus, #contactForm select:focus, #contactForm textarea:focus { outline: none; border-color: #ff6b81; box-shadow: 0 0 0 2px rgba(255,80,100,0.25); }
  .char-counter { text-align: right; font-size: 0.75rem; margin-top: 4px; color: #28d176; }
  .agree { display: flex; flex-direction: row; align-items: center; gap: 8px; }
  .agree input[type="checkbox"] { width: auto !important; flex-shrink: 0; }
  .contact-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
  .btn { padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,80,100,0.35); cursor: pointer; font-weight: 600; font-size: 0.9rem; line-height: 1.1; }
  .btn.primary { background: linear-gradient(135deg, #ff4757, #ff3838); color: #fff; }
  .btn.primary:hover { background: linear-gradient(135deg, #ff3838, #ff2828); box-shadow: 0 4px 16px rgba(255, 71, 87, 0.4); }
  .btn.secondary { background: rgba(20,20,28,0.9); color: #f5f8ff; }
  .btn.secondary:hover { background: rgba(30,30,38,0.95); }
  .contact-close { position: absolute; top: 8px; right: 10px; border: none; background: transparent; color: #ff6b81; font-size: 1rem; cursor: pointer; }
  @media (max-width: 680px) { #contactForm .form-grid, #contactForm .yn-grid { grid-template-columns: 1fr; } .contact-inner { width: min(96vw, 720px);} }
  @media (max-width: 480px) { .contact-actions .btn { font-size: 0.85rem; padding: 8px 10px; } }

  /* Light theme overrides for contact modal */
  [data-theme="light"] .contact-inner { background: radial-gradient(1200px 300px at top, rgba(212,0,0,0.08), transparent), linear-gradient(180deg, rgba(250,250,250,0.95), rgba(245,245,245,0.98)); border: 1px solid rgba(212,0,0,0.3); box-shadow: 0 10px 35px rgba(212,0,0,0.2), inset 0 1px 0 rgba(0,0,0,0.06); }
  [data-theme="light"] .contact-glow { box-shadow: 0 0 0 1px rgba(212,0,0,0.5), 0 0 25px rgba(212,0,0,0.25), inset 0 0 20px rgba(212,0,0,0.06); }
  [data-theme="light"] .contact-inner h3 { color: #d40000; text-shadow: 0 0 6px rgba(212,0,0,0.5); }
  [data-theme="light"] #contactForm input[type="text"], [data-theme="light"] #contactForm input[type="email"], [data-theme="light"] #contactForm input[type="tel"], [data-theme="light"] #contactForm select, [data-theme="light"] #contactForm textarea { background: rgba(255,255,255,0.9); border: 1px solid rgba(212,0,0,0.25); color: #111; }
  [data-theme="light"] .btn.secondary { background: rgba(240,240,240,0.9); color: #111; }
  [data-theme="light"] .btn.secondary:hover { background: rgba(230,230,230,0.95); }
  [data-theme="light"] .contact-close { color: #d40000; }
#msgodBtn {
  right: 300px;
  position: absolute;
  top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 50px;
  width: auto;
  box-sizing: border-box;
  white-space: nowrap;
  background: linear-gradient(135deg, #0d6efd, #0957c3);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 25px;
  box-shadow: 0 2px 10px rgba(13, 110, 253, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  cursor: pointer;
  z-index: 20;
  font-weight: 700;
  letter-spacing: 0.3px;
}
#msgodBtn:hover {
  background: linear-gradient(135deg, #0b5ed7, #0848a7);
}
#msgodBtn .msgod-icon { font-size: 1rem; line-height: 1; filter: drop-shadow(0 0 4px rgba(255,255,255,0.25)); }
#msgodBtn .msgod-text { font-size: 0.8rem; text-transform: uppercase; font-weight: 800; letter-spacing: 0.3px; }
/* Optional states for feedback */
#msgodBtn.active {
  box-shadow: 0 0 12px rgba(98, 214, 255, 0.6);
}
#msgodBtn.loading {
  opacity: 0.6;
  pointer-events: none;
}
    .story-mode-hud {
      position: absolute;
      top: 1rem;
      left: 1rem;
      width: 240px;
      height: 80px;
      background: linear-gradient(135deg, rgba(255, 0, 0, 0.06), rgba(128, 0, 0, 0.08));
      border: 2px solid transparent;
      border-radius: 12px;
      backdrop-filter: blur(10px);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 16px;
      z-index: 21;
      cursor: pointer;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
      box-shadow:
        0 4px 20px rgba(255, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .story-mode-hud::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 0, 0, 0.15) 50%,
        transparent 70%);
      transform: translateX(-100%);
      transition: transform 0.6s ease;
    }

    .story-mode-hud:hover::before {
      transform: translateX(100%);
    }

    .story-mode-hud.enabled {
      border-color: #ff0000;
      box-shadow:
        0 0 20px rgba(255, 0, 0, 0.35),
        0 0 40px rgba(255, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
      background: linear-gradient(135deg, rgba(255, 0, 0, 0.12), rgba(128, 0, 0, 0.1));
    }

    .story-mode-hud.disabled {
      border-color: #662222;
      box-shadow:
        0 0 15px rgba(102, 34, 34, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
      background: linear-gradient(135deg, rgba(51, 0, 0, 0.2), rgba(17, 17, 17, 0.08));
    }

    .story-mode-content {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
    }

    .story-mode-icon {
      position: relative;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      transition: all 0.3s ease;
    }

    .story-mode-hud.enabled .story-mode-icon {
      background: radial-gradient(circle, rgba(255, 0, 0, 0.25), transparent);
      color: #ff0000;
      animation: pulse-glow 2s infinite;
    }

    .story-mode-hud.disabled .story-mode-icon {
      background: radial-gradient(circle, rgba(102, 34, 34, 0.25), transparent);
      color: #aa4444;
    }

    @keyframes pulse-glow {
      0%, 100% {
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.35);
        transform: scale(1);
      }
      50% {
        box-shadow: 0 0 16px rgba(255, 0, 0, 0.6);
        transform: scale(1.05);
      }
    }

    .story-mode-text {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .story-mode-label {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 1px;
      opacity: 0.8;
    }

    .story-mode-status {
      font-size: 14px;
      font-weight: 700;
      transition: all 0.3s ease;
    }

    .story-mode-hud.enabled .story-mode-status {
      color: #ff1a1a;
      text-shadow: 0 0 8px rgba(255, 0, 0, 0.45);
    }

    .story-mode-hud.disabled .story-mode-status {
      color: #aa4444;
    }

    .story-mode-toggle {
      width: 20px;
      height: 20px;
      border-radius: 3px;
      border: 1px solid currentColor;
      position: relative;
      transition: all 0.3s ease;
      flex-shrink: 0;
    }

    .story-mode-hud.enabled .story-mode-toggle {
      background: linear-gradient(45deg, #ff0000, #cc0000);
      border-color: #ff0000;
      box-shadow: 0 0 8px rgba(255, 0, 0, 0.35);
    }

    .story-mode-hud.disabled .story-mode-toggle {
      background: transparent;
      border-color: #aa4444;
    }

    .story-mode-toggle::after {
      content: '';
      position: absolute;
      width: 8px;
      height: 4px;
      border: 2px solid #0f0f1a;
      border-top: none;
      border-right: none;
      transform: rotate(-45deg);
      top: 4px;
      left: 4px;
      opacity: 0;
      transition: opacity 0.3s ease;
    }