/* 3D Coin Flipper Styling */

.coin-stage {
    perspective: 1200px;
    display: inline-block;
    margin: 2rem 0;
}

.coin-container {
    width: 240px;
    height: 240px;
    position: relative;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d; /* WebKit Safari support */
    transition: transform 5s cubic-bezier(0.1, 0.8, 0.1, 1);
    cursor: pointer;
}

.coin-container:active .coin-face {
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.3), 0 5px 10px rgba(0, 0, 0, 0.1);
}

.coin-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden; /* Bulletproof Safari/Chrome support */
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d; /* WebKit Safari support */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

/* Metallic Shiny Finishes (Soft & pleasing to the eyes) */
.coin-face.heads {
    background: radial-gradient(circle at 30% 30%, #fffbf0 0%, #f5e4c3 50%, #dfc38d 100%);
    color: #5c4308;
    border: 10px double rgba(92, 67, 8, 0.2);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
    transform: translateZ(1px);
}

.coin-face.tails {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f1f5f9 50%, #cbd5e1 100%);
    color: #334155;
    border: 10px double rgba(51, 65, 85, 0.2);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
    transform: rotateY(180deg) translateZ(1px);
}

/* Coin details */
.coin-inner {
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    max-width: 80%;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
}

.coin-symbol {
    font-size: 3rem;
    margin-bottom: 5px;
    line-height: 1;
}

/* Glossy reflection sweeps */
.coin-face::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 70%
    );
    transform: rotate(-30deg);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.coin-container:hover .coin-face::after {
    transform: translate(25%, 25%) rotate(-30deg);
    transition: transform 1.2s cubic-bezier(0.1, 0.8, 0.1, 1);
}

/* Layout containers */
.controls-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.controls-card h5 {
    color: #ec0088;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.history-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    max-height: 520px;
    display: flex;
    flex-direction: column;
}

.history-list {
    overflow-y: auto;
    flex-grow: 1;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f2f0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    color: white;
    margin-right: 12px;
    flex-shrink: 0;
}

.history-badge.heads {
    background: linear-gradient(135deg, #fffbf0 0%, #dfc38d 100%);
    border: 1px solid rgba(92, 67, 8, 0.15);
    color: #5c4308;
}

.history-badge.tails {
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    border: 1px solid rgba(51, 65, 85, 0.15);
    color: #334155;
}

.action-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 1rem;
}

/* Stats Counter badges */
.stats-badge {
    background: #f8f9fa;
    border: 1px solid #e3e3e3;
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
}

.stats-badge.heads {
    color: #5c4308 !important;
    background-color: #fffbf0;
    border-color: rgba(92, 67, 8, 0.2);
}

.stats-badge.tails {
    color: #334155 !important;
    background-color: #f1f5f9;
    border-color: rgba(51, 65, 85, 0.2);
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .coin-container {
        width: 190px;
        height: 190px;
    }
    
    .coin-inner {
        font-size: 1.4rem;
    }
    
    .coin-symbol {
        font-size: 2.2rem;
    }
}
