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

/* Custom scrollbar for all scrollable elements */
* {
    scrollbar-width: thin;
    scrollbar-color: #764ba2 rgba(255, 255, 255, 0.1);
}

/* Webkit browsers (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7d8ff5 0%, #8b5ab8 100%);
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: url('https://files.catbox.moe/vi93yw.png'); /* Replace with your image URL */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    z-index: -1;
}

/* Custom scrollbar for the entire page */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7d8ff5 0%, #8b5ab8 100%);
    border-color: rgba(255, 255, 255, 0.4);
}

.swiper-container {
    max-width: 500px;
    width: 100%;
    padding-bottom: 40px;
    overflow: visible;
}

.swiper-title {
    text-align: center;
    color: white;
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.card-stack {
    position: relative;
    width: 400px;
    height: 500px;
    margin: 0 auto;
}

.character-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    cursor: grab;
    transition: box-shadow 0.3s ease;
    overflow: hidden;
    transform-origin: center center;
    user-select: none;
    touch-action: none;
}

.character-card:active {
    cursor: grabbing;
}

.character-image {
    width: 100%;
    height: 60%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.character-info {
    padding: 20px;
    height: 40%;
    display: flex;
    flex-direction: column;
}

.character-name {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.character-desc {
    color: #666;
    font-size: 0.95em;
    line-height: 1.4;
    margin-bottom: 15px;
    flex-grow: 1;
}

.view-profile-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.view-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.skip-all-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 0.95em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    display: block;
    margin: 15px auto 0;
}

.skip-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.skip-btn {
    background: #ff6b6b;
    color: white;
}

.like-btn {
    background: #51cf66;
    color: white;
}

.control-btn:hover {
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    color: white;
    font-size: 1.2em;
    padding: 0;
    margin-bottom: 0;
}

.empty-state > p {
    text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
}

.reset-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.reset-btn:hover {
    transform: translateY(-2px);
}

.character-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 0;
    padding: 20px 10px;
    width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

#finalContainer {
    margin-top: -10px;
}

.character-grid-item {
    position: relative;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.character-grid-item:hover {
    transform: scale(1.05);
}

.character-grid-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 3px solid white;
}

.character-grid-name {
    margin-top: 8px;
    font-size: 0.85em;
    font-weight: bold;
    color: white;
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.liked-heart {
    position: absolute;
    top: -5px;
    right: calc(50% - 45px);
    background: #ff6b6b;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 2px solid white;
}

.controls.hidden {
    display: none;
}

.skip-all-btn.hidden {
    display: none;
}