/* Final presentation layer: image-sliced silver frames and readable ink. */
html body #save-section :is(h2,h3,p,span,strong,small,b,label,li),
html body #save-section {
 color:#fff !important; -webkit-text-fill-color:#fff !important;
 -webkit-text-stroke:0 !important; text-shadow:none !important;
}
html body #roster-preview,
html body #save-section .king-tier-reward-banner {
 background:linear-gradient(155deg,#f0f8ff 0%,#c2d7e6 38%,#e6f1f8 49%,#b0c8dd 52%,#d7e6f2 100%) !important;
 border:12px solid transparent !important;
 border-image:url('../assets/premium-heart-frame.png') 180 / 12px / 0 round !important;
 background-clip:padding-box !important;
 box-shadow:inset 0 2px 0 #fff,inset 0 -3px 0 #7694b3,0 6px 12px #06142b60 !important;
}
html body #roster-preview,html body #roster-preview *,
html body #save-section .king-tier-reward-banner,
html body #save-section .king-tier-reward-banner * {
 color:#27366f !important; -webkit-text-fill-color:#27366f !important;
 -webkit-text-stroke:0 !important; text-shadow:none !important;
 opacity:1;
}
html body #roster-preview :is(small,p,span),
html body #save-section .king-tier-reward-banner b { font-size:1rem; line-height:1.5; overflow-wrap:anywhere; }
/* IDs outrank the older summon-panel border shorthand, which resets border-image. */
#summon-section :is(.contract-card,.rate-grid>div,.prime-odds,.result-card,.collection-summary,button),
#book-discovery {
 border:12px solid transparent !important;
 border-image: url('../assets/premium-heart-frame.png') 180 / 12px / 0 round !important;
 border-radius:0 !important;
 background-clip:padding-box !important;
}
html body #book-discovery,
html body #book-discovery :is(h2,p,span,strong,small) {
 color:#28356f !important;
 -webkit-text-fill-color:#28356f !important;
 -webkit-text-stroke:0 !important;
 text-shadow:none !important;
}
html body :is(.panel,.section-nav,.contract-card,.rate-grid>div,.prime-odds,.result-card,.collection-summary,.owned-character-card,.mini-card,.team-member,.team-slot,.quest-book,.quest-details,.selected-character-stats,.training-character-picker,.training-inventory,.training-card,.progression-card,.legendary-roster-tab,.all-characters-browser,.king-tier-leaderboard,.stat,.saga-books article,.preview-video-grid figure) {
 border:12px solid transparent !important;
 border-image: url('../assets/premium-heart-frame.png') 180 / 12px / 0 round !important;
 border-radius:8px !important;
 background:linear-gradient(145deg,#254878,#12294e 65%,#0c1e3b) !important;
 background-clip:padding-box !important;
 box-shadow:0 6px 14px #06142b70 !important;
 color:#fff !important;
}
html body :is(.panel,.section-nav,.saga-landing,.special-cast-cinema,.summon-reveal-cinema) :is(h2,h3,h4,p,span,strong,small,b,em,label,summary,a,button,li,div) {
 color:#fff !important; -webkit-text-fill-color:#fff !important;
 -webkit-text-stroke:0 !important; text-shadow:none !important;
}
html body :is(.panel,.special-cast-cinema) :is(h2,h3,h4) { background:none !important; font-weight:800; }
html body :is(button:not(#entry-splash-button),summary,.pill,.count-badge,.quest-details,.arena,.special-cast-caption,.selected-stats-grid>div) {
 background-color:#18365f !important;
 background-image:linear-gradient(160deg,#34598a,#172e55) !important;
 color:#fff !important; -webkit-text-fill-color:#fff !important; text-shadow:none !important;
}
html body button:not(#entry-splash-button),html body summary { min-height:44px; touch-action:manipulation; }
html body :is(.mini-card,.owned-character-card) :is(small,span,b,em) { font-size: .85rem; line-height:1.45; }
html body :is(input,select,textarea,select option) { color:#fff !important; -webkit-text-fill-color:#fff !important; background:#152f55 !important; }
html body input::placeholder { color:#cbdaf0; opacity:1; }
html body button:disabled { opacity:.7; }
html body :is(.enemy-fighter,#enemy-health,.enemy-health) { color:#ff8c96 !important; }
html,body { touch-action:pan-x pan-y pinch-zoom; }
.section-nav,.training-character-grid,.collection-grid,.leaderboard-name-list ol { overflow:auto; touch-action:pan-x pan-y pinch-zoom; -webkit-overflow-scrolling:touch; }
.section-nav a { flex-shrink:0; min-width:96px; }
@media(max-width:760px) {
 .panel { min-width:0 !important; width:100%; }
 .multi-grid,.owned-roster-grid { display:flex !important; overflow-x:auto; gap:12px; padding:8px; touch-action:pan-x pan-y pinch-zoom; }
 .multi-grid>* , .owned-roster-grid>* { flex:0 0 180px; }
 .quest-browser { grid-template-columns:1fr !important; }
 .quest-details { position:static !important; min-width:0; }
 .special-cast-cinema { max-width:100vw; }
 .special-cast-cinema :is(h2,h3,p,strong) { overflow-wrap:anywhere; max-width:100%; }
}
/* Persistent 30-day world tournament clock */
.tournament-countdown {
  position: fixed;
  z-index: 9000;
  inset: 0 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px 18px;
  color: #fff;
  background: linear-gradient(180deg, #253f7a 0%, #15184d 50%, #090f31 100%);
  border-bottom: 4px solid #9ee9ff;
  box-shadow: 0 5px 0 #071d46, 0 12px 28px rgba(0, 10, 42, .5), inset 0 2px 0 rgba(255,255,255,.65);
}
.tournament-countdown-copy { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 18px; text-align: center; }
.online-account-form { display:grid; gap:10px; margin:16px 0; padding:14px; border:1px solid rgba(92,205,255,.45); border-radius:14px; background:rgba(4,23,52,.55); }
.online-account-form label { display:grid; gap:5px; font-weight:800; }
.online-account-form input { width:100%; box-sizing:border-box; padding:11px; border:1px solid #5ccfff; border-radius:9px; color:#fff; background:#071a35; }
.tournament-countdown-label { font-size: .76rem; font-weight: 900; letter-spacing: .16em; color: #c8f2ff; }
#tournament-countdown-value { min-width: 290px; font-size: 1.42rem; letter-spacing: .08em; color: #fff; text-shadow: 0 2px 0 #07132e, 0 0 14px #53d8ff; }
#tournament-countdown-status { font-size: .78rem; font-weight: 800; color: #eafaff; }
.tournament-admin-open { padding: 7px 12px; color: #fff; background: #263e78; border: 2px solid #9ee9ff; border-radius: 10px; font-weight: 900; }
body:not(.entry-splash-active) { padding-top: 68px; }
body.entry-splash-active .tournament-countdown { display: none; }

.tournament-admin-dialog {
  max-width: 560px;
  color: #fff;
  background: linear-gradient(145deg, #233f7a, #0b153b);
  border: 4px solid #a7ecff;
  border-radius: 18px;
  box-shadow: 0 18px 70px rgba(0,0,0,.65), inset 0 2px 0 rgba(255,255,255,.45);
}
.tournament-admin-dialog::backdrop { background: rgba(2, 7, 28, .76); backdrop-filter: blur(7px); }
.tournament-admin-dialog h2, .tournament-admin-dialog p { color: #fff !important; }
.tournament-admin-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 12px; }

.tournament-finale {
  position: fixed;
  z-index: 12000;
  inset: 0;
  overflow: auto;
  padding: clamp(14px, 3vw, 42px);
  color: #fff;
  background: radial-gradient(circle at 50% 10%, rgba(55, 105, 210, .78), rgba(3, 8, 29, .97) 62%);
}
.tournament-finale[hidden] { display: none; }
.tournament-finale-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  background: linear-gradient(145deg, rgba(38, 70, 133, .96), rgba(8, 18, 52, .98));
  border: 5px ridge #bdefff;
  border-radius: 24px;
  box-shadow: 0 24px 90px #000, inset 0 3px 0 rgba(255,255,255,.5);
}
.tournament-finale-panel h2, .tournament-finale-panel h3, .tournament-finale-panel p, .tournament-finale-panel li { color: #fff !important; }
.tournament-finale-panel h2 { font-size: clamp(2rem, 6vw, 5rem); text-align: center; text-shadow: 0 4px 0 #0a1b49, 0 0 24px #68dcff; }
.tournament-finale-stage { display: grid; place-items: center; min-height: min(58vw, 600px); margin: 20px 0; overflow: hidden; border: 4px solid #9ee9ff; border-radius: 18px; background: #040917; box-shadow: inset 0 0 36px #1c66ae, 0 10px 24px rgba(0,0,0,.45); }
.tournament-finale-stage video { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #000; }
.tournament-cinematic-countdown {
  display: grid;
  place-items: center;
  min-height: min(58vw, 600px);
  width: 100%;
  color: #fff;
  font-size: clamp(4rem, 18vw, 13rem);
  font-weight: 1000;
  letter-spacing: .04em;
  text-align: center;
  background: radial-gradient(circle, #315da0 0%, #121c57 48%, #030718 100%);
  text-shadow: 0 7px 0 #081437, 0 0 18px #59dcff, 0 0 54px #8ceaff;
  animation: tournament-countdown-impact .9s ease both;
}
@keyframes tournament-countdown-impact {
  0% { opacity: 0; transform: scale(1.8); filter: blur(8px); }
  45% { opacity: 1; transform: scale(.94); filter: blur(0); }
  100% { opacity: 1; transform: scale(1); }
}
.tournament-finale-complete { font-size: clamp(1.5rem, 5vw, 4.5rem); text-align: center; color: #fff; text-shadow: 0 0 18px #48d8ff; }
.tournament-winner-columns { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(300px, 1.2fr); gap: 18px; }
.tournament-winner-columns > div { padding: 20px; background: linear-gradient(180deg, #315994, #162f68); border: 4px ridge #a8edff; border-radius: 15px; box-shadow: 0 8px 0 #071c49; }
.tournament-winner-columns > div > strong { display: block; font-size: 1.3rem; color: #fff; margin-bottom: 12px; }
#tournament-top-thousand { max-height: 420px; overflow: auto; columns: 2; }
body.tournament-finale-open { overflow: hidden; }
.tournament-winners.is-cinematic-overlay {
  position: fixed;
  z-index: 12010;
  inset: 8vh clamp(12px, 5vw, 80px);
  overflow: auto;
  padding: clamp(16px, 3vw, 34px);
  color: #fff;
  background: linear-gradient(145deg, rgba(35, 71, 138, .96), rgba(7, 16, 49, .97));
  border: 5px ridge #bdefff;
  border-radius: 22px;
  box-shadow: 0 22px 80px #000, inset 0 3px 0 rgba(255,255,255,.5);
  animation: tournament-winners-reveal .65s ease both;
}
@keyframes tournament-winners-reveal {
  from { opacity: 0; transform: scale(.88); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 720px) {
  body:not(.entry-splash-active) { padding-top: 90px; }
  .tournament-countdown { min-height: 86px; padding: 6px 10px; }
  .tournament-countdown-copy { gap: 3px 10px; }
  #tournament-countdown-value { min-width: 100%; font-size: 1.05rem; }
  #tournament-countdown-status { max-width: 78vw; font-size: .68rem; }
  .tournament-winner-columns { grid-template-columns: 1fr; }
  #tournament-top-thousand { columns: 1; }
}

/* Final phone-readable type layer. It intentionally outranks legacy ID rules. */
html body.game-active #main-content :is(h1,h2,h3,h4,p,span,strong,small,b,em,label,summary,a,button,li,div),
html body.game-active #main-content :is(#summon-heading,#puzzle-heading,#roster-heading,#team-heading,#campaign-heading,#battle-heading,#training-heading,#save-heading,#account-heading,#special-upgrade-heading) {
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  -webkit-text-stroke:0 transparent !important;
  text-shadow:0 2px 3px rgba(0,10,32,.92) !important;
  font-family:Arial,"Helvetica Neue",sans-serif !important;
  font-weight:700;
  opacity:1 !important;
}
html body.game-active #main-content :is(h1,h2,h3,h4,strong,b,button,summary) { font-weight:900 !important; }
html body.game-active #main-content :is(p,li,label,small,span) { line-height:1.45; }
html body.game-active #main-content :is(input,select,textarea,select option) {
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  -webkit-text-stroke:0 !important;
  font-family:Arial,"Helvetica Neue",sans-serif !important;
  font-weight:700 !important;
}
html body.game-active #main-content input::placeholder { color:#fff !important; opacity:.9 !important; }
.diamond-special-heading { display:flex; align-items:center; gap:14px; }
.special-diamond-indicator {
  flex:0 0 auto;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  font-size:clamp(2.2rem,8vw,4rem);
  line-height:1;
  filter:drop-shadow(0 2px 2px #06142b);
  transition:color .2s ease,filter .2s ease,transform .2s ease;
}
.diamond-special-upgrade.has-special-boost .special-diamond-indicator {
  color:#35c9ff !important;
  -webkit-text-fill-color:#35c9ff !important;
  filter:drop-shadow(0 0 7px #26bfff) drop-shadow(0 0 16px #68dcff);
  transform:scale(1.08);
}
@media(max-width:600px) {
  html body.game-active #main-content { font-size:17px; }
  html body.game-active #main-content :is(p,li,label,button,input,select,textarea) { font-size:1rem !important; }
  html body.game-active #main-content small { font-size:.9rem !important; }
  html body.game-active #main-content :is(h2,h3) { line-height:1.14 !important; }
  .diamond-special-heading { align-items:flex-start; }
}
html body .character-gallery-link{display:block;margin-top:14px;text-align:center;text-decoration:none}
html body .animation-preview-notice{display:flex;flex-direction:column;gap:5px;margin:14px 0 10px;padding:12px 14px;border:3px solid #5ee5ff;border-radius:13px;background:#092752!important;box-shadow:0 0 18px rgba(56,213,255,.75)}
html body .animation-preview-notice label{font-size:1rem;font-weight:950;color:#fff!important;-webkit-text-fill-color:#fff!important}
html body #all-character-search{width:100%;min-height:48px;padding:10px 13px;border:3px solid #fff;border-radius:11px;background:#102f5b!important;color:#fff!important;-webkit-text-fill-color:#fff!important;font-size:1rem;font-weight:800}
html body .animation-preview-notice strong{font-size:1.05rem;color:#fff!important;-webkit-text-fill-color:#fff!important}
html body .animation-preview-notice span{color:#fff!important;-webkit-text-fill-color:#fff!important;font-weight:800}
html body .all-character-gallery-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:18px 0 10px}
html body .all-character-gallery-heading span{font-size:.76rem;font-weight:900;letter-spacing:.06em}
html body .all-character-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:14px;margin:0 0 22px;max-height:72vh;overflow-y:auto;overscroll-behavior:contain;padding:14px;border:3px solid #fff;border-radius:15px;scrollbar-color:#55dfff #08234a;scrollbar-width:thin}
html body .all-character-gallery-card{appearance:none;display:flex;flex-direction:column;align-items:center;gap:7px;min-width:0;padding:12px 9px;border-radius:15px;background:rgba(8,34,74,.92)!important;color:#fff!important;-webkit-text-fill-color:#fff!important;text-align:center;cursor:pointer;overflow:hidden}
html body .all-character-gallery-card.is-obtained{border:3px solid #55dfff!important;box-shadow:0 0 9px #20cfff,0 0 24px rgba(36,202,255,.9),inset 0 0 16px rgba(75,215,255,.3)!important}
html body .all-character-gallery-card.is-not-obtained{border:3px solid #fff!important;box-shadow:0 0 9px #fff,0 0 22px rgba(255,255,255,.85),inset 0 0 15px rgba(255,255,255,.2)!important;opacity:1!important;filter:none!important}
html body .all-character-gallery-card.is-not-obtained:disabled{cursor:not-allowed;filter:grayscale(1)!important;background:linear-gradient(145deg,#f5f7fa,#aeb8c4)!important;color:#34404d!important;-webkit-text-fill-color:#34404d!important;box-shadow:0 0 8px rgba(255,255,255,.75)!important}
html body .all-character-gallery-card.in-team{border-color:#fff4a8!important;box-shadow:0 0 10px #fff,0 0 28px #35dfff,inset 0 0 20px rgba(255,238,112,.35)!important}
html body .all-character-gallery-portrait{width:100%;aspect-ratio:4/5;object-fit:cover;border-radius:10px;filter:none!important;opacity:1!important}
html body .all-character-gallery-card strong{font-size:1.06rem}
html body .all-character-gallery-card b{font-size:.72rem;letter-spacing:.06em;padding:4px 7px;border-radius:999px}
html body .all-character-gallery-card .gallery-preview-callout{display:block;width:100%;padding:7px 4px;border:2px solid #fff;border-radius:8px;background:#113f78!important;color:#fff!important;-webkit-text-fill-color:#fff!important;font-weight:950;font-size:.7rem}
html body .all-character-gallery-card .obtained-label{background:#1bbfe8!important;color:#001b36!important;-webkit-text-fill-color:#001b36!important}
html body .all-character-gallery-card .not-obtained-label{background:#fff!important;color:#09244c!important;-webkit-text-fill-color:#09244c!important}
html body .free-animation-preview-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
html body .free-animation-preview-actions button{flex:1 1 170px}
@media(max-width:600px){html body .all-character-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}html body .all-character-gallery-heading{align-items:flex-start;flex-direction:column}html body .all-character-gallery-card{padding:9px 6px}html body .section-nav .nav-tab{min-width:105px}}
