/* === Vintage Family Tree === */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: #f5e6ca;
    background-image: 
        radial-gradient(ellipse at 20% 50%, rgba(139, 90, 43, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(139, 90, 43, 0.05) 0%, transparent 50%);
    color: #3a2a1a;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* === Header === */
header {
    text-align: center;
    padding: 30px 20px 20px;
    border-bottom: 2px solid rgba(139, 90, 43, 0.2);
    margin-bottom: 10px;
}

.logo {
    font-size: 48px;
    margin-bottom: 10px;
}

h1 {
    font-size: 36px;
    font-weight: normal;
    color: #5c3a1e;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 16px;
    color: #8b6b3e;
    font-style: italic;
    margin-top: 8px;
}

.hint {
    text-align: center;
    color: #8b6b3e;
    font-size: 14px;
    margin-bottom: 20px;
    font-style: italic;
}

/* === Variants Grid === */
.variants {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 0;
    max-width: 1000px;
    margin: 0 auto;
}

.variant {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(139, 90, 43, 0.2);
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.variant:hover {
    border-color: #a0805a;
    box-shadow: 0 2px 12px rgba(139, 90, 43, 0.15);
}

.variant h3 {
    font-size: 18px;
    font-weight: normal;
    color: #5c3a1e;
    margin-bottom: 4px;
}

.variant-desc {
    font-size: 12px;
    color: #8b6b3e;
    font-style: italic;
    margin-bottom: 10px;
}

.variant .tree {
    width: 100%;
    height: 700px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(139, 90, 43, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* === Button bar (under variants) === */
.controls {
    text-align: center;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.controls button {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid #c4a87c;
    padding: 8px 20px;
    border-radius: 6px;
    font-family: 'Georgia', serif;
    font-size: 14px;
    color: #5c3a1e;
    cursor: pointer;
    transition: background 0.2s;
}

.controls button:hover {
    background: rgba(139, 90, 43, 0.15);
}

.controls button.active {
    background: #c4a87c;
    color: #fff;
}

/* === Card Panel === */
.card-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    background: #faf3e6;
    border: 1px solid #c4a87c;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 30px;
    z-index: 1000;
}

.card-panel.hidden {
    display: none;
}

.card-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #8b6b3e;
    cursor: pointer;
    line-height: 1;
}

.card-close:hover {
    color: #5c3a1e;
}

#cardContent h2 {
    font-size: 24px;
    font-weight: normal;
    color: #5c3a1e;
    border-bottom: 1px solid #c4a87c;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#cardContent .id-badge {
    font-size: 12px;
    color: #8b6b3e;
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
}

#cardContent .dates {
    font-size: 15px;
    color: #6b4a2e;
    margin-bottom: 8px;
}

#cardContent .places {
    font-size: 14px;
    color: #8b6b3e;
    font-style: italic;
    margin-bottom: 15px;
}

#cardContent .section-title {
    font-size: 15px;
    font-weight: bold;
    color: #5c3a1e;
    margin-top: 15px;
    margin-bottom: 8px;
}

#cardContent table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

#cardContent table td {
    padding: 4px 8px;
    font-size: 14px;
    border-bottom: 1px solid rgba(139, 90, 43, 0.1);
}

#cardContent table td:first-child {
    width: 80px;
    color: #8b6b3e;
}

#cardContent .bio {
    font-size: 14px;
    line-height: 1.6;
    color: #3a2a1a;
}

#cardContent .loc-line {
    font-size: 14px;
    color: #5c3a1e;
    margin-bottom: 4px;
}

#cardContent .loc-line.coords {
    font-size: 12px;
    color: #8b6b3e;
    font-family: 'Courier New', monospace;
    margin-left: 20px;
}

#cardContent .maiden-line {
    font-size: 14px;
    color: #8B4513;
    font-style: italic;
    margin-bottom: 8px;
}

/* === Overlay === */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

/* === Responsive === */
@media (max-width: 768px) {
    h1 { font-size: 26px; }
    .variants { grid-template-columns: 1fr; }
    .variant .tree { height: 300px; }
    .card-panel { width: 95vw; padding: 20px; }
}
