/* 共用導覽列 — index.html 主站 nav 移植 */
nav {
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 2px solid #b8956a;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #d4af37;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-logo {
    height: 2.2rem;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.nav-brand-sub {
    font-size: 0.7rem;
    color: #b8956a;
    display: block;
    letter-spacing: 2px;
}
.nav-links {
    display: none;
    gap: 0.5rem;
}
@media (min-width: 768px) {
    .nav-links { display: flex; }
}
.nav-link {
    color: #f0ede5;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    cursor: pointer;
}
.nav-link:hover, .nav-link.active {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}
.nav-fb {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f0ede5;
}
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    border: 1px solid rgba(212,175,55,.3);
    border-radius: 10px;
    min-width: 190px;
    z-index: 999;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    overflow: hidden;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-item {
    display: block;
    padding: .7rem 1.1rem;
    color: #d0c8b8;
    text-decoration: none;
    font-size: .85rem;
    border-bottom: 1px solid rgba(255,255,255,.05);
    transition: background .15s;
}
.nav-dropdown-item:last-child { border-bottom: none; }
.nav-dropdown-item:hover { background: rgba(212,175,55,.12); color: #d4af37; }
.nav-dropdown-item span { display: block; font-size: .7rem; color: #888; margin-top: 1px; }
.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-button {
    background: transparent;
    border: 1px solid #b8956a;
    color: #f0ede5;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}
.user-button:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.98);
    border-top: 2px solid #b8956a;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    z-index: 999;
    backdrop-filter: blur(10px);
}
@media (min-width: 768px) {
    .bottom-nav { display: none; }
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #b8956a;
    text-decoration: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    flex: 1;
}
.bottom-nav-item:hover, .bottom-nav-item.active {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}

/* 牌義選擇 Modal（手機用） */
#cardsModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 1200;
    align-items: flex-end;
    justify-content: center;
}
#cardsModal.open { display: flex; }
#cardsModal > div {
    background: #1a1a2e;
    border: 1px solid rgba(212,175,55,.3);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem 1.2rem 2.5rem;
}
#cardsModal .modal-title {
    text-align: center;
    color: #d4af37;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 1.2rem;
}
#cardsModal .modal-item {
    display: block;
    padding: .9rem 1rem;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    text-decoration: none;
    margin-bottom: .7rem;
}
#cardsModal .modal-item .t { color: #f0ede5; font-size: .9rem; font-weight: bold; }
#cardsModal .modal-item .d { color: #888; font-size: .75rem; margin-top: 2px; }
#cardsModal .modal-cancel {
    width: 100%;
    padding: .7rem;
    background: none;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    margin-top: .3rem;
}

/* 給手機底部 bottom-nav 留空間（避免內容被遮住） */
@media (max-width: 767px) {
    body.has-bottom-nav { padding-bottom: 4.5rem; }
}
