/* 遊戲入口與求神問卜共用；沿用既有色彩與角色。 */
body.hub-page, body.oracle-page { overflow: auto; min-height: 100%; height: auto; }
a { color: inherit; }
.hub-shell, .oracle-shell { width: min(100% - 32px, 920px); margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom)); }
.hub-brand, .oracle-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hub-brand { font-size: 13px; color: var(--ink-2); margin-bottom: 24px; }
.hub-brand strong { font-family: var(--font-title); color: var(--ink); font-size: 17px; }
.hub-hero { position: relative; border-radius: 32px; background: #f9eee7 url('../assets/bg_temple_mobile.webp') center 44% / cover; min-height: 260px; padding: 34px; overflow: hidden; box-shadow: var(--shadow-md); }
.hub-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #fff6edf5 0%, #fff6edc7 46%, #fff6ed20 100%); }
.hub-hero-copy { position: relative; z-index: 2; max-width: 70%; }
.hub-hero h1 { font-family: var(--font-title); font-size: clamp(28px, 5vw, 42px); line-height: 1.4; margin: 10px 0; letter-spacing: .04em; }
.hub-hero p { color: var(--ink-2); font-size: 14px; line-height: 1.9; margin: 0; }
.hub-hero .hero-image { position: absolute; right: 20px; bottom: -12px; height: 95%; width: auto; filter: drop-shadow(0 10px 12px #63434828); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #963e4d; background: #fff8f3d9; padding: 5px 10px; border-radius: 999px; }
.hub-section-title { font-family: var(--font-title); font-size: 21px; margin: 28px 0 14px; }
.game-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.game-card { border-radius: 26px; padding: 24px; background: #fffaf5e8; box-shadow: var(--shadow-md); border: 1px solid #fff; display: flex; flex-direction: column; align-items: flex-start; }
.game-card.oracle-card { background: linear-gradient(145deg, #fff9e9, #f9e6d9); }
.card-art { height: 108px; align-self: stretch; display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 18px; border-radius: 18px; background: #eee7f5; }
.card-art img { width: 82px; height: 92px; object-fit: contain; filter: drop-shadow(0 5px 6px #63434825); }
.mini-grid { display: grid; grid-template-columns: repeat(3, 25px); gap: 4px; transform: rotate(-8deg); margin-right: 18px; }
.mini-grid i { width: 25px; height: 25px; border-radius: 5px; background: #d2b9e8; }
.mini-grid i:nth-child(2n) { background: #d4eadf; }
.oracle-card .card-art { background: #f3e5c9; gap: 10px; }
.number-demo { display: grid; place-items: center; width: 49px; height: 57px; border-radius: 13px; background: #fffaf2; font-size: 30px; font-weight: 700; color: #9e4d31; box-shadow: 0 4px 0 #d5b994; transform: rotate(-7deg); }
.number-demo:last-child { transform: rotate(7deg); }
.game-card h3 { font-family: var(--font-title); font-size: 27px; margin: 9px 0; }
.game-card p { font-size: 13px; line-height: 1.8; color: var(--ink-2); margin: 0 0 18px; }
.game-card .btn { display: block; width: 100%; text-align: center; text-decoration: none; margin-top: auto; }
.game-card .card-caption { font-size: 11px; margin: 10px 0 0; width: 100%; text-align: center; }
.hub-footer { text-align: center; color: var(--ink-2); font-size: 11px; line-height: 1.8; margin: 22px 0 0; }
.oracle-shell { max-width: 560px; }
.oracle-header a { text-decoration: none; font-size: 13px; padding: 10px 0; }
.oracle-header h1 { font-size: 21px; font-family: var(--font-title); margin: 0; }
.oracle-header button { min-height: 44px; border: 0; background: transparent; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.oracle-intro { display: flex; align-items: center; gap: 14px; padding: 22px 4px 18px; }
.oracle-intro img { width: 76px; height: 82px; object-fit: contain; filter: drop-shadow(0 5px 5px #63434822); }
.oracle-intro h2 { font-family: var(--font-title); margin: 8px 0; font-size: 25px; }
.oracle-intro p { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.8; }
.oracle-progress { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin: 0 0 8px; }
.oracle-progress-track { height: 6px; background: #d4c7d0; border-radius: 10px; overflow: hidden; }
.oracle-progress-track i { display: block; height: 100%; background: var(--red); transition: width .3s; }
.oracle-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 22px 0; }
.oracle-levels button { border: 1px solid #ead7d2; border-radius: 14px; background: #fff9f3; min-height: 62px; font-size: 21px; font-weight: 700; }
.oracle-levels button small { display: block; font-size: 10px; margin-top: 4px; font-weight: 500; }
.oracle-levels button.done { background: #fff0b9; }
.oracle-levels button.next { background: var(--red); color: white; border-color: var(--red); }
.oracle-levels button:disabled { opacity: .5; cursor: default; }
.oracle-note { background: #fffaf1c9; border: 1px solid #fff; border-radius: 18px; padding: 16px; font-size: 12px; line-height: 1.9; color: var(--ink-2); margin-bottom: 20px; }
.oracle-note strong { color: var(--ink); display: block; font-size: 14px; margin-bottom: 4px; }
.deity-road { margin-top: 24px; }
.deity-road summary { font-size: 13px; cursor: pointer; padding: 10px 0; }
.deity-road ol { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deity-road li { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; background: #fff7f0b0; font-size: 12px; }
.deity-road img { width: 30px; height: 35px; object-fit: contain; }
.deity-road small { display: block; color: var(--ink-2); font-size: 10px; }
.oracle-game-top { display: flex; justify-content: space-between; align-items: center; margin: 17px 0; gap: 8px; }
.oracle-game-top button { min-height: 44px; }
.oracle-game-top div { text-align: center; font-size: 13px; }
.oracle-game-top strong { display: block; font-family: var(--font-title); font-size: 18px; margin-bottom: 4px; }
.oracle-game-top time { font-variant-numeric: tabular-nums; font-size: 18px; min-width: 48px; text-align: right; }
.oracle-status { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); padding: 10px 2px; }
.oracle-board { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(var(--columns,4), 1fr); gap: 8px; padding: 12px; border: 1px solid #fff; border-radius: 25px; background: #eadad1; box-shadow: var(--shadow-md); }
.number-cell { aspect-ratio: 1; border: 2px solid transparent; border-radius: 15px; background: #fff9ef; box-shadow: 0 4px 0 #d5bfb4; font-size: clamp(22px, calc(100vw / var(--columns,4) * .33), 40px); font-weight: 700; color: #634138; touch-action: manipulation; transition: transform .15s, background .15s; }
.number-cell:active { transform: scale(.94); }
.number-cell.selected { background: #ffe0af; border-color: #a85532; transform: translateY(-3px); }
.number-cell.hint { background: #dbf3de; border-color: #4c8555; }
.number-cell:disabled { visibility: hidden; }
.oracle-board.matching .number-cell { pointer-events: none; }
.number-cell.matching-cell { position: relative; z-index: 2; background: #fff0bd; border-color: #e6b653; animation: match-away .54s cubic-bezier(.2,.7,.25,1) both; }
.match-effects { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.match-effects svg { position: absolute; inset: 0; overflow: visible; }
.match-effects line { stroke: #eeb850; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 5px #fff4b0); stroke-dasharray: var(--line-length); stroke-dashoffset: var(--line-length); animation: match-connect .52s ease-out both; }
.match-equation { position: absolute; padding: 5px 10px; white-space: nowrap; border-radius: 999px; background: #fff5d8; border: 1px solid #e0ab4d; color: #925328; box-shadow: 0 4px 12px #80542e20; font-size: 16px; font-weight: 700; animation: match-equation .54s ease-out both; }
.match-spark { position: absolute; width: 7px; height: 7px; border-radius: 2px; background: #f2be54; box-shadow: 0 0 5px #fff6cd; animation: match-spark .54s ease-out both; }
@keyframes match-away { 0% { transform: scale(1); opacity: 1; } 24% { transform: scale(1.12); opacity: 1; box-shadow: 0 0 0 7px #fff0b550, 0 0 20px #efc35980; } 56% { transform: scale(.94); opacity: 1; } 100% { transform: scale(.1); opacity: 0; } }
@keyframes match-connect { 0% { stroke-dashoffset: var(--line-length); opacity: 0; } 26% { stroke-dashoffset: 0; opacity: 1; } 62% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes match-equation { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.75); } 30% { opacity: 1; transform: translate(-50%,-68%) scale(1.05); } 66% { opacity: 1; transform: translate(-50%,-82%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-110%) scale(.9); } }
@keyframes match-spark { 0%, 20% { opacity: 0; transform: translate(-50%,-50%) scale(.3); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) rotate(90deg) scale(.3); } }
.oracle-message { min-height: 57px; margin: 14px 0 10px; padding: 11px 13px; border-radius: 14px; background: #fffaf0c9; color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.oracle-message.dead { background: #ffe0df; color: #8a293c; }
.oracle-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.oracle-tools button { min-height: 55px; padding: 10px 7px; border: 1px solid #e1c9c4; border-radius: 14px; background: #fff9f3; font-size: 14px; font-weight: 700; }
.oracle-tools button:disabled { opacity: .45; cursor: default; }
.oracle-fine { font-size: 11px; line-height: 1.8; color: var(--ink-2); text-align: center; margin: 16px 0; }
.oracle-dialog { border: 1px solid #e4cabe; background: #fff8ee; color: var(--ink); border-radius: 26px; padding: 25px; width: min(90vw, 420px); max-height: 88dvh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.oracle-dialog::backdrop { background: #38273680; backdrop-filter: blur(5px); }
.oracle-dialog h2 { font-family: var(--font-title); font-size: 25px; margin: 12px 0; }
.oracle-dialog p, .oracle-dialog li { font-size: 13px; line-height: 1.9; color: var(--ink-2); }
.oracle-dialog ul { padding-left: 19px; }
.oracle-dialog .dialog-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.oracle-dialog .btn { text-decoration: none; text-align: center; }
.poem-paper { text-align: center; border: 1px solid #dab578; background: #fff4d9; border-radius: 17px; padding: 21px 10px; margin: 18px 0; }
.poem-paper .poem-lines { font-family: var(--font-title); font-size: 19px; line-height: 2.1; letter-spacing: .12em; color: #75412c; }
.poem-paper img { width: 96px; height: 100px; object-fit: contain; }
.storage-warning { font-size: 12px; color: #8a293c; background: #ffe0df; padding: 10px; border-radius: 12px; }
.score-profile { padding: 15px; margin: 0 0 20px; border: 1px solid #fff; background: #fff9f2bf; border-radius: 20px; }
.score-profile-name { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.score-profile-name strong { font-size: 15px; overflow-wrap: anywhere; }
.score-profile-name small { display: block; font-size: 10px; color: var(--ink-2); margin-top: 4px; }
.score-profile-name > button { flex-shrink: 0; min-height: 44px; }
.score-account-actions { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.score-account-actions .btn-google { flex: 1; width: auto; font-size: 12px; padding: 8px; }
.score-account-actions > .link { flex-shrink: 0; min-height: 44px; font-size: 11px; }
.oracle-secondary-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.oracle-secondary-actions button { padding: 12px 8px; font-size: 13px; }
#ranking-title { font-family: var(--font-title); font-size: 19px; margin: 0; white-space: nowrap; }
#score-screen .oracle-game-top { gap: 7px; }
#score-screen .btn { padding: 10px; font-size: 12px; }
.ranking-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.ranking-row { display: grid; grid-template-columns: 33px minmax(0,1fr) auto; gap: 10px; align-items: center; border: 1px solid #fff; background: #fffaf3d9; padding: 15px 12px; border-radius: 18px; box-shadow: var(--shadow-md); }
.ranking-row.me { border-color: var(--gold); background: #fff1c9; }
.ranking-place { font-family: var(--font-title); font-size: 24px; color: var(--ink-2); text-align: center; }
.ranking-row:nth-child(-n+3) .ranking-place { color: #b87626; }
.ranking-name { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.ranking-name small, .ranking-score small { display: block; margin-top: 5px; font-size: 10px; font-weight: 400; color: var(--ink-2); }
.ranking-score { text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#score-name-form label { display: block; font-size: 12px; margin: 18px 0 8px; }
#score-name-form input { width: 100%; padding: 13px; border: 2px solid #e8cbbd; border-radius: 14px; color: var(--ink); background: #fff; font-family: inherit; font-size: 17px; }
#score-name-form .btn { width: 100%; }
@media (max-width: 600px) {
  .hub-shell { max-width: 460px; }
  .hub-brand { margin-bottom: 16px; }
  .hub-hero { min-height: 222px; padding: 24px 20px; }
  .hub-hero-copy { max-width: 75%; }
  .hub-hero p { font-size: 12px; }
  .hub-hero .hero-image { right: -10px; height: 80%; opacity: .8; }
  .game-cards { grid-template-columns: 1fr; gap: 14px; }
  .game-card { display: grid; grid-template-columns: 78px 1fr; gap: 0 15px; padding: 18px; align-items: start; }
  .card-art { grid-row: 1 / 4; height: 110px; margin: 0; flex-direction: column; gap: 4px; }
  .card-art img { width: 65px; height: 75px; }
  .mini-grid { display: none; }
  .game-card h3 { font-size: 23px; margin: 6px 0; }
  .game-card p { font-size: 12px; margin: 0 0 13px; }
  .game-card .btn, .game-card .card-caption { grid-column: 1 / -1; }
  .game-card .btn { font-size: 14px; padding: 12px; }
  .game-card .tag { justify-self: start; font-size: 10px; padding: 4px 8px; }
  .oracle-card .card-art { flex-direction: row; gap: 3px; }
  .oracle-card .card-art > span:not(.number-demo) { display: none; }
  .number-demo { width: 29px; height: 39px; font-size: 23px; border-radius: 8px; }
}
@media (max-height: 650px) {
  .oracle-shell { padding-top: 10px; }
  .oracle-game-top { margin: 7px 0; }
  .oracle-game-top strong { font-size: 16px; }
  .oracle-board { max-width: 330px; width: 100%; margin-inline: auto; gap: 6px; padding: 10px; }
  .oracle-message { min-height: 46px; margin: 10px 0; padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) { .oracle-page *, .hub-page * { transition: none !important; animation: none !important; } }

.oracle-tier { background:#fff8f0b0; border:1px solid #fff; padding:14px; border-radius:20px; margin:18px 0; }
.oracle-tier h3 { display:flex; align-items:center; gap:10px; font-family:var(--font-title); font-size:19px; margin:0; }
.oracle-tier img { object-fit:contain; }
.oracle-tier p { font-size:11px; color:var(--ink-2); margin:7px 0; }
.oracle-tier .oracle-levels { gap:7px; margin:12px 0 0; }
.oracle-tier button { min-height:58px; }
.poem-collection { display:grid; gap:8px; }
.poem-collection-card { padding:14px; border:1px solid #e2c48b; border-radius:12px; background:#fff0c3; text-align:left; font:inherit; font-size:12px; min-height:48px; }
.poem-collection-card:disabled { opacity:.55; background:#f0e5df; }
@media(max-width:360px) { .oracle-board { gap:5px; padding:8px; } .number-cell { border-radius:10px; } .oracle-tier { padding:10px; } .oracle-tier .oracle-levels { gap:5px; } }
@media(max-width:360px) { .oracle-shell { width:calc(100% - 16px); } .oracle-board { gap:4px; padding:8px; } }

.oracle-utilities { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:8px 0 0; }
.oracle-utilities .ranking-entry { min-height:44px; font-size:14px; padding:10px 18px; background:#fff0c7; border:1px solid #e3bf6e; color:#785327; }
