/* Model Arena（AI 模型盲測競技場）共用樣式 */

.arena-page { background: #f8fafc; min-height: 100vh; padding: 24px 0 48px; }

.arena-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 22px 26px; margin-bottom: 18px;
}

.arena-hero {
    background: linear-gradient(149deg, #3C6F9A 0%, #3C938A 100%);
    color: #fff; border-radius: 14px; padding: 34px 30px; margin-bottom: 20px;
}
.arena-hero h1 { color: #fff; font-weight: 800; font-size: 1.7rem; margin: 0 0 10px; }
.arena-hero p { color: rgba(255, 255, 255, 0.92); margin: 0; line-height: 1.8; }

.arena-note {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
    color: #92400e; font-size: 0.85rem; padding: 10px 14px; line-height: 1.7;
}

/* 四哲學卡片（hover 只改色不位移） */
.arena-phil-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 992px) { .arena-phil-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .arena-phil-grid { grid-template-columns: 1fr; } }
.arena-phil-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 18px; transition: border-color 0.15s, box-shadow 0.15s;
}
.arena-phil-card:hover {
    border-color: #00b297; box-shadow: 0 0 10px rgba(0, 178, 151, 0.25);
}
.arena-phil-card h5 { font-weight: 700; font-size: 1rem; margin: 8px 0 6px; }
.arena-phil-card p { font-size: 0.83rem; color: #64748b; margin: 0; line-height: 1.7; }

/* 哲學標籤 chip */
.arena-chip {
    display: inline-block; padding: 3px 12px; border-radius: 50px;
    font-size: 0.78rem; font-weight: 700; color: #fff; white-space: nowrap;
}
.arena-chip-commercial { background: #3C6F9A; }
.arena-chip-community { background: #00b297; }
.arena-chip-sovereign { background: #8a5a00; }
.arena-chip-open_science { background: #5f3dc4; }
.arena-chip-neutral { background: #64748b; }

/* 出題區 */
.arena-mode-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.arena-mode-tabs button {
    padding: 8px 20px; border: 1px solid #cbd5e1; background: #fff;
    border-radius: 50px; cursor: pointer; font-weight: 600; color: #475569;
}
.arena-mode-tabs button.active {
    background: linear-gradient(149deg, #3C6F9A 0%, #3C938A 100%);
    color: #fff; border-color: transparent;
}
.arena-prompt-input {
    width: 100%; border: 1px solid #cbd5e1; border-radius: 10px;
    padding: 12px 14px; font-size: 0.95rem; resize: vertical; min-height: 84px;
}
.arena-prompt-input:focus { outline: none; border-color: #00b297; }
.arena-curated-text {
    background: #f1f5f9; border-radius: 10px; padding: 14px 16px;
    font-size: 0.95rem; color: #334155; line-height: 1.8; min-height: 64px;
}

.arena-btn-primary {
    background: linear-gradient(149deg, #3C6F9A 0%, #3C938A 100%);
    color: #fff; border: none; border-radius: 50px; padding: 10px 30px;
    font-weight: 700; cursor: pointer; font-size: 1rem;
}
.arena-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.arena-btn-outline {
    background: #fff; color: #3C6F9A; border: 1px solid #3C6F9A;
    border-radius: 50px; padding: 8px 22px; font-weight: 600; cursor: pointer;
}

/* 對戰雙欄（桌機並排、手機堆疊） */
.arena-battle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .arena-battle-grid { grid-template-columns: 1fr; } }

.arena-col {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    display: flex; flex-direction: column; min-height: 220px; overflow: hidden;
}
.arena-col.arena-col-winner { border-color: #00b297; box-shadow: 0 0 12px rgba(0, 178, 151, 0.3); }

/* 名牌翻牌（揭露時 CSS flip） */
.arena-nameplate { perspective: 600px; height: 52px; }
.arena-nameplate-inner {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d; transition: transform 0.6s;
}
.arena-nameplate.flipped .arena-nameplate-inner { transform: rotateY(180deg); }
.arena-nameplate-face {
    position: absolute; inset: 0; backface-visibility: hidden;
    display: flex; align-items: center; gap: 10px; padding: 0 16px;
    font-weight: 700; color: #334155; border-bottom: 1px solid #e2e8f0;
}
.arena-nameplate-front { background: #f1f5f9; }
.arena-nameplate-back {
    background: linear-gradient(149deg, #3C6F9A 0%, #3C938A 100%);
    color: #fff; transform: rotateY(180deg);
}

.arena-col-content {
    padding: 16px 18px; font-size: 0.92rem; line-height: 1.8; color: #1e293b;
    flex: 1; overflow-wrap: break-word;
}
.arena-col-content pre {
    background: #f1f5f9; border-radius: 8px; padding: 10px 12px; overflow-x: auto;
}
.arena-col-content table { max-width: 100%; overflow-x: auto; display: block; }
.arena-col-meta {
    font-size: 0.75rem; color: #94a3b8; padding: 8px 18px 12px;
    border-top: 1px dashed #e2e8f0;
}
.arena-col-error {
    background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
    border-radius: 8px; padding: 10px 12px; margin: 12px 18px; font-size: 0.85rem;
}

/* 串流游標 */
.arena-cursor {
    display: inline-block; width: 8px; height: 1em; background: #00b297;
    vertical-align: text-bottom; animation: arena-blink 1s step-end infinite;
}
@keyframes arena-blink { 50% { opacity: 0; } }

/* 投票區 */
.arena-vote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 768px) { .arena-vote-grid { grid-template-columns: repeat(2, 1fr); } }
.arena-vote-btn {
    background: #fff; border: 1.5px solid #cbd5e1; border-radius: 12px;
    padding: 12px 8px; font-weight: 700; color: #475569; cursor: pointer;
    font-size: 0.92rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.arena-vote-btn:hover:not(:disabled) {
    border-color: #00b297; box-shadow: 0 0 8px rgba(0, 178, 151, 0.25);
}
.arena-vote-btn.selected { border-color: #00b297; background: #ecfdf5; color: #047857; }
.arena-vote-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* 揭露區 */
.arena-reveal-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 0; border-bottom: 1px solid #f1f5f9;
}
.arena-reveal-row:last-child { border-bottom: none; }
.arena-elo-delta-up { color: #047857; font-weight: 700; }
.arena-elo-delta-down { color: #b91c1c; font-weight: 700; }

/* 同意 overlay */
.arena-consent-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
    z-index: 1050; display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.arena-consent-box {
    background: #fff; border-radius: 14px; max-width: 620px; width: 100%;
    padding: 28px 30px; max-height: 85vh; overflow-y: auto;
}
.arena-consent-box h4 { font-weight: 800; margin-bottom: 14px; }
.arena-consent-box p, .arena-consent-box li {
    font-size: 0.9rem; color: #475569; line-height: 1.8;
}

/* 載入轉圈（沿用站內 loading-spinner 命名；此處提供 arena 頁面內的樣式保底） */
.arena-page .loading-spinner {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid #e2e8f0; border-top-color: #00b297;
    animation: arena-spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes arena-spin { to { transform: rotate(360deg); } }

/* 排行榜表格 */
.arena-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.arena-table th, .arena-table td {
    padding: 11px 14px; border-bottom: 1px solid #f1f5f9; text-align: left;
}
.arena-table th { background: #f1f5f9; color: #475569; font-weight: 600; }
.arena-rank-1 { color: #d97706; font-weight: 800; font-size: 1.05rem; }
.arena-empty { text-align: center; color: #94a3b8; padding: 40px; }
