* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: black;
    color: #0f0;
    font-family: 'Courier New', monospace;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Matrix Rain Canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
}

/* Main Content */
.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: transparent;
    border-left: 2px solid #0f0;
    border-right: 2px solid #0f0;
    min-height: 100vh;
}

/* Header - Desktop */
h1 {
    text-align: center;
    font-size: 3rem;
    letter-spacing: 0.3em;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px #0f0;
    font-weight: normal;
}

/* Header - Mobile */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
        letter-spacing: 0.15em;
        text-shadow: 0 0 3px #0f0;
    }
}

.subtitle {
    text-align: center;
    margin-bottom: 2rem;
    color: #2a2;
    font-size: 0.8rem;
}

.question-area {
    margin-bottom: 2rem;
    padding: 0.5rem;
    background: transparent;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

input {
    width: 100%;
    background: black;
    border: 1px solid #0f0;
    color: #0f0;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

input:focus {
    outline: none;
    box-shadow: 0 0 10px #0f0;
}

.coin-area {
    text-align: center;
    margin: 2rem 0;
    background: transparent;
}

.coins-display {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.ancient-coin {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ancient-coin.heads {
    background: radial-gradient(circle at 30% 35%, #f0c060, #c49a1a, #9B6E0B);
}

.ancient-coin.tails {
    background: radial-gradient(circle at 30% 35%, #a8751a, #7a5a10, #4a3a08);
}

.ancient-coin .square-hole {
    width: 22px;
    height: 22px;
    background: #000;
    border: 1px solid rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.ancient-coin::before {
    content: '通' '寶';
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: normal;
    color: rgba(60, 40, 10, 0.35);
    text-shadow: none;
    letter-spacing: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.ancient-coin .char-top,
.ancient-coin .char-bottom,
.ancient-coin .char-left,
.ancient-coin .char-right {
    position: absolute;
    font-family: 'Courier New', 'Segoe UI', monospace;
    font-size: 0.65rem;
    color: rgba(50, 35, 10, 0.4);
    pointer-events: none;
    z-index: 1;
}

.ancient-coin .char-top {
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
}

.ancient-coin .char-bottom {
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
}

.ancient-coin .char-left {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.ancient-coin .char-right {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.ancient-coin::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 45%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.08) 80%);
    pointer-events: none;
    z-index: 1;
}

.ancient-coin .coin-rim {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.3);
    pointer-events: none;
    z-index: 1;
}

.ancient-coin:hover {
    transform: scale(1.05) rotate(5deg);
}

.line-display {
    font-family: monospace;
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    margin: 0;
    line-height: 0.4;
}

/* BUTTON STYLES */
button {
    background: black;
    border: 2px solid #0f0;
    color: #0f0;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
}

button:hover {
    background: #0f0;
    color: black;
    box-shadow: 0 0 15px #0f0;
}

/* Mobile button - reduced glow */
@media (max-width: 768px) {
    button {
        padding: 0.4rem 1.2rem;
        font-size: 0.9rem;
    }
    
    button:hover {
        box-shadow: 0 0 5px #0f0;
    }
}

.reset-btn {
    margin-top: 1rem;
    background: rgba(0, 50, 0, 0.5);
    border-color: #2a2;
}

.hexagram-display {
    margin-top: 2rem;
    padding: 1.5rem;
    border-top: 1px solid #0f0;
    background: transparent;
}

.judgment {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 30, 0, 0.5);
    border-left: 3px solid #0f0;
    font-style: italic;
}

.judgment p {
    margin: 0.5rem 0;
}

.image-text {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 20, 0, 0.4);
    border-left: 2px solid #2a2;
}

.changing-lines {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 30, 0, 0.3);
    border-top: 1px dashed #2a2;
}

.changing-line {
    margin: 0.75rem 0;
    padding-left: 1rem;
    border-left: 2px solid #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.line-number {
    color: #6f6;
    font-weight: bold;
    font-size: 1rem;
}

.progress {
    margin: 1rem 0;
    font-size: 0.9rem;
}

.footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.7rem;
    color: #2a2;
}

hr {
    border-color: #2a2;
    margin: 1rem 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#coinsDisplay {
    transition: all 0.2s ease;
}

.oracle-whisper {
    text-align: center;
    font-size: 0.9rem;
    color: #2a2;
    font-style: italic;
    letter-spacing: 0.1rem;
    padding: 0.5rem;
    opacity: 0.7;
}

#lineDisplay {
    font-family: monospace;
    font-size: 1rem;
    text-align: center;
    margin: 1rem 0;
}

/* SHARP RECTANGULAR HEXAGRAM LINES */
.hexagram-sharp {
    display: inline-block;
    text-align: center;
}

.hexagram-sharp .yang-line {
    width: 100px;
    height: 12px;
    background-color: #0f0;
    box-shadow: 0 0 4px #0f0;
    margin: 6px auto;
    border-radius: 0px !important;
}

.hexagram-sharp .yin-line {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 6px auto;
    width: 100px;
}

.hexagram-sharp .yin-line span {
    width: 42px;
    height: 12px;
    background-color: #0f0;
    box-shadow: 0 0 4px #0f0;
    border-radius: 0px !important;
}

.hexagram-sharp .placeholder-line {
    width: 100px;
    height: 12px;
    background-color: rgba(0, 255, 0, 0.15);
    margin: 6px auto;
    border-radius: 0px !important;
}

/* Mobile hexagram lines - reduced or no glow */
@media (max-width: 768px) {
    .hexagram-sharp .yang-line,
    .hexagram-sharp .yin-line span {
        box-shadow: 0 0 2px #0f0;
    }
}

@media (max-width: 480px) {
    .hexagram-sharp .yang-line,
    .hexagram-sharp .yin-line span {
        box-shadow: none;
    }
}

/* Dual hexagram view during tossing */
.hexagram-dual-view {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.hexagram-dual-view > div {
    text-align: center;
    min-width: 140px;
}

.line-column-title {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    letter-spacing: 2px;
}

/* Mobile dual view */
@media (max-width: 600px) {
    .hexagram-dual-view {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
}

/* Final hexagram display */
#hexagramLines {
    font-family: 'Courier New', monospace;
    font-weight: 900;
    font-size: 2.2rem;
    line-height: 1.15;
    letter-spacing: 2px;
    text-align: center;
    margin: 1rem 0;
}
.translation-card {
    background: rgba(0, 20, 0, 0.3);
    border-left: 3px solid #0f0;
    padding: 1rem;
    margin: 1rem 0;
}

.translation-title {
    font-size: 1rem;
    font-weight: bold;
    color: #6f6;
    margin-bottom: 0.75rem;
    letter-spacing: 2px;
}

.translation-judgment {
    font-style: italic;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.translation-image {
    font-size: 0.9rem;
    color: #2a2;
    padding-left: 1rem;
    border-left: 1px solid #2a2;
    margin-top: 0.5rem;
}
/* ============================================
   3D COIN TOSS ANIMATION
   ============================================ */

/* Animation for when coins are tossed */
.tossing .ancient-coin {
    animation: subtleToss 0.5s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

/* Subtle 3D toss effect */
@keyframes subtleToss {
    0% {
        transform: rotateX(0deg) translateY(0);
        filter: brightness(1);
    }
    10% {
        transform: rotateX(180deg) translateY(-12px);
        filter: brightness(1.6);
    }
    25% {
        transform: rotateX(360deg) translateY(-2px);
        filter: brightness(1.1);
    }
    100% {
        transform: rotateX(360deg) translateY(0);
        filter: brightness(1);
    }
}

.tossing .ancient-coin {
    animation: subtleToss 0.3s cubic-bezier(0.3, 1.8, 0.4, 1) forwards;
}

/* Make the coin elements 3D aware */
.ancient-coin {
    transform-style: preserve-3d;
}

/* Slight depth for square hole */
.ancient-coin .square-hole {
    transform: translateZ(2px);
}

/* Slight depth for Chinese characters */
.ancient-coin .char-top,
.ancient-coin .char-bottom,
.ancient-coin .char-left,
.ancient-coin .char-right {
    transform: translateZ(3px);
}

/* Slight depth for rim */
.ancient-coin .coin-rim {
    transform: translateZ(-2px);
}

.translation-selector {
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem;
    font-family: monospace;
}

.translation-selector select {
    background: rgba(0, 0, 0, 0.7);
    color: #0f0;
    border: 1px solid #0f0;
    padding: 0.5rem 1rem;
    font-family: monospace;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

.translation-selector select:hover {
    background: rgba(0, 255, 0, 0.1);
}

.translation-card {
    display: block;
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid rgba(0, 255, 0, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.translation-card.hidden-translation {
    display: none !important;
}

.translation-selector select {
    background: rgba(0, 0, 0, 0.8);
    color: #0f0;
    border: 1px solid #0f0;
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-family: monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    
    /* Custom dropdown arrow */
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300ff00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
}

/* Remove default arrow in IE/Edge */
.translation-selector select::-ms-expand {
    display: none;
}

/* Style the dropdown when focused */
.translation-selector select:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    border-color: #0f0;
}

/* Style all dropdown options */
.translation-selector select option {
    background: #000;
    color: #0f0;
}

/* Style when hovering over options */
.translation-selector select option:hover {
    background: #0f0;
    color: #000;
}

/* FIX FOR BLUE SELECTION - Style the checked/selected option */
.translation-selector select option:checked {
    background: #0f0 !important;
    color: #000 !important;
}

/* For Firefox - dropdown list styling */
.translation-selector select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #0f0;
}

/* Additional styles for tarot cards - add to existing css/style.css or inline here */
.tarot-section {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid rgba(0, 255, 0, 0.3);
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
}
.tarot-title {
    text-align: center;
    font-size: 1rem;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    color: #0f0;
    opacity: 0.8;
}
.tarot-cards-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-start;
    position: relative;
    min-height: 300px;
}
.tarot-card-wrapper {
    position: relative;
    width: 192px;     /* 1/4 of 768px - much smaller */
    height: 288px;    /* 1/4 of 1152px */
    perspective: 1200px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    z-index: 5;
}
.tarot-card-wrapper:hover {
    transform: scale(1.5);  /* Enlarges to 288x432 on hover */
    z-index: 100;
}
.tarot-card {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}
/* Flipped state */
.tarot-card.flipped {
    transform: rotateY(180deg);
}
.tarot-card-front, .tarot-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: 0 0 10px rgba(0,255,0,0.2);
}
.tarot-card-front {
    transform: rotateY(0deg);
}
.tarot-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #0a0a0a, #1a2a1a);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
    border: 1px solid #0f0;
    color: #0f0;
    font-family: 'Courier New', monospace;
}
.tarot-card-back h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #0f0;
    display: inline-block;
}
.tarot-card-back p {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-top: 1rem;
    opacity: 0.9;
}
.tarot-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* ensure no text push */
.tarot-card-wrapper:hover .tarot-card-front img,
.tarot-card-wrapper:hover .tarot-card-back {
    box-shadow: 0 0 20px #0f0;
}
/* Responsive adjustments */
@media (max-width: 900px) {
    .tarot-card-wrapper {
        width: 144px;
        height: 216px;
    }
    .tarot-card-wrapper:hover {
        transform: scale(1.6);
    }
}

@media (max-width: 700px) {
    .tarot-card-wrapper {
        width: 115px;
        height: 172px;
    }
    .tarot-card-wrapper:hover {
        transform: scale(1.8);
    }
}
.tarot-card-back h4 {
    font-size: 0.85rem;
    margin: 0 0 0.3rem 0;
}
.tarot-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: sepia(100%) hue-rotate(65deg) saturate(300%) brightness(0.85);
    transition: filter 0.7s ease;
}

/* For the original structure */
.tarot-card-wrapper:hover .tarot-card-front img {
    filter: sepia(0%) hue-rotate(0deg) saturate(100%) brightness(1);
}
/* ============================================
   FLOATING ORB NAVIGATION - Top of page
   ============================================ */

.floating-oracle-orb {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    cursor: pointer;
}

.orb-container {
    position: relative;
    width: 48px;
    height: 48px;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.orb {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle at 30% 30%, rgba(0, 30, 0, 0.95), rgba(0, 10, 0, 0.98));
    border: 1px solid #0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    cursor: pointer;
}

.orb span {
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.orb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    border-color: #0f0;
}

/* Expanded menu */
.orb-menu {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0, 15, 0, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid #0f0;
    border-radius: 40px;
    padding: 0.5rem 1rem;
    display: flex;
    gap: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

.orb-container:hover .orb-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(55px);
}

.orb-container:hover .orb {
    transform: scale(0.95);
}

.orb-menu a {
    color: #0f0;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 0.3rem 0.5rem;
    transition: all 0.2s ease;
    border-radius: 20px;
}

.orb-menu a:hover {
    text-shadow: 0 0 8px #0f0;
    background: rgba(0, 255, 0, 0.15);
}

.orb-menu .menu-divider {
    color: #2a2;
    font-size: 0.7rem;
}
.footer-nav {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.7rem;
    color: #2a2;
    border-top: 1px solid #0f0;
    padding-top: 1.5rem;
}

.footer-nav a {
    color: #0f0;
    text-decoration: none;
}

.footer-divider {
    color: #2a2;
    margin: 0 0.8rem;
    font-size: 0.7rem;
}
/* For mobile - tap friendly */
@media (max-width: 700px) {
    .floating-oracle-orb {
        top: 0.8rem;
        left: 0.8rem;
    }
    
    .orb {
        width: 40px;
        height: 40px;
    }
    
    .orb span {
        font-size: 1.2rem;
    }
    
    .orb-container:hover .orb-menu {
        transform: translateX(48px);
    }
    
    .orb-menu a {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}
.detail-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    color: #0f0;
    font-size: 0.55rem;
    text-decoration: none;
    border: 1px solid #0f0;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.detail-link:hover {
    background: #0f0;
    color: black;
    box-shadow: 0 0 8px #0f0;
}
.hexagram-primary,
.hexagram-transformed {
    margin-bottom: 1.5rem;
}

.hexagram-title,
.transformed-title {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    margin: 1rem 0 0.5rem 0;
    color: #ffd700;
    letter-spacing: 2px;
}

.hexagram-judgment {
    line-height: 1.6;
    margin: 0.5rem 0;
    text-align: justify;
}

.hexagram-image {
    font-style: italic;
    margin: 0.75rem 0;
    opacity: 0.85;
    font-size: 0.95rem;
}

.section-divider {
    text-align: center;
    margin: 1.5rem 0;
    opacity: 0.5;
    letter-spacing: 4px;
}

.changing-title {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    margin: 0.5rem 0 1rem 0;
    color: #ffaa66;
}

.changing-line {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #ffaa66;
    padding: 0.75rem;
    margin: 0.75rem 0;
}

.line-number {
    font-weight: bold;
    color: #ffaa66;
    display: inline-block;
    margin-right: 1rem;
}

.line-change {
    display: inline-block;
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.line-text {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.all-changing-note {
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
    opacity: 0.7;
}