/* bobei — P7 對齊共用工具頁 layout */

.tool-header-actions {
    display: none !important;
}

.bb-tool-header {
    margin-bottom: 24px;
}

.bb-shell {
    max-width: 1180px;
}

/* ===== Toolbar ===== */
.bb-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px 0 14px;
    margin-bottom: 4px;
    min-width: 0;
    border-bottom: 1px solid var(--c-border, var(--bs-border-color));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bb-toolbar-modes {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
}

.bb-deity-label {
    white-space: nowrap;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.bb-deity-select {
    min-width: 140px;
    max-width: min(320px, 55vw);
    flex: 0 1 auto;
}

.bb-toolbar-spacer {
    flex: 0 1 auto;
    min-width: 8px;
}

.bb-toolbar-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: nowrap;
}

.bb-toolbar .btn.btn-outline-secondary.btn-sm,
.bb-toolbar .btn.btn-warning.btn-sm {
    height: 34px;
    padding-top: 0;
    padding-bottom: 0;
    white-space: nowrap;
}

.tool-top-ad-primary {
    margin: 16px 0 20px;
}

.tool-top-ad-secondary {
    margin: 20px 0;
}

/* ===== 主區：輸入｜箭頭｜舞台 ===== */
.bb-editor-wrap {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) auto minmax(280px, 1.1fr);
    gap: 14px;
    align-items: stretch;
    margin-bottom: 18px;
}

.bb-panel-surface {
    border-radius: var(--radius, 14px);
    border: 1.5px solid var(--c-border, var(--bs-border-color));
    background: var(--c-surface-1, var(--bs-card-bg, #fff));
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, 0.06);
    padding: 16px 18px;
}

[data-bs-theme='dark'] .bb-panel-surface {
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.25);
}

.bb-input-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bb-flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color);
    font-size: 1.75rem;
    padding: 0 4px;
    opacity: 0.75;
}

.bb-stage-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.display-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    font-weight: 700;
}

.bb-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.bb-stage-hint {
    font-size: 0.82rem;
}

/* ===== 杯象舞台（沿用專案內筊杯圖：images/up.png、images/down.png）===== */
.bb-coin-stage.coin-stage {
    min-height: 220px;
    border-radius: 1rem;
    border: 1px dashed var(--bs-border-color);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
    perspective: 1100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 3vw, 28px);
    padding: 18px 12px;
    flex-wrap: nowrap;
}

.bb-coin-stage .moon-block {
    --rest-rotate: 0deg;
    width: min(220px, 42vw);
    height: clamp(100px, 22vw, 120px);
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.bb-coin-stage .moon-block#coin-a {
    --rest-rotate: -10deg;
}

.bb-coin-stage .moon-block#coin-b {
    --rest-rotate: 10deg;
}

.bb-coin-stage .moon-block:not(.rolling):not(.flipping) {
    transform: rotate(var(--rest-rotate));
}

.bb-coin-stage .moon-block-inner {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.22s cubic-bezier(0.24, 0.76, 0.35, 1.02);
    filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.28));
}

.bb-coin-stage .moon-face {
    position: absolute;
    inset: 0;
    border-radius: 0.5rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform-style: preserve-3d;
    background-image: url('../images/up.png');
}

.bb-coin-stage .moon-block[data-side='yin'] .moon-face {
    background-image: url('../images/down.png');
}

.bb-coin-stage .moon-block.rolling {
    animation: bb-toss-roll 0.2s linear infinite;
}

.bb-coin-stage .moon-block.rolling .moon-block-inner {
    transition: none;
}

.bb-coin-stage .moon-block.flipping {
    animation: bb-toss-drop 0.46s cubic-bezier(0.18, 0.76, 0.36, 1.03);
    filter: brightness(1.1);
}

.bb-coin-stage .moon-block.flipping .moon-block-inner {
    animation: bb-face-flip 0.46s ease-in-out;
}

@keyframes bb-toss-roll {
    0% { transform: translateY(0) rotate(var(--rest-rotate)) rotateZ(0deg) scale(1); }
    50% { transform: translateY(-15px) rotate(calc(var(--rest-rotate) + 10deg)) rotateZ(8deg) scale(1.05); }
    100% { transform: translateY(0) rotate(calc(var(--rest-rotate) + 20deg)) rotateZ(0deg) scale(1); }
}

@keyframes bb-toss-drop {
    0% { transform: translateY(-16px) rotate(calc(var(--rest-rotate) + 24deg)) scale(1.06); }
    55% { transform: translateY(4px) rotate(calc(var(--rest-rotate) + 8deg)) scale(0.98); }
    100% { transform: translateY(0) rotate(var(--rest-rotate)) scale(1); }
}

@keyframes bb-face-flip {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(180deg); }
    100% { transform: rotateX(360deg); }
}

.bb-result-board {
    border-radius: 1rem;
    background: var(--c-surface-2, var(--bs-secondary-bg));
    padding: 14px 16px;
}

.bb-result-title {
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.bb-deity-photo-slot {
    border-radius: var(--radius, 14px);
    border: 1px dashed var(--bs-border-color);
    background: var(--c-surface-2, var(--bs-secondary-bg));
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    font-size: 0.82rem;
    color: var(--bs-secondary-color);
}

.bb-history-item {
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.bb-history-item:last-child {
    border-bottom: 0;
}

/* ===== Info section ===== */
.bb-info-section {
    margin-top: 34px !important;
    padding-top: 28px !important;
}

.bb-faq-list .faq-item {
    margin-bottom: 12px;
    border-radius: 16px;
}

.bb-faq-list .faq-q {
    font-size: 0.9rem;
    padding: 14px 18px;
}

.bb-faq-list .faq-a {
    display: none;
    font-size: 0.86rem;
    line-height: 1.7;
    padding-top: 12px;
}

.bb-faq-list .faq-item.is-open .faq-a {
    display: block;
}

.bb-faq-list .faq-item .faq-q i {
    transition: transform 0.2s ease;
}

.bb-faq-list .faq-item.is-open .faq-q i {
    transform: rotate(180deg);
}

.bb-info-section .rk-item {
    padding: 18px 0;
    margin: 0;
    border-radius: 0;
    background: transparent !important;
}

.bb-info-section .rk-thumb {
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
    border-radius: 14px;
    align-self: flex-start;
}

.bb-info-section .rk-thumb::after {
    background: rgba(0, 0, 0, 0.16);
}

.bb-info-section .rk-thumb-icon {
    font-size: 1.45rem;
}

.bb-info-section .rk-info > .d-flex {
    margin-bottom: 4px !important;
}

.bb-info-section .rk-info > .d-flex > div:first-child,
.bb-info-section .rk-tag {
    display: none !important;
}

.bb-info-section .rk-title {
    font-size: 0.875rem;
    line-height: 1.35;
    margin-bottom: 6px;
}

.bb-info-section .rk-excerpt {
    font-size: 0.77rem;
    line-height: 1.55;
}

.bb-info-section .rk-date {
    margin-top: 8px;
    font-size: 0.88rem;
}

@media (max-width: 991.98px) {
    .bb-editor-wrap {
        grid-template-columns: 1fr;
    }

    .bb-flow-arrow {
        display: none;
    }
}

@media (max-width: 767.98px) {
    
    
    .bb-toolbar {
        flex-wrap: wrap;
    }

    .bb-toolbar-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}
