* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at 50% 0%, #2A0E38 0%, #150824 50%, #0A0412 100%);
    min-height: 100vh;
    color: #FFF1F2;
    padding-top: 80px;
    overflow-x: hidden;
}

/* Minimalist Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(12, 5, 20, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 32px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.logo {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.4px;
    background: linear-gradient(135deg, #FF6097 0%, #FF2A85 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
    text-shadow: none;
}

.nav-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Mobile Navigation Toggle (Burger) */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 114, 182, 0.35);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    gap: 5px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
    backdrop-filter: blur(8px);
}

.mobile-nav-toggle:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #F43F5E;
    box-shadow: none;
    transform: translateY(-1px);
}

.mobile-nav-toggle .bar {
    width: 20px;
    height: 2px;
    background: #FFE4E6;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
}

.mobile-nav-toggle.active {
    background: rgba(244, 63, 94, 0.22);
    border-color: #FF2A85;
    box-shadow: none;
}

.mobile-nav-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: #FF2A85;
}

.mobile-nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: #FF2A85;
}

.user-email {
    color: #F1F5F9;
    font-size: 13px;
    font-weight: 500;
    margin-right: 4px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.user-email:hover {
    border-color: rgba(255, 42, 133, 0.45);
    background: rgba(255, 42, 133, 0.08);
}

/* Minimalist Buttons */
.btn-secondary {
    position: relative;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #E2E8F0;
    -webkit-text-fill-color: initial;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-primary {
    position: relative;
    padding: 8px 20px;
    background: #FF2A85;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
    background: #FF1475;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
}

/* Container */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, #FFA3C6 0%, #FF2A85 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 28px;
}

/* Big Generate Button */
.generate-control {
    display: flex;
    justify-content: center;
    margin: 0 auto 28px;
}

.generate-btn {
    position: relative;
    padding: 16px 44px;
    background: linear-gradient(135deg, #FF1475 0%, #FF2A85 45%, #F43F5E 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #FFFFFF;
    border-radius: 16px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
}

.generate-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(0.4);
}

/* Roll Display Slots */
.roll-display {
    min-height: 96px;
    margin: 0 auto 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 10, 36, 0.65);
    border: 1.5px solid rgba(244, 114, 182, 0.3);
    border-radius: 20px;
    max-width: 460px;
    width: 100%;
    padding: 14px 18px;
    box-shadow: none;
    box-sizing: border-box;
    backdrop-filter: blur(12px);
}

.roll-container {
    display: flex;
    gap: 9px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.digit-slot {
    width: 50px;
    height: 72px;
    background: linear-gradient(180deg, #1C0A28 0%, #2A103A 100%);
    border: 2px solid rgba(244, 114, 182, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 38px;
    font-weight: 800;
    color: #FFF1F2;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7), 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    user-select: none;
    transition: all 0.25s ease;
}

.digit-slot.placeholder {
    color: rgba(244, 114, 182, 0.25);
    border-color: rgba(244, 114, 182, 0.12);
    background: rgba(25, 11, 38, 0.6);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.digit-slot.spinning {
    color: #FF54A5;
    border-color: #FF2A85;
    box-shadow: none;
    transform: scale(1.08);
    background: #250A33;
}

.digit-slot.locked {
    color: #FF75B0;
    border-color: #F43F5E;
    text-shadow: none;
    background: linear-gradient(180deg, #2D0D39 0%, #40124D 100%);
    box-shadow: none;
    animation: digitDrop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes digitDrop {
    0% {
        transform: translateY(-16px) scale(1.25);
        filter: brightness(2.2);
    }
    70% {
        transform: translateY(3px) scale(0.96);
    }
    100% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
}

.countdown {
    margin: 0 auto 24px;
    color: #FBCFE8;
    text-align: center;
    font: 600 18px/1.4 'Courier New', monospace;
    text-shadow: none;
}

/* Card */
.card {
    background: rgba(24, 10, 38, 0.72);
    border: 1.5px solid rgba(244, 114, 182, 0.22);
    border-radius: 20px;
    padding: 32px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.cover-wrapper {
    text-align: center;
    margin-bottom: 24px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.spoiler-cover {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: #12051C;
    max-width: min(350px, 100%);
    width: 100%;
    margin: 0 auto;
    border: 1px solid rgba(244, 114, 182, 0.25);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.cover {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    object-fit: contain;
}

.spoiler-cover .cover {
    filter: blur(24px);
    transform: scale(1.08);
    transition: filter .35s ease, transform .35s ease;
}

.spoiler-cover.revealed .cover {
    filter: none;
    transform: scale(1);
}

.reveal-cover {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(18, 5, 28, 0.65);
    color: #FFE4E6;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: none;
    width: 100%;
    height: 100%;
    transition: all 0.2s;
}

.reveal-cover:hover {
    background: rgba(18, 5, 28, 0.45);
    color: #FFFFFF;
}

.spoiler-cover.revealed .reveal-cover {
    display: none;
}

.title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.4;
    color: #FFF1F2;
    overflow-wrap: break-word;
    word-break: break-word;
}

.metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(13, 5, 22, 0.55);
    border: 1px solid rgba(244, 114, 182, 0.15);
    border-radius: 12px;
}

.meta-item {
    color: #FBCFE8;
    font-size: 14px;
}

.meta-item strong {
    color: #FDA4AF;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    display: inline-block;
    min-width: 60px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #FFFFFF;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tag {
    padding: 6px 14px;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 114, 182, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #F472B6;
    transition: all 0.2s;
}

.tag:hover {
    background: rgba(244, 63, 94, 0.22);
    border-color: #EC4899;
    color: #FFE4E6;
}

.actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.view-btn {
    padding: 14px 36px;
    background: rgba(244, 63, 94, 0.12);
    border: 1.5px solid rgba(244, 114, 182, 0.45);
    color: #FF70B8;
    border-radius: 14px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.view-btn:hover {
    background: linear-gradient(135deg, #FF2A85 0%, #F43F5E 100%);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-color: transparent;
}

.share-btn {
    padding: 14px 30px;
    background: rgba(255, 42, 133, 0.15);
    border: 1.5px solid rgba(255, 42, 133, 0.45);
    color: #FFF1F2;
    border-radius: 14px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    font-family: inherit;
}

.share-btn:hover {
    background: linear-gradient(135deg, #FF1475 0%, #FF2A85 100%);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-color: transparent;
}

.share-btn:active {
    transform: translateY(1px);
}

.share-btn.copied {
    background: rgba(34, 197, 94, 0.25) !important;
    border-color: #22C55E !important;
    color: #4ADE80 !important;
    box-shadow: none;
}

/* Loading & Spinner */
.loading {
    text-align: center;
    padding: 48px;
    display: none;
}

.loading.visible {
    display: block;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 4px solid rgba(244, 114, 182, 0.2);
    border-top-color: #FF2A85;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.error {
    background: rgba(225, 29, 72, 0.15);
    border: 1px solid rgba(225, 29, 72, 0.4);
    color: #FECDD3;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin: 24px auto;
    max-width: 600px;
    display: none;
}

.error.visible {
    display: block;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 4, 16, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(25, 11, 40, 0.96);
    border: 1.5px solid rgba(244, 114, 182, 0.3);
    border-radius: 20px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #F472B6;
    font-size: 26px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #FFF1F2;
    transform: scale(1.1);
}

.modal h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 22px;
    color: #FFF1F2;
    background: linear-gradient(135deg, #FFA3C6, #FF2A85);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #FBCFE8;
    font-size: 14px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 13px 16px;
    background: rgba(14, 5, 24, 0.65);
    border: 1.5px solid rgba(244, 114, 182, 0.25);
    border-radius: 12px;
    color: #FFF1F2;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #FF2A85;
    box-shadow: none;
    background: rgba(14, 5, 24, 0.9);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions button {
    flex: 1;
}

.switch-mode {
    text-align: center;
    margin-top: 18px;
    color: #F472B6;
    font-size: 14px;
}

.switch-mode button {
    background: none;
    border: none;
    color: #FDA4AF;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.switch-mode button:hover {
    color: #FFFFFF;
}

/* History Modal & Grid */
.history-modal-content {
    max-width: 820px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    overflow-y: auto;
    max-height: calc(85vh - 120px);
    margin-top: 18px;
    padding-right: 6px;
}

.history-card {
    position: relative;
    background: rgba(20, 8, 32, 0.82);
    border: 1.5px solid rgba(244, 114, 182, 0.2);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.28s ease, 
                box-shadow 0.28s ease;
}

.history-card:hover {
    transform: translateY(-5px);
    border-color: #FF2A85;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

/* --- Minimalist Rarity Cards (Clean borders, no neon glare) --- */

.history-card {
    position: relative;
    background: rgba(18, 7, 28, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.history-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Legendary: Amber / Gold */
.history-card.card-rarity-legendary {
    border-color: rgba(249, 115, 22, 0.6);
}
.history-card.card-rarity-legendary:hover {
    border-color: #F97316;
}

/* Epic: Mystic Purple */
.history-card.card-rarity-epic {
    border-color: rgba(168, 85, 247, 0.55);
}
.history-card.card-rarity-epic:hover {
    border-color: #A855F7;
}

/* Superrare: Cyan */
.history-card.card-rarity-superrare {
    border-color: rgba(6, 182, 212, 0.5);
}
.history-card.card-rarity-superrare:hover {
    border-color: #06B6D4;
}

/* Rare: Emerald Green */
.history-card.card-rarity-rare {
    border-color: rgba(34, 197, 94, 0.45);
}
.history-card.card-rarity-rare:hover {
    border-color: #22C55E;
}

/* Common: Soft Slate Gray */
.history-card.card-rarity-common {
    border-color: rgba(148, 163, 184, 0.25);
}
.history-card.card-rarity-common:hover {
    border-color: rgba(244, 63, 94, 0.45);
}

/* Trash: Muted Sienna Brown */
.history-card.card-rarity-trash {
    border-color: rgba(160, 82, 45, 0.3);
    opacity: 0.88;
}
.history-card.card-rarity-trash:hover {
    opacity: 1;
    border-color: rgba(160, 82, 45, 0.6);
}

.history-spoiler-cover {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: #100418;
    cursor: pointer;
}

.history-spoiler-cover .history-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: blur(22px);
    transform: scale(1.1);
    transition: filter 0.35s ease, transform 0.35s ease;
}

.history-spoiler-cover.revealed .history-cover {
    filter: none;
    transform: scale(1);
}

.history-spoiler-cover .reveal-cover {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(18, 5, 28, 0.65);
    color: #FFE4E6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    text-shadow: none;
    transition: background 0.2s;
    user-select: none;
}

.history-spoiler-cover .reveal-cover:hover {
    background: rgba(18, 5, 28, 0.45);
    color: #FFFFFF;
}

.history-spoiler-cover.revealed .reveal-cover {
    display: none;
}

.history-cover {
    width: 100%;
    height: 240px;
    object-fit: cover;
    background: #100418;
    display: block;
}

.history-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.history-info:hover {
    background: rgba(244, 63, 94, 0.08);
}

.history-info:hover .history-title {
    color: #FF75B0;
}

.history-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #FFF1F2;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-meta {
    font-size: 11px;
    color: #F472B6;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-meta a {
    color: #FDA4AF;
    text-decoration: none;
    font-weight: 700;
}

.history-meta a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

.history-empty {
    text-align: center;
    color: #F472B6;
    padding: 48px 16px;
    font-size: 15px;
}

/* Tablet & Mobile Media Queries */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    header {
        padding: 10px 16px;
    }

    .logo {
        font-size: 21px;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .nav-buttons {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(18, 9, 28, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(244, 63, 94, 0.35);
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px 20px 20px;
        gap: 10px;
        z-index: 999;
    }

    .nav-buttons.active {
        display: flex;
        animation: navSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .nav-buttons .btn-secondary,
    .nav-buttons .btn-primary,
    .nav-buttons .user-email {
        width: 100%;
        text-align: center;
        padding: 12px 16px !important;
        font-size: 14px !important;
        margin: 0;
        max-width: 100%;
        display: block;
        box-sizing: border-box;
        border-radius: 12px;
    }

    .nav-buttons .user-email {
        order: -1;
        background: rgba(244, 63, 94, 0.16);
        border-color: rgba(244, 114, 182, 0.4);
        color: #FDA4AF;
        font-weight: 600;
        margin-bottom: 4px;
    }

    .nav-buttons .user-email[style*="display: none"],
    .nav-buttons button[style*="display: none"],
    .nav-buttons a[style*="display: none"] {
        display: none !important;
    }

    .container {
        padding: 24px 14px;
    }

    h1 {
        font-size: 34px;
        margin-bottom: 24px;
    }

    .card {
        padding: 20px 14px;
        border-radius: 16px;
    }

    .title {
        font-size: 18px;
    }

    .metadata {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .meta-item {
        font-size: 13px;
    }

    .user-email {
        max-width: 120px;
        font-size: 12px;
    }

    .btn-secondary, .btn-primary {
        padding: 7px 14px;
        font-size: 13px;
    }

    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .history-cover, .history-spoiler-cover {
        height: 190px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px 10px;
    }

    .card {
        padding: 16px 10px;
    }

    .digit-slot {
        width: 36px;
        height: 54px;
        font-size: 26px;
        border-radius: 10px;
    }

    .roll-container {
        gap: 5px;
    }

    .roll-display {
        padding: 8px 10px;
        min-height: 80px;
        border-radius: 16px;
    }

    .generate-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }

    .actions {
        flex-direction: column;
    }

    .view-btn, .share-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

@keyframes navSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Profile Page Styles */
.profile-card {
    background: rgba(18, 8, 28, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 28px;
    max-width: 1000px;
    margin: 0 auto 32px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 24px;
    align-items: center;
    box-sizing: border-box;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF1475 0%, #FF2A85 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: #FFFFFF;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: #FFFFFF;
}

#profileDisplayName {
    background: linear-gradient(135deg, #FFA3C6, #FF2A85);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#editUsernameBtn {
    background: rgba(255, 42, 133, 0.18) !important;
    border: 1px solid rgba(255, 42, 133, 0.5) !important;
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    padding: 5px 14px !important;
    border-radius: 999px !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: all 0.2s ease;
    line-height: 1.2;
}

#editUsernameBtn:hover {
    background: #FF2A85 !important;
    border-color: #FF2A85 !important;
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.profile-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    background: rgba(244, 63, 94, 0.18);
    border: 1px solid rgba(244, 114, 182, 0.4);
    border-radius: 12px;
    color: #FDA4AF;
    -webkit-text-fill-color: initial;
}

.profile-email-masked {
    color: #FBCFE8;
    font-size: 14px;
    margin-bottom: 18px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.profile-stat-box {
    background: rgba(13, 5, 22, 0.6);
    border: 1px solid rgba(244, 114, 182, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
}

.profile-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #FDA4AF;
    margin-bottom: 4px;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #FFFFFF;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFF1F2;
}

@media (max-width: 768px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
        padding: 24px 16px;
        gap: 18px;
    }

    .profile-name {
        justify-content: center;
        font-size: 22px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
}
/* Points & Scores */
.tag-pts {
    font-size: 10px;
    font-weight: 700;
    color: #FDA4AF;
    background: rgba(255, 42, 133, 0.25);
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 5px;
}

.score-value {
    color: #FF2A85 !important;
    font-weight: 800 !important;
    text-shadow: none;
}


/* Rarity Badge & Pill Styles */
.rarity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-radius: 9999px;
    border: 1.5px solid transparent;
    transition: all 0.3s ease;
}

.rarity-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.history-card-rarity {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}


/* ===================================================
   LEADERBOARD & FRIENDS STYLES
   =================================================== */

.leaderboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.leaderboard-tabs {
    display: inline-flex;
    background: rgba(18, 10, 24, 0.7);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.leaderboard-tabs .tab-btn {
    padding: 8px 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: #FBCFE8;
    text-decoration: none;
    transition: all 0.2s ease;
}

.leaderboard-tabs .tab-btn:hover {
    color: #FFF;
    background: rgba(244, 63, 94, 0.15);
}

.leaderboard-tabs .tab-btn.active {
    background: linear-gradient(135deg, #EC4899 0%, #BE185D 100%);
    color: #FFF;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.leaderboard-filter {
    display: inline-flex;
    gap: 8px;
}

.filter-pill {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(244, 114, 182, 0.2);
    color: #FBCFE8;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    background: rgba(244, 63, 94, 0.15);
    color: #FFF;
}

.filter-pill.active {
    background: rgba(255, 42, 133, 0.25);
    border-color: #FF2A85;
    color: #FFF;
    box-shadow: none;
}

.leaderboard-card {
    background: rgba(26, 11, 28, 0.75);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: none;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    padding: 16px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #FDA4AF;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(244, 63, 94, 0.15);
    font-weight: 700;
}

.leaderboard-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(244, 63, 94, 0.1);
    font-size: 14px;
    color: #FBCFE8;
    vertical-align: middle;
}

.leaderboard-row:hover td {
    background: rgba(244, 63, 94, 0.06);
}

.current-user-row td {
    background: rgba(255, 42, 133, 0.12) !important;
    border-color: rgba(255, 42, 133, 0.3) !important;
}

.leaderboard-table th:first-child,
.leaderboard-table td.rank-cell {
    width: 90px !important;
    min-width: 90px !important;
    padding: 14px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.rank-number {
    font-weight: 800;
    font-size: 15px;
    color: #94A3B8;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1;
}

.rank-number .medal-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    flex-shrink: 0;
}

.rank-number .rank-num {
    font-weight: 800;
    display: inline-block;
    white-space: nowrap !important;
}

.rank-gold .rank-number {
    color: #FBBF24;
    font-size: 18px;
    text-shadow: none;
}

.rank-silver .rank-number {
    color: #E2E8F0;
    font-size: 17px;
    text-shadow: none;
}

.rank-bronze .rank-number {
    color: #F97316;
    font-size: 16px;
    text-shadow: none;
}

/* Friends Podium Showcase */
.friends-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 28px;
    padding: 10px 0;
    animation: fadeInPodium 0.3s ease;
}

@keyframes fadeInPodium {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.podium-card {
    flex: 1;
    max-width: 280px;
    background: rgba(24, 10, 38, 0.85);
    border-radius: 18px;
    padding: 20px 16px;
    text-align: center;
    position: relative;
    border: 1.5px solid rgba(244, 114, 182, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    backdrop-filter: blur(14px);
}

.podium-card:hover {
    transform: translateY(-4px);
}

.podium-card.podium-1 {
    order: 2;
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25);
    padding: 26px 18px 24px 18px;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.16) 0%, rgba(24, 10, 38, 0.9) 100%);
}

.podium-card.podium-2 {
    order: 1;
    border-color: rgba(226, 232, 240, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    background: linear-gradient(180deg, rgba(226, 232, 240, 0.12) 0%, rgba(24, 10, 38, 0.85) 100%);
}

.podium-card.podium-3 {
    order: 3;
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.12) 0%, rgba(24, 10, 38, 0.85) 100%);
}

.podium-medal {
    font-size: 38px;
    line-height: 1;
    margin-bottom: 8px;
    display: inline-block;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.podium-card.podium-1 .podium-medal {
    font-size: 46px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.podium-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.podium-1 .podium-title { color: #FBBF24; }
.podium-2 .podium-title { color: #E2E8F0; }
.podium-3 .podium-title { color: #F97316; }

.podium-name {
    font-size: 16px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-decoration: none;
}

.podium-name:hover {
    color: #FF75B0;
    text-decoration: underline;
}

.podium-score {
    font-size: 14px;
    font-weight: 800;
    color: #FF2A85;
    background: rgba(255, 42, 133, 0.14);
    border: 1px solid rgba(255, 42, 133, 0.35);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    box-shadow: none;
}

@media (max-width: 650px) {
    .friends-podium {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .podium-card {
        max-width: 100%;
        order: unset !important;
        padding: 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }
    .podium-medal {
        font-size: 30px !important;
        margin-bottom: 0;
        margin-right: 14px;
    }
    .podium-info {
        flex: 1;
    }
}

.user-link {
    color: #FFFFFF;
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.user-link:hover {
    color: #FF75B0;
    text-decoration: underline;
}

.you-badge {
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    background: #FF2A85;
    color: #FFF;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.friend-pill {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22C55E;
    color: #22C55E;
    border-radius: 6px;
}

.rolls-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(244, 114, 182, 0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #FDA4AF;
}

/* Friend action buttons */
.btn-friend-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-friend-add {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.4);
    color: #FDA4AF;
}

.btn-friend-add:hover {
    background: #EC4899;
    color: #FFF;
    box-shadow: none;
}

.btn-friend-pending {
    background: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.4);
    color: #FACC15;
}

.btn-friend-pending:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #EF4444;
    color: #F87171;
}

.btn-friend-accept {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22C55E;
    color: #4ADE80;
}

.btn-friend-accept:hover {
    background: #22C55E;
    color: #000;
}

.btn-friend-remove {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86EFAC;
}

.btn-friend-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #EF4444;
    color: #F87171;
}

/* Friends Section in Profile */
.friends-container {
    margin-top: 36px;
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.friend-card {
    background: rgba(26, 11, 28, 0.7);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s ease;
}

.friend-card:hover {
    border-color: #EC4899;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.friend-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.friend-card-name {
    font-weight: 700;
    font-size: 15px;
    color: #FFF;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-card-name:hover {
    color: #FF75B0;
}

.friend-card-stats {
    font-size: 12px;
    color: #FDA4AF;
    display: flex;
    gap: 8px;
}

.request-card {
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.request-actions {
    display: flex;
    gap: 8px;
}

.btn-accept-sm {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    background: #22C55E;
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-accept-sm:hover {
    background: #16A34A;
    color: #FFF;
}

.btn-decline-sm {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
    border: 1px solid #EF4444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-decline-sm:hover {
    background: #EF4444;
    color: #FFF;
}


/* Details button in profile cards */
.btn-details {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 114, 182, 0.3);
    color: #FDA4AF;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-details:hover {
    background: #EC4899;
    color: #FFF;
    border-color: #EC4899;
    box-shadow: none;
}

.history-title {
    transition: color 0.2s ease;
}

.history-title:hover {
    color: #FF75B0 !important;
}

/* Category Section below Tags */
.category-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(244, 63, 94, 0.25);
    text-align: left;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.category-title {
    font-size: 12px;
    font-weight: 700;
    color: #FDA4AF;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Bonus Tags */
.tag.tag-age,
.tag.tag-bonus {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(180, 83, 9, 0.15) 100%) !important;
    border: 1px solid rgba(245, 158, 11, 0.55) !important;
    color: #FDE68A !important;
    font-weight: 600;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.tag.tag-age:hover,
.tag.tag-bonus:hover {
    border-color: #F59E0B !important;
    box-shadow: none;
    transform: translateY(-1px);
}

.tag.tag-age .tag-pts,
.tag.tag-bonus .tag-pts {
    background: rgba(245, 158, 11, 0.35) !important;
    border: 1px solid #F59E0B !important;
    color: #FFFBEB !important;
    font-weight: 800;
    text-shadow: none;
    margin-left: 0;
}

/* Discord Auth Button */
.btn-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 18px;
    background: #5865F2;
    color: #FFFFFF !important;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    margin-top: 14px;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.btn-discord:hover {
    background: #4752C4;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.btn-discord:active {
    transform: translateY(0);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 14px 0 16px 0;
    color: rgba(253, 164, 175, 0.6);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(244, 114, 182, 0.2);
}

.auth-divider:not(:empty)::before {
    margin-right: .75em;
}

.auth-divider:not(:empty)::after {
    margin-left: .75em;
}

/* Discord pill & small button */
.discord-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.45);
    color: #A5B4FC;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
}

.btn-discord-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #5865F2;
    color: #FFFFFF !important;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    font-weight: 700;
    transition: background 0.2s, transform 0.15s;
    line-height: 1.2;
}

.btn-discord-sm:hover {
    background: #4752C4;
    transform: translateY(-1px);
}

/* Danger Zone */
.danger-zone-container {
    max-width: 1000px;
    margin: 40px auto 20px;
    animation: fadeIn 0.3s ease;
}

.danger-zone-card {
    background: rgba(24, 10, 38, 0.65);
    border: 1.5px solid rgba(239, 68, 68, 0.35);
    border-radius: 18px;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(14px);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.danger-zone-card:hover {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.danger-zone-title {
    font-size: 18px;
    font-weight: 800;
    color: #EF4444;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.danger-zone-desc {
    color: #FDA4AF;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    max-width: 650px;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1.5px solid #EF4444;
    color: #FCA5A5 !important;
    -webkit-text-fill-color: #FCA5A5 !important;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: #EF4444;
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .danger-zone-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    .danger-zone-action {
        width: 100%;
    }
    .danger-zone-action .btn-danger {
        width: 100%;
        text-align: center;
    }
}





/* Collection Tabs & Favorites */
.collection-tabs {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.collection-tabs .tab-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: #FBCFE8;
    text-decoration: none;
    transition: all 0.2s ease;
}

.collection-tabs .tab-btn:hover {
    color: #FFF;
    background: rgba(244, 63, 94, 0.15);
}

.collection-tabs .tab-btn.active {
    background: linear-gradient(135deg, #EC4899 0%, #BE185D 100%);
    color: #FFF;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Star-shaped favorite button on cards */
.card-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    padding: 0;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-fav-btn .star-icon {
    width: 28px;
    height: 28px;
    fill: rgba(0, 0, 0, 0.5);
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.95));
    transition: fill 0.25s ease, stroke 0.25s ease, filter 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-fav-btn:hover {
    transform: scale(1.22);
}

.card-fav-btn:hover .star-icon {
    stroke: #FDE047;
    fill: rgba(251, 191, 36, 0.35);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.card-fav-btn:active {
    transform: scale(0.9);
}

/* Filled / Active Star */
.card-fav-btn.active .star-icon {
    fill: #FBBF24;
    stroke: #D97706;
    stroke-width: 1.5;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
    animation: starPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-fav-btn.active:hover .star-icon {
    fill: #FDE047;
    stroke: #F59E0B;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

@keyframes starPop {
    0% { transform: scale(0.75); }
    50% { transform: scale(1.35) rotate(15deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.fav-badge {
    color: #FBBF24;
    text-shadow: none;
    line-height: 1;
}

/* Modal Favorite button */
.btn-fav-modal {
    border: 1px solid rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
    color: #FDE047;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
}

.btn-fav-modal .star-icon {
    width: 18px;
    height: 18px;
    fill: transparent;
    stroke: #FDE047;
    stroke-width: 2;
    stroke-linejoin: round;
    transition: fill 0.2s ease, stroke 0.2s ease, transform 0.2s ease;
}

.btn-fav-modal:hover {
    background: rgba(251, 191, 36, 0.22);
    border-color: #FBBF24;
    color: #FFF;
    box-shadow: none;
}

.btn-fav-modal:hover .star-icon {
    fill: rgba(251, 191, 36, 0.35);
    transform: scale(1.15);
}

.btn-fav-modal.active {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border-color: #F59E0B;
    color: #FFF;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn-fav-modal.active .star-icon {
    fill: #FFF;
    stroke: #FFF;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
    animation: starPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Profile Card 3-Dots Dropdown Menu --- */
.profile-card {
    position: relative;
}

.profile-menu-container {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 50;
}

.profile-menu-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(244, 114, 182, 0.25);
    color: #CBD5E1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    padding: 0;
}

.profile-menu-btn:hover {
    background: rgba(255, 42, 133, 0.18);
    border-color: #FF2A85;
    color: #FFFFFF;
    transform: scale(1.06);
}

.profile-menu-btn:active {
    transform: scale(0.95);
}

.profile-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: rgba(22, 9, 36, 0.96);
    border: 1.5px solid rgba(244, 114, 182, 0.32);
    border-radius: 14px;
    padding: 6px;
    box-shadow: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    animation: fadeInMenu 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-menu-dropdown.active {
    display: flex;
}

@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-menu-item {
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #E2E8F0;
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.profile-menu-item:hover {
    background: rgba(255, 42, 133, 0.16);
    color: #FFFFFF;
}

.profile-menu-item .menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    font-size: 15px;
    color: #FF75B0;
    flex-shrink: 0;
}

.profile-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.profile-menu-item-danger {
    color: #F87171;
}

.profile-menu-item-danger:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #EF4444;
}

.profile-menu-item-danger .menu-icon {
    color: #F87171;
}

@media (max-width: 768px) {
    .profile-menu-container {
        top: 16px;
        right: 16px;
    }
}

/* --- 18+ Age Gate Modal --- */
.age-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 3, 14, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.age-gate-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.age-gate-modal {
    max-width: 480px;
    width: 100%;
    background: rgba(18, 7, 28, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 36px 30px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
    box-sizing: border-box;
    animation: ageGatePop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ageGatePop {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.age-gate-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.14);
    border: 1.5px solid rgba(239, 68, 68, 0.45);
    color: #EF4444;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 20px;
}

.age-gate-title {
    font-size: 22px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.age-gate-text {
    color: #CBD5E1;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 14px;
}

.age-gate-subtext {
    color: #94A3B8;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 26px;
}

.age-gate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
