:root {
    --text-main: #333;
    --text-sub: #444;
    --text-muted: #999;
    --surface: #fff;
    --surface-soft: #fafafa;
    --chip-bg: rgba(255, 255, 255, 0.55);
    --radius-card: 12px;
    --radius-medium: 8px;
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-btn: 0 2px 6px rgba(0, 0, 0, 0.15);
    --shadow-btn-hover: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-btn-active: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.dan-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.dan-page-title {
    margin: 20px 0 0;
    text-align: center;
}

.team-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 20px 0 24px;
}

.team-btn {
    width: 52px;
    height: 52px;
    border: 3px solid transparent;
    border-radius: 50%;
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.team-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-btn-hover);
}

.team-btn.active {
    border-color: var(--text-main);
    transform: scale(1.15);
    box-shadow: var(--shadow-btn-active);
}

.team-card {
    overflow: hidden;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.team-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
}

.team-badge {
    color: var(--text-main);
    font-family: 'Zen Antique', 'Yuji Syuku', serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.team-color-label {
    padding: 2px 12px;
    border-radius: 20px;
    color: var(--text-sub);
    background: var(--chip-bg);
    font-size: 1rem;
    font-weight: 700;
}

.team-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.team-image-wrap {
    text-align: center;
}

.team-image {
    max-width: 100%;
    max-height: 320px;
    border-radius: var(--radius-medium);
    object-fit: cover;
}

.team-slogan {
    padding: 8px 0;
    color: #222;
    text-align: center;
    letter-spacing: 0.05em;
    font-family: 'Yuji Syuku', 'Zen Antique', serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.team-message {
    color: var(--text-sub);
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.8;
}

.team-pdf {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text-muted);
    text-align: center;
}

.team-pdf-page {
    /* A4 縦（210 : 297）に合わせ、画面幅が変わってもページ枠を同じ比率に保つ。 */
    aspect-ratio: 210 / 297;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: var(--radius-medium);
    background: var(--surface-soft);
}

.team-pdf-page canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.team-pdf-error {
    padding: 24px;
    border: 1px solid #ddd;
    border-radius: var(--radius-medium);
}

.team-empty {
    padding: 24px 0;
    color: var(--text-muted);
    text-align: center;
}

.team-loading {
    padding: 40px 0;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 600px) {
    .dan-page-title {
        margin-top: 16px;
    }

    .team-btn {
        width: 46px;
        height: 46px;
        font-size: 1.05rem;
    }

    .team-card-header {
        padding: 16px 18px;
    }

    .team-badge {
        font-size: 1.75rem;
    }

    .team-card-body {
        padding: 18px;
        gap: 14px;
    }
}
