@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&display=swap');

body {
    font-family: 'Cinzel', serif;
    background-color: #1a1a2e;
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
    color: #e0e0e0;
    text-align: center;
    /* MODIFIED: Removed 'overflow: hidden;' to allow scrolling */
    padding: 1em; /* ADDED: Ensures some space around the content on mobile */
    min-height: 100vh; /* ADDED: Ensures the body takes at least the full height of the viewport */
}

/* Language Switcher Styling */
#lang-switcher {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

#lang-switcher button {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid #ffd700;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px; /* ADDED: For better touch-friendliness */
}

#lang-switcher button:hover, #lang-switcher button.active {
    background-color: #ffd700;
    color: #1a1a2e;
    box-shadow: 0 0 10px #ffd700;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 5px #ffd700, 0 0 10px #000;
}

h2 {
    font-weight: 700;
    font-size: 1.8rem;
    color: #ffd700;
    text-shadow: 0 0 5px #ffd700, 0 0 10px #000;
}

#game-board {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 20px 0; /* MODIFIED: Removed horizontal padding to allow full width on mobile */
    min-height: 500px;
    gap: 20px;
}

.card-zone {
    border: 2px dashed rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    min-width: 350px;
    min-height: 250px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-content: flex-start;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

/* ADDED: Makes the player's hand scrollable if cards overflow */
#player-hand {
    overflow-x: scroll;
}

/* --- Style the scrollbar for WebKit browsers (Chrome, Safari, Edge) --- */
#player-hand::-webkit-scrollbar {
    height: 12px; /* Sets the height of the horizontal scrollbar */
}

#player-hand::-webkit-scrollbar-track {
    background: #ffffff; /* The white bar in the background */
    border-radius: 10px;
    border: 1px solid #4a4a6a; /* Optional: adds a subtle border */
}

#player-hand::-webkit-scrollbar-thumb {
    background-color: #888; /* The draggable grey part of the scrollbar */
    border-radius: 10px;
    border: 2px solid #ffffff; /* Creates padding around thumb */
}

#player-hand::-webkit-scrollbar-thumb:hover {
    background-color: #555; /* Darker color on hover */
}

/* --- Style the scrollbar for Firefox --- */
/* Note: Firefox offers less customization than WebKit */
#player-hand {
  scrollbar-width: thin; /* Can be 'auto', 'thin', or 'none' */
  scrollbar-color: #888 #ffffff; /* thumb color track color */
}```

.card-zone.drag-over {
    border-style: solid;
    border-color: #ffd700;
    box-shadow: 0 0 20px #ffd700;
}

.card-zone h2 {
    pointer-events: none;
    width: 100%;
    margin-top: -5px;
    margin-bottom: 10px;
    flex-shrink: 0; /* Prevent the title from shrinking */
}

#prediction-display {
    width: 100%;
    min-height: 120px;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.6));
    border: 1px solid #ffd700;
    border-radius: 5px;
    padding: 15px;
    color: #f5f5f5;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 18px;
    line-height: 1.6;
    text-align: left;
    order: -1;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    box-sizing: border-box; /* Ensures padding is included in the width */
}

.card {
    width: 120px;
    height: 200px;
    border-radius: 10px;
    cursor: grab;
    user-select: none;
    background-color: #333;
    background-size: cover;
    background-position: center;
    border: 3px solid #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0; /* Prevent cards from shrinking */
}

.card:hover {
    transform: scale(1.05) translateY(-10px);
    box-shadow: 0 0 25px #ffd700;
    border-color: #ffd700;
}

#deck {
    background-image: url('Tarot/cards/card_back.png');
    cursor: pointer;
    margin: 20px auto; /* ADDED: To center it in its container */
}

.card.dragging {
    opacity: 0.8;
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 0 0 30px #c300ff;
}

/* Card Preview Styling */
#card-preview {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 250px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #ffd700;
    border-radius: 10px;
    color: #f0f0f0;
    font-family: 'Times New Roman', Times, serif;
    font-size: 16px;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 200;
}

#card-preview.visible {
    opacity: 1;
    visibility: visible;
}

/* ======================================= */
/* === ADDED: Media Query for Mobiles ==== */
/* ======================================= */
@media (max-width: 768px) {
    body {
        padding: 0.5em; /* Reduce padding on smaller screens */
    }

    h1 {
        font-size: 2.2rem; /* Reduce font size */
    }

    h2 {
        font-size: 1.5rem;
    }

    #game-board {
        flex-direction: column; /* Stack game areas vertically */
        align-items: center;
        gap: 25px;
    }

    .card-zone, #deck-area {
        width: 95%; /* Make zones take up most of the width */
        min-width: 0; /* Override the desktop min-width */
    }

    #lang-switcher {
        position: static; /* Position buttons in the normal document flow */
        justify-content: center;
        margin-bottom: 1em;
    }

    #card-preview {
        /* Adjust preview for small screens */
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto; /* Let it fill the space */
    }
}
