/* Server-authoritative rewards and a continuous ticket animation. */
.fortune-panel {
  --fortune-ink: #285f56;
  --fortune-red: #a84630;
  --fortune-gold: #8b641f;
  --fortune-muted: #726652;
  grid-column: 1;
  grid-row: auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 12px;
  min-height: 312px;
  margin-top: 0;
  padding: 14px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--card-bg);
}
.fortune-heading { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 4px 0 0; }
.fortune-title-group { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fortune-heading h2 { margin: 0; writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap; font-size: var(--credits-heading-size); font-weight: 800; letter-spacing: .12em; line-height: 1.2; }
.fortune-rules-toggle { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 3px; border: 0; border-radius: 50%; background: transparent; color: #696052; cursor: pointer; }
.fortune-rules-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.fortune-rules-toggle .fortune-question-dot { fill: currentColor; stroke: none; }
.fortune-rules-toggle:hover, .fortune-rules-toggle[aria-expanded="true"] { color: var(--fortune-ink); background: #e2e9df; }
.fortune-rules-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--text); background: var(--card-bg); font: inherit; scrollbar-color: #a49a86 var(--card-bg); }
.fortune-rules-dialog::backdrop { background: rgb(33 38 30 / 40%); }
.fortune-rules-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.fortune-rules-heading h3 { margin: 0; font-size: var(--credits-heading-size); font-weight: 800; }
.fortune-rules-heading button { padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 3px; background: transparent; color: var(--fortune-ink); font: inherit; font-size: 12px; cursor: pointer; }
.fortune-rules-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.8; text-align: left; }
.fortune-rules-table th, .fortune-rules-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.fortune-rules-table th { font-weight: 500; white-space: nowrap; }
.fortune-rules-table thead { color: var(--fortune-muted); font-size: 12px; }
.fortune-rules-table td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fortune-rules-table span { display: block; }
.fortune-rules-note { margin: 14px 0 0; color: var(--fortune-muted); font-size: 12px; line-height: 1.8; }
.fortune-rules-note + .fortune-rules-note { margin-top: 6px; }
.fortune-content { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0; }
.fortune-stage { position: relative; display: block; flex: none; width: 250px; min-width: 250px; height: 312px; zoom: .82; margin: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fortune-stage > * { pointer-events: none; }
.fortune-stage:hover:enabled .fortune-orbit { border-color: #b8a47f; }
.fortune-stage:disabled { cursor: default; }
.fortune-stage[aria-busy="true"] { cursor: wait; }
.credits-page .fortune-stage:focus-visible { outline: none; }
.fortune-stage:focus-visible .fortune-orbit { outline: 2px solid var(--fortune-ink); outline-offset: 4px; }
.fortune-orbit { position: absolute; width: 218px; height: 218px; top: 62px; left: calc(50% - 109px); border: 1px solid #dfd4be; border-radius: 50%; }
.fortune-orbit::after { content: ''; position: absolute; inset: 9px; border: 1px solid #eae1d0; border-radius: 50%; }
.fortune-spark { position: absolute; z-index: 2; width: 19px; height: 19px; fill: var(--card-bg); stroke: var(--fortune-gold); stroke-width: 1.2; }
.fortune-spark-one { top: 81px; left: calc(50% - 99px); }
.fortune-spark-two { top: 220px; left: calc(50% + 95px); width: 13px; height: 13px; }
.fortune-ground { position: absolute; bottom: 16px; left: calc(50% - 71px); width: 142px; height: 16px; border-radius: 50%; background: #e9decb; }
.fortune-assembly { position: absolute; left: calc(50% - 56px); top: 100px; width: 112px; height: 200px; transform-origin: 50% 92%; }
.fortune-vessel-back { position: absolute; z-index: 0; bottom: 105px; left: 0; width: 112px; height: 27px; border-radius: 50%; background: #733422; border: 3px solid #bc684b; }
.fortune-sticks { position: absolute; z-index: 1; inset: 0; }
.fortune-sticks i { position: absolute; bottom: 38px; left: 49px; width: 13px; height: 142px; border: 1px solid #c8a45c; border-top: 9px solid #a84630; border-radius: 3px 3px 1px 1px; background: #ead2a0; transform: translateY(var(--lift)) rotate(var(--lean)); transform-origin: 50% 95%; }
.fortune-sticks i::after { content: ''; position: absolute; top: 10px; bottom: 0; left: 3px; width: 1px; background: #d1b47a; }
.fortune-chosen-stick { position: absolute; z-index: 2; bottom: 40px; left: 46px; width: 20px; height: 152px; perspective: 800px; transform-origin: 50% 50%; }
.fortune-ticket-turn { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.fortune-ticket-front, .fortune-ticket-back { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fortune-ticket-front { inset: 0; padding-top: 13px; border: 1px solid #b89a5e; border-top: 10px solid var(--fortune-red); border-radius: 3px 3px 1px 1px; background: #f5e5c1; text-align: center; }
.fortune-ticket-front span { display: inline-block; color: #654b2b; font-size: 13px; font-weight: 700; line-height: 1.4; letter-spacing: .14em; writing-mode: vertical-rl; }
.fortune-ticket-back { display: grid; place-items: center; top: 50%; left: 50%; width: 94px; height: 198px; border: 1px solid #b89a5e; border-radius: 3px; background: #f5e5c1; color: var(--outcome-color, var(--fortune-red)); transform: translate(-50%, -50%) rotateY(180deg); }
.fortune-ticket-back::before { content: ''; position: absolute; inset: 7px; border: 1px solid #d0b47b; }
.fortune-ticket-back strong { position: relative; font-size: 29px; font-weight: 800; line-height: 1.3; letter-spacing: .18em; writing-mode: vertical-rl; }
.fortune-panel:lang(en) .fortune-ticket-back strong { max-width: 7ch; font-size: 16px; letter-spacing: 0; text-align: center; writing-mode: horizontal-tb; overflow-wrap: anywhere; }
.fortune-vessel { position: absolute; z-index: 3; bottom: 11px; width: 112px; height: 111px; overflow: hidden; border-radius: 0 0 23px 23px / 0 0 12px 12px; background: #a84b33; }
.fortune-vessel::before { content: ''; position: absolute; inset: 0 auto 0 8px; width: 12px; background: #b75a3e; }
.fortune-vessel::after { content: ''; position: absolute; inset: 0 9px 0 auto; width: 7px; background: #923e2b; }
.fortune-vessel-rim { position: absolute; z-index: 1; top: 0; width: 100%; height: 15px; border-bottom: 2px solid #ce8662; border-radius: 0 0 50% 50%; background: #b85b3f; }
.fortune-vessel-line { position: absolute; z-index: 1; top: 22px; left: 0; width: 100%; height: 1px; background: #cc7e57; }
.fortune-vessel-seal { position: absolute; z-index: 2; top: 33px; left: 37px; display: grid; place-items: center; width: 38px; height: 47px; border: 1px solid #e5b987; color: #ffe6b9; font-size: 27px; line-height: 1; }
.fortune-vessel-foot { position: absolute; z-index: 1; bottom: 9px; left: 0; width: 100%; height: 2px; border-radius: 50%; background: #cf845e; }
.fortune-reading { flex: none; width: 100%; min-width: 0; text-align: center; }
.fortune-copy { margin-top: 0; }
.fortune-copy h3 { margin: 0 0 13px; color: #423a2c; font-size: clamp(20px, 2vw, 24px); font-weight: 700; line-height: 1.5; text-wrap: balance; }
.fortune-copy p { margin: 0; color: var(--fortune-muted); font-size: 13px; line-height: 1.85; }
.fortune-availability { min-height: 22px; margin: 0; color: var(--fortune-ink); font-size: 13px; line-height: 1.75; }
.fortune-error { margin: 0; color: #a13c2b; font-size: 13px; line-height: 1.8; }
#fortune-login { display: inline-block; color: var(--fortune-ink); font-size: 13px; }
.fortune-result-meta { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.fortune-result-meta strong { color: var(--outcome-color, var(--fortune-red)); font-size: 21px; font-weight: 800; line-height: 1.3; letter-spacing: .04em; }
.fortune-result h3 { font-size: 16px; margin-bottom: 9px; }
.fortune-result p { font-size: 13px; }
#fortune-result-note { max-width: 36ch; margin-inline: auto; text-wrap: pretty; }
.fortune-payment-dialog { width: min(420px, calc(100vw - 36px)); max-height: calc(100dvh - 40px); padding: 28px; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--text); background: var(--card-bg); font: inherit; }
.fortune-payment-dialog::backdrop { background: rgb(48 42 33 / 38%); }
.fortune-payment-dialog h3 { margin: 0 0 14px; font-size: var(--credits-heading-size); font-weight: 800; }
.fortune-payment-dialog p { margin: 0; color: var(--fortune-muted); font-size: 14px; line-height: 1.8; }
.fortune-payment-preference { display: flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--fortune-muted); font-size: 13px; cursor: pointer; }
.fortune-payment-preference input { width: 16px; height: 16px; margin: 0; accent-color: var(--fortune-ink); }
.fortune-payment-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.fortune-payment-actions button { min-height: 40px; padding: 9px 15px; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--fortune-ink); background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.fortune-payment-actions #fortune-payment-confirm { border-color: var(--fortune-ink); color: #fffaf0; background: var(--fortune-ink); }
.fortune-payment-actions #fortune-payment-confirm:hover { background: #1c4942; }
.fortune-panel[data-outcome="best"], .sign-in-result-dialog[data-outcome="best"] { --outcome-color: #a84630; }
.fortune-panel[data-outcome="good"], .sign-in-result-dialog[data-outcome="good"] { --outcome-color: #8b641f; }
.fortune-panel[data-outcome="steady"], .sign-in-result-dialog[data-outcome="steady"] { --outcome-color: #285f56; }
.fortune-panel[data-outcome="reset"], .sign-in-result-dialog[data-outcome="reset"] { --outcome-color: #626271; }
.fortune-panel[data-phase="revealed"] .fortune-result { animation: fortune-unfold 380ms cubic-bezier(.16, 1, .3, 1) both; }
@keyframes fortune-unfold { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0); } }
@keyframes fortune-ink { from { opacity: .35; } to { opacity: 1; } }
@media (max-width: 1050px) { .fortune-heading { gap: 8px; } }
@media (max-width: 1050px) { .fortune-panel { min-height: 312px; grid-column: auto; } }
@media (max-width: 560px) {
  .fortune-panel { padding: 14px; }
  .fortune-heading { gap: 6px; }
  .fortune-rules-dialog { padding: 20px; }
  .fortune-rules-table th, .fortune-rules-table td { padding-inline: 5px; }
  .fortune-content { padding: 0; }
  .fortune-orbit { width: 208px; height: 208px; left: calc(50% - 104px); }
  .fortune-copy h3 { font-size: 21px; }
  .fortune-copy p { max-width: none; }
  .fortune-result-meta { justify-content: center; }
  .fortune-result h3 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .fortune-panel[data-phase="revealed"] .fortune-result { animation: fortune-ink 160ms ease-out; }
}
