/* DBTS V0.558 — Masters Teachings: title tile, panel, Dragon Vault tab, preview popup. */

/* ── Title tile (sits under Capsule Shop; the menu moves up to make room) ── */
.hub-menu { top: calc(50% - 407px); }
.hub-menu > :nth-child(5) { animation-delay: .32s; }
/* V0.559: same gold design as the Capsule Shop tile (it carries .hub-tile-shop). */
.glyph-masters { --glyph: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><path fill='black' d='M32 4l5 17 17-5-11 14 15 10-18 1 2 18-10-14-10 14 2-18-18-1 15-10L10 16l17 5z'/></svg>"); }
.hub-masters-meta { position: absolute; right: 78px; top: 50%; translate: 0 -50%; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.hub-masters-meta { z-index: 2; }
.hub-masters-meta i { font: 700 12px/1 var(--f-ui); font-style: normal; letter-spacing: .22em; text-transform: uppercase; color: var(--text-mute); }
.hub-masters-meta b { font: italic 800 22px/1 var(--f-ui); letter-spacing: .04em; text-transform: uppercase; color: #ffe7a8; }
.hub-tile-masters.account-locked .hub-masters-meta { display: none; }
.hub-tile-masters.account-locked::before { top: 50%; translate: 0 -50%; right: 78px; }

/* ── Panel ── */
.masters-panel .hub-panel-head { grid-template-columns: 1fr auto auto; column-gap: 18px; }
.masters-panel .hub-panel-head .vault-zeni-chip { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.masters-panel .hub-back { grid-column: 3; }
.masters-body { gap: 16px; }
.masters-intro { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 14px 18px; background: rgba(var(--cyan-rgb), .07); box-shadow: inset 0 0 0 1px var(--line); clip-path: var(--chamfer-s); }
.masters-intro p { margin: 0; color: var(--text-dim); font: 600 18px/1.35 var(--f-ui); letter-spacing: .02em; }
.masters-intro p b { color: #fff; }
.masters-current { display: grid; gap: 4px; justify-items: end; text-align: right; }
.masters-current b { color: var(--gold); font: italic 800 26px/1 var(--f-ui); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.masters-groups { display: grid; gap: 20px; }
.masters-group { display: grid; gap: 12px; }
.masters-group .hub-section-label { margin: 0; font: italic 800 22px/1 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.masters-group .hub-section-label small { color: var(--text-mute); font: 700 14px/1 var(--f-num); letter-spacing: .08em; }
.masters-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-content: start; }

/* ── Master card ── */
.mt-card {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 6px;
  width: 100%; min-width: 0; min-height: 0; padding: 14px 8px 12px; margin: 0;
  border: 0; border-radius: 0; text-transform: none;
  background: linear-gradient(180deg, rgba(26, 42, 88, .7), rgba(8, 14, 34, .9));
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: var(--chamfer-s);
  color: var(--text); text-align: center; cursor: pointer;
  transition: transform .2s var(--ease-out), box-shadow .2s ease, filter .2s ease;
}
.mt-card:hover, .mt-card:focus-visible { transform: translateY(-4px); outline: none; filter: none; box-shadow: inset 0 0 0 2px var(--ma), 0 0 22px color-mix(in srgb, var(--ma) 45%, transparent); background: linear-gradient(180deg, rgba(36, 58, 116, .8), rgba(10, 18, 44, .92)); }
.mt-card.owned { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ma) 70%, transparent); }
.mt-card.current { box-shadow: inset 0 0 0 2px var(--gold), 0 0 18px rgba(var(--gold-rgb), .35); }
.mt-icon {
  position: relative; display: grid; place-items: center; flex: none;
  width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--mc, #fff) 0 9%, var(--mb) 10% 34%, var(--ma) 35% 66%, rgba(0, 0, 0, .35) 67%);
  background-size: cover; background-position: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .16), 0 6px 14px rgba(0, 0, 0, .4);
}
.mt-icon i { font: italic 900 38px/1 var(--f-ui); font-style: italic; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .55), 0 0 10px rgba(0, 0, 0, .6); }
.mt-icon.has-art i { display: none; }
.mt-name { max-width: 100%; font: italic 800 20px/1.05 var(--f-ui); letter-spacing: .02em; text-transform: uppercase; color: #fff; overflow-wrap: anywhere; }
.mt-move { max-width: 100%; color: var(--text-dim); font: 600 13px/1.2 var(--f-ui); letter-spacing: .03em; overflow-wrap: anywhere; }
.mt-tag { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; padding: 3px 9px; background: rgba(255, 255, 255, .08); color: var(--text-dim); font: 700 12px/1.2 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; }
.mt-card.owned .mt-tag { color: #9fe8ff; background: rgba(var(--cyan-rgb), .14); }
.mt-card.current .mt-tag { color: #2a1500; background: var(--gold); }

/* ── Dragon Vault tab ── */
.vault-masters-pane { gap: 14px; }
.vault-masters-grid { padding-bottom: 6px; }
.dragon-vault-panel .dragon-vault-tabs { grid-template-columns: 1fr 1fr 1.35fr 1.2fr 1fr; }

/* ── Preview popup ── */
.master-preview-overlay {
  position: fixed; inset: 0; z-index: 100260; display: grid; place-items: center; padding: 3vh 3vw;
  background: rgba(2, 4, 12, .82); backdrop-filter: blur(4px);
}
.master-preview-overlay[hidden] { display: none !important; }
.master-preview {
  position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  width: min(1040px, 94vw); max-height: 94vh;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 80px rgba(0, 0, 0, .6);
  clip-path: var(--chamfer-m);
  animation: fxSlideIn .3s var(--ease-out) both;
}
.master-preview::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 4px; z-index: 2; background: linear-gradient(90deg, var(--p1) 0 30%, var(--gold) 30% 36%, var(--p2) 36% 70%, transparent 95%); }
.master-preview-x { position: absolute; right: 14px; top: 16px; z-index: 3; width: 42px; min-height: 42px; padding: 0; border: 0; border-radius: 0; background: rgba(8, 14, 34, .8); box-shadow: inset 0 0 0 1px var(--line-2); color: #fff; font: 700 18px/1 var(--f-ui); clip-path: var(--chamfer-s); }
.master-preview-x:hover, .master-preview-x:focus-visible { background: rgba(var(--cyan-rgb), .35); outline: none; filter: none; }
.master-preview-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 8.2; max-height: 62vh; overflow: hidden; cursor: crosshair; touch-action: none;
  background:
    linear-gradient(rgba(150, 175, 230, .07) 1px, transparent 1px) 0 50% / 100% 50%,
    radial-gradient(120% 90% at 50% 40%, #0f1a36 0%, #070b18 70%);
}
.master-preview-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.master-preview-tag { position: absolute; padding: 4px 10px; background: rgba(4, 8, 20, .7); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-dim); font: 700 13px/1.3 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.master-preview-stage.is-demo .master-preview-tag { opacity: 1; }
.master-preview-tag kbd { display: inline-block; margin: 0 2px; padding: 0 6px; background: rgba(255, 255, 255, .12); color: #fff; font: inherit; }
.master-preview-tag.tag-ping { left: 4%; top: 6%; }
.master-preview-tag.tag-beam { left: 4%; bottom: 6%; }
.master-preview-try { position: absolute; right: 16px; bottom: 10px; color: rgba(233, 238, 251, .5); font: 600 13px/1 var(--f-ui); letter-spacing: .06em; pointer-events: none; }
.master-preview-info { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; padding: 16px 22px 18px; border-top: 1px solid var(--line); }
.master-preview-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.master-preview-id .mt-icon { width: 72px; height: 72px; }
.master-preview-id .mt-icon i { font-size: 32px; }
.master-preview-id h3 { margin: 4px 0 2px; color: #fff; font: italic 900 38px/.95 var(--f-ui); letter-spacing: .01em; text-transform: uppercase; }
.master-preview-id p { margin: 0; color: var(--text-dim); font: 600 17px/1.2 var(--f-ui); letter-spacing: .03em; }
.master-preview-buy { display: flex; align-items: center; gap: 16px; }
.master-preview-price { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font: 700 17px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.master-preview-price b { color: var(--gold); font: 700 22px/1 var(--f-num); }
.master-preview-buy .hub-btn { min-width: 250px; min-height: 54px; font-size: 20px; }
.master-preview-status { grid-column: 1 / -1; min-height: 20px; color: #9fe8ff; font: 700 15px/1.3 var(--f-ui); letter-spacing: .05em; }
.master-preview-status.error { color: #ff8d9c; }

@media (max-width: 760px) {
  .master-preview-info { grid-template-columns: 1fr; }
  .master-preview-buy { justify-content: space-between; }
  .master-preview-buy .hub-btn { min-width: 0; flex: 1; }
}
body.fx-lite .mt-card, body.fx-lite .master-preview { transition: none; animation: none; }


/* ── V0.559: Zeni lives in the top bar ── */
.hub-zeni-chip { box-shadow: inset 0 0 0 1px rgba(255, 197, 61, .45), inset 3px 0 0 #ffc53d; }
.hub-zeni-chip[hidden] { display: none !important; }
.hub-zeni-row { display: inline-flex; align-items: center; gap: 7px; }
.hub-zeni-row .zeni-coin { font-size: 18px; font-style: normal; }
.hub-zeni-chip b { color: #ffe7a8; }

/* ── V0.559: while a master's preview is open, every CSS animation behind
   it is paused (same idea as pack opening) so the effect runs smoothly. ── */
body.master-preview-open > :not(#masterPreviewOverlay),
body.master-preview-open > :not(#masterPreviewOverlay)::before,
body.master-preview-open > :not(#masterPreviewOverlay)::after,
body.master-preview-open > :not(#masterPreviewOverlay) *,
body.master-preview-open > :not(#masterPreviewOverlay) *::before,
body.master-preview-open > :not(#masterPreviewOverlay) *::after {
  animation-play-state: paused !important;
}
.master-preview-overlay { backdrop-filter: none; background: rgba(2, 4, 12, .9); }
.master-preview-try kbd { font: inherit; padding: 1px 5px; border-radius: 3px; background: rgba(255,255,255,.12); color: #fff; }


/* ── V0.560: top bar order + Players Online menu ── */
.hub-online-chip { cursor: pointer; width: auto; min-width: 0; margin: 0; appearance: none; -webkit-appearance: none; border: 0; border-radius: 0; color: #fff; text-align: left; text-transform: none; justify-items: start; }
.hub-online-chip:hover, .hub-online-chip:focus-visible { background: linear-gradient(180deg, rgba(45, 85, 150, .95), rgba(15, 30, 70, .95)); outline: none; filter: none; }
.online-overlay { position: fixed; inset: 0; z-index: 100240; display: grid; place-items: center; padding: 4vh 4vw; background: rgba(2, 4, 12, .82); }
.online-overlay[hidden] { display: none !important; }
.online-menu { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(720px, 94vw); max-height: min(760px, 90vh); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 80px rgba(0, 0, 0, .6); clip-path: var(--chamfer-m); animation: onlineMenuIn .28s var(--ease-out) both; }
.online-menu::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--orange) 0 26%, var(--gold) 26% 32%, var(--cyan) 32% 100%); }
@keyframes onlineMenuIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.online-menu-head { display: grid; grid-template-columns: 1fr auto auto; column-gap: 18px; align-items: center; padding: 26px 30px 20px; border-bottom: 1px solid var(--line); }
.online-menu-head .hub-kicker { grid-column: 1; grid-row: 1; }
.online-menu-head h2 { grid-column: 1; grid-row: 2; margin: 4px 0 0; font: italic 900 44px/1 var(--f-ui); letter-spacing: .02em; text-transform: uppercase; color: #fff; }
.online-menu-count { grid-column: 2; grid-row: 1 / span 2; display: grid; justify-items: center; gap: 3px; padding: 8px 18px; background: rgba(8, 10, 24, .72); box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--cyan); clip-path: var(--chamfer-s); }
.online-menu-count b { font: 700 26px/1 var(--f-num); color: #fff; }
.online-menu-count i { font: 700 11px/1 var(--f-ui); font-style: normal; letter-spacing: .24em; text-transform: uppercase; color: var(--text-mute); }
.online-menu-head .hub-back { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.online-menu-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; min-height: 120px; padding: 22px 30px; overflow-y: auto; color: var(--text-dim); font: 700 18px/1.2 var(--f-ui); letter-spacing: .03em; }
.dbts-online-person { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 16px; background: linear-gradient(180deg, rgba(26, 42, 88, .7), rgba(8, 14, 34, .9)); box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--cyan); clip-path: var(--chamfer-s); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbts-online-person::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #45e08a; box-shadow: 0 0 8px #45e08a; }
.dbts-online-person.guest { box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 #6d7791; color: var(--text-dim); }
.dbts-online-person.guest::before { background: #8a94ad; box-shadow: none; }
.online-menu-note { margin: 0; padding: 14px 30px 20px; border-top: 1px solid var(--line); color: var(--text-mute); font: 600 14px/1.4 var(--f-ui); letter-spacing: .03em; }
body.fx-lite .online-menu { animation: none; }
.hub-topbar-right .hub-chip { min-height: 56px; align-content: center; }

/* V0.561: every top-bar chip sizes to its content */
.hub-topbar-right .hub-chip { min-width: 0; white-space: nowrap; }

/* V0.564: real icons have transparent backgrounds; sit them on the master's colour */
.mt-icon.has-art { background-color: color-mix(in srgb, var(--ma) 38%, #0a1024); background-size: cover; background-position: center top; }
.mt-icon[data-master-icon="classic"].has-art { background-color: #aab4cc; }
.dragon-vault-panel .vault-pane-head .vault-leader-note b { margin-right: 0; }


/* ── V0.570: any name opens the player profile ── */
.player-profile-overlay { z-index: 100320; }
.player-name-link, .game-history-seat.player-profile-link, .game-chat-name.player-profile-link { cursor: pointer; }
.player-name-link:hover, .player-name-link:focus-visible { color: #fff; text-shadow: 0 0 8px currentColor; outline: none; }
.dbts-online-person.player-name-link:hover, .dbts-online-person.player-name-link:focus-visible { box-shadow: inset 0 0 0 1px var(--cyan), inset 3px 0 0 var(--cyan); text-shadow: none; }
.game-chat-name[data-chat-sender-key] { cursor: pointer; }
.player-profile-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.player-profile-actions[hidden] { display: none; }

/* V0.571: the preview stage is not clickable */
.master-preview-stage { cursor: default; }

/* Locked masters: greyed out, not clickable */
.mt-card.locked, .mt-card.locked:hover, .mt-card.locked:focus-visible { cursor: not-allowed; transform: none; opacity: .5; filter: grayscale(1); box-shadow: inset 0 0 0 1px var(--line); background: linear-gradient(180deg, rgba(26, 42, 88, .7), rgba(8, 14, 34, .9)); }
.mt-card.locked .mt-tag { color: var(--text-mute); background: rgba(255, 255, 255, .08); }
.mt-card .mt-tag { white-space: nowrap; letter-spacing: .05em; padding-left: 7px; padding-right: 7px; }
