.logo {
    font-size: 26px;
    font-weight: bold;
}

.container-fluid.background {
    background-color: #f5f5f5;
    min-height: 730px;
}

.container-fluid.background > .row {
    min-height: 730px;
}

.container-fluid.background .col-lg-6 {
    display: flex;
}

.title-section {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

h1.fw-bold {
    font-size: 2.5rem;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #212529;
}

.ad-header-position {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.ad-position {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.coin-area-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
}

.control-panel-border {
    border: 3px solid #dee2e6 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
    background-color: #ffffff;
    min-height: 630px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.gx-5 {
    --bs-gutter-x: 3rem;
}

.nav-tabs {
    border-bottom: 3px solid #dee2e6 !important;
    background-color: #f8f9fa;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 4px solid transparent;
    color: #6c757d;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1.25rem 2rem;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link.active {
    border-bottom: 4px solid #0d6efd;
    color: #0d6efd;
    background-color: #ffffff;
}

.nav-tabs .nav-link:hover {
    border-bottom: 4px solid #0d6efd;
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.stat-item-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.result-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-display h2 {
    font-weight: 700;
    margin: 0;
}

.card {
    border-radius: 16px;
    border: 2px solid #e9ecef;
}

.shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

.form-control-lg {
    border-radius: 10px;
    border: 2px solid #dee2e6;
    padding: 0.875rem 1.25rem;
    font-size: 1.05rem;
}

.form-control-lg:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
}

.btn-outline-secondary {
    border-width: 2px;
    font-weight: 600;
}

.btn-outline-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bg-light {
    background-color: #f8f9fa !important;
    border: 2px solid #e9ecef;
    border-radius: 10px;
}

.form-label.fw-semibold {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 0.75rem;
}

.form-select,
.form-control {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-select:focus,
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-check-input {
    width: 3rem;
    height: 1.5rem;
    border: 2px solid #dee2e6;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.nav-tabs {
    flex-shrink: 0;
}

.tab-content {
    padding: 2rem !important;
}

.tab-content h5 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem !important;
}

#settings .mb-3 {
    margin-bottom: 1rem !important;
}

#settings .form-label {
    margin-bottom: 0.5rem;
}

:fullscreen .container-fluid.background .row {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

:-webkit-full-screen .container-fluid.background .row {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

:-moz-full-screen .container-fluid.background .row {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

:-ms-fullscreen .container-fluid.background .row {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .sticky-ads {
        position: sticky !important;
        top: 20px;
    }
}

@media (max-width: 991px) {
    .sticky-ads {
        position: relative !important;
        top: auto !important;
        margin-top: 2rem;
    }
    
    .nav-tabs .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    h1.fw-bold {
        font-size: 1.5rem;
    }
    
    .ad-header-position {
        margin-top: 1rem;
        min-height: 80px;
    }
}

:root {
    --d8-face-color-1: #5468db;
    --d8-face-color-2: #3949a3;
    --d8-face-color-3: #4c5ec7;
    --d8-face-color-4: #344296;
    --d8-face-color-5: #4557b9;
    --d8-face-color-6: #2f3b89;
    --d8-face-color-7: #3f51b5;
    --d8-face-color-8: #2a357c;
    --d8-number-color: #ffffff;
}

.dice-container {
    display: grid;
    gap: 2px;
    padding: 5px;
    justify-items: center;
    align-items: center;
    max-width: 800px;
    margin: 0 auto 80px auto;
}

.dice-container.multiple {
    grid-template-columns: repeat(4, 1fr);
    min-height: auto;
}

@media (max-width: 767px) {
    .dice-container {
        padding: 3px;
        gap: 2px;
        margin: 0;
    }

    .dice-container.multiple {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }

    .d8-dice {
        transform-origin: center center;
        width: 120px;
        height: 120px;
    }

    .dice-container.single .d8-dice {
        width: 150px;
        height: 150px;
    }
}

.dice-container.single {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: auto;
    padding: 10px;
}

.dice-container.single .d8-dice {
    transform: scale(1.8) rotateX(-30deg) rotateY(5deg);
}

.dice-container.multiple .d8-dice {
    transform: scale(1.1) rotateX(-30deg) rotateY(5deg);
}

.dice-container:has(.d8-dice:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
    max-width: 500px;
}

.dice-container:has(.d8-dice:nth-child(3):last-child) {
    grid-template-columns: repeat(3, 1fr);
    max-width: 700px;
}

.dice-container:has(.d8-dice:nth-child(5)) .d8-dice {
    transform: scale(0.95) rotateX(-30deg) rotateY(5deg);
}

.dice-container:has(.d8-dice:nth-child(9)) .d8-dice {
    transform: scale(0.85) rotateX(-30deg) rotateY(5deg);
}

.d8-dice {
    position: relative;
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    cursor: pointer;
}

.d8-face {
    position: absolute;
    left: 50%;
    margin: 0 -69px;
    border-left: 69px solid transparent;
    border-right: 69px solid transparent;
    border-bottom: 110px solid var(--face-color);
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.d8-face:nth-child(1) { --face-color: var(--d8-face-color-1, #5468db); }
.d8-face:nth-child(3) { --face-color: var(--d8-face-color-3, #4c5ec7); }
.d8-face:nth-child(5) { --face-color: var(--d8-face-color-5, #4557b9); }
.d8-face:nth-child(7) { --face-color: var(--d8-face-color-7, #3f51b5); }
.d8-face:nth-child(2) { --face-color: var(--d8-face-color-2, #3949a3); }
.d8-face:nth-child(4) { --face-color: var(--d8-face-color-4, #344296); }
.d8-face:nth-child(6) { --face-color: var(--d8-face-color-6, #2f3b89); }
.d8-face:nth-child(8) { --face-color: var(--d8-face-color-8, #2a357c); }

.d8-number {
    position: absolute;
    top: 25px;
    left: -52px;
    color: var(--d8-number-color, #ffffff);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    font-size: 3.1rem;
    text-align: center;
    line-height: 100px;
    width: 104px;
    height: 100px;
    user-select: none;
    font-weight: 900;
    pointer-events: none;
}

.d8-face:nth-child(1) { transform: rotateY(0deg) translateZ(34px) translateY(6.96px) rotateX(39deg); top: 0; }
.d8-face:nth-child(2) { transform: rotateY(90deg) translateZ(-34px) translateY(-6.96px) rotateZ(180deg) rotateY(180deg) rotateX(39deg); top: 99px; }
.d8-face:nth-child(3) { transform: rotateY(-90deg) translateZ(34px) translateY(6.96px) rotateX(39deg); top: 0; }
.d8-face:nth-child(4) { transform: rotateY(180deg) translateZ(-34px) translateY(-6.96px) rotateZ(180deg) rotateY(180deg) rotateX(39deg); top: 99px; }
.d8-face:nth-child(5) { transform: rotateY(-180deg) translateZ(34px) translateY(6.96px) rotateX(39deg); top: 0; }
.d8-face:nth-child(6) { transform: rotateY(270deg) translateZ(-34px) translateY(-6.96px) rotateZ(180deg) rotateY(180deg) rotateX(39deg); top: 99px; }
.d8-face:nth-child(7) { transform: rotateY(-270deg) translateZ(34px) translateY(6.96px) rotateX(39deg); top: 0; }
.d8-face:nth-child(8) { transform: rotateY(360deg) translateZ(-34px) translateY(-6.96px) rotateZ(180deg) rotateY(180deg) rotateX(39deg); top: 99px; }

@keyframes roll {
    0% { transform: rotateX(-30deg) rotateY(5deg) rotateZ(0); }
    100% { transform: rotateX(calc(-30deg + var(--finalX))) rotateY(calc(5deg + var(--finalY))) rotateZ(var(--finalZ)); }
}

.rolling {
    animation: roll 1.5s ease-out;
}

/* 自动旋转动画已禁用，避免与抛骰子动画冲突
@keyframes autoRotate {
    from {
        transform: scale(1.5) rotateX(-30deg) rotateY(5deg);
    }
    to {
        transform: scale(1.5) rotateX(-30deg) rotateY(365deg);
    }
}
*/

.quick-select {
    text-align: center;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-select button {
    margin: 0 5px;
    padding: 8px 16px;
    border: 2px solid #5468db;
    background-color: white;
    color: #5468db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 45px;
    font-weight: 600;
}

.quick-select button:hover {
    background-color: #5468db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(84, 104, 219, 0.3);
}

.quick-select input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 2px solid #5468db;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.quick-select input[type="number"]::-webkit-inner-spin-button,
.quick-select input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

.quick-select input[type="number"]:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.roll-button {
    font-size: 1.5rem;
    padding: 15px 60px;
    border-radius: 50px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
    margin: 20px 0;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
    cursor: pointer;
}

.roll-button:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.5);
}

.roll-button:active {
    transform: translateY(0) scale(1.02);
}

.content-sections {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 50px;
}

.content-sections section {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.content-sections h4 {
    color: #0d6efd;
    font-weight: 700;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #e9ecef;
}

.content-sections p {
    color: #495057;
    font-size: 1.05rem;
}

.content-sections ul {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-sections ul li {
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 1.05rem;
}

.sticky-ads {
    position: sticky;
    top: 20px;
}

.sticky-ads .ad-position {
    margin-bottom: 1.5rem;
}
