* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0b0c10;
    color: #c5c6c7;
    font-family: "Georgia", serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    text-align: center;
    max-width: 900px;
    padding: 40px;
}

h1 {
    color: #d4af37;
    font-size: 2.5rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.subtitle {
    font-style: italic;
    margin-bottom: 40px;
    color: #888;
}

.input-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

input[type="number"] {
    background: transparent;
    border: 1px solid #444;
    border-bottom: 2px solid #d4af37;
    color: #fff;
    font-family: serif;
    font-size: 1.2rem;
    padding: 10px;
    width: 100px;
    text-align: center;
    outline: none;
    transition: box-shadow 0.3s ease;
}

input[type="number"]:focus {
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

button {
    background: transparent;
    border: 1px solid #d4af37;
    color: #d4af37;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-family: "Georgia", serif;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    margin-bottom: 60px;
}

button:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    perspective: 1000px;
    flex-wrap: wrap;
}

.card-slot {
    width: 200px;
}

.card {
    width: 200px;
    height: 320px;
    background-color: transparent;
    perspective: 1000px;
    margin-bottom: 20px;
}

/* Flip Animation */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    border: 1px solid #d4af37;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.card-front {
    background: #111;
    background-image: repeating-linear-gradient(45deg,
            #1a1a1a,
            #1a1a1a 10px,
            #0a0a0c 10px,
            #0a0a0c 20px);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1);
}

/* Add a gold border inside the front */
.card-front::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 5px;
}

.card-back {
    background: #1a1c23;
    color: #fff;
    transform: rotateY(180deg);
}

.card-title {
    color: #d4af37;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.card-meaning {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ccc;
    font-style: italic;
}

.position-label {
    color: #d4af37;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 1s ease 0.8s;
    /* Fade in after flip */
}

.card.flipped+.position-label {
    opacity: 1;
}

.back-link {
    display: inline-block;
    margin-top: 50px;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #d4af37;
}