:root {
    --primary: #ff4757;
    --primary-hover: #ff6b81;
    --bg-dark: #0f111a;
    --bg-card: #1a1d29;
    --text-main: #f1f2f6;
    --text-muted: #a4b0be;
    --border: #2f3542;
    --gold: #f1c40f;
    --silver: #bdc3c7;
    --bronze: #d35400;
    --discord-blue: #5865F2;
    --discord-hover: #4752C4;
}

/* 全域平滑滾動與隱藏滾動條 */
html {
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar,
.rules-content::-webkit-scrollbar,
.modal-body-tiers::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.all-news-scroll-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

/* 導覽列 */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 17, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.05);
}

.site-icon {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s, text-shadow 0.2s;
}

nav a:hover {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(255, 71, 87, 0.6);
}

nav a.active-link {
    color: var(--primary);
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 71, 87, 0.6);
}

/* 通用按鈕 */
.btn-primary {
    display: inline-block;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
}

/* Discord 漂浮標籤 / 橫幅按鈕 */
.discord-banner {
    position: fixed;
    top: 75px;
    right: 0;
    z-index: 999;
    background-color: var(--discord-blue);
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.2rem 0.65rem 1rem;
    border-radius: 8px 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.3), 0 0 12px rgba(88, 101, 242, 0.35);
    animation: slideInFromRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.discord-banner:hover {
    background-color: var(--discord-hover);
    transform: translateX(-6px);
    box-shadow: -6px 6px 20px rgba(88, 101, 242, 0.5);
}

.discord-banner svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

/* 評分規則漂浮按鈕 */
.rules-banner-btn {
    position: fixed;
    top: 75px;
    left: 0;
    z-index: 999;
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 0.65rem 1.2rem 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.3);
    animation: slideInFromLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.rules-banner-btn:hover {
    background-color: #202433;
    color: var(--primary);
    border-color: var(--primary);
    transform: translateX(6px);
    box-shadow: 6px 6px 20px rgba(255, 71, 87, 0.25);
}

/* 彈窗遮罩與通用樣式 (Modal) */
.modal, .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.modal.open, .modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content, .player-modal, .rules-modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 71, 87, 0.15);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal.open .modal-content,
.modal-overlay.active .player-modal,
.modal-overlay.active .rules-modal {
    transform: scale(1) translateY(0);
}

.modal-close, .modal-close-btn {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: none;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.modal-close:hover, .modal-close-btn:hover {
    color: var(--primary);
    transform: scale(1.15);
}

/* 複製成功提示 (Toast) */
#copy-toast {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--primary);
    padding: 0.9rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 71, 87, 0.3);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

#copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#copy-toast::before {
    content: '✔';
    color: var(--primary);
    font-weight: bold;
}

/* 返回頂部按鈕 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--border);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 71, 87, 0.4);
}

/* 頁尾 */
footer {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* 共同動畫 */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes slideInFromLeft {
    0% { transform: translateX(-120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromRight {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* 響應式調整 */
@media (max-width: 768px) {
    nav ul { display: none; }
    .rules-banner-btn {
        top: 68px;
        padding: 0.5rem 0.75rem 0.5rem 0.6rem;
        font-size: 0.85rem;
    }
    .discord-banner {
        top: 68px;
        padding: 0.5rem 0.9rem 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    .discord-banner svg {
        width: 18px;
        height: 18px;
    }
}