/* ============================================================
   2026年國際反腐敗日 — 網上問答遊戲
   暖色主題
   ============================================================ */

:root {
    --ink: #5a2a12;
    --ink-soft: #8a5a32;
    --cream: #fff6e8;
    --cream-dark: #f3e0c4;
    --coral: #e85d3a;
    --coral-dark: #c94428;
    --orange: #f08a2a;
    --orange-dark: #d46c18;
    --gold: #e8b01a;
    --gold-light: #ffd65a;
    --white: #ffffff;
    --green: #3aaa62;
    --red: #e24b3a;
    --radius-pill: 999px;
    --shadow-lg: 0 10px 36px rgba(90, 42, 18, .22);
    --font: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "微軟正黑體", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: radial-gradient(1200px 700px at 30% 20%, #fff4dd 0%, #f4d7a8 45%, #edc48a 100%) fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── 海報背景 ─────────────────────────────── */
.bg-poster {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bg-poster::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../img/bg.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    /*filter: blur(5px);*/
}
.bg-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    /*background: rgba(255, 246, 230, .62);*/
}

/* ── 版面骨架 ─────────────────────────────── */
.page {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px 32px 16px;
    display: flex;
    flex-direction: column;
}

/* ── 頁首 ─────────────────────────────────── */
.site-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
}
.logo-wrap,
.title-wrap,
.header-right {
    grid-area: 1 / 1;
}
.logo-wrap { justify-self: start; z-index: 1; }
.header-right { justify-self: end; z-index: 1; }
.logo {
    width: 70%;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4));
}
.title-wrap {
    justify-self: stretch;
    width: 100%;
    text-align: center;
    padding-top: 6px;
    pointer-events: none;
}
.game-title {
    --title-track: .06em;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: var(--title-track);
    padding-left: var(--title-track);
    color: #0E2947;
    -webkit-text-stroke: 6px #fff;
    paint-order: stroke fill;
    /* 白框外再加一圈深藍，貼近參考圖 */
    filter:
        drop-shadow(1px 0 0 #0E2947)
        drop-shadow(-1px 0 0 #0E2947)
        drop-shadow(0 1px 0 #0E2947)
        drop-shadow(0 -1px 0 #0E2947)
        drop-shadow(1px 1px 0 #0E2947)
        drop-shadow(-1px -1px 0 #0E2947)
        drop-shadow(1px -1px 0 #0E2947)
        drop-shadow(-1px 1px 0 #0E2947);
}
.game-subtitle {
    display: inline-block;
    margin-top: 20px;
    padding: 6px 26px 6px calc(26px + .3em);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .3em;
    color: var(--white);
    background: linear-gradient(180deg, var(--coral) 0%, var(--coral-dark) 100%);
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 14px rgba(201, 68, 40, .4);
}

/* ── 頁首右側：章程連結 + 燈泡 ─────────────── */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
.rules-link {
    display: inline-block;
    padding: 6px 18px;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--white);
    text-decoration: none;
    background: linear-gradient(180deg, var(--coral) 0%, var(--coral-dark) 100%);
    border: 1.5px solid rgba(201, 68, 40, .55);
    border-radius: var(--radius-pill);
    box-shadow: 0 3px 10px rgba(201, 68, 40, .35);
    transition: background .2s, color .2s, box-shadow .2s, transform .15s;
}
.rules-link:hover {
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
    color: var(--ink);
    box-shadow: 0 4px 14px rgba(232, 176, 26, .45);
    transform: translateY(-1px);
}

/* ── 燈泡 ─────────────────────────────────── */
.bulbs {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}
.bulb {
    width: 34px;
    height: 46px;
    transition: filter .3s, transform .3s;
    filter: drop-shadow(0 0 4px rgba(255, 196, 64, .55));
}
.bulb .bulb-glass { fill: #73726f; }
.bulb .bulb-base  { fill: #e09a22; }
.bulb.lit .bulb-glass { fill: #fff36a; }
.bulb.lit .bulb-base  { fill: #ffb020; }
.bulb.lit {
    filter:
        drop-shadow(0 0 6px #fff8c0)
        drop-shadow(0 0 14px #ffd24a)
        drop-shadow(0 0 28px rgba(255, 196, 40, .9));
    animation: bulb-glow 1.4s ease-in-out infinite;
}
@keyframes bulb-glow {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px #fff8c0) drop-shadow(0 0 14px #ffd24a) drop-shadow(0 0 28px rgba(255, 196, 40, .9)); }
    50%      { transform: scale(1.08); filter: drop-shadow(0 0 10px #fffce0) drop-shadow(0 0 22px #ffe066) drop-shadow(0 0 36px rgba(255, 210, 50, 1)); }
}

/* ── 主舞台 ───────────────────────────────── */
.stage {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 24px 0;
}
.lantern-wrap {
    flex: 0 0 32%;
    display: flex;
    justify-content: center;
}
.lantern {
    max-width: 100%;
    max-height: 480px;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .5));
}
.content {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.screen { width: 100%; max-width: 620px; text-align: center; }
.hidden { display: none !important; }

.lead {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 2;
    color: var(--ink);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
    margin-bottom: 36px;
}

/* ── 按鈕 ─────────────────────────────────── */
.btn {
    display: inline-block;
    text-decoration: none;
    min-width: 170px;
    padding: 13px 34px;
    font-family: var(--font);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .15em;
    color: var(--white);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .2s;
    box-shadow: 0 5px 16px rgba(0, 0, 0, .35);
}
a.btn,
a.btn:visited { color: var(--white); }
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-blue   { background: linear-gradient(180deg, var(--coral) 0%, var(--coral-dark) 100%); }
.btn-blue:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(201, 68, 40, .45); }
.btn-orange { background: linear-gradient(180deg, var(--orange) 0%, var(--orange-dark) 100%); }
.btn-orange:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(240, 162, 60, .55); }

.btn-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.btn-row.center { justify-content: center; margin-top: 22px; }

/* ── 答題畫面 ─────────────────────────────── */
.quiz-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    font-size: .95rem;
}
.quiz-progress { color: var(--ink-soft); font-weight: 700; letter-spacing: .1em; font-size: 1.2rem; }
.quiz-category {
    padding: 4px 14px;
    font-size: .85rem;
    color: var(--coral-dark);
    border: 1px solid rgba(201, 68, 40, .4);
    border-radius: var(--radius-pill);
}

.question-text {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.65;
    color: var(--ink);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
    width: 100%;
    max-width: 560px;
    margin: 0 auto 34px;
    min-height: 3.3em;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}
.option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 26px 12px 12px;
    font-family: var(--font);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    text-align: left;
    background: linear-gradient(180deg, #f3a24d 0%, var(--orange) 55%, var(--orange-dark) 100%);
    border: 2px solid rgba(255, 255, 255, .45);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .2s, border-color .2s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.option-btn:hover:not(:disabled) {
    transform: translateX(6px);
    background: linear-gradient(180deg, #f37755 0%, var(--coral) 55%, var(--coral-dark) 100%);
    box-shadow: 0 6px 18px rgba(201, 68, 40, .45);
}
.option-btn:disabled { cursor: default; }
.option-letter {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    color: var(--ink);
    background: var(--white);
    border-radius: 50%;
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .18);
}
.option-btn.picked-correct {
    background: linear-gradient(180deg, #4ed28a 0%, var(--green) 100%);
    border-color: rgba(255, 255, 255, .5);
}
.option-btn.picked-wrong {
    background: linear-gradient(180deg, #f37773 0%, var(--red) 100%);
    border-color: rgba(255, 255, 255, .5);
}
.option-btn.reveal-correct {
    background: linear-gradient(180deg, #4ed28a 0%, var(--green) 100%);
    border-color: rgba(255, 255, 255, .5);
    animation: pulse .9s ease-in-out 2;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
    50%      { box-shadow: 0 0 24px rgba(56, 193, 114, .8); }
}

/* ── 答題回饋 ─────────────────────────────── */
.feedback {
    width: 100%;
    max-width: 560px;
    margin: 28px auto 0;
}
.feedback .btn {
    display: block;
    width: 100%;
}
/* 隱藏時仍保留空間（覆蓋 .hidden 的 display:none），避免作答畫面上下跳動 */
.feedback.hidden {
    display: block !important;
    visibility: hidden;
}
.feedback-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: .1em;
    margin-bottom: 18px;
    min-height: 1.6em; /* 無文字時也保留一行高度 */
}
.feedback-text.correct { color: var(--green); }
.feedback-text.wrong   { color: var(--red); }

/* ── 大訊息畫面 ───────────────────────────── */
.big-message {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: .2em;
    color: var(--coral-dark);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 3px 10px rgba(201, 68, 40, .25);
    margin-bottom: 20px;
}
.sub-message { font-size: 1.5rem; color: black; }
.screen-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .25em;
    color: var(--ink);
    margin-bottom: 24px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

/* ── 面板（同意書／表格） ──────────────────── */
.panel {
    background: rgba(255, 248, 236, .88);
    border: 1px solid rgba(184, 122, 48, .22);
    border-radius: 18px;
    padding: 30px 34px;
    box-shadow: var(--shadow-lg);
    text-align: left;
    backdrop-filter: blur(4px);
}
.consent-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0 8px;
    font-size: 1.05rem;
    cursor: pointer;
}
.consent-line input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--orange); }
.consent-line a { color: var(--coral-dark); }

/* ── 表格 ─────────────────────────────────── */
.entry-form .form-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.entry-form label {
    flex: 0 0 190px;
    font-weight: 700;
    color: var(--ink);
}
.entry-form input,
.entry-form select {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 1rem;
    color: var(--ink);
    background: var(--white);
    border: 2px solid rgba(184, 122, 48, .25);
    border-radius: 10px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.entry-form input:focus,
.entry-form select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(240, 138, 42, .35);
}
.captcha-row {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}
.captcha-row img {
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(184, 122, 48, .35);
}
.captcha-row input { width: 120px; flex: 0 0 auto; }
.form-error {
    color: var(--red);
    font-weight: 700;
    text-align: center;
    margin: 4px 0 10px;
}

/* ── Modal ────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(90, 42, 18, .35);
    backdrop-filter: blur(3px);
}
.modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fffaf0 0%, #f8e6c8 100%);
    border: 1px solid rgba(184, 122, 48, .28);
    border-radius: 20px;
    padding: 30px 34px;
    box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }
.modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .2em;
    text-align: center;
    color: var(--coral-dark);
    margin-bottom: 18px;
}
.modal-body { line-height: 1.9; font-size: 1.02rem; }
.modal-body.scrollable {
    overflow-y: auto;
    padding-right: 10px;
}
.modal-body.scrollable::-webkit-scrollbar { width: 8px; }
.modal-body.scrollable::-webkit-scrollbar-thumb { background: #d4b07a; border-radius: 4px; }
.modal-body ul { padding-left: 1.4em; }
.modal-body li { margin-bottom: 8px; }
.rule-section { margin-bottom: 16px; }
.rule-section h4 {
    color: var(--coral-dark);
    font-size: 1.05rem;
    margin-bottom: 4px;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--ink);
    background: rgba(184, 122, 48, .18);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s;
}
.modal-close:hover { background: rgba(184, 122, 48, .35); }

/* ── 頁尾 ─────────────────────────────────── */
.site-footer {
    font-size: .95rem;
    color: black;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
	position:absolute;
	bottom:5px;
}

/* ── 章程獨立頁 ───────────────────────────── */
.header-spacer { display: none; }
.rules-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    width: 100%;
}
.rules-card {
    width: 100%;
    max-width: 860px;
    background: rgba(255, 248, 236, .9);
    border: 1px solid rgba(184, 122, 48, .22);
    border-radius: 18px;
    padding: 42px 52px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(4px);
    line-height: 2;
    font-size: 1.05rem;
}
.rules-title {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-align: center;
    color: var(--coral-dark);
    margin-bottom: 28px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}
.rules-card .rule-section {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(184, 122, 48, .28);
}
.rules-card .rule-section:last-child { border-bottom: none; }
.rules-card .rule-section h4 {
    display: inline-block;
    padding: 2px 14px;
    margin-bottom: 8px;
    font-size: 1.05rem;
    color: var(--coral-dark);
    border: 1px solid rgba(201, 68, 40, .4);
    border-radius: var(--radius-pill);
}
.rules-card ul { padding-left: 1.5em; }
.rules-card li { margin-bottom: 6px; }
.back-row { margin-top: 28px; text-align: center; }
.back-row .btn { text-decoration: none; }

/* ── RWD ──────────────────────────────────── */
@media (max-width: 900px) {
    .game-title { --title-track: .04em; font-size: 2.1rem; }
    .game-subtitle { font-size: 1rem; }
    .logo { width: 70%; }
    .bulb { width: 24px; height: 33px; }
    .stage { flex-direction: column; gap: 8px; }
    .lantern-wrap { flex: 0 0 auto; }
    .lantern { max-height: 170px; }
    .question-text { font-size: 1.3rem; min-height: 0; }
    .entry-form .form-row { flex-direction: column; align-items: stretch; gap: 6px; }
    .entry-form label { flex: none; }
    .btn { min-width: 140px; font-size: 1.05rem; }
    .btn-row { justify-content: center; }
}

@media (max-width: 520px) {
    .page { padding: 14px 14px 10px; }
    .site-header { display: flex; flex-wrap: wrap; gap: 10px; }
    .title-wrap { order: 3; flex-basis: 100%; pointer-events: auto; }
    .game-title { font-size: 1.6rem; }
    .header-right { margin-left: auto; }
    .lead { font-size: 1.15rem; }
    .big-message { font-size: 1.7rem; }
    .option-btn { font-size: 1rem; }
    .modal { padding: 24px 20px; }
    .rules-card { padding: 26px 20px; font-size: .98rem; }
    .rules-title { font-size: 1.25rem; }
    .header-spacer { display: none; }
}
