body {
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.coin-flip-tool {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.tool-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.tool-description {
    font-size: 1.1rem;
    color: #5a6c7d;
    margin: 0;
    line-height: 1.6;
}

.coin-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    height: 200px;
    perspective: 1000px;
}

.coin {
    width: 150px;
    height: 150px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out;
    cursor: pointer;
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.coin-heads {
    transform: rotateY(0deg);
}

.coin-tails {
    transform: rotateY(180deg);
}

.coin-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.coin.flipping {
    animation: coinFlip 2s ease-in-out;
}

@keyframes coinFlip {
    0% { transform: rotateY(0deg) rotateX(0deg); }
    25% { transform: rotateY(450deg) rotateX(180deg) scale(1.1); }
    50% { transform: rotateY(900deg) rotateX(360deg) scale(1.2); }
    75% { transform: rotateY(1350deg) rotateX(540deg) scale(1.1); }
    100% { transform: rotateY(1800deg) rotateX(720deg) scale(1); }
}

/* [개선] JS에서 분리한 알림창 애니메이션 */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

.coin.show-heads {
    transform: rotateY(0deg);
}

.coin.show-tails {
    transform: rotateY(180deg);
}

.result-display {
    text-align: center;
    margin: 30px 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.result-text {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-text.heads {
    color: #e67e22;
}

.result-text.tails {
    color: #3498db;
}

.control-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.flip-button, .reset-button {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
    justify-content: center;
}

.flip-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.flip-button:hover {
    background: linear-gradient(135deg, #2980b9, #1e6a96);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.flip-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.reset-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.reset-button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.button-icon {
    width: 18px;
    height: 18px;
}

.statistics-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.stats-title, .section-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-weight: 600;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
}

.quick-flip-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-button {
    padding: 12px 15px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.quick-button:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

.quick-button:disabled {
    border-color: #bdc3c7;
    color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.history-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.history-empty {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    width: 100%;
}

.history-item {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-item.heads {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.history-item.tails {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.info-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.info-content {
    display: grid;
    gap: 15px;
}

.info-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    line-height: 1.6;
    color: #2c3e50;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .coin-flip-tool {
        padding: 10px;
    }
    .tool-header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    .tool-title {
        font-size: 2rem;
    }
    .tool-description {
        font-size: 1rem;
    }
    .coin-container {
        height: 160px;
        margin: 30px 0;
    }
    .coin {
        width: 120px;
        height: 120px;
    }
    .result-text {
        font-size: 1.5rem;
    }
    .control-section {
        flex-direction: column;
        align-items: center;
    }
    .flip-button, .reset-button {
        width: 100%;
        max-width: 280px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .quick-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    .statistics-section,
    .quick-flip-section,
    .history-section,
    .info-section {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .coin-flip-tool {
        padding: 5px;
    }
    .tool-header {
        padding: 15px 10px;
    }
    .coin {
        width: 100px;
        height: 100px;
    }
    .coin-container {
        height: 140px;
    }
    .quick-buttons {
        grid-template-columns: 1fr;
    }
    .statistics-section,
    .quick-flip-section,
    .history-section,
    .info-section {
        padding: 15px 10px;
    }
}