* { box-sizing: border-box; }
:root {
  --bg: #0f1020;
  --panel: rgba(255,255,255,.09);
  --panel-strong: rgba(255,255,255,.13);
  --line: rgba(255,255,255,.16);
  --text: #fffaf2;
  --muted: #d8cfee;
  --gold: #f2b84b;
  --gold-dark: #b96f19;
  --violet: #7c3aed;
  --ink: #17111f;
}
body { margin: 0; font-family: Arial, sans-serif; color: var(--text); background: radial-gradient(circle at top left, rgba(242,184,75,.18), transparent 28%), linear-gradient(145deg, #15122a 0%, #261646 48%, #0f1020 100%); min-height: 100vh; }
body.zen { background: #050505; }
.container { max-width: 1180px; margin: auto; padding: 28px 16px 42px; }
.center { text-align: center; }
.site-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), #fff1b8); color: var(--ink); box-shadow: 0 12px 26px rgba(0,0,0,.24); }
.top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: end; }
.support-link { display: inline-flex; align-items: center; justify-content: center; padding: 9px 13px; border-radius: 999px; background: rgba(37,211,102,.14); border: 1px solid rgba(37,211,102,.35); color: #bbf7d0; text-decoration: none; font-size: 14px; font-weight: 800; }
.support-link:hover { filter: brightness(1.08); }
.badge { display: inline-block; padding: 10px 18px; background: rgba(242,184,75,.12); border: 1px solid rgba(242,184,75,.3); border-radius: 999px; color: #fde8b3; }
h1 { font-size: clamp(34px, 6vw, 62px); margin: 18px 0 10px; letter-spacing: 0; }
h2, h3 { letter-spacing: 0; }
p { line-height: 1.5; }
.hero-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-stats span { padding: 9px 13px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 22px 60px rgba(0,0,0,.28); margin: 22px 0; backdrop-filter: blur(14px); }
.control-panel { background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.07)); }
.controls { display: grid; grid-template-columns: 1fr 220px auto; gap: 14px; align-items: end; }
label { color: var(--muted); font-size: 14px; font-weight: 700; }
input[type="text"], select { width: 100%; margin-top: 8px; padding: 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(4,6,18,.48); color: #fff; outline: none; }
input[type="text"]:focus, select:focus { border-color: rgba(242,184,75,.68); box-shadow: 0 0 0 3px rgba(242,184,75,.14); }
select option { color: #111827; }
.zen-toggle { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.15); background: rgba(4,6,18,.36); cursor: pointer; white-space: nowrap; }
.buttons { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
button { border: 0; border-radius: 12px; padding: 12px 18px; color: #fff; cursor: pointer; font-weight: 800; box-shadow: 0 12px 26px rgba(0,0,0,.22); transition: transform .16s, filter .16s; }
button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.btn-purple { background: linear-gradient(135deg, var(--violet), #5b21b6); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #1f1304; }
.btn-light { background: #e5e7eb; color: #111827; }
button:disabled { opacity: .45; cursor: not-allowed; }
.progress { height: 12px; background: rgba(0,0,0,.42); border-radius: 999px; margin-top: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); }
.bar { height: 100%; background: linear-gradient(90deg, var(--gold), #fff1a8); width: 0%; transition: .3s; }
.deck-board { display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); gap: 5px; padding: 22px 0 6px; }
.deck-card { width: 100%; aspect-ratio: 5 / 8; border-radius: 8px; border: 1px solid rgba(255,255,255,.28); background: #b9dceb; box-shadow: 0 8px 16px rgba(0,0,0,.24); transition: transform .16s, box-shadow .16s, border-color .16s; padding: 0; overflow: hidden; }
.deck-card:hover { transform: translateY(-6px) scale(1.2); z-index: 10; border-color: rgba(253,230,138,.85); box-shadow: 0 14px 24px rgba(0,0,0,.35); }
.deck-board.shuffling .deck-card { pointer-events: none; }
.deck-board.shuffling .deck-card:hover { transform: none; }
.card-back { width: 100%; height: 100%; position: relative; background: #b9dceb; background-image: radial-gradient(ellipse at center, rgba(255,255,255,.24) 0 23%, transparent 24%), repeating-linear-gradient(45deg, rgba(83,154,179,.2) 0 2px, transparent 2px 9px), repeating-linear-gradient(-45deg, rgba(83,154,179,.2) 0 2px, transparent 2px 9px); }
.card-back:before { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(255,255,255,.52); border-radius: 5px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.slots.aarudam-spread { display: block; }
.slots.star-spread { position: relative; display: block; min-height: 1040px; max-width: 760px; margin: 0 auto 34px; }
.slots.star-spread:before { content: '✡'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: rgba(74,118,191,.5); font-size: 660px; line-height: 1; z-index: 0; pointer-events: none; }
.slots.star-spread .slot { position: absolute; width: 174px; min-height: 224px; z-index: 1; padding: 12px; }
.slots.star-spread .slot:nth-child(1) { left: 0; top: 185px; }
.slots.star-spread .slot:nth-child(2) { right: 0; top: 185px; }
.slots.star-spread .slot:nth-child(3) { left: 50%; top: 790px; transform: translateX(-50%); }
.slots.star-spread .slot:nth-child(4) { left: 0; top: 505px; }
.slots.star-spread .slot:nth-child(5) { right: 0; top: 505px; }
.slots.star-spread .slot:nth-child(6) { left: 50%; top: 0; transform: translateX(-50%); }
.slots.star-spread .slot:nth-child(7) { left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; background: rgba(242,184,75,.16); border-color: rgba(242,184,75,.35); }
.slots.star-spread .slot-head { display: block; }
.slots.star-spread .status { margin-top: 6px; display: inline-block; }
.slots.star-spread .slot p { font-size: 12px; margin: 8px 0; }
.slots.star-spread .empty { min-height: 48px; padding: 10px 12px; }
.slots.star-spread .face { max-width: 118px; margin: 0 auto; border-width: 2px; border-radius: 10px; }
.slots.star-spread .face-img { aspect-ratio: 600 / 1000; }
.slots.star-spread .face-name { min-height: 38px; font-size: 13px; padding: 6px; }
.slot { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 16px; padding: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.slot-head { display: flex; justify-content: space-between; gap: 12px; }
.status { align-self: start; font-size: 11px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.1); color: var(--muted); }
.face { border-radius: 14px; overflow: hidden; background: #fef3c7; color: #111827; border: 4px solid rgba(146,64,14,.7); display: flex; flex-direction: column; }
.face > .card-back { height: auto; aspect-ratio: 5 / 8; }
.face-img { aspect-ratio: 600 / 1000; background: white; }
.face-img img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; }
.face.reversed .face-img img { transform: rotate(180deg); }
.face-img-fallback { height: 100%; display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; font-weight: 800; }
.face-name { display: flex; align-items: center; justify-content: center; min-height: 54px; text-align: center; padding: 10px; font-size: 20px; font-weight: 800; }
.empty { min-height: 54px; border: 1px dashed rgba(255,255,255,.24); border-radius: 14px; padding: 14px 18px; display: flex; align-items: center; justify-content: center; text-align: center; color: #ddd6fe; font-size: 14px; }
.reading-card { display: grid; grid-template-columns: 190px 1fr; gap: 22px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.15); border-radius: 18px; padding: 22px; margin: 16px 0; }
.gold-panel { background: #fef3c7; color: #111827; }
.prediction { background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 16px; }
.reading-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.overview-item { padding: 12px; border-radius: 12px; background: rgba(17,24,39,.08); border: 1px solid rgba(17,24,39,.12); }
.overview-item b { display: block; margin-bottom: 4px; color: #92400e; }
.reading-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.copy-note { color: #78350f; font-size: 13px; font-weight: 800; align-self: center; }
.history-panel { display: none; }
.history-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.history-head h2 { margin: 0; }
.history-head p { margin: 6px 0 0; color: var(--muted); }
.history-list { display: grid; gap: 10px; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.14); }
.history-item b { display: block; margin-bottom: 4px; color: #fde68a; }
.history-meta { color: #e9d5ff; font-size: 13px; }
.history-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.history-empty { color: var(--muted); margin: 0; }
.aarudam-panel { max-width: 760px; margin: 24px auto; text-align: center; background: linear-gradient(135deg, #fff7d6, #fde68a); color: #241407; border-color: rgba(146,64,14,.35); }
.aarudam-number { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: #92400e; color: #fff7d6; font-size: 28px; font-weight: 900; margin: 0 auto 12px; }
.aarudam-panel h2 { color: #78350f; }
.aarudam-action { margin: 14px auto 0; max-width: 560px; padding: 14px; border-radius: 12px; background: rgba(146,64,14,.12); border: 1px solid rgba(146,64,14,.18); }
.aarudam-song, .aarudam-meaning { white-space: pre-line; text-align: left; line-height: 1.75; }
.aarudam-source { display: inline-block; margin-top: 14px; color: #78350f; font-weight: 800; }
.aarudam-board { max-width: 880px; margin: 0 auto 24px; padding: 30px; background: rgba(255,247,214,.1); border: 1px solid rgba(242,184,75,.28); border-radius: 18px; box-shadow: 0 22px 60px rgba(0,0,0,.18); }
.aarudam-board h2 { margin-top: 0; text-align: center; }
.aarudam-board p { color: var(--muted); text-align: center; }
.aarudam-time-note { display: inline-block; width: 100%; margin: 0; color: #fde68a !important; font-weight: 800; }
.aarudam-grid { display: grid; grid-template-columns: repeat(8, minmax(66px, 1fr)); gap: 10px; margin: 20px auto 0; max-width: 760px; }
.aarudam-box { min-height: 66px; aspect-ratio: 1; padding: 0; border-radius: 12px; background: linear-gradient(135deg, #fff7d6, #f2b84b); color: #3b1f08; border: 1px solid rgba(146,64,14,.35); box-shadow: 0 10px 20px rgba(0,0,0,.22); font-size: 22px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.aarudam-box small { min-width: 28px; padding: 2px 6px; border-radius: 999px; background: rgba(59,31,8,.12); font-size: 12px; line-height: 1.2; opacity: .82; }
.aarudam-box:hover { filter: brightness(1.05); transform: translateY(-2px); }
.aarudam-box.selected { outline: 3px solid #fff7d6; box-shadow: 0 0 0 5px rgba(146,64,14,.72), 0 14px 28px rgba(0,0,0,.26); transform: translateY(-2px); }
.tips-panel { background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(251,191,36,.08)); }
.tips-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.tips-head h2 { margin: 0; }
.tips-head p { max-width: 560px; margin: 6px 0 0; color: #e9d5ff; }
.tips-mark { flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(251,191,36,.18); border: 1px solid rgba(251,191,36,.35); color: #fde68a; font-size: 28px; }
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tip-card { min-height: 132px; padding: 18px; border-radius: 18px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.tip-icon { width: 42px; height: 42px; margin-bottom: 12px; border-radius: 14px; display: grid; place-items: center; background: rgba(124,58,237,.28); border: 1px solid rgba(255,255,255,.14); font-size: 22px; }
.tip-card h3 { margin: 0 0 8px; font-size: 17px; }
.tip-card p { margin: 0; color: #e9d5ff; font-size: 14px; }
.site-footer { margin: 26px auto 0; max-width: 880px; text-align: center; color: #f8e7bd; }
.site-footer h2 { margin: 0 0 8px; color: #fde68a; font-size: 20px; }
.site-footer p { margin: 0; color: #e9d5ff; font-size: 14px; }
@media (max-width: 960px) { .deck-board { grid-template-columns: repeat(13, minmax(0, 1fr)); } .reading-overview { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .site-top, .controls, .slots, .reading-card, .tips, .reading-overview, .history-item { grid-template-columns: 1fr; } .slots.star-spread { display: grid; grid-template-columns: 1fr; min-height: 0; max-width: none; } .slots.star-spread:before { display: none; } .slots.star-spread .slot { position: static; width: auto; min-height: 0; transform: none !important; } .site-top { align-items: start; flex-direction: column; } .top-actions { justify-content: start; } .tips-head, .history-head { align-items: start; } .history-head { display: block; } .history-actions { justify-content: start; } .deck-board { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; } .aarudam-board { padding: 22px; } .aarudam-grid { grid-template-columns: repeat(4, minmax(64px, 1fr)); max-width: 340px; } }
@media (max-width: 560px) { .tips-head { display: block; } .tips-mark { margin-top: 14px; } }
@media (max-width: 420px) { .deck-board { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media print {
  @page { margin: 14mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff !important; color: #111827; font-family: Arial, sans-serif; }
  .site-top, header, .control-panel, #deckPanel, #slots, .tips-panel, .reading-actions, .history-panel, .support-link, .site-footer { display: none !important; }
  .container { max-width: none; padding: 0; }
  #reading { display: block !important; }
  .panel, .reading-card, .aarudam-panel { color: #111827 !important; background: #fff !important; border: 1px solid #d1d5db !important; box-shadow: none !important; break-inside: avoid; page-break-inside: avoid; }
  .gold-panel { border: 2px solid #92400e !important; padding: 18px !important; margin: 0 0 12px !important; }
  .aarudam-number { background: #fff !important; color: #92400e !important; border: 2px solid #92400e; }
  .aarudam-action { background: #f8fafc !important; border-color: #e5e7eb !important; }
  .print-title { display: block !important; margin-bottom: 8px; color: #92400e; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
  .reading-overview { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
  .overview-item { border: 1px solid #e5e7eb; background: #f9fafb; padding: 9px; font-size: 12px; }
  .reading-card { grid-template-columns: 110px 1fr; gap: 14px; padding: 12px; margin: 10px 0; border-radius: 10px; }
  .reading-card h2 { margin: 3px 0 8px; font-size: 20px; color: #111827; }
  .reading-card p { margin: 5px 0; font-size: 12px; line-height: 1.35; color: #111827 !important; }
  .reading-card p[style] { color: #92400e !important; font-weight: 700; }
  .face { border: 1px solid #92400e; border-radius: 8px; background: #fff; }
  .face-img { aspect-ratio: 600 / 1000; }
  .face-name { min-height: 32px; padding: 6px; font-size: 11px; }
  .prediction { color: #111827 !important; background: #f8fafc !important; border: 1px solid #e5e7eb !important; border-radius: 8px; padding: 9px; margin-top: 8px; }
  .prediction p { margin-bottom: 0; }
}
