html.house-orientation-document,
body.house-orientation-document {
  /* `hidden` trên body tạo scrolling ancestor và làm hỏng position: sticky. */
  overflow-x: clip !important;
}

.house-orientation-page {
  --house-primary: #003c47;
  --house-primary-soft: #e6f4f5;
  --house-accent: #00aeb5;
  --house-gold: #d99a24;
  --house-ink: #17313a;
  --house-muted: #64748b;
  --house-border: #dce5e8;
  --house-surface: #ffffff;
  --house-soft: #f6fafb;
  --house-radius-xl: 26px;
  --house-radius-lg: 18px;
  --house-shadow: 0 18px 48px rgba(12, 35, 42, 0.1);

  max-width: 1320px;
  margin: 10rem auto 4rem;
  padding: 0 16px;
  color: var(--house-ink);

  * {
    box-sizing: border-box;
  }

  .house-orientation-eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid rgba(0, 174, 181, 0.24);
    border-radius: 999px;
    background: var(--house-primary-soft);
    color: var(--house-primary);
    font-size: 1.18rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  .house-orientation-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(28px, 4vw, 48px);
    align-items: center;
    overflow: hidden;
    padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 46px);
    border-radius: var(--house-radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
      linear-gradient(135deg, rgba(0, 45, 54, 0.95) 0%, rgba(0, 60, 71, 0.92) 55%, rgba(180, 83, 9, 0.88) 100%),
      url(../../../docs/images/common/project/caurongdanang.jpg) center / cover no-repeat;
    box-shadow: 0 20px 48px rgba(0, 35, 43, 0.22);
    position: relative;

    .house-orientation-hero__content {
      display: flex;
      flex-direction: column;
      justify-content: center;

      .house-orientation-eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border: 1px solid rgba(255, 153, 0, 0.4);
        background: rgba(255, 153, 0, 0.16);
        color: #ffc278;
        padding: 5px 14px;
        font-size: 1.25rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        border-radius: 12px;
        backdrop-filter: blur(4px);
        width: fit-content;
        margin-bottom: 12px;

        svg {
          color: #ff9900;
          flex-shrink: 0;
        }
      }

      .house-orientation-hero__title {
        max-width: 920px;
        margin: 0 0 14px;
        color: #ffffff;
        font-size: clamp(2.2rem, 2.7vw, 3.3rem);
        font-weight: 700;
        line-height: 1.3;
        letter-spacing: -0.015em;
        text-wrap: balance;
      }

      p {
        max-width: 700px;
        margin: 0 0 20px;
        color: rgba(255, 255, 255, 0.88);
        font-size: 1.48rem;
        line-height: 1.65;
      }

      .house-orientation-hero__features {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;

        .house-hero-chip {
          display: inline-flex;
          align-items: center;
          gap: 6px;
          padding: 6px 12px;
          border-radius: 12px;
          background: rgba(255, 255, 255, 0.12);
          border: 1px solid rgba(255, 255, 255, 0.18);
          color: #ffffff;
          font-size: 1.25rem;
          font-weight: 600;
          backdrop-filter: blur(6px);
          transition: all 0.25s ease;

          svg {
            color: #ff9900;
            flex-shrink: 0;
          }

          &:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: #ff9900;
          }
        }
      }
    }

    .house-orientation-hero__visual {
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      user-select: none;
      pointer-events: none;
      width: clamp(170px, 18vw, 225px);
      height: clamp(170px, 18vw, 225px);
      flex-shrink: 0;

      &::before {
        content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 153, 0, 0.22) 0%, rgba(0, 60, 71, 0.12) 55%, transparent 72%);
        filter: blur(20px);
        pointer-events: none;
      }

      &::after {
        content: "";
        position: absolute;
        inset: 4px;
        border-radius: 50%;
        border: 2.5px dashed #ff9900;
        border-top-color: #fff3bf;
        border-bottom-color: #ff9900;
        box-shadow: 0 0 22px rgba(255, 153, 0, 0.28), inset 0 0 18px rgba(255, 153, 0, 0.15);
        animation: heroDashedRingSpin 10s linear infinite;
        transform-origin: center center;
        will-change: transform;
        pointer-events: none;
      }

      .house-hero-art {
        position: relative;
        z-index: 1;
        width: clamp(120px, 14vw, 160px);
        height: clamp(120px, 14vw, 160px);
        object-fit: contain;
        display: block;
        opacity: 0.96;
        filter: drop-shadow(0 14px 30px rgba(0, 24, 30, 0.5));
        transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.45s ease;
      }
    }

    &:hover .house-orientation-hero__visual {
      &::after {
        border-color: #ff9900;
        border-top-color: #ffffff;
        animation-duration: 4s;
        box-shadow: 0 0 30px rgba(255, 153, 0, 0.5), inset 0 0 24px rgba(255, 153, 0, 0.25);
      }

      .house-hero-art {
        transform: scale(1.06) rotate(3deg);
        filter: drop-shadow(0 18px 36px rgba(0, 24, 30, 0.6));
      }
    }
  }

  .house-orientation-tool {
    margin-top: 26px;
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid var(--house-border);
    border-radius: var(--house-radius-xl);
    background: var(--house-surface);
    box-shadow: var(--house-shadow);
  }

  .house-orientation-tool__intro {
    max-width: 880px;
    margin-bottom: 24px;

    .house-orientation-tool__title {
      margin: 12px 0 10px;
      color: var(--house-primary);
      font-size: clamp(2.4rem, 3vw, 3.5rem);
      font-weight: 900;
      line-height: 1.16;
    }

    p {
      margin: 0;
      color: var(--house-muted);
      font-size: 1.48rem;
      line-height: 1.7;
    }
  }

  .house-orientation-form {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 16px;
    align-items: end;
  }

  .house-orientation-field {
    position: relative;
    min-width: 0;
  }

  .house-orientation-label {
    display: block;
    margin-bottom: 9px;
    color: var(--house-primary);
    font-size: 1.34rem;
    font-weight: 850;
  }

  .house-orientation-select {
    position: relative;
  }

  .house-orientation-input {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 15px;
    border: 1px solid var(--house-border);
    border-radius: 14px;
    background: var(--house-soft);
    color: var(--house-ink);
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 720;
    outline: 0;
    transition:
      border-color 0.2s ease,
      background 0.2s ease,
      box-shadow 0.2s ease;

    &:focus {
      border-color: var(--house-accent);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(0, 174, 181, 0.13);
    }

    &::placeholder {
      color: #8a9aa3;
      font-weight: 650;
    }

    &.shake {
      border-color: #ef4444;
      animation: houseOrientationShake 0.36s ease;
    }
  }

  .house-orientation-select__icon {
    position: absolute;
    top: 18px;
    right: 15px;
    color: var(--house-muted);
    font-size: 1.35rem;
    pointer-events: none;
    transition: transform 0.2s ease;

    &.active {
      transform: rotate(180deg);
    }
  }

  .house-orientation-error {
    display: none;
    margin-top: 6px;
    color: #dc2626;
    font-size: 1.18rem;
    font-weight: 760;
    line-height: 1.35;
  }

  .house-orientation-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 30;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--house-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(12, 35, 42, 0.16);
  }

  .house-orientation-search {
    position: relative;
    padding: 12px;
    border-bottom: 1px solid var(--house-border);

    .house-orientation-search__input {
      display: block;
      width: 100%;
      height: 40px;
      margin: 0;
      padding: 0 42px 0 14px;
      border: 1px solid var(--house-border);
      border-radius: 12px;
      color: var(--house-ink);
      font-size: 1.32rem;
      outline: 0;
      background: #ffffff;

      &:focus {
        border-color: var(--house-accent);
      }
    }

    .icon-tabler-search,
    svg,
    i {
      position: absolute;
      top: 50%;
      right: 24px;
      transform: translateY(-50%);
      width: 18px !important;
      height: 18px !important;
      display: block;
      vertical-align: initial;
      color: var(--house-muted);
      pointer-events: none;
      flex-shrink: 0;
    }
  }

  .house-orientation-suggestions--sex {
    overflow: visible !important;
    width: 100%;
  }

  .house-orientation-suggestions__list--sex {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;

    .item-sex {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      min-height: 46px;
      padding: 10px 14px;
      border: 1.5px solid var(--house-border);
      border-radius: 12px;
      background: #ffffff;
      cursor: pointer;
      font-size: 1.35rem;
      font-weight: 750;
      color: var(--house-ink);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);

      .sex-option-icon {
        font-size: 1.5rem;
        transition: transform 0.2s ease;
      }

      &[data-sex="1"] .sex-option-icon {
        color: #0284c7;
      }

      &[data-sex="0"] .sex-option-icon {
        color: #e11d48;
      }

      &:hover {
        background: #f0fdfa;
        border-color: var(--house-primary);
        box-shadow: 0 4px 12px rgba(0, 60, 71, 0.12);

        .sex-option-icon {
          transform: scale(1.15);
        }
      }

      &.active {
        background: var(--house-primary);
        border-color: var(--house-gold);
        color: #ffffff;
        box-shadow: 0 4px 14px rgba(0, 60, 71, 0.25);

        .sex-option-icon {
          color: var(--house-gold);
        }
      }
    }
  }

  /* Compass Pie Selector */
  .compass-pie-wrapper {
    padding: 14px 14px 8px;
    background: linear-gradient(180deg, #f7fbfb 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(0, 60, 71, 0.1);
    user-select: none;
  }

  .compass-pie-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-bottom: 8px;
    text-align: center;
  }

  .compass-pie-header__title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--house-primary);
    font-size: 1.35rem;
    font-weight: 850;

    svg {
      color: var(--house-gold);
    }
  }

  .compass-pie-header__hint {
    color: var(--house-muted);
    font-size: 1.15rem;
  }

  .compass-pie-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 0;
  }

  .compass-pie-svg {
    width: min(240px, 75vw);
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 6px 14px rgba(0, 45, 53, 0.08));
  }

  .compass-ring-outer {
    fill: #ffffff;
    stroke: var(--house-gold);
    stroke-width: 2px;
  }

  .compass-ring-track {
    fill: none;
    stroke: rgba(0, 60, 71, 0.15);
    stroke-width: 1px;
    stroke-dasharray: 2 4;
  }

  .compass-pie-slice {
    cursor: pointer;
    outline: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: 150px 150px;

    .pie-slice-path {
      fill: #f4f9f9;
      stroke: #b9d3d8;
      stroke-width: 1.5px;
      transition: all 0.25s ease;
    }

    .pie-slice-code {
      fill: var(--house-gold);
      font-size: 11px;
      font-weight: 900;
      text-anchor: middle;
      pointer-events: none;
      transition: fill 0.2s ease;
    }

    .pie-slice-label {
      fill: var(--house-primary);
      font-size: 11px;
      font-weight: 750;
      text-anchor: middle;
      pointer-events: none;
      transition: fill 0.2s ease;
    }

    &:hover {
      transform: scale(1.03);

      .pie-slice-path {
        fill: #e1f3f4;
        stroke: var(--house-primary);
        stroke-width: 2px;
        filter: drop-shadow(0 2px 6px rgba(0, 60, 71, 0.2));
      }

      .pie-slice-label {
        fill: var(--house-primary);
        font-weight: 850;
      }
    }

    &.active {
      transform: scale(1.05);

      .pie-slice-path {
        fill: url(#compassSliceActiveGrad);
        stroke: var(--house-gold);
        stroke-width: 2.5px;
        filter: drop-shadow(0 3px 8px rgba(255, 153, 0, 0.45));
      }

      .pie-slice-code {
        fill: #ffb74d;
      }

      .pie-slice-label {
        fill: #ffffff;
        font-weight: 900;
      }
    }
  }

  .compass-center-disc {
    stroke: var(--house-gold);
    stroke-width: 2.5px;
    filter: drop-shadow(0 3px 8px rgba(0, 20, 24, 0.35));
  }

  .compass-center-ring {
    fill: none;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 1px;
  }

  .compass-needle-group {
    pointer-events: none;
  }

  .compass-needle-tip-north {
    fill: #e11d48;
  }

  .compass-needle-tip-south {
    fill: #cbd5e1;
  }

  .compass-needle-pivot {
    fill: var(--house-gold);
    stroke: #ffffff;
    stroke-width: 1.5px;
  }

  .compass-center-status {
    fill: rgba(255, 255, 255, 0.75);
    font-size: 8.5px;
    font-weight: 700;
    text-anchor: middle;
    letter-spacing: 0.5px;
    pointer-events: none;
  }

  .compass-center-val {
    fill: #ffb74d;
    font-size: 11.5px;
    font-weight: 900;
    text-anchor: middle;
    letter-spacing: 0.5px;
    pointer-events: none;
  }

  .house-orientation-suggestions__list {
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;

    &.house-orientation-suggestions__list--directions {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
      padding: 10px 12px;
      background: #ffffff;

      @media (max-width: 576px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .item-direction {
        justify-content: center;
        min-height: 38px;
        padding: 6px 8px;
        border: 1px solid var(--house-border);
        border-radius: 10px;
        font-size: 1.25rem;
        background: #f8fafc;
        text-align: center;

        &:hover {
          background: #e8f4f5;
          border-color: var(--house-primary);
          color: var(--house-primary);
        }

        &.active {
          background: var(--house-primary);
          border-color: var(--house-gold);
          color: #ffffff;
          box-shadow: 0 2px 8px rgba(0, 60, 71, 0.2);
        }
      }
    }
  }

  .house-orientation-option,
  .suggestion-item {
    display: flex;
    min-height: 42px;
    align-items: center;
    padding: 9px 12px;
    border-radius: 11px;
    color: var(--house-ink);
    cursor: pointer;
    font-size: 1.32rem;
    font-weight: 720;
    transition:
      background 0.18s ease,
      color 0.18s ease;

    &:hover,
    &.active {
      background: var(--house-primary-soft);
      color: var(--house-primary);
    }
  }

  .house-orientation-clear {
    display: none;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--house-border);

    &.active {
      display: block;
    }
  }

  .house-orientation-clear__button {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-radius: 11px;
    background: #fff2e0;
    color: #9a5a00;
    cursor: pointer;
    font-size: 1.28rem;
    font-weight: 850;
  }

  .house-orientation-submit {
    display: inline-flex;
    grid-column: 1 / -1;
    height: 52px;
    align-items: center;
    justify-content: center;
    justify-self: center;
    gap: 9px;
    min-width: 210px;
    margin-top: 22px;
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    background: var(--house-primary);
    color: #fff;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 880;
    white-space: nowrap;
    box-shadow: 0 12px 26px rgba(0, 60, 71, 0.2);
    transition:
      background 0.2s ease,
      transform 0.2s ease,
      box-shadow 0.2s ease;

    &:hover {
      background: #00616d;
      box-shadow: 0 4px 12px rgba(0, 60, 71, 0.12);
      box-shadow: 0 16px 32px rgba(0, 60, 71, 0.26);
    }
  }

  /* Nâng cấp phần Kết Quả Trả Ra (Elevated Results Section - Tách ngoài tool) */
  .house-orientation-result {
    display: none;
    margin-top: 28px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    width: 100%;

    @media (max-width: 576px) {
      margin-top: 16px;

      .house-orientation-result__image-wrapper {
        .luopan-svg-instrument {
          width: min(calc(100vh - 200px), 94vw);
          min-width: 280px;
        }
      }

      .house-orientation-result__visual-caption {
        max-width: min(calc(100vh - 200px), 94vw);
        padding: 10px 14px;
      }
    }

    &.active {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 36px;
    }

    .house-orientation-result__visual {
      position: static;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-height: auto;
      margin: 0 auto;
      gap: 16px;
      padding: 6px 0 14px;

      @media (min-width: 992px) {
        min-height: min(calc(100vh - 140px), 720px);
        gap: clamp(18px, 2.5vh, 26px);
        padding: 6px 0 18px;
      }
    }

    .house-orientation-result__image-wrapper {
      position: relative;
      overflow: visible;
      border: none;
      background: transparent;
      padding: 0;
      box-shadow: none;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;

      .luopan-svg-instrument {
        width: min(calc(100vh - 210px), 640px, 92vw);
        min-width: 280px;
        height: auto;
        aspect-ratio: 1 / 1;
        display: block;
        filter: drop-shadow(0 12px 32px rgba(0, 36, 44, 0.18));
      }

      .house-orientation-result__image {
        width: 100%;
        max-height: 300px;
        object-fit: contain;
        display: block;
        transition: transform 0.35s ease;

        &:hover {
          transform: scale(1.04);
        }
      }
    }

    .house-orientation-result__visual-caption {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 6px;
      width: 100%;
      max-width: min(calc(100vh - 210px), 640px, 92vw);
      padding: 12px 24px;
      border: 1.5px solid rgba(0, 60, 71, 0.16);
      border-radius: 18px;
      background: #ffffff;
      box-shadow: 0 10px 28px rgba(0, 40, 48, 0.08);
      transition: border-color 0.4s ease, box-shadow 0.4s ease;

      .caption-label {
        color: var(--house-muted);
        font-size: 1.12rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 700;
      }

      .caption-title {
        color: var(--house-primary);
        font-size: clamp(1.35rem, 1.7vw, 1.55rem);
        font-weight: 900;
        line-height: 1.35;
        transition: color 0.4s ease;

        &.is-neutral {
          color: #64748b;
          font-weight: 750;
        }
      }

      .caption-status-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 5px 16px;
        border-radius: 999px;
        font-size: 1.2rem;
        font-weight: 850;
        width: fit-content;
        transition: all 0.4s ease;

        &.neutral {
          background: #f1f5f9;
          color: #475569;
          border: 1px solid #cbd5e1;
        }

        &.good {
          background: #dcfce7;
          color: #15803d;
          border: 1px solid #bbf7d0;
        }

        &.bad {
          background: #fee2e2;
          color: #b91c1c;
          border: 1px solid #fecaca;
        }
      }

      &.house-orientation-result__visual-caption--neutral {
        border-top: 4px solid #94a3b8;
        border-left: none;
      }

      &.house-orientation-result__visual-caption--good {
        border-top: 4px solid #16a34a;
        border-left: none;
      }

      &.house-orientation-result__visual-caption--bad {
        border-top: 4px solid #dc2626;
        border-left: none;
      }
    }

    .house-orientation-result__content {
      width: 100%;
      max-width: 1100px;
      margin: 0 auto;
      opacity: 0;
      transform: translateY(24px);
      pointer-events: none;
      transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);

      &.is-revealed {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
      }
    }

    .house-orientation-result__heading-group {
      margin-bottom: 22px;
    }

    /* Gạch chân thương hiệu nghệ thuật */
    .house-orientation-result__title {
      position: relative;
      margin: 6px 0 0;
      padding-bottom: 14px;
      color: var(--house-primary);
      font-size: clamp(2.2rem, 2.7vw, 3rem);
      font-weight: 900;
      line-height: 1.25;

      &::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 80px;
        height: 3.5px;
        border-radius: 999px;
        background: var(--house-primary);
        box-shadow: 0 2px 6px rgba(0, 60, 71, 0.25);
      }
    }

    .house-orientation-result__meta {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 20px;

      @media (max-width: 900px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      @media (max-width: 500px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }
    }

    .house-orientation-result__pill {
      display: flex;
      flex-direction: column;
      gap: 5px;
      padding: 12px 14px;
      border: 1.5px solid rgba(0, 60, 71, 0.12);
      border-radius: 14px;
      background: #ffffff;
      box-shadow: 0 2px 8px rgba(0, 36, 44, 0.04);
      transition: all 0.2s ease;

      @media (max-width: 500px) {
        padding: 10px 11px;
      }

      &:hover {
        border-color: var(--house-primary);
        box-shadow: 0 4px 12px rgba(0, 60, 71, 0.1);
      }

      .pill-label {
        display: flex;
        align-items: center;
        gap: 6px;
        color: var(--house-muted);
        font-size: 1.15rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.3px;

        @media (max-width: 500px) {
          font-size: 1.05rem;
          gap: 4px;
        }

        i,
        svg {
          color: var(--house-gold);
          font-size: 1.25rem;
          width: 14px;
          height: 14px;
          flex-shrink: 0;
        }
      }

      .pill-value {
        color: var(--house-primary);
        font-size: 1.45rem;
        font-weight: 850;
        line-height: 1.35;
        word-break: break-word;

        @media (max-width: 500px) {
          font-size: 1.3rem;
        }

        .pill-main {
          display: block;
        }

        .pill-sub {
          display: block;
          font-size: 1.18rem;
          font-weight: 700;
          color: var(--house-muted);
          margin-top: 3px;

          @media (max-width: 500px) {
            font-size: 1.08rem;
            margin-top: 2px;
          }
        }
      }
    }

    .house-orientation-result__description {
      padding: 20px 22px;
      border-radius: 16px;
      border: 1.5px solid rgba(0, 60, 71, 0.12);
      background: #ffffff;
      margin-bottom: 20px;
      box-shadow: 0 4px 18px rgba(0, 40, 48, 0.05);

      @media (max-width: 640px) {
        padding: 14px 16px;
        border-radius: 14px;
        margin-bottom: 16px;
      }

      .description-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 12px;

        .description-badge {
          display: inline-flex;
          align-items: center;
          gap: 6px;
          padding: 6px 14px;
          border-radius: 999px;
          font-size: 1.22rem;
          font-weight: 850;
          white-space: nowrap;

          @media (max-width: 480px) {
            font-size: 1.12rem;
            padding: 5px 10px;
            gap: 4px;
          }

          &.good {
            background: #dcfce7;
            color: #15803d;
            border: 1px solid #bbf7d0;
          }

          &.bad {
            background: #fee2e2;
            color: #b91c1c;
            border: 1px solid #fecaca;
          }
        }

        .description-score {
          font-size: 1.35rem;
          font-weight: 850;
          color: var(--house-primary);
          white-space: nowrap;
          flex-shrink: 0;

          @media (max-width: 480px) {
            font-size: 1.22rem;
          }
        }
      }

      .description-lead {
        font-size: 1.55rem;
        font-weight: 800;
        color: var(--house-primary);
        margin-bottom: 10px;
        line-height: 1.45;
        text-wrap: balance;

        @media (max-width: 640px) {
          font-size: 1.42rem;
          line-height: 1.4;
          margin-bottom: 8px;
        }
      }

      .description-summary {
        margin: 0 0 14px;
        color: var(--house-ink);
        font-size: 1.4rem;
        line-height: 1.68;
      }

      .description-advice {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
        border-radius: 12px;
        background: #fff8ea;
        border: 1px solid rgba(217, 154, 36, 0.25);
        color: #854d0e;
        font-size: 1.35rem;
        line-height: 1.6;

        i {
          color: var(--house-gold);
          font-size: 1.6rem;
          margin-top: 2px;
          flex-shrink: 0;
        }

        b {
          color: #92400e;
        }
      }

      &.house-orientation-result__description--good {
        border-left: 5px solid #16a34a;
        background: linear-gradient(180deg, #f7fdf9 0%, #ffffff 100%);
      }

      &.house-orientation-result__description--bad {
        border-left: 5px solid #dc2626;
        background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%);
      }
    }

    .house-orientation-result__detail {
      display: grid;
      gap: 18px;
    }

    .house-orientation-analysis-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;

      @media (max-width: 700px) {
        grid-template-columns: 1fr;
      }
    }

    .house-orientation-analysis-section {
      padding: 20px 22px;
      border: 1.5px solid rgba(0, 60, 71, 0.12);
      border-radius: 16px;
      background: #ffffff;
      box-shadow: 0 4px 18px rgba(0, 36, 44, 0.04);
      transition: all 0.25s ease;

      @media (max-width: 640px) {
        padding: 14px 16px;
        border-radius: 14px;
      }

      &:hover {
        border-color: rgba(0, 60, 71, 0.28);
        box-shadow: 0 6px 22px rgba(0, 36, 44, 0.08);
      }

      .analysis-section-title {
        position: relative;
        display: flex;
        align-items: center;
        gap: 9px;
        padding-bottom: 12px;
        margin-bottom: 14px;
        color: var(--house-primary);
        font-size: 1.55rem;
        font-weight: 850;
        border-bottom: 2px solid rgba(0, 60, 71, 0.08);

        @media (max-width: 640px) {
          font-size: 1.38rem;
          line-height: 1.35;
          gap: 8px;
          padding-bottom: 10px;
          margin-bottom: 12px;
        }

        &::after {
          content: "";
          position: absolute;
          bottom: -2px;
          left: 0;
          width: 44px;
          height: 2px;
          border-radius: 999px;
          background: var(--house-primary);
        }

        i,
        svg {
          color: var(--house-gold);
          font-size: 1.5rem;
          width: 18px;
          height: 18px;
          flex-shrink: 0;
        }
      }

      p {
        margin: 0;
        color: var(--house-ink);
        font-size: 1.38rem;
        line-height: 1.68;

        @media (max-width: 640px) {
          font-size: 1.32rem;
          line-height: 1.6;
        }
      }
    }

    .house-orientation-analysis-section--notice {
      border-color: rgba(217, 154, 36, 0.35);
      background: #fffcf5;

      .analysis-section-title {
        border-bottom-color: rgba(217, 154, 36, 0.2);

        &::after {
          background: #d97706;
        }

        i,
        svg {
          color: #d97706;
        }
      }
    }

    .house-orientation-analysis-section--practical {
      background: #f7fbfb;
      border-color: rgba(0, 60, 71, 0.18);

      ul {
        margin: 0;
        padding-left: 20px;
      }

      li {
        color: var(--house-ink);
        font-size: 1.36rem;
        line-height: 1.65;

        @media (max-width: 640px) {
          font-size: 1.3rem;
          line-height: 1.55;
        }

        & + li {
          margin-top: 8px;
        }
      }
    }

    .house-orientation-direction-group {
      padding: 20px 22px;
      border: 1.5px solid rgba(0, 60, 71, 0.12);
      border-radius: 16px;
      background: #ffffff;
      box-shadow: 0 4px 18px rgba(0, 36, 44, 0.04);

      @media (max-width: 640px) {
        padding: 14px 16px;
        border-radius: 14px;
      }

      .direction-group-title {
        position: relative;
        display: flex;
        align-items: center;
        gap: 9px;
        padding-bottom: 12px;
        margin-bottom: 14px;
        font-size: 1.55rem;
        font-weight: 880;
        border-bottom: 2px solid rgba(0, 60, 71, 0.08);

        span {
          text-wrap: balance;
        }

        @media (max-width: 640px) {
          font-size: 1.38rem;
          line-height: 1.35;
          gap: 8px;
          padding-bottom: 10px;
          margin-bottom: 12px;
        }

        &::after {
          content: "";
          position: absolute;
          bottom: -2px;
          left: 0;
          width: 50px;
          height: 2px;
          border-radius: 999px;
          background: var(--house-primary);
        }
      }

      &.house-orientation-direction-group--good {
        border-left: 5px solid #16a34a;

        .direction-group-title {
          color: #15803d;

          &::after {
            background: #15803d;
          }

          i,
          svg {
            color: #16a34a;
            width: 18px;
            height: 18px;
            flex-shrink: 0;
          }
        }
      }

      &.house-orientation-direction-group--bad {
        border-left: 5px solid #dc2626;

        .direction-group-title {
          color: #b91c1c;

          &::after {
            background: #dc2626;
          }

          i,
          svg {
            color: #dc2626;
            width: 18px;
            height: 18px;
            flex-shrink: 0;
          }
        }
      }

      ul {
        display: grid;
        gap: 10px;
        margin: 0;
        padding: 0;
        list-style: none;
      }
    }

    .house-orientation-direction {
      display: block;
      padding: 12px 16px;
      border-radius: 13px;
      background: #f8fafc;
      border: 1px solid rgba(0, 60, 71, 0.06);
      transition: all 0.2s ease;

      @media (max-width: 640px) {
        padding: 10px 13px;
      }

      &:hover {
        transform: translateX(3px);
      }

      .house-orientation-direction__info {
        .direction-name-star {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 10px;
          margin-bottom: 6px;

          .direction-name-star__title {
            color: var(--house-primary);
            font-size: 1.42rem;
            font-weight: 880;
          }

          .direction-name-star__score {
            display: inline-flex;
            min-width: 48px;
            height: 26px;
            align-items: center;
            justify-content: center;
            padding: 2px 10px;
            border-radius: 999px;
            color: #fff;
            font-size: 1.18rem;
            font-weight: 900;
            letter-spacing: 0.3px;
            flex-shrink: 0;
          }
        }

        p {
          margin: 0;
          color: var(--house-muted);
          font-size: 1.32rem;
          line-height: 1.58;
        }
      }

      &.house-orientation-direction--good {
        background: #f2fbf4;
        border-color: #d1fae5;

        .direction-name-star__score {
          background: #15803d;
        }
      }

      &.house-orientation-direction--bad {
        background: #fef4f4;
        border-color: #fee2e2;

        .direction-name-star__score {
          background: #b91c1c;
        }
      }
    }

    .house-orientation-result__note {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin-top: 20px;
      padding: 16px 18px;
      border-left: 5px solid var(--house-gold);
      border-radius: 14px;
      background: #fffcf3;
      border-top: 1px solid rgba(255, 153, 0, 0.2);
      border-right: 1px solid rgba(255, 153, 0, 0.2);
      border-bottom: 1px solid rgba(255, 153, 0, 0.2);
      box-shadow: 0 4px 16px rgba(255, 153, 0, 0.08);

      .note-icon {
        color: #d97706;
        font-size: 1.8rem;
        margin-top: 2px;
        flex-shrink: 0;
      }

      .note-content {
        color: #78350f;
        font-size: 1.34rem;
        line-height: 1.6;

        b {
          color: #92400e;
        }
      }
    }
  }

  .house-orientation-guide {
    background: linear-gradient(180deg, #ffffff, #f7fbfb);
  }

  .house-orientation-guide {
    margin-top: clamp(40px, 5vw, 60px);
    padding: clamp(28px, 4vw, 42px);
    border: 1px solid rgba(0, 60, 71, 0.1);
    border-radius: var(--house-radius-xl);
    background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
    box-shadow: 0 16px 40px rgba(0, 45, 54, 0.06);

    .house-orientation-guide__heading {
      max-width: 820px;
      margin-bottom: 30px;

      .house-orientation-eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 5px 14px;
        border-radius: 999px;
        background: rgba(0, 60, 71, 0.07);
        border: 1px solid rgba(0, 60, 71, 0.14);
        color: #003c47;
        font-size: 1.25rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        text-transform: uppercase;

        svg {
          color: #ff9900;
        }
      }

      .house-orientation-guide__title {
        margin: 12px 0 8px;
        color: #002d36;
        font-size: clamp(2.2rem, 2.6vw, 3rem);
        font-weight: 700;
        line-height: 1.25;
      }

      p {
        margin: 0;
        color: #52606d;
        font-size: 1.5rem;
        line-height: 1.65;
      }
    }

    .house-orientation-guide__grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 22px;
      align-items: stretch;

      @media (max-width: 900px) {
        grid-template-columns: 1fr !important;
        gap: 16px;
      }
    }

    .house-orientation-guide-card {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      position: relative;
      overflow: hidden;
      padding: 24px;
      border: 1px solid rgba(0, 60, 71, 0.09);
      border-radius: 20px;
      background: #ffffff;
      box-shadow: 0 4px 18px rgba(0, 60, 71, 0.04);
      transition:
        transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease;

      &::after {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        content: "";
        background: linear-gradient(90deg, #003c47 0%, #008f93 50%, #ff9900 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
      }

      &:hover {
        transform: translateY(-5px);
        border-color: rgba(255, 153, 0, 0.35);
        box-shadow: 0 16px 36px rgba(0, 60, 71, 0.1);

        &::after {
          opacity: 1;
        }

        .house-orientation-guide-card__icon {
          transform: translateY(-2px) scale(1.06);
          background: linear-gradient(135deg, #003c47 0%, #005666 100%);
          color: #ffffff;
          border-color: transparent;
          box-shadow: 0 8px 18px rgba(0, 60, 71, 0.2);
        }

        .house-orientation-guide-title {
          color: #ff9900;
        }

        .guide-card-tag {
          background: rgba(255, 153, 0, 0.12);
          color: #b45309;
        }

        .guide-card-step {
          background: #ff9900;
          color: #ffffff;
          transform: scale(1.05);
        }
      }

      .house-orientation-guide-card__body {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        flex: 1 1 auto;
        position: relative;
        z-index: 1;
      }

      .house-orientation-guide-card__info {
        flex: 1 1 auto;
        min-width: 0;

        .house-orientation-guide-title {
          margin: 0 0 8px;
          color: #003c47;
          font-size: 1.85rem;
          font-weight: 800;
          line-height: 1.35;
          transition: color 0.25s ease;
        }

        p {
          margin: 0;
          color: #475569;
          font-size: 1.38rem;
          line-height: 1.6;
        }
      }

      .house-orientation-guide-card__icon {
        flex: 0 0 54px;
        width: 54px;
        height: 54px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        border-radius: 14px;
        background: rgba(0, 60, 71, 0.08);
        border: 1.5px solid rgba(0, 60, 71, 0.12);
        color: #003c47;
        filter: drop-shadow(0 4px 10px rgba(0, 60, 71, 0.08));
        transition:
          transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
          background 0.3s ease,
          color 0.3s ease,
          box-shadow 0.3s ease;

        svg {
          width: 26px;
          height: 26px;
        }
      }

      .house-orientation-guide-card__footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 14px;
        margin-top: 16px;
        border-top: 1px solid rgba(0, 60, 71, 0.08);

        .guide-card-tag {
          display: inline-flex;
          align-items: center;
          padding: 4px 10px;
          border-radius: 8px;
          background: rgba(0, 60, 71, 0.05);
          color: #003c47;
          font-size: 1.2rem;
          font-weight: 700;
          transition: all 0.25s ease;
        }

        .guide-card-step {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          width: 28px;
          height: 28px;
          border-radius: 50%;
          background: #f1f5f9;
          color: #64748b;
          font-size: 1.2rem;
          font-weight: 850;
          letter-spacing: 0.02em;
          transition: all 0.25s ease;
        }
      }
    }
  }
}

@keyframes houseOrientationShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@media (max-width: 1100px) {
  .house-orientation-page {
    .house-orientation-form {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .house-orientation-submit {
      grid-column: 1 / -1;
      width: min(100%, 260px);
      justify-self: center;
    }
  }
}

@media (max-width: 900px) {
  .house-orientation-page {
    margin: 4rem auto 3rem;

    .house-orientation-hero {
      grid-template-columns: 1fr;
      text-align: center;
      padding: 24px 20px;

      .house-orientation-hero__content {
        align-items: center;

        .house-orientation-hero__features {
          justify-content: center;
        }
      }

      .house-orientation-hero__visual {
        margin: 10px auto 0;
      }
    }

    .house-orientation-result {
      &.active {
        display: flex;
        flex-direction: column;
        align-items: center;
      }

      .house-orientation-result__visual {
        position: static;
      }
    }

    .house-orientation-guide__grid {
      grid-template-columns: 1fr;
    }
  }
}

@media (max-width: 640px) {
  .mobile-search-section {
    display: none;
  }

  .house-orientation-page {
    margin: 3rem auto 2rem;
    padding: 0 10px;

    .house-orientation-hero {
      border-radius: 18px;
      padding: 20px 16px;

      .house-orientation-hero__title {
        font-size: clamp(2rem, 5.5vw, 2.5rem);
        margin: 10px 0;
      }

      p {
        font-size: 1.35rem;
        margin-bottom: 12px;
      }

      .house-orientation-hero__features {
        display: none !important;
      }
    }

    .house-orientation-hero__visual {
      display: none;
    }

    .house-orientation-tool,
    .house-orientation-guide {
      border-radius: 18px;
      padding: 16px 12px;
    }

    .house-orientation-tool__intro {
      margin-bottom: 16px;

      .house-orientation-tool__title {
        font-size: clamp(1.85rem, 5vw, 2.3rem);
      }

      p {
        font-size: 1.35rem;
      }
    }

    .house-orientation-form {
      grid-template-columns: 1fr;
    }

    .house-orientation-suggestions__list {
      &.house-orientation-suggestions__list--directions {
        grid-template-columns: 1fr;
      }
    }

    .house-orientation-submit {
      width: 100%;
      max-width: 320px;
      justify-self: center;
    }

    .house-orientation-result {
      .house-orientation-result__title {
        font-size: clamp(1.8rem, 4.8vw, 2.2rem);
      }

      .house-orientation-result__meta {
        grid-template-columns: 1fr;
      }

      .house-orientation-analysis-grid {
        grid-template-columns: 1fr;
      }
    }
  }
}

@keyframes heroDashedRingSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.compass-pie-selected-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 2px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #edf8f8;
  border: 1px solid rgba(0, 60, 71, 0.15);
  color: #003c47;
  font-size: 1.25rem;
  font-weight: 600;

  i {
    color: #ff9900;
  }

  .selected-direction-text {
    color: #003c47;
    font-weight: 850;
  }

  &.active {
    background: #003c47;
    color: #ffffff;
    border-color: #003c47;

    .selected-direction-text {
      color: #ff9900;
    }
  }
}

.house-orientation-suggestions--sex .house-orientation-clear {
  display: none !important;
  border-top: none !important;
}

/* ========================================================
   SÂN KHẤU TÍNH TOÁN LA BÀN BÁT TRẠCH ĐA TẦNG NGHỊCH LUÂN
   ======================================================== */
.luopan-calc-stage {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(26px, 4vw, 44px) clamp(16px, 3vw, 32px);
  border-radius: 24px;
  border: 1.5px solid rgba(0, 60, 71, 0.16);
  background: radial-gradient(circle at 50% 25%, #ffffff 0%, #f7fafb 60%, #edf4f5 100%);
  box-shadow: 0 16px 44px rgba(0, 45, 54, 0.08);
  position: relative;
  overflow: hidden;
  animation: luopanStageFadeIn 0.4s ease;

  &::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, 95vw);
    height: min(520px, 95vw);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 154, 36, 0.12) 0%, rgba(0, 60, 71, 0.05) 50%, transparent 70%);
    filter: blur(28px);
    pointer-events: none;
  }
}

.luopan-calc-header {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 680px;
  margin-bottom: 20px;

  .luopan-calc-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(0, 60, 71, 0.08);
    border: 1px solid rgba(0, 60, 71, 0.15);
    color: #003c47;
    font-size: 1.25rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;

    i {
      color: #ff9900;
    }
  }

  .luopan-calc-title {
    margin: 0 0 8px;
    color: #003c47;
    font-size: clamp(2.2rem, 2.6vw, 3rem);
    font-weight: 900;
    line-height: 1.25;
  }

  .luopan-calc-desc {
    margin: 0;
    color: #52606d;
    font-size: 1.45rem;
    line-height: 1.65;
  }
}

.luopan-calc-instrument {
  position: relative;
  z-index: 2;
  width: min(560px, 92vw);
  height: min(560px, 92vw);
  margin: 12px auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  filter: drop-shadow(0 16px 40px rgba(0, 36, 44, 0.24));

  .luopan-svg-instrument {
    width: 100%;
    height: 100%;
    overflow: visible;
  }
}

/* Các vòng tròn xoay nghịch luân tự định vị và DỪNG LẠI khi kim chốt quẻ */
.luopan-ring {
  transform-origin: 320px 320px;
  will-change: transform;
}

/* Chỉ kích hoạt animation khi có class is-animating (hỗ trợ reset và chạy lại toàn bộ vòng + kim khi ấn nút Xoay lại) */
.luopan-svg-instrument.is-animating {
  .luopan-ring--degrees {
    animation: luopanSettleDegrees 4.2s cubic-bezier(0.12, 1, 0.28, 1) forwards;
  }

  .luopan-ring--duniens {
    animation: luopanSettleDuNien 4.2s cubic-bezier(0.12, 1, 0.28, 1) forwards;
  }

  .luopan-ring--24-mountains {
    animation: luopanSettleMountains 4.2s cubic-bezier(0.12, 1, 0.28, 1) forwards;
  }

  .luopan-ring--directions {
    animation: luopanSettleDirections 4.2s cubic-bezier(0.12, 1, 0.28, 1) forwards;
  }

  .luopan-ring--bagua-names {
    animation: luopanSettleBagua 4.2s cubic-bezier(0.12, 1, 0.28, 1) forwards;
  }

  .luopan-ring--trigrams {
    animation: luopanSettleTrigrams 4.2s cubic-bezier(0.12, 1, 0.28, 1) forwards;
  }

  .luopan-ring--yinyang {
    animation: luopanSettleYinYang 4.2s cubic-bezier(0.12, 1, 0.28, 1) forwards;
  }
}

.luopan-needle-group {
  transform-origin: 320px 320px;
  transition: transform 4.2s cubic-bezier(0.12, 1, 0.28, 1);
  will-change: transform;
  filter: drop-shadow(0 3px 5px rgba(0, 36, 44, 0.28));
}

/* Vùng quẻ chỉ định: Ban đầu ẩn hoàn toàn (opacity 0), kết thúc quay 4.2s mới hiện viền cam (chỉ viền nét đứt, không có nền làm mờ chữ) */
.luopan-target-highlight {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-in-out;
  will-change: opacity;

  &.is-visible {
    opacity: 1;
  }
}

.luopan-calc-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 440px;

  .luopan-calc-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #003c47;
    font-size: 1.38rem;
    font-weight: 750;

    .step-dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: #ff9900;
      box-shadow: 0 0 10px #ff9900;
      animation: luopanDotPulse 1.2s infinite alternate;
    }
  }

  .luopan-calc-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 60, 71, 0.1);
    overflow: hidden;
    position: relative;

    .luopan-calc-bar__fill {
      height: 100%;
      width: 30%;
      border-radius: 999px;
      background: linear-gradient(90deg, #003c47 0%, #008f93 100%);
      animation: luopanBarFill 2s ease-in-out forwards;
    }
  }
}


/* Vòng tâm: Âm Dương Thái Cực quay 3 vòng (-1080deg) CW */
@keyframes luopanSettleYinYang {
  0% { transform: rotate(-1080deg); }
  100% { transform: rotate(0deg); }
}

/* Tầng 1: Hào quẻ Bát Quái quay 2.5 vòng (900deg) CCW */
@keyframes luopanSettleTrigrams {
  0% { transform: rotate(900deg); }
  100% { transform: rotate(0deg); }
}

/* Tầng 2: Tên 8 Quẻ quay 2 vòng (-720deg) CW */
@keyframes luopanSettleBagua {
  0% { transform: rotate(-720deg); }
  100% { transform: rotate(0deg); }
}

/* Tầng 3: 8 Hướng Địa Lý quay 1.5 vòng (540deg) CCW */
@keyframes luopanSettleDirections {
  0% { transform: rotate(540deg); }
  100% { transform: rotate(0deg); }
}

/* Tầng 4: 24 Sơn Hướng quay 1 vòng (-360deg) CW */
@keyframes luopanSettleMountains {
  0% { transform: rotate(-360deg); }
  100% { transform: rotate(0deg); }
}

/* Tầng 5: 8 Cung Du Niên quay 0.5 vòng (180deg) CCW */
@keyframes luopanSettleDuNien {
  0% { transform: rotate(180deg); }
  100% { transform: rotate(0deg); }
}

/* Tầng 6: Vành 360 độ quay 90 độ (-90deg) CW */
@keyframes luopanSettleDegrees {
  0% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

@keyframes luopanSpinCW {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes luopanSpinCCW {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}

@keyframes luopanDotPulse {
  from {
    transform: scale(0.9);
    opacity: 0.6;
  }
  to {
    transform: scale(1.3);
    opacity: 1;
  }
}

@keyframes luopanBarFill {
  0% {
    width: 10%;
  }
  50% {
    width: 65%;
  }
  100% {
    width: 100%;
  }
}

@keyframes luopanStageFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


