@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;700&family=Outfit:wght@300;400;600&display=swap');

.sanmei-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 2rem;
    background: #1a1a1a;
    color: #f5f5f5;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    font-family: 'Outfit', sans-serif;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(197, 160, 89, 0.2);
}

.sanmei-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(197,160,89,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.sanmei-header {
    text-align: center;
    margin-bottom: 3rem;
}

.sanmei-header h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: 2.5rem;
    color: #C5A059;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.sanmei-header p {
    color: #888;
    font-weight: 300;
}

.sanmei-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.form-row {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    color: #C5A059;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    background: #000;
    border: 1px solid rgba(197, 160, 89, 0.4);
    color: #fff;
    padding: 0.8rem;
    border-radius: 4px;
    text-align: center;
    font-size: 1.1rem;
    outline: none;
    transition: 0.3s;
    width: 100%;
}

.form-group input:focus {
    border-color: #C5A059;
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.3);
}

.btn-calculate {
    position: relative;
    background: linear-gradient(135deg, #C5A059 0%, #a68545 100%);
    color: #1a1a1a;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-calculate:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.4);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    to { left: 200%; }
}

/* Results Styling */
.sanmei-result {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-section {
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.5rem;
    color: #C5A059;
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.section-title::before, .section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(197,160,89,0.3), transparent);
}

/* In-sen Grid */
.insen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: rgba(197,160,89,0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.kanshi-box {
    background: #000;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px solid rgba(197,160,89,0.2);
}

.kanshi-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.kanshi-value {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.8rem;
    letter-spacing: 0.1em;
}

/* Yo-sen Body Layout */
.yosen-body {
    display: grid;
    grid-template-areas: 
        ". head top-r"
        "right center left"
        ". bottom bottom-r";
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1rem;
    max-width: 450px;
    margin: 0 auto;
}

.star-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(197,160,89,0.1);
    padding: 1rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
    transition: 0.3s;
}

.star-box:hover {
    background: rgba(197,160,89,0.05);
    border-color: rgba(197,160,89,0.4);
}

.star-name {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.2rem;
    color: #fff;
}

.star-label {
    font-size: 0.7rem;
    color: #C5A059;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.area-head { grid-area: head; }
.area-top-r { grid-area: top-r; }
.area-right { grid-area: right; }
.area-center { grid-area: center; background: rgba(197,160,89,0.08); border-color: rgba(197,160,89,0.3); }
.area-left { grid-area: left; }
.area-bottom { grid-area: bottom; }
.area-bottom-r { grid-area: bottom-r; }

.tenchumu-box {
    text-align: center;
    margin-top: 2rem;
    font-size: 1.2rem;
    color: #C5A059;
}

/* Loader */
.sanmei-loader {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(197,160,89,0.1);
    border-top-color: #C5A059;
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .yosen-body {
        max-width: 100%;
        gap: 0.5rem;
    }
    .star-name {
        font-size: 1rem;
    }
    .kanshi-value {
        font-size: 1.4rem;
    }
}
