    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    html, body {
      height: 100%;
      overflow: hidden;
    }

    body {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: #0a0a0a;
      font-family: 'Share Tech Mono', monospace;
      position: fixed;
      inset: 0;
    }

    /* Ensure circled numbers use consistent font */
    .modal, .reading-modal {
      font-family: 'Share Tech Mono', 'Noto Sans Symbols 2', monospace;
    }

    /* ========================================================================
       LANDING PAGE
       ======================================================================== */

    .landing-page {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #0a0a0a;
      z-index: 100;
      transition: opacity 0.6s ease, transform 0.6s ease;
    }

    .landing-page.transitioning {
      opacity: 0;
      transform: scale(1.05);
    }

    .landing-page.hidden {
      display: none;
    }

    .landing-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding: 2rem;
      max-width: 400px;
    }

    .landing-emblem {
      opacity: 0.8;
      margin-bottom: 2rem;
    }

    .landing-title {
      font-family: 'Share Tech Mono', monospace;
      font-size: 2rem;
      font-weight: 400;
      letter-spacing: 0.3em;
      color: #fff;
      margin-bottom: 0.5rem;
    }

    .landing-pronunciation {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.8rem;
      color: #666;
      margin-bottom: 1.5rem;
      letter-spacing: 0.05em;
    }

    .landing-pos {
      font-style: italic;
      color: #555;
      margin-left: 0.5em;
    }

    .landing-description {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.85rem;
      line-height: 1.7;
      color: #888;
      margin-bottom: 3rem;
      letter-spacing: 0.02em;
    }

    .landing-button {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.9rem;
      letter-spacing: 0.15em;
      padding: 1rem 2.5rem;
      background: transparent;
      border: 1px solid #fff;
      color: #fff;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .landing-button:hover {
      background: #fff;
      color: #0a0a0a;
    }

    .landing-footer {
      position: absolute;
      bottom: 2rem;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.65rem;
      color: #444;
      letter-spacing: 0.05em;
    }

    .landing-footer a {
      color: #666;
      text-decoration: none;
    }

    .landing-footer a:hover {
      color: #888;
    }

    /* Mobile landing adjustments */
    @media (max-width: 480px) {
      .landing-title {
        font-size: 1.5rem;
        letter-spacing: 0.2em;
      }

      .landing-description {
        font-size: 0.8rem;
        margin-bottom: 2.5rem;
      }

      .landing-button {
        font-size: 0.8rem;
        padding: 0.9rem 2rem;
      }
    }

    /* ========================================================================
       CREDITS
       ======================================================================== */

    .credits {
      position: fixed;
      bottom: 1rem;
      left: 1rem;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.55rem;
      color: #333;
      letter-spacing: 0.05em;
      z-index: 50;
    }

    @supports (padding: max(0px)) {
      .credits {
        bottom: max(1rem, env(safe-area-inset-bottom));
        left: max(1rem, env(safe-area-inset-left));
      }
    }

    /* ========================================================================
       MAIN DISPLAY
       ======================================================================== */

    .main-display {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
      opacity: 1;
      transition: opacity 0.5s ease;
    }

    .main-display.hidden {
      display: none;
    }

    .main-display.entering {
      opacity: 0;
    }

    .emblem {
      margin-bottom: 0.5rem;
      opacity: 0.7;
      cursor: pointer;
      transition: opacity 0.2s ease;
    }

    .emblem:hover {
      opacity: 1;
    }

    .tree-lines {
      width: 100%;
      max-width: 320px;
      height: 40px;
      margin-top: -0.5rem;
      margin-bottom: -0.5rem;
    }

    @media (min-width: 600px) {
      .tree-lines {
        max-width: 500px;
        height: 60px;
      }
    }

    .symbols-row,
    .digits-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      max-width: 320px;
      padding: 0 10px;
      gap: 0.5rem;
    }

    @media (min-width: 600px) {
      .symbols-row,
      .digits-row {
        max-width: 500px;
        gap: 1rem;
      }
    }

    .counter-wrapper {
      position: relative;
      padding: 0.15em;
    }

    .corner-border {
      position: absolute;
      width: 0.4em;
      height: 0.4em;
      border-color: rgba(255, 255, 255, 0.3);
      border-style: solid;
      border-width: 0;
    }

    .corner-border.top-left {
      top: 0;
      left: 0;
      border-top-width: 1px;
      border-left-width: 1px;
    }

    .corner-border.top-right {
      top: 0;
      right: 0;
      border-top-width: 1px;
      border-right-width: 1px;
    }

    .corner-border.bottom-left {
      bottom: 0;
      left: 0;
      border-bottom-width: 1px;
      border-left-width: 1px;
    }

    .corner-border.bottom-right {
      bottom: 0;
      right: 0;
      border-bottom-width: 1px;
      border-right-width: 1px;
    }

    .counter {
      display: flex;
      gap: 0.1em;
      opacity: 0;
      transition: opacity 0.3s ease;
      cursor: pointer;
    }

    .counter.ready {
      opacity: 0;
    }

    .counter.visible {
      opacity: 1;
    }

    .counter:hover {
      opacity: 0.8;
    }

    .digit {
      position: relative;
      width: 1ch;
      height: 1.2em;
      font-size: clamp(4rem, 15vw, 12rem);
      overflow: hidden;
      -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 30%,
        black 70%,
        transparent 100%
      );
      mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 30%,
        black 70%,
        transparent 100%
      );
    }

    .digit-inner {
      position: absolute;
      top: 0;
      left: 0;
      line-height: 1.2;
      color: #fff;
      will-change: transform, filter;
    }

    .digit-inner.spinning {
      filter: blur(2px);
    }

    .digit-char {
      display: block;
      height: 1.2em;
      opacity: 0.3;
      transition: opacity 0.3s ease;
    }

    .digit-char.active {
      opacity: 1;
    }

    .symbol-container {
      position: relative;
      width: 48px;
      height: 48px;
      font-size: 32px;
      overflow: hidden;
      opacity: 0;
      transition: opacity 0.3s ease;
      -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 25%,
        black 75%,
        transparent 100%
      );
      mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 25%,
        black 75%,
        transparent 100%
      );
    }

    @media (min-width: 600px) {
      .symbol-container {
        width: 64px;
        height: 64px;
        font-size: 42px;
      }
    }

    .symbol-container::before {
      content: attr(data-label);
      position: fixed;
      bottom: 4rem;
      left: 50%;
      transform: translateX(-50%);
      font-size: 12px;
      font-family: 'Share Tech Mono', monospace;
      color: #555;
      white-space: nowrap;
      opacity: 0;
      transition: opacity 0.2s ease;
      pointer-events: none;
      z-index: 100;
    }

    .symbol-container:hover::before {
      opacity: 1;
    }

    .symbol-container.ready {
      opacity: 0;
    }

    .symbol-container.visible {
      opacity: 1;
    }

    .symbol-inner {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      color: #fff;
      font-family: 'Noto Sans Symbols 2', sans-serif;
      will-change: transform;
    }

    .symbol-inner.spinning {
      filter: blur(2px);
    }

    .symbol-char {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 48px;
      height: 48px;
      text-align: center;
      color: #fff;
      font-family: 'Share Tech Mono', 'Segoe UI Symbol', monospace;
      font-variant-emoji: text;
    }

    @media (min-width: 600px) {
      .symbol-char {
        width: 64px;
        height: 64px;
      }
    }

    .digit-container {
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
    }

    .digit-container:hover {
      transform: scale(1.1);
    }

    .digit-container .symbol-char {
      font-size: 2.5rem;
      color: #fff;
      text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
      transition: all 0.3s ease;
      width: auto;
      height: auto;
    }

    @media (min-width: 600px) {
      .digit-container .symbol-char {
        font-size: 3rem;
      }
    }

    .symbol-container:hover {
      opacity: 0.8;
    }

    /* Modal styles */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.9);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .modal-overlay.active {
      opacity: 1;
      visibility: visible;
    }

    .modal {
      background: #111;
      border: 1px solid #333;
      padding: 2rem;
      max-width: 400px;
      width: 90%;
      text-align: center;
      transform: scale(0.9);
      transition: transform 0.3s ease;
    }

    .modal-overlay.active .modal {
      transform: scale(1);
    }

    .modal-description {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.85rem;
      color: #ccc;
      line-height: 1.8;
      margin-bottom: 1.5rem;
      white-space: pre-line;
    }

    .modal-close {
      background: transparent;
      border: 1px solid #444;
      color: #888;
      padding: 0.5rem 1.5rem;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.8rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .modal-close:hover {
      border-color: #fff;
      color: #fff;
    }

    .modal-link {
      display: inline-block;
      color: #666;
      font-size: 0.75rem;
      margin-top: 1rem;
      text-decoration: none;
      transition: color 0.2s ease;
    }

    .modal-link:hover {
      color: #fff;
    }

    /* Reading Modal - Fullscreen */
    .reading-modal {
      max-width: 95vw;
      max-height: 95vh;
      width: 1200px;
      overflow-y: auto;
      padding: 2rem;
    }

    .reading-header {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-bottom: 2rem;
      padding-bottom: 1rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .reading-number {
      font-size: 3rem;
      color: #fff;
      letter-spacing: 0.2em;
      margin: 0;
    }

    .reading-tabs {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
      flex-wrap: wrap;
      justify-content: center;
    }

    .reading-tab {
      background: transparent;
      border: 1px solid #333;
      color: #555;
      padding: 0.4rem 0.8rem;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.7rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .reading-tab:hover {
      border-color: #555;
      color: #888;
    }

    .reading-tab.active {
      border-color: #fff;
      color: #fff;
    }

    .reading-content {
      display: block;
      margin-bottom: 2rem;
      text-align: center;
    }

    .reading-symbol-container {
      display: none;
    }

    .reading-symbol {
      font-size: 4rem;
      font-family: 'Noto Sans Symbols 2', 'Share Tech Mono', sans-serif;
      color: #fff;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .reading-symbol.tarot-img {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      height: 300px;
    }

    .reading-symbol.tarot-img img {
      width: auto;
      height: 300px;
      max-width: 200px;
      border-radius: 4px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
      transition: transform 0.3s ease;
      object-fit: contain;
    }

    .reading-symbol.tarot-img img.reversed {
      transform: rotate(180deg);
    }

    /* Alchemy symbols in reading modal */
    .reading-symbol.alchemy-symbol {
      background: radial-gradient(circle, rgba(218, 165, 32, 0.2), rgba(218, 165, 32, 0.05));
      border: 2px solid rgba(218, 165, 32, 0.4);
      border-radius: 50%;
      width: 120px;
      height: 120px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto;
      font-size: 3.5rem;
      color: #DAA520;
      text-shadow: 0 0 15px rgba(218, 165, 32, 0.6);
      box-shadow: 0 0 20px rgba(218, 165, 32, 0.3), inset 0 0 15px rgba(218, 165, 32, 0.1);
    }

    /* Zodiac symbols in reading modal */
    .reading-symbol.zodiac-symbol {
      background: radial-gradient(circle, rgba(138, 43, 226, 0.2), rgba(72, 61, 139, 0.05));
      border: 2px solid rgba(138, 43, 226, 0.4);
      border-radius: 50%;
      width: 120px;
      height: 120px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto;
      font-size: 3.5rem;
      color: #9370DB;
      text-shadow: 0 0 15px rgba(138, 43, 226, 0.6);
      box-shadow: 0 0 20px rgba(138, 43, 226, 0.4), inset 0 0 15px rgba(138, 43, 226, 0.1);
    }

    /* I Ching symbols in reading modal */
    .reading-symbol.iching-symbol {
      background: radial-gradient(circle, rgba(0, 206, 209, 0.2), rgba(64, 224, 208, 0.05));
      border: 2px solid rgba(0, 206, 209, 0.4);
      border-radius: 50%;
      width: 120px;
      height: 120px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto;
      font-size: 3.5rem;
      color: #40E0D0;
      text-shadow: 0 0 15px rgba(0, 206, 209, 0.6);
      box-shadow: 0 0 20px rgba(0, 206, 209, 0.4), inset 0 0 15px rgba(0, 206, 209, 0.1);
    }

    .reading-info {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }

    .reading-title {
      font-family: 'Share Tech Mono', monospace;
      font-size: 1.8rem;
      font-weight: 700;
      color: #fff;
      margin-bottom: 1rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
    }

    .reading-desc {
      font-family: 'Cardo', serif;
      font-size: 1.05rem;
      color: #ccc;
      line-height: 1.9;
      white-space: pre-line;
    }

    .divination-methods {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
      margin-top: 1.25rem;
      text-align: left;
    }

    .divination-method {
      border: 1px solid #222;
      padding: 0.75rem;
      background: #0a0a0a;
    }

    .divination-method-title {
      font-size: 0.7rem;
      color: #fff;
      margin-bottom: 0.4rem;
      letter-spacing: 0.1em;
    }

    .divination-method-calc {
      font-size: 0.65rem;
      color: #666;
      margin-bottom: 0.4rem;
      font-family: 'Share Tech Mono', monospace;
    }

    .divination-method-desc {
      font-size: 0.6rem;
      color: #444;
      line-height: 1.4;
    }

    /* Mobile styles */
    @media (max-width: 500px) {
      .modal {
        width: 95%;
        padding: 1.25rem;
        max-height: 90vh;
        overflow-y: auto;
      }

      .modal-description {
        font-size: 0.75rem;
      }

      .divination-methods {
        grid-template-columns: 1fr;
        gap: 0.5rem;
      }

      .divination-method {
        padding: 0.6rem;
      }

      .divination-method-title {
        font-size: 0.65rem;
      }

      .divination-method-calc {
        font-size: 0.6rem;
      }

      .divination-method-desc {
        font-size: 0.55rem;
      }

      .reading-modal {
        max-width: 95%;
      }

      .reading-number {
        font-size: 2rem;
      }

      .reading-tabs {
        gap: 0.3rem;
      }

      .reading-tab {
        padding: 0.3rem 0.5rem;
        font-size: 0.6rem;
      }

      .reading-symbol {
        font-size: 2rem;
      }

      .reading-symbol.tarot-font {
        font-size: 2.5rem;
      }

      .reading-title {
        font-size: 0.85rem;
      }

      .reading-desc {
        font-size: 0.7rem;
      }
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Deck Carousel Modal */
    .deck-carousel-container {
      position: relative;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      background: radial-gradient(ellipse at center, rgba(20, 20, 25, 0.95) 0%, rgba(8, 8, 10, 0.98) 100%);
    }

    .deck-close {
      position: absolute;
      top: 1.5rem;
      right: 1.5rem;
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #666;
      width: 40px;
      height: 40px;
      font-size: 1.2rem;
      cursor: pointer;
      border-radius: 50%;
      transition: all 0.2s ease;
      z-index: 10;
    }

    .deck-close:hover {
      border-color: #fff;
      color: #fff;
    }

    .deck-nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: #666;
      width: 50px;
      height: 80px;
      font-size: 2rem;
      cursor: pointer;
      transition: all 0.2s ease;
      z-index: 10;
    }

    .deck-nav:hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.3);
      color: #fff;
    }

    .deck-nav-prev {
      left: 1rem;
      border-radius: 4px 0 0 4px;
    }

    .deck-nav-next {
      right: 1rem;
      border-radius: 0 4px 4px 0;
    }

    .deck-stack {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      flex: 1;
      width: 100%;
      max-width: 900px;
      padding: 1rem 0;
      perspective: 1000px;
      perspective-origin: center center;
    }

    .deck-stack.transitioning .deck-card-prev,
    .deck-stack.transitioning .deck-card-next {
      pointer-events: none;
    }

    .deck-card-prev,
    .deck-card-next {
      flex-shrink: 0;
      width: 120px;
      cursor: pointer;
      z-index: 1;
      transform-style: preserve-3d;
    }

    .deck-card-prev {
      transform-origin: right center;
    }

    .deck-card-next {
      transform-origin: left center;
    }

    .deck-card-mini {
      background: linear-gradient(165deg, rgba(18, 18, 22, 0.95) 0%, rgba(10, 10, 12, 0.98) 100%);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      padding: 1.25rem 0.75rem;
      text-align: center;
      box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    }

    .deck-card-mini-glyph {
      font-size: 1.8rem;
      color: #888;
      margin-bottom: 0.5rem;
    }

    .deck-card-mini-title {
      font-size: 0.65rem;
      color: #aaa;
      font-weight: 500;
      letter-spacing: 0.02em;
      margin-bottom: 0.25rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .deck-card-mini-type {
      font-size: 0.55rem;
      color: #555;
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    .deck-card-display {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      max-width: 500px;
      width: 100%;
      padding: 0 1.5rem;
      z-index: 5;
      transform-style: preserve-3d;
    }

    .deck-card {
      will-change: transform, opacity;
      transform-style: preserve-3d;
      position: relative;
      background: linear-gradient(165deg, rgba(18, 18, 22, 0.98) 0%, rgba(12, 12, 15, 0.99) 100%);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 2.5rem 2rem;
      width: 100%;
      max-width: 450px;
      text-align: center;
      box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
      transform-style: preserve-3d;
      backdrop-filter: blur(20px);
      overflow: hidden;
    }

    .deck-card::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 12px;
      background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%);
      pointer-events: none;
    }

    /* Glyph subtle glow on rare cards */
    .deck-card-glyph {
      text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    }

    .deck-card-type {
      font-size: 0.6rem;
      color: #666;
      letter-spacing: 0.2em;
      margin-bottom: 0.75rem;
    }

    .deck-card-rarity {
      font-size: 0.55rem;
      letter-spacing: 0.15em;
      padding: 0.25rem 0.75rem;
      border: 1px solid;
      border-radius: 2px;
      display: inline-block;
      margin-bottom: 1rem;
      text-transform: uppercase;
    }

    .deck-card-glyph {
      font-size: 5rem;
      margin-bottom: 1rem;
      line-height: 1;
      color: #fff;
    }

    .deck-card-title {
      font-size: 1.5rem;
      font-weight: 600;
      color: #fff;
      margin-bottom: 0.5rem;
      letter-spacing: 0.05em;
    }

    .deck-card-suit {
      font-size: 0.8rem;
      color: #888;
      margin-bottom: 1.5rem;
    }

    .deck-card-meaning {
      font-size: 0.85rem;
      color: #aaa;
      line-height: 1.7;
      margin-bottom: 1.5rem;
    }

    .deck-card-keywords {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
    }

    .deck-card-keyword {
      padding: 0.4rem 0.8rem;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 20px;
      font-size: 0.7rem;
      color: #999;
    }

    .deck-card-signature {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.5rem;
      padding: 1rem;
      background: rgba(0, 0, 0, 0.3);
      border-radius: 6px;
      font-size: 0.65rem;
      color: #666;
    }

    .deck-card-signature span {
      text-align: center;
    }

    .deck-card-signature strong {
      color: #888;
    }

    .deck-footer {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
      padding-top: 1rem;
    }

    .deck-filter {
      display: flex;
      gap: 0.5rem;
    }

    .filter-btn {
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #555;
      padding: 0.5rem 1rem;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.7rem;
      letter-spacing: 0.1em;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .filter-btn:hover {
      border-color: rgba(255, 255, 255, 0.3);
      color: #888;
    }

    .filter-btn.active {
      border-color: rgba(107, 182, 255, 0.5);
      color: #6bb6ff;
      background: rgba(107, 182, 255, 0.1);
    }

    .deck-counter {
      font-size: 0.75rem;
      color: #555;
      letter-spacing: 0.1em;
    }

    /* Mobile styles for deck carousel */
    @media (max-width: 700px) {
      .deck-card-prev,
      .deck-card-next {
        display: none;
      }

      .deck-stack {
        padding: 0;
      }

      .deck-card-display {
        max-width: 100%;
        padding: 0 0.5rem;
      }
    }

    @media (max-width: 600px) {
      .deck-carousel-container {
        padding: 1rem;
      }

      .deck-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
      }

      .deck-nav {
        width: 40px;
        height: 60px;
        font-size: 1.5rem;
      }

      .deck-nav-prev {
        left: 0.5rem;
      }

      .deck-nav-next {
        right: 0.5rem;
      }

      .deck-card {
        padding: 1.5rem 1rem;
      }

      .deck-card-glyph {
        font-size: 3.5rem;
      }

      .deck-card-title {
        font-size: 1.2rem;
      }

      .deck-card-meaning {
        font-size: 0.8rem;
      }

      .deck-card-signature {
        font-size: 0.6rem;
      }

      .filter-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.6rem;
      }

      .deck-card-keywords {
        gap: 0.3rem;
      }

      .deck-card-keyword {
        padding: 0.2rem 0.5rem;
        font-size: 0.55rem;
      }
    }

    /* Extra small mobile (iPhone SE, etc) */
    @media (max-width: 380px) {
      .deck-carousel-container {
        padding: 0.75rem;
      }

      .deck-card {
        padding: 1.25rem 0.75rem;
      }

      .deck-card-glyph {
        font-size: 2.8rem;
      }

      .deck-card-title {
        font-size: 1rem;
      }

      .deck-card-meaning {
        font-size: 0.7rem;
      }

      .deck-card-signature {
        font-size: 0.5rem;
        flex-direction: column;
        gap: 0.25rem;
      }

      .deck-footer {
        flex-direction: column;
        gap: 0.75rem;
      }

      .filter-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.55rem;
      }
    }

    /* ═══════════════════════════════════════════════════════════════ */
    /* ANALYSIS MODAL RESPONSIVE STYLES                                */
    /* ═══════════════════════════════════════════════════════════════ */

    /* Analysis section boxes */
    .analysis-section {
      background: rgba(255,255,255,0.02);
      border: 1px solid rgba(255,255,255,0.05);
      border-radius: 4px;
      padding: 1.5rem;
      margin-bottom: 1.5rem;
      transition: all 0.2s ease;
    }

    .analysis-section:hover {
      background: rgba(255,255,255,0.04);
      border-color: rgba(255,255,255,0.1);
    }

    .analysis-section-title {
      font-size: 0.65rem;
      color: #999;
      letter-spacing: 0.15em;
      margin-bottom: 1rem;
      text-align: center;
    }

    /* Unified Identity Section */
    .identity-section {
      text-align: center;
      padding: 2rem 1rem;
      margin-bottom: 2rem;
    }

    .identity-sigil {
      margin-bottom: 1.5rem;
    }

    .identity-sigil svg {
      max-width: 280px;
      height: auto;
    }

    .identity-seed {
      font-family: 'Share Tech Mono', monospace;
      font-size: 1.4rem;
      color: #fff;
      letter-spacing: 0.2em;
      opacity: 0.9;
    }

    /* Seed display (legacy) */
    .seed-display {
      font-family: 'Share Tech Mono', monospace;
      font-size: 1.1rem;
      color: #fff;
      letter-spacing: 0.15em;
      padding: 1rem 1.5rem;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 4px;
      display: inline-block;
      word-break: break-all;
    }

    /* Codes grid */
    .codes-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.8rem;
      font-size: 0.9rem;
      font-family: 'Share Tech Mono', monospace;
    }

    .code-item {
      padding: 0.6rem;
      background: rgba(255,255,255,0.02);
      border: 1px solid rgba(255,255,255,0.05);
      border-radius: 3px;
      text-align: center;
    }

    /* Correspondences grid */
    .correspondences-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1rem;
    }

    .correspondence-item {
      text-align: center;
      padding: 1rem;
      background: rgba(255,255,255,0.02);
      border-radius: 4px;
    }

    /* Deck preview */
    .deck-preview {
      position: relative;
      height: 180px;
      margin-bottom: 2rem;
    }

    /* Deck action buttons container */
    .deck-action-buttons {
      display: flex;
      gap: 1rem;
      justify-content: center;
      flex-wrap: wrap;
    }

    /* Explore deck button */
    .explore-deck-btn {
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.15);
      color: #fff;
      padding: 1rem 2.5rem;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.8rem;
      letter-spacing: 0.15em;
      cursor: pointer;
      border-radius: 4px;
      transition: all 0.3s ease;
    }

    .explore-deck-btn:hover {
      background: rgba(255,255,255,0.1);
      border-color: rgba(255,255,255,0.25);
    }

    /* Draw cards button */
    .draw-cards-btn {
      background: linear-gradient(135deg, rgba(201, 162, 39, 0.15) 0%, rgba(139, 115, 85, 0.15) 100%);
      border: 1px solid rgba(201, 162, 39, 0.4);
      color: #c9a227;
      padding: 1rem 2.5rem;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.8rem;
      letter-spacing: 0.15em;
      cursor: pointer;
      border-radius: 4px;
      transition: all 0.3s ease;
    }

    .draw-cards-btn:hover {
      background: linear-gradient(135deg, rgba(201, 162, 39, 0.25) 0%, rgba(139, 115, 85, 0.25) 100%);
      border-color: rgba(201, 162, 39, 0.6);
      box-shadow: 0 0 20px rgba(201, 162, 39, 0.2);
    }

    .star-map-btn {
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: #555;
      padding: 0.5rem 1.25rem;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.55rem;
      letter-spacing: 0.15em;
      cursor: pointer;
      border-radius: 3px;
      transition: all 0.3s ease;
      margin: 1.5rem auto 3rem;
      display: block;
    }

    .star-map-btn:hover {
      border-color: rgba(255, 255, 255, 0.4);
      color: #fff;
      box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    }

    /* ═══════════════════════════════════════════════════════════════ */
    /* STAR MAP MODAL                                                   */
    /* ═══════════════════════════════════════════════════════════════ */

    .starmap-container {
      position: relative;
      width: 100%;
      height: 100%;
      background: #050508;
      overflow: hidden;
    }

    .starmap-close {
      position: fixed;
      top: 1.5rem;
      right: 1.5rem;
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #666;
      width: 40px;
      height: 40px;
      font-size: 1.2rem;
      cursor: pointer;
      border-radius: 50%;
      transition: all 0.3s ease;
      z-index: 1000;
    }

    .starmap-close:hover {
      border-color: rgba(255, 255, 255, 0.5);
      color: #fff;
    }

    .starmap-content {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      padding: 4rem 2rem;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    /* Probability Cascade */
    .cascade-container {
      max-width: 600px;
      width: 100%;
      text-align: center;
    }

    .cascade-title {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.7rem;
      letter-spacing: 0.3em;
      color: #555;
      margin-bottom: 3rem;
      opacity: 0;
    }

    .cascade-step {
      margin-bottom: 2.5rem;
      opacity: 0;
      transform: translateY(20px);
    }

    .cascade-label {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.6rem;
      letter-spacing: 0.2em;
      color: #666;
      margin-bottom: 0.75rem;
    }

    .cascade-value {
      font-family: 'Share Tech Mono', monospace;
      font-size: 1.8rem;
      color: #fff;
      margin-bottom: 0.5rem;
      letter-spacing: 0.05em;
    }

    .cascade-probability {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.65rem;
      color: #444;
    }

    .cascade-line {
      width: 1px;
      height: 40px;
      background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
      margin: 0 auto 2rem;
      opacity: 0;
    }

    .cascade-pulls {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.75rem;
      margin: 1.5rem 0;
      max-width: 400px;
      margin-left: auto;
      margin-right: auto;
    }

    .cascade-pull-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 0.75rem;
      background: rgba(255,255,255,0.02);
      border: 1px solid rgba(255,255,255,0.05);
      border-radius: 4px;
    }

    .cascade-pull-num {
      font-size: 0.5rem;
      color: #555;
      letter-spacing: 0.1em;
      margin-bottom: 0.25rem;
    }

    .cascade-pull-value {
      font-size: 0.9rem;
      color: #fff;
      letter-spacing: 0.05em;
    }

    .cascade-deck-explanation {
      text-align: left;
      max-width: 450px;
      margin: 1.5rem auto 0;
      font-size: 0.7rem;
      line-height: 1.8;
      color: #777;
    }

    .cascade-deck-explanation p {
      margin-bottom: 1rem;
    }

    .cascade-deck-explanation strong {
      color: #aaa;
    }

    .cascade-deck-note {
      margin-top: 1.5rem;
      padding: 1rem;
      background: rgba(255,255,255,0.03);
      border-left: 2px solid rgba(255,255,255,0.1);
      font-style: italic;
      color: #888;
    }

    .cascade-comparison {
      margin-top: 3rem;
      padding-top: 2rem;
      border-top: 1px solid rgba(255,255,255,0.05);
      opacity: 0;
    }

    .cascade-comparison-title {
      font-size: 0.55rem;
      letter-spacing: 0.25em;
      color: #555;
      margin-bottom: 2rem;
      text-align: center;
    }

    .cascade-comparison-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 1rem;
    }

    @media (max-width: 600px) {
      .cascade-comparison-grid {
        grid-template-columns: 1fr;
      }
    }

    .cascade-wonder-card {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 8px;
      padding: 1.25rem;
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
    }

    .cascade-wonder-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    }

    .cascade-wonder-card:hover {
      border-color: rgba(255, 255, 255, 0.15);
      background: rgba(255, 255, 255, 0.04);
    }

    .wonder-notation {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.9rem;
      color: #555;
      margin-bottom: 0.75rem;
      letter-spacing: 0.05em;
    }

    .wonder-notation sup {
      font-size: 0.6rem;
    }

    .wonder-text {
      font-size: 0.7rem;
      line-height: 1.6;
      color: #666;
    }

    .wonder-text em {
      color: #aaa;
      font-style: normal;
    }

    .cascade-comparison-footer {
      margin-top: 2rem;
      padding: 1.25rem;
      text-align: center;
      background: rgba(255, 255, 255, 0.02);
      border-radius: 6px;
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .footer-glyph {
      color: #444;
      font-size: 0.7rem;
    }

    .footer-message {
      display: inline-block;
      margin: 0 0.75rem;
      font-size: 0.6rem;
      color: #555;
      line-height: 1.5;
    }

    .footer-message em {
      color: #999;
      font-style: normal;
      font-family: 'Share Tech Mono', monospace;
    }

    /* Keep old styles for backward compatibility but they won't be used */
    .cascade-comparison-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.75rem 0;
      border-bottom: 1px solid rgba(255,255,255,0.03);
      font-size: 0.7rem;
    }

    .cascade-comparison-label {
      color: #666;
    }

    .cascade-comparison-value {
      color: #888;
      font-family: 'Share Tech Mono', monospace;
    }

    .cascade-final {
      margin-top: 3rem;
      padding: 2rem;
      background: rgba(255,255,255,0.02);
      border: 1px solid rgba(255,255,255,0.05);
      border-radius: 8px;
      opacity: 0;
    }

    .cascade-final-label {
      font-size: 0.55rem;
      letter-spacing: 0.2em;
      color: #555;
      margin-bottom: 1rem;
    }

    .cascade-final-value {
      font-size: 0.9rem;
      color: #fff;
      letter-spacing: 0.1em;
      word-break: break-all;
    }

    .cascade-final-note {
      font-size: 0.6rem;
      color: #444;
      margin-top: 1rem;
      font-style: italic;
    }

    /* ═══════════════════════════════════════════════════════════════ */
    /* THREE CARD DRAW MODAL                                           */
    /* ═══════════════════════════════════════════════════════════════ */

    .draw-container {
      position: relative;
      width: 100%;
      height: 100%;
      max-width: 1200px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      background: radial-gradient(ellipse at center, rgba(20, 20, 25, 0.95) 0%, rgba(8, 8, 10, 0.98) 100%);
      overflow-y: auto;
    }

    .draw-header {
      text-align: center;
      margin-bottom: 2rem;
    }

    .draw-title {
      font-size: 0.9rem;
      letter-spacing: 0.3em;
      color: #c9a227;
      margin-bottom: 0.5rem;
    }

    .draw-subtitle {
      font-size: 0.65rem;
      letter-spacing: 0.15em;
      color: #666;
    }

    /* Three card spread layout */
    .draw-spread {
      display: flex;
      gap: 2rem;
      justify-content: center;
      align-items: flex-start;
      flex-wrap: wrap;
      margin-bottom: 2rem;
    }

    .draw-position {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.75rem;
    }

    .draw-position-label {
      font-size: 0.6rem;
      letter-spacing: 0.2em;
      color: #666;
      text-transform: uppercase;
    }

    .draw-card-slot {
      transition: opacity 0.4s ease, transform 0.4s ease;
    }

    /* Individual drawn card */
    .draw-card {
      width: 180px;
      min-height: 260px;
      background: linear-gradient(180deg, rgba(25, 25, 30, 0.95) 0%, rgba(15, 15, 18, 0.98) 100%);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 8px;
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      cursor: pointer;
      transition: all 0.3s ease;
      position: relative;
    }

    .draw-card:hover {
      transform: translateY(-8px);
      box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
      border-color: rgba(255, 255, 255, 0.3);
    }

    .draw-card-rarity {
      position: absolute;
      top: 0.5rem;
      right: 0.5rem;
      font-size: 0.5rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    .draw-card-type {
      font-size: 0.5rem;
      letter-spacing: 0.15em;
      color: #666;
      margin-bottom: 0.75rem;
    }

    .draw-card-glyph {
      font-size: 2.5rem;
      margin-bottom: 0.75rem;
      opacity: 0.9;
    }

    .draw-card-title {
      font-size: 0.75rem;
      letter-spacing: 0.1em;
      color: #fff;
      margin-bottom: 0.5rem;
      line-height: 1.3;
    }

    .draw-card-name {
      font-size: 0.55rem;
      letter-spacing: 0.1em;
      color: #888;
    }

    /* Detail view */
    .draw-detail {
      width: 100%;
      max-width: 600px;
      padding: 1rem;
    }

    .draw-back-btn {
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #888;
      padding: 0.5rem 1rem;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.1em;
      cursor: pointer;
      border-radius: 4px;
      margin-bottom: 1.5rem;
      transition: all 0.2s ease;
    }

    .draw-back-btn:hover {
      border-color: rgba(255, 255, 255, 0.4);
      color: #fff;
    }

    .draw-detail-content {
      text-align: center;
    }

    .draw-detail-position {
      font-size: 0.6rem;
      letter-spacing: 0.25em;
      color: #c9a227;
      margin-bottom: 1rem;
    }

    .draw-detail-type {
      font-size: 0.55rem;
      letter-spacing: 0.15em;
      color: #666;
      margin-bottom: 0.5rem;
    }

    .draw-detail-rarity {
      display: inline-block;
      font-size: 0.5rem;
      letter-spacing: 0.1em;
      padding: 0.25rem 0.75rem;
      border: 1px solid;
      border-radius: 2px;
      margin-bottom: 1rem;
    }

    .draw-detail-glyph {
      font-size: 4rem;
      margin: 1rem 0;
      opacity: 0.9;
    }

    .draw-detail-title {
      font-size: 1.2rem;
      letter-spacing: 0.15em;
      color: #fff;
      margin-bottom: 0.5rem;
    }

    .draw-detail-name {
      font-size: 0.7rem;
      letter-spacing: 0.1em;
      color: #888;
      margin-bottom: 1.5rem;
    }

    .draw-detail-section {
      margin-bottom: 1.5rem;
      text-align: left;
      background: rgba(255, 255, 255, 0.02);
      border-radius: 4px;
      padding: 1rem;
    }

    .draw-detail-label {
      font-size: 0.55rem;
      letter-spacing: 0.2em;
      color: #666;
      margin-bottom: 0.75rem;
    }

    .draw-detail-meaning {
      font-size: 0.7rem;
      line-height: 1.7;
      color: #ccc;
    }

    .draw-detail-interpretation {
      font-size: 0.7rem;
      line-height: 1.7;
      color: #c9a227;
      font-style: italic;
    }

    .draw-detail-keywords {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      justify-content: center;
      margin-bottom: 1.5rem;
    }

    .draw-detail-keyword {
      font-size: 0.55rem;
      letter-spacing: 0.1em;
      color: #888;
      padding: 0.35rem 0.75rem;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 2px;
    }

    .draw-detail-meta {
      display: flex;
      justify-content: center;
      gap: 1.5rem;
      font-size: 0.55rem;
      color: #555;
      letter-spacing: 0.1em;
    }

    .draw-footer {
      margin-top: 1rem;
    }

    .draw-notice {
      font-size: 0.55rem;
      letter-spacing: 0.15em;
      color: #444;
      text-transform: uppercase;
    }

    /* Mobile adjustments for draw modal */
    @media (max-width: 640px) {
      .draw-container {
        padding: 1rem;
        padding-top: 3.5rem;
        justify-content: flex-start;
      }

      .draw-header {
        margin-bottom: 1.5rem;
      }

      .draw-title {
        font-size: 0.8rem;
      }

      .draw-subtitle {
        font-size: 0.55rem;
      }

      .draw-spread {
        gap: 0.75rem;
      }

      .draw-position-label {
        font-size: 0.5rem;
      }

      .draw-card {
        width: 100px;
        min-height: 160px;
        padding: 0.75rem;
      }

      .draw-card-type {
        font-size: 0.4rem;
        margin-bottom: 0.5rem;
      }

      .draw-card-glyph {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
      }

      .draw-card-title {
        font-size: 0.55rem;
        line-height: 1.2;
      }

      .draw-card-name {
        font-size: 0.45rem;
      }

      .draw-card-rarity {
        font-size: 0.4rem;
        top: 0.35rem;
        right: 0.35rem;
      }

      .draw-detail {
        padding: 0.5rem;
      }

      .draw-back-btn {
        font-size: 0.6rem;
        padding: 0.4rem 0.75rem;
        margin-bottom: 1rem;
      }

      .draw-detail-position {
        font-size: 0.55rem;
        margin-bottom: 0.75rem;
      }

      .draw-detail-glyph {
        font-size: 2.5rem;
        margin: 0.75rem 0;
      }

      .draw-detail-title {
        font-size: 0.9rem;
      }

      .draw-detail-name {
        font-size: 0.6rem;
        margin-bottom: 1rem;
      }

      .draw-detail-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
      }

      .draw-detail-label {
        font-size: 0.5rem;
        margin-bottom: 0.5rem;
      }

      .draw-detail-meaning,
      .draw-detail-interpretation {
        font-size: 0.6rem;
        line-height: 1.6;
      }

      .draw-detail-keywords {
        gap: 0.35rem;
        margin-bottom: 1rem;
      }

      .draw-detail-keyword {
        font-size: 0.5rem;
        padding: 0.25rem 0.5rem;
      }

      .draw-detail-meta {
        flex-direction: column;
        gap: 0.35rem;
        font-size: 0.5rem;
      }

      .draw-footer {
        margin-top: 0.75rem;
      }

      .draw-notice {
        font-size: 0.5rem;
      }
    }

    @media (max-width: 480px) {
      .deck-action-buttons {
        flex-direction: column;
        width: 100%;
      }

      .explore-deck-btn,
      .draw-cards-btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
      }

      .draw-container {
        padding: 0.75rem;
        padding-top: 3rem;
      }

      .draw-spread {
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
      }

      .draw-position {
        flex: 1;
        max-width: 110px;
      }

      .draw-card {
        width: 100%;
        min-height: 140px;
        padding: 0.6rem;
      }

      .draw-card-glyph {
        font-size: 1.5rem;
      }

      .draw-card-title {
        font-size: 0.5rem;
      }
    }

    @media (max-width: 360px) {
      .draw-spread {
        gap: 0.35rem;
      }

      .draw-position {
        max-width: 95px;
      }

      .draw-card {
        min-height: 130px;
        padding: 0.5rem;
      }

      .draw-card-glyph {
        font-size: 1.3rem;
      }

      .draw-card-title {
        font-size: 0.45rem;
      }

      .draw-card-type,
      .draw-card-name {
        display: none;
      }

      .draw-position-label {
        font-size: 0.45rem;
      }
    }

    /* Touch-friendly tap targets for draw cards */
    .draw-card {
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }

    .draw-card:active {
      transform: scale(0.97);
    }

    .draw-back-btn {
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }

    /* Safe area support for notched phones */
    @supports (padding: max(0px)) {
      .draw-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
      }

      .draw-footer {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
      }
    }

    /* Mobile adjustments */
    @media (max-width: 500px) {
      .analysis-section {
        padding: 1rem;
        margin-bottom: 1rem;
      }

      .seed-display {
        font-size: 0.7rem;
        padding: 0.75rem;
        letter-spacing: 0.08em;
      }

      .codes-grid {
        gap: 0.5rem;
        font-size: 0.8rem;
      }

      .code-item {
        padding: 0.5rem 0.3rem;
      }

      .correspondences-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
      }

      .correspondence-item {
        padding: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
      }

      .deck-preview {
        height: 140px;
        transform: scale(0.85);
        margin-bottom: 1rem;
      }

      .explore-deck-btn {
        padding: 0.85rem 1.5rem;
        font-size: 0.7rem;
        width: 100%;
      }

      /* Sigil smaller on mobile */
      .analysis-section svg {
        max-width: 200px;
        height: auto;
      }

      /* Digital root section */
      .analysis-section [style*="font-size: 4rem"] {
        font-size: 3rem !important;
      }

      .analysis-section [style*="font-size: 1.2rem"] {
        font-size: 1rem !important;
      }
    }

    @media (min-width: 501px) and (max-width: 700px) {
      .correspondences-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    /* Algo breakdown details */
    details summary {
      outline: none;
    }

    details summary::-webkit-details-marker {
      display: none;
    }

    details[open] summary [style*="▾"] {
      transform: rotate(180deg);
    }

    /* Two-column grids on mobile */
    @media (max-width: 500px) {
      /* Frequency harmonics grid */
      [style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
      }

      /* Chinese numerology 4-col grid */
      [style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      /* Pattern badges wrap nicely */
      [style*="flex-wrap: wrap"] {
        gap: 0.5rem !important;
      }

      /* Smaller pattern badges on mobile */
      [style*="border-radius: 20px"][style*="padding: 0.5rem 1rem"] {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.6rem !important;
      }
    }

    /* ═══════════════════════════════════════════════════════════════ */
    /* GLOBAL MOBILE OPTIMIZATIONS                                     */
    /* ═══════════════════════════════════════════════════════════════ */

    /* Prevent text selection on interactive elements */
    button, .filter-btn, .deck-nav, .deck-close {
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }

    /* Smooth scrolling for modals */
    .modal, .reading-modal {
      -webkit-overflow-scrolling: touch;
    }

    /* Safe area padding for notched phones */
    @supports (padding: max(0px)) {
      .deck-carousel-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
      }

      .deck-footer {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
      }

      .modal-close {
        margin-bottom: max(0rem, env(safe-area-inset-bottom));
      }
    }