/**
 * JHM5 全局樣式
 * 所有應用共用的 CSS
 */

/* ========== 基本重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== 全局字體和顏色 ========== */
body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    color: #000000;
    min-height: 100vh;
}

/* ========== 返回主頁按鈕 ========== */
.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.back-link a {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border: 2px solid #000000;
    display: inline-block;
    transition: all 0.2s ease;
}

.back-link a:hover {
    background: #000000;
    color: #ffffff;
}

/* ========== 容器 ========== */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ========== 標題樣式 ========== */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000000;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    color: #666666;
    font-size: 1rem;
}

/* ========== 按鈕基本樣式 ========== */
.btn {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #f5f5f5;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.active,
.btn-primary {
    background: #000000;
    color: #ffffff;
}

.btn.active:hover,
.btn-primary:hover {
    background: #ffffff;
    color: #000000;
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
}

.btn-secondary:hover {
    background: #000000;
    color: #ffffff;
}

/* ========== 表單控制項 ========== */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #000000;
    font-size: 0.95rem;
    font-family: inherit;
    background: #ffffff;
    color: #000000;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    background: #f5f5f5;
}

/* 下拉選單 */
select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23000000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

select.form-control:hover {
    background-color: #f5f5f5;
}

/* 輸入框 */
input.form-control {
    display: block;
}

input.form-control[type="number"],
input.form-control[type="text"] {
    -moz-appearance: textfield;
}

input.form-control::-webkit-outer-spin-button,
input.form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 表單組 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #000000;
}

.form-group .help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666666;
}

/* ========== 排行榜樣式 ========== */
.leaderboard {
    border: 2px solid #000000;
    margin-bottom: 20px;
}

.leaderboard-title {
    padding: 15px;
    background: #000000;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
}

.leaderboard-list {
    list-style: none;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #eeeeee;
}

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

.leaderboard-item.highlight {
    background: #fffbeb;
    font-weight: 700;
}

.rank {
    font-weight: 700;
    min-width: 30px;
}

.rank.top-3 {
    color: #000000;
}

.player-name {
    flex: 1;
    text-align: left;
    margin-left: 15px;
}

.player-score,
.player-time {
    font-weight: 700;
}

.empty-leaderboard {
    padding: 30px;
    text-align: center;
    color: #666666;
    font-style: italic;
}

/* ========== 響應式設計 ========== */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .container {
        padding-top: 80px;
    }
}

@media (max-width: 480px) {
    .back-link a {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

