:root {
    --bg-color: #fcf9ff;
    --card-bg: #fcf9ff;
    --text-primary: #333333;
    --accent-dark: #9c8f9c;
    --border-color: #efefef;
    --shadow: rgba(0, 0, 0, 0.08);
}

body {
    margin: 0;
    /* padding: 20px; */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    font-family: 'Merriweather', serif;
    color: var(--text-primary);
    box-sizing: border-box;
    padding-top: 30px;
    padding-bottom: 30px;
}

.container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.app-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
    margin-bottom: 0.5rem;
    position: relative;
}

.refresh-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.icon-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: var(--card-bg);
    box-shadow: 0 2px 5px var(--shadow);
    transition: all 0.2s ease;
    padding: 0;
    color: var(--accent-dark);
}

.icon-btn svg {
    display: block;
    width: 24px;
    height: 24px;
    transition: transform 1s ease;
}

.icon-btn:hover {
    border-color: var(--accent-dark);
}

.refresh-btn:hover>svg {
    transform: rotate(-180deg);
}

.lang-select {
    font-family: 'Merriweather', serif;
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 2px 5px var(--shadow);
    outline: none;
}

.card {
    position: relative;
    width: min(95vw, 420px);
    height: min(150vw, 680px);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow), 0 5px 15px rgba(0, 0, 0, 0.03);
    background-color: var(--card-bg);
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

.card-decoration-left {
    position: absolute;
    top: -15px;
    left: -15px;
    width: 160px;
    height: 160px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
}

.card-decoration-right {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 130px;
    height: 130px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
}

.card-decoration-left img,
.card-decoration-right img,
.card-decoration-bottom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-decoration-bottom {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    pointer-events: none;
    z-index: 1;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.card:active {
    transform: translateY(1px);
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.card-content h2 {
    font-size: 1.8rem;
    color: var(--accent-dark);
    margin: 70px 0 0 0;
    font-weight: 700;
}

.card-content h3 {
    font-size: 1.2rem;
    color: var(--accent-dark);
    margin: 5px 0 0 0;
    font-weight: 500;
}

.image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 270px;
    margin: 1.5rem 0;
}

.image-wrapper img {
    max-height: 230px;
    object-fit: container;
}

.messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

#card-message {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 10px;
    font-weight: 400;
    color: var(--accent-dark);
}

.hidden {
    display: none !important;
}

/* Music control icon stopped state */
#play-icon.stopped {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* Paywall Overlay */
.paywall-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.paywall-content {
    background: rgba(252, 249, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
}

.paywall-content p {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 500;
}

.buy-button {
    display: inline-block;
    padding: 14px 24px;
    background: #816693;
    color: white !important;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.buy-button:hover {
    background: #816693;
    transform: translateY(-2px);
}

.buy-button:active {
    transform: translateY(0);
}

/* Blur effect */
.blurred {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

@media (max-width: 768px) {
    body {
        padding-top: 15px;
        padding-bottom: 15px;
    }
    .app-header {
       width: 95%;
    }
    .card {
        height: auto;
    }
    .card-decoration-bottom {
        margin-top: 20px;
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
    }
}