/* Savage Soul — The Cards. Same house: navy starfield, gold art-deco frame, Cinzel / Cinzel Decorative / Bebas / Montserrat, phi spacing. */
@font-face { font-family: "Cinzel"; src: url("fonts/Cinzel.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "CinzelDeco"; src: url("fonts/CinzelDecorative-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bebas"; src: url("fonts/BebasNeue-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Mont"; src: url("fonts/Montserrat-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --navy: #060c1e; --navy-2: #0b1430; --ink: #e8ecf5; --muted: #9aa5c4;
  --gold: #d8b45a; --gold-deep: #8d6b22; --gold-light: #f6e3a1;
  --gold-grad: linear-gradient(135deg, #f6e3a1 0%, #d8b45a 22%, #8d6b22 48%, #e9cf7a 70%, #a98433 100%);
  --silver-grad: linear-gradient(180deg, #ffffff 0%, #d9dde8 35%, #8f97ad 55%, #e6e9f2 72%, #aab1c6 100%);
  --s1: 5px; --s2: 8px; --s3: 13px; --s4: 21px; --s5: 34px; --s6: 55px; --s7: 89px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--navy); color: var(--ink); font-family: "Mont", system-ui, sans-serif; }
body { background: radial-gradient(ellipse at 50% 0%, #152048 0%, var(--navy-2) 38%, var(--navy) 100%) fixed; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: calc(env(safe-area-inset-top) + var(--s4)) var(--s3) calc(env(safe-area-inset-bottom) + var(--s5)); overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.shell { position: relative; z-index: 1; width: 100%; max-width: 480px; }

/* gold frame */
.frame { position: relative; border: 1.5px solid transparent; border-image: var(--gold-grad) 1; box-shadow: 0 0 0 1px rgba(216,180,90,.12), 0 0 40px rgba(0,0,0,.6) inset, 0 0 34px rgba(216,180,90,.08); background: linear-gradient(180deg, rgba(14,22,52,.92), rgba(6,12,30,.96)); }
.frame::before { content: ""; position: absolute; inset: 5px; pointer-events: none; border: 1px solid transparent; border-image: var(--gold-grad) 1; opacity: .55; }
.frame::after { content: ""; position: absolute; inset: 11px; pointer-events: none;
  background: linear-gradient(var(--gold), var(--gold)) 0 0 / 14px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) 0 0 / 1px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 14px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) 100% 0 / 1px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 100% / 14px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) 0 100% / 1px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 100% / 14px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) 100% 100% / 1px 14px no-repeat; }

/* type */
.name { margin: 0; font-family: "CinzelDeco"; font-weight: 700; font-size: 34px; letter-spacing: .06em; line-height: 1.05; background: var(--silver-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(216,180,90,.55)) drop-shadow(0 0 10px rgba(0,0,0,.6)); }
.name.small { font-size: 24px; }
.epithet { font-family: "Cinzel"; font-weight: 700; font-size: 11px; letter-spacing: .34em; padding-left: .34em; color: var(--gold); }
.meta { font-family: "Cinzel"; font-weight: 600; font-size: 10px; letter-spacing: .2em; color: var(--muted); margin-top: var(--s2); }
.sig { font-family: "Cinzel"; font-weight: 700; font-size: 12px; letter-spacing: .34em; padding-left: .34em; color: var(--gold); }
.ig { font-family: "Cinzel"; font-weight: 600; font-size: 11px; letter-spacing: .14em; color: var(--muted); border-bottom: 1px solid rgba(216,180,90,.4); padding-bottom: 1px; }
.ig:hover, .ig:active { color: var(--gold); }

/* home */
.home-hdr { text-align: center; margin-bottom: var(--s4); }
.wordmark { width: 72%; max-width: 340px; display: block; margin: 0 auto var(--s2); }
.subline { font-family: "Cinzel"; font-weight: 600; font-size: 11px; letter-spacing: .32em; color: var(--muted); }
.subline .dot { color: var(--gold); }
.decks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-bottom: var(--s3); }
.deck-tab { font-family: "Cinzel"; font-weight: 700; font-size: 11px; letter-spacing: .26em; padding: var(--s3) 0; color: var(--muted); border: 1px solid rgba(216,180,90,.3); transition: color .25s, border-color .25s, box-shadow .25s; }
.deck-tab.on { color: var(--gold); border-color: rgba(216,180,90,.75); box-shadow: 0 0 14px rgba(216,180,90,.18); }
.deck-note { text-align: center; font-size: 12.5px; color: var(--muted); margin: 0 0 var(--s4); line-height: 1.5; }
.months { margin: 0 0 var(--s3); }
.months-lab { font-family: "Cinzel"; font-weight: 700; font-size: 10px; letter-spacing: .3em; color: var(--gold); text-align: center; margin-bottom: var(--s2); }
.month-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s1); }
.month-strip button { font-family: "Bebas"; font-size: 13px; letter-spacing: .14em; color: var(--muted); padding: 7px 0 5px; border: 1px solid rgba(216,180,90,.28); transition: color .2s, border-color .2s; }
.month-strip button:active, .month-strip button.on { color: var(--gold); border-color: rgba(216,180,90,.75); }
.gain { text-align: left; width: 100%; display: flex; flex-direction: column; gap: var(--s2); }
.gain .intro { margin: 0 0 var(--s1); font-size: 14px; line-height: 1.6; color: var(--ink); }
.gain .way { padding: var(--s3); border: 1px solid rgba(216,180,90,.28); background: rgba(10,18,44,.55); display: grid; grid-template-columns: 22px 1fr; gap: var(--s3); align-items: start; }
.gain .way .num { font-family: "Cinzel"; font-weight: 700; font-size: 12px; color: var(--gold); margin-top: 2px; }
.gain .way .lab { display: block; font-family: "Bebas"; font-size: 13px; letter-spacing: .16em; color: var(--gold); margin-bottom: 4px; }
.gain .way .txt { font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.tile { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s2) 0 var(--s3); border: 1px solid rgba(216,180,90,.22); background: rgba(10,18,44,.5); transition: border-color .25s, transform .2s; }
.tile:active { transform: scale(.97); border-color: rgba(216,180,90,.7); }
.tile img { width: 78%; aspect-ratio: 1; display: block; filter: drop-shadow(0 0 8px rgba(150,170,230,.3)); }
.tile .t-name { font-family: "Cinzel"; font-weight: 700; font-size: 11px; letter-spacing: .16em; color: var(--ink); }
.tile .t-sub { font-family: "Cinzel"; font-size: 9px; letter-spacing: .14em; color: var(--muted); }
.home-foot { display: flex; justify-content: center; align-items: baseline; gap: var(--s4); margin-top: var(--s5); }

/* card view */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s3); }
.tb-btn { font-family: "Cinzel"; font-weight: 700; font-size: 11px; letter-spacing: .22em; color: var(--muted); padding: var(--s2) var(--s3); border: 1px solid rgba(216,180,90,.3); }
.tb-btn.gold { color: var(--gold); border-color: rgba(216,180,90,.7); }
.flip { position: relative; perspective: 1600px; }
.face { padding: var(--s4) var(--s4) var(--s4); display: flex; flex-direction: column; align-items: center; text-align: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .9s cubic-bezier(.3,.9,.3,1); transform-style: preserve-3d; }
.face.back { position: absolute; inset: 0; transform: rotateY(180deg); overflow: hidden; }
.flip.turned .front { transform: rotateY(-180deg); }
.flip.turned .back { transform: rotateY(0); position: relative; }
.flip.turned .front { position: absolute; inset: 0; overflow: hidden; }
.wm { width: 46%; max-width: 220px; margin: var(--s1) 0 var(--s3); }
.medal { width: 72%; max-width: 300px; aspect-ratio: 1; display: block; margin-bottom: var(--s3); filter: drop-shadow(0 0 18px rgba(150,170,230,.35)); }
.medal.small { width: 38%; max-width: 150px; }
.keys { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; margin: var(--s3) 0 var(--s3); }
.keys span { font-family: "Bebas"; font-size: 13px; letter-spacing: .16em; color: var(--gold); padding: 4px 10px 3px; border: 1px solid rgba(216,180,90,.4); }
.about { font-size: 14.5px; line-height: 1.6; color: var(--ink); margin: var(--s2) 0 0; white-space: pre-line; text-align: left; }
.bodyline { margin-top: var(--s3); padding: var(--s3); border: 1px solid rgba(216,180,90,.28); background: rgba(10,18,44,.55); font-size: 13px; line-height: 1.5; color: var(--ink); text-align: left; width: 100%; }
.bodyline b { font-family: "Bebas"; font-weight: 400; font-size: 13px; letter-spacing: .16em; color: var(--gold); margin-right: 8px; }
.owner { display: flex; flex-direction: column; gap: var(--s1); width: 100%; margin-top: var(--s4); }
.owner-lab { font-family: "Cinzel"; font-weight: 700; font-size: 10px; letter-spacing: .3em; color: var(--gold); }
.owner input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(216,180,90,.6); color: var(--ink); font-family: "CinzelDeco"; font-size: 20px; letter-spacing: .08em; text-align: center; padding: var(--s2) 0; outline: none; }
.owner input::placeholder { color: rgba(154,165,196,.45); font-family: "Cinzel"; font-size: 14px; letter-spacing: .2em; }
.turn { font-family: "Cinzel"; font-weight: 700; font-size: 11.5px; letter-spacing: .26em; color: var(--gold); padding: var(--s3) var(--s4); border: 1px solid rgba(216,180,90,.7); margin-top: var(--s4); width: 100%; display: block; text-align: center; animation: glow 3.4s ease-in-out infinite; }
.turn.solid { background: var(--gold-grad); color: var(--navy); animation: none; border-color: transparent; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 rgba(216,180,90,0); } 50% { box-shadow: 0 0 18px rgba(216,180,90,.35); } }
.cfoot { display: flex; justify-content: center; align-items: baseline; gap: var(--s4); margin-top: var(--s4); width: 100%; }
.for { font-family: "Cinzel"; font-weight: 700; font-size: 12px; letter-spacing: .3em; padding-left: .3em; color: var(--ink); margin: var(--s2) 0 var(--s3); }
.reading { text-align: left; width: 100%; display: flex; flex-direction: column; gap: var(--s2); }
.reading p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); }
.reading .blk { padding: var(--s3); border: 1px solid rgba(216,180,90,.28); background: rgba(10,18,44,.55); }
.reading .blk-lab { font-family: "Bebas"; font-size: 13px; letter-spacing: .16em; color: var(--gold); margin-bottom: 4px; }
.reading .blk p { font-size: 13.5px; line-height: 1.5; }
.reading ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s2); }
.reading li { padding: var(--s3); border: 1px solid rgba(216,180,90,.28); background: rgba(10,18,44,.55); font-size: 13.5px; line-height: 1.5; }
.reading li::before { content: "\2726"; color: var(--gold); margin-right: 8px; font-size: 11px; }

/* gate */
.locked-note { font-family: "Cinzel"; font-weight: 700; font-size: 10.5px; letter-spacing: .26em; color: var(--gold); }
.grid.locked { grid-template-columns: 1fr; justify-items: center; }
.grid.locked .tile { width: 60%; max-width: 240px; }
.gate-box .medal.small { margin-bottom: var(--s2); }
.gate-box .name.small { margin-bottom: var(--s1); }
.gate { position: fixed; inset: 0; z-index: 20; background: rgba(4,8,20,.82); display: grid; place-items: center; padding: var(--s4); }
.gate-box { width: 100%; max-width: 400px; padding: var(--s5) var(--s4) var(--s4); text-align: center; display: flex; flex-direction: column; align-items: center; }
.gate-box p { font-size: 14px; line-height: 1.6; color: var(--ink); margin: var(--s3) 0 var(--s2); }
.gate-box strong { color: var(--gold); font-weight: 600; }
.gate-box .turn { margin-top: var(--s3); }
.gate-close { position: absolute; top: 10px; right: 12px; color: var(--muted); font-size: 14px; width: 32px; height: 32px; display: grid; place-items: center; }

@media (prefers-reduced-motion: reduce) { .face { transition: none; } .turn { animation: none; } }

/* ---------- tablet tier: iPad, iPad Air, iPad Pro 11/13 ---------- */
@media (min-width: 768px) {
  body { padding-top: calc(env(safe-area-inset-top) + var(--s5)); }
  .shell { max-width: 640px; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
  .tile .t-name { font-size: 12.5px; } .tile .t-sub { font-size: 10px; }
  .deck-tab { font-size: 12.5px; padding: var(--s4) 0; }
  .deck-note { font-size: 14.5px; }
  .subline { font-size: 12.5px; }
  .face { padding: var(--s5) var(--s6) var(--s5); }
  .medal { max-width: 340px; } .medal.small { max-width: 180px; }
  .name { font-size: 42px; } .name.small { font-size: 30px; }
  .epithet { font-size: 12.5px; } .meta { font-size: 11.5px; }
  .keys span { font-size: 15px; padding: 5px 13px 4px; }
  .about, .reading p { font-size: 16.5px; }
  .bodyline, .reading li, .reading .blk p, .gain .way .txt { font-size: 15px; }
  .bodyline b, .reading .blk-lab, .reading li::before, .gain .way .lab { font-size: 15px; }
  .gain .intro { font-size: 16.5px; }
  .month-strip { grid-template-columns: repeat(12, 1fr); } .month-strip button { font-size: 14px; }
  .owner input { font-size: 24px; }
  .turn { font-size: 12.5px; }
  .tb-btn { font-size: 12px; padding: var(--s3) var(--s4); }
  .for { font-size: 13.5px; }
  .gate-box { max-width: 480px; } .gate-box p { font-size: 16px; }
}
@media (min-width: 1000px) {
  .shell { max-width: 760px; }
  .medal { max-width: 380px; }
  .name { font-size: 48px; } .name.small { font-size: 34px; }
  .about, .reading p { font-size: 18px; }
  .bodyline, .reading li, .reading .blk p, .gain .way .txt { font-size: 16px; }
  .gain .intro { font-size: 18px; }
}

/* unsigned nudge: gold glow on the signature line until a name is typed */
.owner.unsigned input { border-bottom-color: var(--gold); animation: sigGlow 2.6s ease-in-out infinite; }
.owner.unsigned input::placeholder { color: rgba(216,180,90,.75); }
@keyframes sigGlow { 0%,100% { box-shadow: 0 1px 0 0 rgba(216,180,90,.25), 0 6px 18px -6px rgba(216,180,90,.25); } 50% { box-shadow: 0 1px 0 0 rgba(246,227,161,.9), 0 8px 22px -4px rgba(216,180,90,.65); } }
@media (prefers-reduced-motion: reduce) { .owner.unsigned input { animation: none; box-shadow: 0 1px 0 0 rgba(246,227,161,.8); } }
