/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Body */
body {
    background: #0d0d0d url('./media/background.jpg') center / cover fixed;
    color: #f2e9ff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Main container */
.container {
    width: 100%;
    max-width: 850px;
    background: rgba(20, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(180, 40, 40, 0.4);
    border-radius: 20px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: 0 0 60px rgba(180, 40, 40, 0.3);
}

/* Title */
h1 {
    font-size: 2.4rem;
    color: #c0392b;
    text-shadow: 0 0 20px rgba(192, 57, 43, 0.6);
    margin-bottom: 20px;
    letter-spacing: 3px;
}

/* Intro */
#intro p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.8;
}

/* Form inputs */
.form-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

input {
    padding: 12px 16px;
    border: 2px solid #922b21;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1rem;
    width: 220px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 10px rgba(192, 57, 43, 0.4);
}

/* Buttons */
button {
    background: #922b21;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin: 6px;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

button:hover {
    background: #b03a2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.4);
}

button.active {
    background: #c0392b;
    box-shadow: 0 0 15px rgba(192, 57, 43, 0.6);
}

/* Spread selection */
.spread-select {
    margin: 20px 0;
}

/* Card spread area */
#spread {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 25px 0;
}

/* Card slot */
.slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.slot span {
    color: #c0392b;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Card */
.card {
    width: 130px;
    height: 220px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid #922b21;
    transition: transform 0.3s, box-shadow 0.3s;
    background: #1a0000;
}

.card:hover {
    transform: scale(1.06);
    box-shadow: 0 0 25px rgba(192, 57, 43, 0.5);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card meaning overlay */
.card .meaning {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: #f2e9ff;
    padding: 6px 4px;
    font-size: 0.7rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover .meaning {
    opacity: 1;
}

/* Interpretation box */
#interpretation {
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(192, 57, 43, 0.3);
    border-radius: 12px;
    text-align: left;
    line-height: 1.7;
}

#interpretation h3 {
    color: #c0392b;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

/* History section */
#history {
    margin-top: 30px;
    text-align: left;
}

#history h3 {
    color: #c0392b;
    margin-bottom: 12px;
    font-size: 1.1rem;
    text-align: center;
}

/* History entries */
.history-item {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #922b21;
    padding: 10px 14px;
    margin: 8px 0;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.history-item .delete-btn {
    background: rgba(192, 57, 43, 0.3);
    padding: 4px 10px;
    font-size: 0.75rem;
    margin: 0;
    flex-shrink: 0;
}

.history-item .delete-btn:hover {
    background: #c0392b;
}

/* Clear history button */
#clearHistoryBtn {
    display: block;
    margin: 10px auto 0;
    background: rgba(192, 57, 43, 0.3);
    font-size: 0.85rem;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px 12px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .card {
        width: 100px;
        height: 170px;
    }

    #spread {
        gap: 12px;
    }

    input {
        width: 100%;
        max-width: 280px;
    }
}