/* Novicia login / character select — sky-blue & white theme (matches the status card, top-left HUD)
   Scoped to .nv-sky so it overrides /css/death-login.css without touching its logic. 2026-09-26 */
.nv-sky {
  --nv-ink: #10294f;
  --nv-ink-2: #3a5680;
  --nv-gold: #dfb758;
  --nv-gold-d: #734f0d;
  --nv-cream: #fff4cb;
  --nv-line: #b9d3ec;
  position: relative !important;
  color: var(--nv-ink) !important;
  font-family: 'Noto Sans Thai', Tahoma, Arial, sans-serif !important;
  background: radial-gradient(ellipse at 50% -10%, #ffffff 0%, #f0f7ff 38%, #e1eefb 72%, #cbe3f8 100%) !important;
  border: 3px solid var(--nv-gold) !important;
  border-radius: 16px !important;
  box-shadow: 0 0 0 2px var(--nv-gold-d), inset 0 0 0 2px var(--nv-cream), 0 18px 44px rgba(10, 30, 60, 0.45) !important;
  overflow: visible !important;
}
.nv-sky::before {
  content: "";
  position: absolute;
  left: 50%; top: -30px;
  width: 104px; height: 52px; margin-left: -52px;
  background: url('/ui/profile/top-ornament.png') center/contain no-repeat;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
  pointer-events: none;
  z-index: 3;
}
.nv-sky.nv-cs::before { display: none; }

/* titlebar used by login + create windows */
.nv-sky .titlebar {
  background: linear-gradient(180deg, #ffffff 0%, #eaf4fd 60%, #d6e9f9 100%) !important;
  color: var(--nv-ink) !important;
  border-bottom: 2px solid var(--nv-gold) !important;
  border-radius: 13px 13px 0 0 !important;
  box-shadow: inset 0 -1px 0 var(--nv-cream) !important;
  text-shadow: 0 1px 0 #fff !important;
  font-weight: 800 !important;
  padding: 12px 16px 10px !important;
}
.nv-sky .titlebar .tb-icon { color: #c9a24e !important; }
.nv-sky .titlebar .tb-tag,
.nv-sky .titlebar .tb-user {
  background: #fff !important; color: var(--nv-ink-2) !important;
  border: 1px solid var(--nv-line) !important; border-radius: 999px !important; padding: 2px 9px !important;
}
.nv-sky .titlebar .win-close-btn,
.nv-sky .nv-x {
  width: 28px; height: 28px; border-radius: 50% !important;
  border: 2px solid #c9a24e !important;
  background: radial-gradient(circle at 40% 35%, #ffffff, #d8ebfa) !important;
  color: #8c6a2a !important; font: 800 18px/1 Arial, sans-serif !important;
  display: grid; place-items: center; cursor: pointer; padding: 0 !important;
}
.nv-sky .death-win-body { background: transparent !important; color: var(--nv-ink) !important; }

/* tabs */
.nv-sky .death-tabs-bar {
  display: grid !important; grid-template-columns: 1fr 1fr; gap: 4px !important;
  margin: 12px 16px 0 !important; padding: 4px !important;
  background: #eef6fd !important; border: 1.5px solid var(--nv-line) !important; border-radius: 10px !important;
}
.nv-sky .death-tab {
  background: transparent !important; border: 1px solid transparent !important; border-radius: 7px !important;
  color: var(--nv-ink-2) !important; font-weight: 700 !important; padding: 7px 8px !important; box-shadow: none !important;
}
.nv-sky .death-tab:hover { background: #fff !important; border-color: var(--nv-line) !important; }
.nv-sky .death-tab.active {
  background: linear-gradient(180deg, #ffe39a, #e2ab33) !important; border-color: #9c7a36 !important;
  color: #2b1803 !important; box-shadow: 0 1px 4px rgba(156, 122, 54, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

/* fields */
.nv-sky .login-field label, .nv-sky label { color: var(--nv-ink-2) !important; font-weight: 700 !important; }
.nv-sky .death-input {
  background: #ffffff !important; color: var(--nv-ink) !important;
  border: 1.5px solid var(--nv-line) !important; border-radius: 8px !important;
  box-shadow: inset 0 1px 3px rgba(16, 41, 79, 0.08) !important;
}
.nv-sky .death-input::placeholder { color: #8aa2c0 !important; }
.nv-sky .death-input:focus { border-color: #c9a24e !important; box-shadow: 0 0 0 3px rgba(223, 183, 88, 0.25) !important; outline: none !important; }
.nv-sky .input-hint, .nv-sky .create-class-info p { color: #5d7598 !important; }
.nv-sky .create-class-info h3 { color: var(--nv-ink) !important; }
.nv-sky .create-portrait { background: #fff !important; border: 1.5px solid var(--nv-line) !important; border-radius: 10px !important; }
.nv-sky .death-divider { color: #7a93b5 !important; }
.nv-sky .death-divider:before, .nv-sky .death-divider:after { background: var(--nv-line) !important; }

/* buttons (existing .btn-revive-style + new .nv-btn) */
.nv-sky .btn-revive-style,
.nv-sky .nv-btn {
  background: linear-gradient(180deg, #ffffff, #e3effa) !important;
  color: var(--nv-ink) !important;
  border: 1.5px solid #9fc0e0 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 0 #fff !important;
  box-shadow: 0 2px 5px rgba(16, 41, 79, 0.15), inset 0 1px 0 #fff !important;
  cursor: pointer;
}
.nv-sky .btn-revive-style:hover:not(:disabled),
.nv-sky .nv-btn:hover:not(:disabled) { filter: brightness(1.04); border-color: #6fa0d2 !important; transform: translateY(-1px); }
.nv-sky .btn-revive-style.btn-primary-play,
.nv-sky .nv-btn.primary {
  background: linear-gradient(180deg, #ffe082 0%, #e6a820 48%, #b87808 52%, #db9a1b 100%) !important;
  border: 2px solid #fff0a8 !important;
  color: #2b1803 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 0 0 1px #9c7a36, 0 4px 12px rgba(184, 120, 8, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}
.nv-sky .btn-revive-style.btn-danger-del,
.nv-sky .nv-btn.danger { color: #a3262f !important; border-color: #e3b1b5 !important; background: linear-gradient(180deg, #fff, #fbeaec) !important; }
.nv-sky .btn-revive-style:disabled, .nv-sky .nv-btn:disabled {
  opacity: 0.55 !important; cursor: default !important; transform: none !important; filter: grayscale(0.3);
}
.nv-sky .google-btn { background: #fff !important; }

.nv-sky .login-bottom-bar {
  background: #eaf3fb !important; border-top: 1.5px solid var(--nv-line) !important;
  border-radius: 0 0 13px 13px !important; color: var(--nv-ink-2) !important;
}
.nv-sky .char-msg-box.error { background: #fff0f0 !important; color: #a3262f !important; border: 1px solid #f0c0c4 !important; }
.nv-sky .char-msg-box.info { background: #eef6ff !important; color: #1d4f8a !important; border: 1px solid var(--nv-line) !important; }

/* ================= Character select (RO-style layout) ================= */
.nv-cs {
  width: min(560px, calc(100vw - 20px)) !important;
  max-width: none !important;
  padding: 0 16px 14px !important;
  box-sizing: border-box !important;
}
.nv-cs .nv-crest {
  position: absolute; left: 50%; top: -30px; width: 104px; height: 52px; margin-left: -52px;
  object-fit: contain; pointer-events: none; z-index: 3; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}
.nv-cs .nv-corner { position: absolute; width: 30px; height: 30px; object-fit: contain; pointer-events: none; z-index: 2; }
.nv-cs .nv-corner.tl { left: -6px; top: -6px; }
.nv-cs .nv-corner.tr { right: -6px; top: -6px; transform: scaleX(-1); }
.nv-cs .nv-corner.bl { left: -6px; bottom: -6px; transform: scaleY(-1); }
.nv-cs .nv-corner.br { right: -6px; bottom: -6px; transform: scale(-1); }
.nv-cs .nv-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 -16px 12px; padding: 16px 16px 10px;
  border-bottom: 2px solid var(--nv-gold);
  border-radius: 13px 13px 0 0;
  background: linear-gradient(180deg, #ffffff 0%, #eaf4fd 60%, #d6e9f9 100%);
  box-shadow: inset 0 -1px 0 var(--nv-cream);
}
.nv-cs .nv-head h2 {
  margin: 0; font: 800 22px/1.1 'Cormorant Garamond', 'Noto Serif Thai', Georgia, serif;
  color: var(--nv-ink); letter-spacing: 0.03em; text-shadow: 0 1px 0 #fff;
}
.nv-cs .nv-head h2::before { content: "✦"; color: #c9a24e; margin-right: 8px; font-size: 0.8em; }
.nv-cs .nv-head-r { display: flex; align-items: center; gap: 6px; }
.nv-cs .nv-chip {
  padding: 2px 10px; border: 1.5px solid var(--nv-line); border-radius: 999px; background: #fff;
  color: var(--nv-ink-2); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.nv-cs .nv-chip b { color: var(--nv-ink); }

.nv-cs .nv-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nv-cs .nv-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 6px 9px; min-width: 0;
  border: 2px solid var(--nv-line); border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f7fe 100%);
  color: var(--nv-ink); cursor: pointer; font-family: inherit;
  box-shadow: 0 2px 6px rgba(16, 41, 79, 0.12);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.nv-cs .nv-slot:hover { transform: translateY(-2px); border-color: #8fb6de; }
.nv-cs .nv-slot.selected {
  border-color: #c9a24e;
  background: linear-gradient(180deg, #fffdf4 0%, #fff3d2 100%);
  box-shadow: 0 0 0 2px rgba(223, 183, 88, 0.45), 0 6px 14px rgba(156, 122, 54, 0.3);
}
.nv-cs .nv-slot-no {
  position: absolute; left: 6px; top: 5px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: #fff; color: var(--nv-ink-2); border: 1.5px solid var(--nv-line);
}
.nv-cs .nv-slot.selected .nv-slot-no { background: #ffe39a; border-color: #c9a24e; color: #2b1803; }
.nv-cs .nv-slot-tag {
  position: absolute; right: 6px; top: 6px; padding: 1px 6px; border-radius: 999px;
  background: #2f6fb4; color: #fff; font-size: 10px; font-weight: 700;
}
.nv-cs .nv-slot-stage {
  width: 100%; height: 118px; display: grid; place-items: end center; overflow: hidden;
  border-radius: 9px;
  background:
    radial-gradient(ellipse 42% 10% at 50% 92%, rgba(16, 41, 79, 0.28), transparent 70%),
    linear-gradient(180deg, #d9ecfb 0%, #eef7ff 62%, #cfe3f5 63%, #e6f1fb 100%);
  border: 1px solid #d4e5f5;
}
.nv-cs .nv-slot-stage img { height: 108px; width: auto; max-width: 100%; object-fit: contain; image-rendering: pixelated; margin-bottom: 4px; }
.nv-cs .nv-slot.empty .nv-slot-stage { place-items: center; background: repeating-linear-gradient(135deg, #f4f9ff 0 8px, #eaf3fc 8px 16px); border-style: dashed; border-color: #b9d3ec; }
.nv-cs .nv-plus { font-size: 34px; color: #8fb2d6; font-weight: 300; }
.nv-cs .nv-slot-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 800; }
.nv-cs .nv-slot-lv { font-size: 11px; font-weight: 700; color: #8c6a2a; }
.nv-cs .nv-slot.empty .nv-slot-name { color: var(--nv-ink-2); font-size: 13px; }
.nv-cs .nv-slot.empty .nv-slot-lv { color: #8aa2c0; }

.nv-cs .nv-info {
  margin-top: 12px; padding: 10px 12px;
  border: 2px solid #c9a24e; border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #eef5fc 100%);
  box-shadow: 0 0 0 1px #9c7a36, inset 0 0 0 1px #fff;
}
.nv-cs .nv-grid { display: grid; grid-template-columns: 74px 1fr 52px 1fr; gap: 5px 8px; margin: 0; align-items: center; }
.nv-cs .nv-grid dt {
  padding: 3px 6px; border-radius: 5px; background: #e4effa; border: 1px solid #c9dcef;
  color: #204374; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
}
.nv-cs .nv-grid dd { margin: 0; font-size: 13px; font-weight: 600; color: var(--nv-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-cs .nv-grid dd.wide { grid-column: 2 / -1; }
.nv-cs .nv-empty-note { margin: 6px 0; text-align: center; color: #5d7598; font-size: 13px; }
.nv-cs .char-msg-box { margin-top: 10px; }

.nv-cs .nv-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.nv-cs .nv-foot-l { display: flex; gap: 6px; }
.nv-cs .nv-btn { padding: 8px 12px; font-size: 13px; font-family: inherit; }
.nv-cs .nv-btn.primary { padding: 9px 22px; font-size: 15px; font-weight: 800 !important; letter-spacing: 0.03em; }

.nv-cs-caption {
  margin-top: 10px; text-align: right; width: min(560px, calc(100vw - 20px));
  font: italic 800 26px/1 'Cormorant Garamond', Georgia, serif; letter-spacing: 0.02em;
  color: #ffffff; text-shadow: 0 2px 0 #2c5a93, 0 0 12px rgba(20, 60, 120, 0.6), 0 4px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.nv-cs-caption span { font-size: 1.35em; color: #fff4cb; }
#death-login-mount, #death-char-select-overlay { flex-direction: column; align-items: center; }
#death-char-select-overlay .nv-cs-caption { display: none; }

@media (max-width: 520px) {
  .nv-cs { padding: 0 10px 10px !important; }
  .nv-cs .nv-head { margin: 0 -10px 10px; padding: 14px 10px 8px; }
  .nv-cs .nv-head h2 { font-size: 18px; }
  .nv-cs .nv-slots { gap: 6px; }
  .nv-cs .nv-slot-stage { height: 90px; }
  .nv-cs .nv-slot-stage img { height: 82px; }
  .nv-cs .nv-grid { grid-template-columns: 64px 1fr; }
  .nv-cs .nv-grid dd.wide { grid-column: 2; }
  .nv-cs .nv-btn { padding: 7px 9px; font-size: 12px; }
  .nv-cs .nv-btn.primary { padding: 8px 14px; font-size: 14px; }
  .nv-cs-caption { font-size: 20px; }
}
.nv-cs .nv-grid { border: 0 !important; padding: 0 !important; background: none !important; }
.nv-cs .nv-grid dt, .nv-cs .nv-grid dd { border-top: 0; }
.nv-sky .titlebar { height: auto !important; min-height: 42px !important; }
.nv-cs .nv-slot-stage canvas.nv-sprite { height: 96px; width: auto; max-width: 92%; object-fit: contain; image-rendering: pixelated; margin-bottom: 8px; filter: drop-shadow(0 2px 2px rgba(16,41,79,.25)); }
.nv-cs .nv-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 8px; }
.nv-cs .nv-stats span {
  display: flex; flex-direction: column; align-items: center; padding: 3px 0;
  border: 1px solid #c9dcef; border-radius: 6px; background: #fff;
}
.nv-cs .nv-stats small { font-size: 10px; font-weight: 800; color: #8c6a2a; letter-spacing: 0.04em; }
.nv-cs .nv-stats b { font-size: 13px; color: var(--nv-ink); }

/* ---------------- Phones ---------------- */
@media (max-width: 520px), (max-height: 520px) {
  #death-login-mount { padding: 38px 8px 10px !important; box-sizing: border-box; width: 100% !important; }
  .nv-sky.login-death-win { width: min(420px, calc(100vw - 16px)) !important; max-width: none !important; }
  .nv-sky .titlebar { padding: 10px 12px 8px !important; font-size: 13px !important; }
  .nv-sky .death-tabs-bar { margin: 10px 10px 0 !important; }
  .nv-sky .death-win-body { padding: 10px 12px !important; }
  .nv-sky .death-input { font-size: 16px !important; padding: 9px 10px !important; } /* 16px stops iOS zoom-on-focus */
  .nv-sky .btn-revive-style.full-btn { padding: 10px !important; font-size: 14px !important; }
  .nv-cs .nv-slot { padding: 5px 4px 6px; border-radius: 10px; }
  .nv-cs .nv-slot-stage { height: 84px; }
  .nv-cs .nv-slot-stage canvas.nv-sprite { height: 66px; margin-bottom: 6px; }
  .nv-cs .nv-slot-name { font-size: 12px; }
  .nv-cs .nv-slot-no { width: 17px; height: 17px; font-size: 10px; }
  .nv-cs .nv-slot-tag { font-size: 9px; padding: 0 5px; }
  .nv-cs .nv-info { padding: 8px; margin-top: 8px; }
  .nv-cs .nv-grid { grid-template-columns: 58px 1fr; gap: 4px 6px; }
  .nv-cs .nv-grid dd { font-size: 12px; }
  .nv-cs .nv-grid dt { font-size: 10px; padding: 2px 4px; }
  .nv-cs .nv-stats { grid-template-columns: repeat(6, 1fr); gap: 3px; }
  .nv-cs .nv-stats b { font-size: 12px; }
  .nv-cs .nv-foot { flex-wrap: wrap; margin-top: 8px; }
  .nv-cs .nv-foot-l { order: 2; width: 100%; }
  .nv-cs .nv-foot-l .nv-btn { flex: 1; }
  .nv-cs .nv-btn.primary { order: 1; width: 100%; padding: 11px !important; font-size: 16px !important; }
  .nv-cs-caption { display: none; }
}
#death-login-mount { max-width: 600px !important; }
#online-login { overflow-y: auto !important; -webkit-overflow-scrolling: touch; }

/* ---- Overflow fix: flex "center" hid the top/bottom of the window on short screens.
   Auto margins centre when there is room and collapse to 0 when the content is taller. ---- */
#online-login:not([hidden]) { justify-content: flex-start !important; }
#online-login:not([hidden]) > :first-child { margin-top: auto !important; }
#online-login:not([hidden]) > :last-child { margin-bottom: auto !important; }

/* ---- Short / landscape phones ---- */
@media (max-height: 560px) {
  #online-login .login-brand, #online-login .login-brand img { max-height: 64px !important; width: auto !important; }
  #online-login .login-brand { margin: 4px auto 0 !important; }
  #death-login-mount { padding: 30px 8px 8px !important; }
  .nv-sky::before, .nv-cs .nv-crest { top: -24px; width: 80px; height: 40px; margin-left: -40px; }
  .nv-sky .titlebar { min-height: 36px !important; padding: 8px 12px 6px !important; }
  .nv-sky .death-win-body { padding: 8px 12px !important; }
  .nv-sky .login-field { margin-bottom: 6px !important; }
  .nv-sky .death-input { padding: 7px 10px !important; }
  .nv-sky .btn-revive-style.full-btn { padding: 8px !important; }
  .nv-sky .death-divider { margin: 6px 0 !important; }
  .nv-sky .alt-login-actions { gap: 6px !important; }
}
@media (max-height: 560px) and (orientation: landscape) {
  /* login: two columns (account fields | guest + google) */
  .nv-sky.login-death-win { width: min(760px, calc(100vw - 16px)) !important; }
  .nv-sky #panel-login-view:not([style*="none"]) {
    display: grid !important; grid-template-columns: 1fr 1fr; column-gap: 16px; align-items: start;
  }
  .nv-sky #panel-login-view > * { grid-column: 1; }
  .nv-sky #panel-login-view > .death-divider { grid-column: 2; grid-row: 1; margin-top: 22px !important; }
  .nv-sky #panel-login-view > .alt-login-actions { grid-column: 2; grid-row: 2 / span 3; }
  .nv-sky #panel-reg-view:not([style*="none"]) {
    display: grid !important; grid-template-columns: 1fr 1fr; column-gap: 12px;
  }
  .nv-sky #panel-reg-view > :not(.login-field) { grid-column: 1 / -1; }

  /* character select: slots left, details right */
  .nv-cs {
    width: min(860px, calc(100vw - 16px)) !important;
    display: grid !important;
    grid-template-columns: 1.05fr 1fr;
    column-gap: 12px;
    align-items: start;
  }
  .nv-cs > .nv-head { grid-column: 1 / -1; margin: 0 -16px 8px !important; padding: 10px 16px 8px !important; }
  .nv-cs > .nv-head h2 { font-size: 18px; }
  .nv-cs > .nv-slots { grid-column: 1; }
  .nv-cs > .nv-info { grid-column: 2; grid-row: 2 / span 2; margin-top: 0 !important; padding: 7px 9px !important; }
  .nv-cs .nv-grid { gap: 3px 6px !important; }
  .nv-cs .nv-grid dd { font-size: 12px !important; }
  .nv-cs > .char-msg-box { grid-column: 1 / -1; }
  .nv-cs > .nv-foot { grid-column: 1; grid-row: 3; align-self: end; }
  .nv-cs .nv-slot-stage { height: 72px; }
  .nv-cs .nv-slot-stage canvas.nv-sprite { height: 58px; margin-bottom: 5px; }
  .nv-cs .nv-grid { grid-template-columns: 58px 1fr; }
  .nv-cs .nv-grid dd.wide { grid-column: 2; }
  .nv-cs .nv-stats { grid-template-columns: repeat(6, 1fr); }
  .nv-cs .nv-foot { flex-wrap: nowrap; margin-top: 8px; }
  .nv-cs .nv-foot-l { order: 0; width: auto; }
  .nv-cs .nv-btn.primary { order: 1; width: auto; padding: 9px 26px !important; }
  .nv-cs-caption { display: none; }
}

@media (max-height: 440px) and (orientation: landscape) {
  html body #online-login .login-brand, html body #online-login .login-brand img { display: none !important; }
  #death-login-mount { padding-top: 28px !important; }
}

.nv-cs .nv-btn { white-space: nowrap; }

/* Create-character dialog: live Novice sprite (character_selection.js mountCharSprites) */
.create-portrait.has-sprite { width: 96px; height: 112px; display: flex; align-items: flex-end; justify-content: center; }
.create-portrait.has-sprite canvas.nv-sprite { height: 96px; width: auto; max-width: 92%; image-rendering: pixelated; margin-bottom: 6px; filter: drop-shadow(0 2px 2px rgba(16,41,79,.25)); }
