:root {
    --bg-dark: #0a0a1a;
    --gold: #d4af37;
    --gold-light: #f3e5ab;
    --gold-dark: #aa8529;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --primary: #c5a85c;
}

body {
    background: radial-gradient(circle at 50% 0%, #1e1e38 0%, var(--bg-dark) 100%);
    color: var(--text-main);
    font-family: 'Noto Serif JP', serif;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

.title-text {
    font-family: 'Playfair Display', serif;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.subtitle-text {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
}

.text-gold {
    color: var(--gold);
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Coin Animation Styles */
.coin-container {
    perspective: 1000px;
    margin: 30px 0;
}

.coin {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.coin.flipping {
    animation: flip-vertical 2s infinite linear;
}

.coin-inner {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 1s;
}

.coin-front, .coin-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: inset 0 0 0 4px rgba(255,255,255,0.2), 0 10px 20px rgba(0,0,0,0.5);
}

.coin-front {
    background: radial-gradient(circle, #fcd15b, #c5a85c);
    color: #5c4300;
    border: 2px solid #fff3cd;
}

.coin-back {
    background: radial-gradient(circle, #94a3b8, #475569);
    color: #1e293b;
    transform: rotateY(180deg);
    border: 2px solid #e2e8f0;
}

/* Flip states */
.show-front {
    transform: rotateY(0deg);
}
.show-back {
    transform: rotateY(180deg);
}

@keyframes flip-vertical {
    0% { transform: rotateY(0); }
    100% { transform: rotateY(1800deg); }
}

/* Table styling */
.custom-table {
    background-color: transparent;
    color: var(--text-main);
}
.custom-table th, .custom-table td {
    border-color: var(--card-border);
    background-color: transparent !important;
    vertical-align: middle;
}
.custom-table tbody tr:hover td {
    background-color: rgba(212, 175, 55, 0.1) !important;
}

.action-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    border: none;
    border-radius: 30px;
    padding: 12px 30px;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.action-btn:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Hexagram Lines */
.hexagram-lines {
    display: flex;
    flex-direction: column-reverse; /* Bottom to top */
    align-items: center;
    gap: 8px;
    margin: 20px auto;
    width: 60%;
}

.h-line {
    width: 100%;
    height: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: monospace;
    font-weight: bold;
    color: var(--gold-dark);
}

.h-line-solid {
    background-color: var(--text-main);
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.h-line-broken {
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.h-line-broken-part {
    background-color: var(--text-main);
    width: 45%;
    height: 100%;
    border-radius: 2px;
}

.h-line-moving {
    color: var(--gold);
    font-weight: bold;
    margin: 0 5px;
}

.hexagram-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hexagram-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid var(--card-border);
}
