/* ─── Page layout ─── */
.omikuji-page {
    padding: 2rem 0;
}

.omikuji-intro {
    text-align: center;
    margin-bottom: 2rem;
}

/* ─── Selection screen ─── */
.omikuji-selection {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
}

.omikuji-strip {
    width: 72px;
    height: 220px;
    background: #fff;
    border: 3px double #c0392b;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.18);
    overflow: hidden;
}

.omikuji-strip::before,
.omikuji-strip::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    height: 18px;
    background: #c0392b;
}

.omikuji-strip::before { top: 0; }
.omikuji-strip::after  { bottom: 0; }

.omikuji-strip-label {
    writing-mode: vertical-rl;
    font-size: 1rem;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", "Noto Serif JP", Georgia, serif;
    color: #2c2c2c;
    letter-spacing: 0.15em;
    z-index: 1;
}

.omikuji-strip:hover {
    transform: translateY(-6px) rotate(0deg) !important;
    box-shadow: 4px 8px 16px rgba(0,0,0,0.28);
}

.omikuji-strip.tilt-1  { transform: rotate(-3deg); }
.omikuji-strip.tilt-2  { transform: rotate(2deg); }
.omikuji-strip.tilt-3  { transform: rotate(-1deg); }
.omikuji-strip.tilt-4  { transform: rotate(3deg); }
.omikuji-strip.tilt-5  { transform: rotate(-2deg); }
.omikuji-strip.tilt-6  { transform: rotate(1deg); }
.omikuji-strip.tilt-7  { transform: rotate(-4deg); }
.omikuji-strip.tilt-8  { transform: rotate(2.5deg); }
.omikuji-strip.tilt-9  { transform: rotate(-1.5deg); }

/* ─── Flip card ─── */
.flip-card-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    margin: 1rem 0 2rem;
}

.flip-card-container {
    perspective: 1200px;
    width: 300px;
    height: 600px;
}

.flip-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.65s ease;
}

.flip-card.is-flipped {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: #fff;
    border: 3px double #c0392b;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 4px 6px 18px rgba(0,0,0,0.22);
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ─── Slip interior ─── */
.slip-band {
    background: #c0392b;
    color: #fff;
    text-align: center;
    padding: 6px 0;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", "Noto Serif JP", Georgia, serif;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
}

.slip-body {
    padding: 1rem 0.9rem;
}

.slip-number {
    text-align: center;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", "Noto Serif JP", Georgia, serif;
    font-size: 0.75rem;
    color: #888;
    letter-spacing: 0.1em;
    margin-bottom: 0.15rem;
}

.slip-fortune-jp {
    text-align: center;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", "Noto Serif JP", Georgia, serif;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0.4rem 0 0.2rem;
}

.slip-fortune-jp-small {
    text-align: center;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", "Noto Serif JP", Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

/* Fortune type colours */
.fortune-daikichi  { color: #c0392b; }
.fortune-kichi     { color: #27ae60; }
.fortune-chukichi  { color: #2980b9; }
.fortune-shokichi  { color: #16a085; }
.fortune-suekichi  { color: #8e44ad; }
.fortune-kyo       { color: #555;    }
.fortune-default   { color: #333;    }

.slip-divider {
    border: none;
    border-top: 1px solid #e8b4b8;
    margin: 0.6rem 0;
}

.slip-poem {
    text-align: center;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", "Noto Serif JP", Georgia, serif;
    font-size: 0.78rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 0.5rem;
}

.slip-poem-reading {
    text-align: center;
    font-size: 0.68rem;
    color: #777;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.slip-summary {
    font-size: 0.78rem;
    color: #333;
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.slip-advice {
    font-size: 0.75rem;
    color: #555;
    font-style: italic;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* ─── Aspects table ─── */
.slip-aspects {
    margin-top: 0.4rem;
}

.slip-aspect-row {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 3px 0;
    border-bottom: 1px solid #f0e0e0;
    font-size: 0.7rem;
    line-height: 1.4;
}

.slip-aspect-label {
    white-space: nowrap;
    font-weight: 600;
    color: #555;
    min-width: 90px;
    flex-shrink: 0;
}

.slip-aspect-label-jp {
    white-space: normal;
    font-weight: 600;
    font-size: 0.68rem;
    color: #555;
    text-align: center;
    line-height: 1.3;
}

.slip-aspect-text {
    color: #333;
    flex: 1;
}

.tone-good    { color: #27ae60; }
.tone-mixed   { color: #e67e22; }
.tone-warning { color: #c0392b; }
.tone-bad     { color: #8e1010; }
.tone-neutral { color: #7f8c8d; }

.tone-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.tone-dot-good    { background: #27ae60; }
.tone-dot-mixed   { background: #e67e22; }
.tone-dot-warning { background: #e74c3c; }
.tone-dot-bad     { background: #8e1010; }
.tone-dot-neutral { background: #95a5a6; }

/* ─── Controls ─── */
.omikuji-controls {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ─── Source note ─── */
.omikuji-source-note {
    max-width: 520px;
    margin: 1.4rem auto 0;
    text-align: center;
    font-size: 0.78rem;
    color: #888;
    line-height: 1.6;
    padding: 0.7rem 1rem;
    border-top: 1px solid #e8e0e0;
}

.omikuji-source-note a {
    color: #c0392b;
    text-decoration: none;
}

.omikuji-source-note a:hover {
    text-decoration: underline;
}

/* ─── Mobile ─── */
@media (max-width: 576px) {
    .flip-card-container {
        width: 260px;
        height: 520px;
    }
    .omikuji-strip {
        width: 60px;
        height: 190px;
    }
}
