.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.hidden {
    display: none;
}

body {
    background: linear-gradient(135deg, #fce4ec, #fff5e6);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    position: relative;
    overflow-x: hidden;
    padding: 1rem;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: none;
    background-repeat: repeat;
    opacity: 0;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Account for right side games panel on desktop */
@media (min-width: 1025px) {
    body {
        padding-left: 280px;
        padding-right: 280px;
    }

    .container {
        margin: 0 auto;
    }
}

.logo-container {
    text-align: center;
    margin-bottom: 1rem;
}

.game-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1rem;
}

h1 {
    font-family: 'Great Vibes', cursive;
    color: #d81b60;
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: 2px;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.dice-container {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 3vw, 30px);
    margin: clamp(15px, 3vw, 30px) 0;
    flex-wrap: wrap;
}

@media (max-width: 575.98px) {
    .dice-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(10px, 3vw, 20px);
        justify-items: center;
        padding: 0 clamp(10px, 3vw, 20px);
    }

    .dice-container #timeDice {
        grid-column: 1 / -1;
        justify-self: center;
        width: clamp(120px, 30vw, 150px);
        height: clamp(120px, 30vw, 150px);
    }

    .dice {
        width: clamp(120px, 30vw, 150px);
        height: clamp(120px, 30vw, 150px);
        margin: 0;
    }
}

.dice {
    width: clamp(120px, 30vw, 150px);
    height: clamp(120px, 30vw, 150px);
    margin: clamp(10px, 2vw, 20px);
    border-radius: clamp(20px, 5vw, 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15),
        inset 0 -8px 12px rgba(0, 0, 0, 0.1),
        inset 0 8px 12px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    line-height: 1.3;
    padding: clamp(10px, 2vw, 15px);
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.dice::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    transform: rotate(45deg);
    pointer-events: none;
}

.dice.action {
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 50%, #c2185b 100%);
    border: none;
}

.dice.where {
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 50%, #c2185b 100%);
    border: none;
}

.dice.time {
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 50%, #c2185b 100%);
    border: none;
}

.dice:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2),
        inset 0 -8px 12px rgba(0, 0, 0, 0.1),
        inset 0 8px 12px rgba(255, 255, 255, 0.3);
}

.dice.rolling {
    animation: rollDice 1s ease-out;
    background: linear-gradient(135deg, #f06292 0%, #e91e63 50%, #c2185b 100%);
}

@keyframes rollDice {
    0% {
        transform: rotateX(0) rotateY(0) rotateZ(0);
    }

    25% {
        transform: rotateX(360deg) rotateY(180deg) rotateZ(90deg);
    }

    50% {
        transform: rotateX(720deg) rotateY(360deg) rotateZ(180deg);
    }

    75% {
        transform: rotateX(1080deg) rotateY(540deg) rotateZ(270deg);
    }

    100% {
        transform: rotateX(1440deg) rotateY(720deg) rotateZ(360deg);
    }
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: clamp(20px, 4vw, 30px) 0;
    flex-wrap: wrap;
}

.button {
    background-color: #FFD400;
    border: none;
    padding: clamp(12px, 3vw, 18px) clamp(25px, 5vw, 40px);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 600;
    border-radius: 50px;
    color: black;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-family: 'Playfair Display', serif;
    min-width: 120px;
    text-align: center;
    cursor: pointer;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: #FFE03D;
}

.button.primary {
    background-color: #FFD400;
    font-size: clamp(1.3rem, 3.2vw, 1.7rem);
}

.button.settings {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    padding: clamp(8px, 2vw, 12px) clamp(20px, 4vw, 30px);
    background-color: #FFD400;
    color: #000;
    min-width: 150px;
}

.button.secondary {
    background-color: #e0e0e0;
}

.button.secondary:hover {
    background-color: #d0d0d0;
}

.result {
    margin-top: clamp(20px, 4vw, 30px);
    padding: clamp(15px, 3vw, 25px);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    line-height: 1.6;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: #d81b60;
    border: none;
}

.save-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4caf50;
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 1.1rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Lora', serif;
}

.save-notification.show {
    opacity: 1;
}

.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90%, 400px);
    height: min(90vh, 600px);
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    right: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.settings-panel.open {
    opacity: 1;
    pointer-events: auto;
    right: auto;
    transform: translate(-50%, -50%);
}

.settings-header {
    padding: 20px 20px 0;
}

.settings-content {
    padding: 0 20px 20px;
    flex: 1;
    overflow-y: auto;
}

.settings-panel h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 20px;
    font-family: 'Great Vibes', cursive;
    color: #d81b60;
    text-align: center;
}

.settings-panel h3 {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin-bottom: 10px;
    font-family: 'Playfair Display', serif;
    color: #d81b60;
}

.dice-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.dice-option input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
}

.delete-btn {
    color: #d81b60;
    font-size: 1.5rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background-color: #fce4ec;
    transform: scale(1.1);
}

.add-option {
    background-color: #FFD400;
    border: none;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    color: black;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    margin: 10px 0;
}

.add-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: #FFE03D;
}

.settings-buttons {
    margin-top: 20px;
    padding-bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.settings-buttons .button {
    font-size: 1rem;
    padding: 10px 20px;
    min-width: 120px;
}

.settings-panel .button {
    margin: 10px 0;
    width: 100%;
    font-size: 1.2rem;
    padding: 12px 20px;
}

.settings-panel .button:last-child {
    margin-top: 20px;
    background-color: #FFD400;
    font-weight: 600;
    letter-spacing: 1px;
}

.close-button {
    background-color: #FFD400;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    color: black;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 15px;
    top: 15px;
}

.close-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: #FFE03D;
}

@media (max-width: 480px) {
    .dice-container {
        flex-direction: column;
        align-items: center;
    }

    .dice {
        width: 80%;
        height: auto;
        aspect-ratio: 1;
        margin: 10px auto;
    }
}

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding-top: 2rem;
    }

    .container {
        padding: 15px;
    }
}

/* SEO Content Styles */
.game-info {
    margin-top: 2rem;
    text-align: left;
    padding: 0 clamp(10px, 4vw, 30px);
    color: #333;
    max-width: 800px;
    margin: 2rem auto 0;
}

.game-info h2 {
    font-family: 'Playfair Display', serif;
    color: #d81b60;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin-bottom: 1rem;
    text-align: center;
}

.game-info h3 {
    font-family: 'Playfair Display', serif;
    color: #d81b60;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    margin: 1.5rem 0 0.75rem;
}

.game-info p,
.game-info li {
    font-family: 'Lora', serif;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
}

.instructions,
.benefits-list,
.ideas-list {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.instructions li,
.benefits-list li,
.ideas-list li {
    margin-bottom: 0.5rem;
}

.faq-container {
    margin: 1rem 0 1.5rem;
}

.faq-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(216, 27, 96, 0.2);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h4 {
    font-family: 'Playfair Display', serif;
    color: #333;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.privacy-note,
.romantic-ideas {
    background-color: rgba(252, 228, 236, 0.4);
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
}

.privacy-note h3,
.romantic-ideas h3 {
    margin-top: 0;
}

@media (max-width: 768px) {
    .game-info {
        padding: 0 15px;
    }
}

/* 手机端导航栏位置自定义 - 移到右下角避免与support me按钮冲突 */
@media (max-width: 768px) {
    .quick-games-bar {
        bottom: 15px !important;
        left: auto !important;
        right: 15px !important;
        transform: none !important;
    }
    
    /* 确保在打开状态下也保持右侧位置 */
    .quick-games-bar.open {
        right: 15px !important;
        left: auto !important;
    }
}