/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ── 색상 ── */
    --primary:       #6366f1;
    --primary-dark:  #4f46e5;
    --primary-light: #eef2ff;
    --secondary:     #f43f5e;
    --white:         #ffffff;
    --bg:            #f5f3ff;
    --text-dark:     #1f2937;
    --text-mid:      #4b5563;
    --text-light:    #9ca3af;
    --border:        #e5e7eb;
    --surface:       #f9fafb;

    /* ── 그림자 (2단계) ── */
    --shadow-sm: 0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 4px 12px rgba(99,102,241,.08), 0 1px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 24px rgba(99,102,241,.12), 0 2px 8px rgba(0,0,0,.06);

    /* ── 모서리 (3단계) ── */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* ── 배경 그라디언트 ── */
    --bg-gradient-start: #f0eeff;
    --bg-gradient-end:   #fce8f3;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Poppins', 'Noto Sans KR', sans-serif;
    background: linear-gradient(160deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Random Names Section */
.random-names-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -.01em;
}

/* refresh-names-btn → btn-ghost 시스템으로 통합 위에서 정의됨 */

.refresh-names-btn svg {
    animation: rotate 0.6s ease-in-out;
}

.refresh-names-btn:hover svg {
    animation: rotate 0.6s ease-in-out infinite;
}

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

.random-names-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.name-card {
    background: var(--white);
    padding: 24px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    text-align: center;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(99,102,241,.06);
}

.name-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.name-card:active {
    transform: translateY(-2px);
}

.name-card.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.name-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.name-card-hangul-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.name-card-hangul {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Noto Sans KR', sans-serif;
    letter-spacing: 2px;
}

.name-card-hanja {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 12px;
    font-family: 'Noto Sans KR', serif;
}

.name-card-roman {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.name-card-meaning {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 12px;
    padding: 0 8px;
}

.name-card-tts-btn {
    background: transparent;
    color: var(--text-light);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.name-card-tts-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    transform: scale(1.15);
}

.name-card-tts-btn:active {
    transform: scale(0.9);
}

.name-card-hint {
    font-size: 0.7rem;
    color: var(--text-light);
    opacity: 0.6;
    text-align: center;
}

.name-card:hover .name-card-hint {
    opacity: 1;
    color: var(--primary);
}

.custom-form-section {
    margin-bottom: 30px;
}

.custom-form-section h2 {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-dark);
}

@media (max-width: 360px) {
    .random-names-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .section-header h2 {
        text-align: center;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(99,102,241,.18), 0 4px 16px rgba(0,0,0,.12);
    animation: slideUp 0.3s ease;
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.modal-close:hover {
    background: #e5e7eb;
    color: var(--text-dark);
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    padding: 40px 24px 24px;
    background: linear-gradient(135deg, #fef3f2 0%, #fae8ff 100%);
    border-radius: 24px 24px 0 0;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.modal-hangul {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Noto Sans KR', sans-serif;
    margin-bottom: 8px;
    letter-spacing: 3px;
}

.modal-hanja {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 12px;
    font-family: 'Noto Sans KR', serif;
}

.modal-roman {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h3 {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 600;
}

.modal-description {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-dark);
    text-align: justify;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.modal-characters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-char {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 12px;
}

.modal-char-hanja {
    font-size: 2rem;
    font-family: 'Noto Sans KR', serif;
    color: var(--text-dark);
    width: 50px;
    text-align: center;
}

.modal-char-info {
    flex: 1;
}

.modal-char-hangul {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Noto Sans KR', sans-serif;
    margin-bottom: 4px;
}

.modal-char-meaning {
    font-size: 0.85rem;
    color: var(--text-light);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
}

.modal-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-btn-tts {
    background: #f3f4f6;
    color: var(--text-dark);
}

.modal-btn-tts:hover {
    background: #e5e7eb;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.modal-btn:active {
    transform: translateY(0);
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Stats Open Button */
.stats-open-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}

.stats-open-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.15);
}

.stats-open-btn:active {
    transform: scale(0.97);
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: flex;
    justify-content: flex-end;
    padding: 10px 0;
    z-index: 100;
}

.lang-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}

.lang-selected:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.15);
}

.lang-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.lang-selected .lang-name {
    font-weight: 500;
}

.lang-arrow {
    transition: transform 0.25s ease;
    color: var(--text-light);
}

.lang-dropdown.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown.open .lang-selected {
    border-color: var(--primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

/* Dropdown Options */
.lang-options {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: -2px;
    list-style: none;
    background: var(--white);
    border: 2px solid var(--primary);
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s ease;
    min-width: 100%;
}

.lang-dropdown.open .lang-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.lang-option:hover {
    background: linear-gradient(135deg, #eef2ff 0%, #fae8ff 100%);
}

.lang-option.active {
    background: #f3f4f6;
    font-weight: 600;
}

.lang-option .lang-badge {
    width: 28px;
    height: 20px;
}

.lang-option .lang-name {
    flex: 1;
}

.lang-check {
    color: var(--primary);
    flex-shrink: 0;
}

/* Header */
header {
    text-align: center;
    padding: 16px 0 28px;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: -.02em;
}

.subtitle {
    color: var(--text-mid);
    font-size: 0.93rem;
    font-weight: 400;
}

/* Main */
main {
    flex: 1;
}

/* Form */
form {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 1px solid rgba(99,102,241,.07);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 0.88rem;
    letter-spacing: .01em;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.97rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--surface);
    color: var(--text-dark);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.form-group input[type="text"]::placeholder {
    color: #9ca3af;
}

/* Gender Buttons */
.gender-buttons {
    display: flex;
    gap: 12px;
}

.gender-buttons input[type="radio"] {
    display: none;
}

.gender-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    background: var(--surface);
}

.gender-btn .icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.gender-btn span:last-child {
    font-weight: 500;
    font-size: 0.9rem;
}

.gender-buttons input[type="radio"]:checked + .gender-btn {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

/* Select Dropdown */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px !important;
}

/* ── 버튼 시스템 ── */

/* Primary (채워진 인디고) */
.submit-btn,
.btn-primary {
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
    letter-spacing: .01em;
}

.submit-btn:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,.45);
}

.submit-btn:active,
.btn-primary:active { transform: translateY(0); }

.submit-btn .arrow {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.submit-btn:hover .arrow { transform: translateX(4px); }

/* Ghost (외곽선) */
.btn-ghost,
.refresh-names-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.btn-ghost:hover,
.refresh-names-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(99,102,241,.12);
}

.btn-ghost:active,
.refresh-names-btn:active { transform: scale(0.97); }

/* Info Section */
.info-section {
    padding: 20px 0;
}

.info-section h2 {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.info-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-card h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.info-card p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.stats-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.stats-link:hover {
    opacity: 1;
}

.ssl-seal {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.ssl-seal:hover {
    opacity: 1;
}

.ssl-seal table {
    margin: 0 auto;
}

/* Feedback Button */
.feedback-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}

.feedback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,.45);
}

.feedback-btn:active { transform: translateY(0); }

/* Feedback Modal */
.feedback-modal-content {
    max-width: 500px;
}

.feedback-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 8px;
    font-weight: normal;
}

.star-rating {
    display: flex;
    gap: 8px;
    font-size: 2.5rem;
    margin: 12px 0;
}

.star-btn {
    cursor: pointer;
    color: #d1d5db;
    transition: all 0.2s ease;
    user-select: none;
}

.star-btn:hover,
.star-btn.hover {
    color: #fbbf24;
    transform: scale(1.2);
}

.star-btn.active {
    color: #fbbf24;
}

.feedback-modal-content textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.feedback-modal-content textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ==================== */
/* Result Page Styles */
/* ==================== */

.result-container {
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--primary);
}

.result-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid rgba(99,102,241,.07);
}

.korean-name {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Noto Sans KR', sans-serif;
    margin-bottom: 8px;
    letter-spacing: 4px;
    cursor: pointer;
    position: relative;
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}

.korean-name:hover {
    color: var(--primary);
    transform: scale(1.02);
}

.korean-name:active {
    transform: scale(0.98);
}

.korean-name .speaker-icon {
    font-size: 1.2rem;
    position: absolute;
    top: 50%;
    right: -35px;
    transform: translateY(-50%);
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.korean-name:hover .speaker-icon {
    opacity: 1;
}

.korean-name.speaking {
    color: var(--primary);
    animation: pulse 0.5s ease-in-out infinite;
}

.korean-name.speaking .speaker-icon {
    opacity: 1;
    animation: soundWave 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes soundWave {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.name-romanization {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 20px;
}

.name-meaning {
    background: linear-gradient(135deg, #fef3f2 0%, #fae8ff 100%);
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.name-meaning h3 {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.name-meaning p {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.6;
}

.hanja-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.hanja-section h3 {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hanja-section h3 .tap-hint {
    font-size: 0.7rem;
    text-transform: none;
    opacity: 0.7;
}

.hanja-breakdown {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.hanja-item {
    text-align: center;
    padding: 12px 20px;
    background: #f9fafb;
    border-radius: 12px;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.hanja-item:hover {
    background: linear-gradient(135deg, #eef2ff 0%, #fae8ff 100%);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.hanja-item:active {
    transform: translateY(0);
}

.hanja-char {
    font-size: 1.8rem;
    font-family: 'Noto Sans KR', serif;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.hanja-hangul {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.hanja-meaning {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Alternative Names */
.alternatives-section {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.alternatives-section h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.alternative-names {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alt-name-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.alt-name-card:hover {
    background: linear-gradient(135deg, #eef2ff 0%, #fae8ff 100%);
    border-color: var(--primary);
}

.alt-name-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alt-korean {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--text-dark);
}

.alt-roman {
    font-size: 0.9rem;
    color: var(--text-light);
}

.alt-meaning {
    font-size: 0.8rem;
    color: var(--primary);
    text-align: right;
    max-width: 100px;
    cursor: pointer;
}

.alt-speak-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.alt-speak-btn:hover {
    opacity: 1;
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.1);
}

.alt-speak-btn:active {
    transform: scale(0.95);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.action-btn.secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid #e5e7eb;
}

.action-btn.secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Share Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-dark);
    color: var(--white);
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Loading Animation */
.loading {
    display: none;
    text-align: center;
    padding: 40px 0;
}

.loading.show {
    display: block;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Error State */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (min-width: 480px) {
    .container {
        padding: 30px;
    }

    header h1 {
        font-size: 2rem;
    }

    .korean-name {
        font-size: 4rem;
    }
}

@media (max-width: 360px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 16px;
    }

    form {
        padding: 20px;
    }

    .korean-name {
        font-size: 3rem;
    }

    .hanja-breakdown {
        gap: 8px;
    }

    .hanja-item {
        padding: 10px 14px;
        min-width: 70px;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-gradient-start: #1f1f2e;
        --bg-gradient-end: #2d1f3d;
        --text-dark: #f3f4f6;
        --text-light: #9ca3af;
        --white: #1f2937;
    }

    body {
        background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    }

    .form-group input[type="text"],
    .form-group select {
        background: #374151;
        border-color: #4b5563;
        color: var(--text-dark);
    }

    .form-group input[type="text"]:focus,
    .form-group select:focus {
        background: #374151;
    }

    .gender-btn {
        background: #374151;
        border-color: #4b5563;
    }

    .info-card,
    .result-card,
    .alternatives-section {
        background: #1f2937;
    }

    .alt-name-card,
    .hanja-item {
        background: #374151;
    }

    .name-meaning {
        background: linear-gradient(135deg, #2d2d3d 0%, #3d2d4d 100%);
    }

    .hanja-section {
        border-color: #4b5563;
    }
}

/* ===== 찜하기 (Favorites) ===== */

/* 상단바 찜 목록 버튼 */
.fav-open-btn {
    background: var(--white);
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.fav-open-btn.has-items {
    border-color: #f43f5e;
    color: #f43f5e;
}

.fav-open-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.2);
}

/* 이름 카드 하트 버튼 */
.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #d1d5db;
    transition: all 0.2s ease;
    padding: 4px;
    line-height: 1;
    z-index: 2;
}

.fav-btn:hover {
    color: #f43f5e;
    transform: scale(1.2);
}

.fav-btn.faved {
    color: #f43f5e;
}

/* 모달 찜하기 버튼 */
.modal-btn-fav {
    background: var(--white);
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    color: #9ca3af;
    font-size: 1.1rem;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 600;
    min-width: 48px;
}

.modal-btn-fav:hover {
    border-color: #f43f5e;
    color: #f43f5e;
    transform: scale(1.05);
}

.modal-btn-fav.faved {
    border-color: #f43f5e;
    color: #f43f5e;
    background: #fff1f2;
}

/* 찜 목록 모달 */
.favorites-modal-content {
    max-width: 420px;
}

.fav-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 1rem;
}

.fav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

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

.fav-item:hover {
    background: #fef9ff;
}

.fav-item-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.fav-item-info {
    flex: 1;
    min-width: 0;
}

.fav-item-hangul {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--text-dark);
    letter-spacing: 1px;
}

.fav-item-sub {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.fav-item-tts,
.fav-item-del {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    color: #9ca3af;
}

.fav-item-tts:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.fav-item-del:hover {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
}

/* ===== 통계 % 뱃지 ===== */
.popularity-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
    letter-spacing: 0.3px;
}

/* ===== SNS 공유 ===== */
.sns-share-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.sns-share-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
}

.sns-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sns-twitter {
    background: #000;
    color: #fff;
}

.sns-twitter:hover {
    background: #333;
    transform: translateY(-1px);
}

.sns-kakao {
    background: #FEE500;
    color: #3A1D1D;
}

.sns-kakao:hover {
    background: #F5DB00;
    transform: translateY(-1px);
}

.sns-link {
    background: #f3f4f6;
    color: var(--text-dark);
    border: 1px solid #e5e7eb;
}

.sns-link:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* ===== 업데이트 배너 ===== */
.update-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    padding: 10px 16px;
    font-size: 0.85rem;
    flex-wrap: wrap;
    text-align: center;
}

.update-banner-link {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
}

.update-banner-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.update-banner-close:hover {
    background: rgba(255,255,255,0.35);
}

/* ===== Explore 섹션 ===== */
.explore-section {
    margin-bottom: 32px;
}

.explore-section h2 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 14px;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.explore-card {
    background: var(--white);
    border-radius: 16px;
    padding: 16px 14px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.explore-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(99,102,241,0.15);
}

.explore-icon { font-size: 1.6rem; }

.explore-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
}

.explore-desc {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ===== 탭 네비게이션 ===== */
.tab-nav {
    display: flex;
    gap: 0;
    background: #f3f4f6;
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(99,102,241,0.08);
}

.tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabFadeIn 0.25s ease;
}

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

/* 하이라이트 explore 카드 */
.explore-card-highlight {
    border: 2px solid #e0e7ff;
    background: linear-gradient(135deg, #faf5ff, #eef2ff);
}

.explore-card-highlight:hover {
    border-color: var(--primary);
}

/* ============================
   조선 왕 카드
   ============================ */
.joseon-king-card {
    display: block;
    background: linear-gradient(135deg, #f59e0b, #b45309);
    border-radius: 20px;
    padding: 20px 20px 16px;
    margin-bottom: 16px;
    color: #fff;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(180,83,9,.28);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.joseon-king-card:hover,
.joseon-king-card:active {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(180,83,9,.38);
}
.joseon-king-card::before {
    content: '';
    position: absolute;
    top: -35px; right: -35px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
}
.joseon-king-card::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -25px;
    width: 90px; height: 90px;
    background: rgba(255,255,255,.07);
    border-radius: 50%;
}
.jk-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    opacity: .8;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.jk-card-myo {
    font-size: 40px;
    font-weight: 900;
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.1;
    margin-bottom: 4px;
}
.jk-card-hwi {
    font-size: 15px;
    opacity: .8;
    margin-bottom: 10px;
    font-family: 'Noto Sans KR', sans-serif;
}
.jk-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.jk-card-meta span {
    background: rgba(255,255,255,.2);
    border-radius: 10px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
}
.jk-card-note {
    font-size: 12px;
    opacity: .8;
    margin-bottom: 12px;
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.5;
}
.jk-card-cta {
    font-size: 12px;
    font-weight: 700;
    opacity: .9;
    letter-spacing: .03em;
}

/* ============================
   오늘의 이름 카드
   ============================ */
.today-name-card {
    background: linear-gradient(135deg, var(--tn-color, #6366f1), color-mix(in srgb, var(--tn-color, #6366f1) 70%, #8b5cf6));
    border-radius: 20px;
    padding: 24px 20px;
    margin-bottom: 20px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0,0,0,.15);
}
.today-name-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 130px; height: 130px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
}
.today-name-card::after {
    content: '';
    position: absolute;
    bottom: -50px; left: -30px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
}
.tn-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    opacity: .8;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.tn-date {
    background: rgba(255,255,255,.2);
    border-radius: 10px;
    padding: 2px 8px;
    margin-left: 6px;
    font-size: 11px;
}
.tn-hangul {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: .02em;
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.1;
    margin-bottom: 8px;
}
.tn-sub {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 8px;
}
.tn-hanja {
    font-size: 16px;
    opacity: .75;
    font-family: 'Noto Sans KR', sans-serif;
}
.tn-roman {
    font-size: 14px;
    font-weight: 600;
    opacity: .85;
    letter-spacing: .04em;
}
.tn-meaning {
    font-size: 13px;
    opacity: .8;
    margin-bottom: 14px;
    font-family: 'Noto Sans KR', sans-serif;
}
.tn-tts {
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    z-index: 1;
}
.tn-tts:hover {
    background: rgba(255,255,255,.32);
}

/* ===== Rank Subtitle Link ===== */
.rank-subtitle-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 5px 14px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 20px;
    color: #6366f1;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rank-subtitle-link:hover {
    background: rgba(99,102,241,0.18);
    transform: translateY(-1px);
}

/* ===== Ranking Modal ===== */
.rank-modal-content {
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}
.rank-view-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 12px 20px 4px;
}
.rank-view-tab {
    padding: 7px 18px;
    border-radius: 20px;
    border: 2px solid #e5e7eb;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: #6b7280;
    transition: all 0.15s ease;
}
.rank-view-tab.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 10px rgba(99,102,241,0.3);
}
.rank-modal-body {
    padding: 8px 0 0;
}
.rank-inner-table {
    width: 100%;
    border-collapse: collapse;
}
.rank-inner-table thead tr {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
}
.rank-inner-table thead th {
    padding: 11px 14px;
    font-size: 0.82rem;
    font-weight: 600;
}
.rank-inner-table thead th:first-child { text-align:center; width:56px; }
.rank-inner-table thead th:last-child { text-align:right; }
.rank-inner-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}
.rank-inner-table tbody tr:last-child { border-bottom:none; }
.rank-inner-table tbody tr:hover { background: #f9fafb; }
.rank-inner-table tbody td { padding: 10px 14px; }
.rank-footer-note {
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    padding: 12px 16px 4px;
    line-height: 1.5;
}
.rank-vote-hint-text {
    font-size: 0.78rem;
    color: #9ca3af;
    flex: 1;
}

/* ===== Vote Cards (Redesigned) ===== */
.vote-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px;
    gap: 8px;
}
.vote-total-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f43f5e;
    background: rgba(244,63,94,0.08);
    border: 1.5px solid rgba(244,63,94,0.2);
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
}
.vote-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 14px 14px;
}
.vote-card {
    display: flex;
    align-items: center;
    gap: 11px;
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.vote-card.voted-card {
    border-color: rgba(244,63,94,0.3);
    background: rgba(244,63,94,0.03);
}
.vote-rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}
.vote-rank-badge.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.vote-rank-badge.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); }
.vote-rank-badge.rank-3 { background: linear-gradient(135deg, #f59e0b, #b45309); }
.vote-rank-badge.rank-other { background: #f3f4f6; font-size: 0.82rem; color: #6b7280; }
.vote-info { flex: 1; min-width: 0; }
.vote-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}
.vote-name-text { font-size: 0.95rem; font-weight: 600; color: #1f2937; }
.vote-bar-row { display: flex; align-items: center; gap: 8px; }
.vote-bar {
    flex: 1;
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.vote-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.5s ease;
}
.vote-count { font-size: 0.75rem; color: #9ca3af; min-width: 20px; text-align: right; }
.vote-btn {
    flex-shrink: 0;
    padding: 7px 13px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    color: #9ca3af;
    font-family: inherit;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.vote-btn:hover:not([disabled]) {
    border-color: #f43f5e;
    color: #f43f5e;
    background: rgba(244,63,94,0.05);
}
.vote-btn.voted {
    border-color: #f43f5e;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    cursor: default;
}

/* ===== Site Footer ===== */
.site-footer {
    margin-top: 48px;
    padding: 28px 20px 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}
.footer-inner { max-width: 720px; margin: 0 auto; }
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px 18px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.15s;
}
.footer-links a:hover { color: #6366f1; }
.footer-sep { color: #d1d5db; font-size: 0.75rem; }
.footer-copy { font-size: 0.75rem; color: #9ca3af; line-height: 1.6; }
.footer-copy span { color: #6366f1; font-weight: 600; }

@media (prefers-color-scheme: dark) {
    .rank-subtitle-link { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); }
    .rank-view-tab { background: #1f2937; border-color: #374151; color: #9ca3af; }
    .rank-inner-table tbody tr { border-color: #374151; }
    .rank-inner-table tbody tr:hover { background: #1f2937; }
    .vote-card { background: #1f2937; border-color: #374151; }
    .vote-card.voted-card { border-color: rgba(244,63,94,0.4); background: rgba(244,63,94,0.05); }
    .vote-name-text { color: #f9fafb; }
    .vote-bar { background: #374151; }
    .vote-rank-badge.rank-other { background: #374151; color: #9ca3af; }
    .vote-btn { background: #1f2937; border-color: #374151; color: #6b7280; }
}
