/* ==========================================================================
   Novicia Online - Death Window Pattern Styling
   Applied to Login Screen & 3-Character Selection / Creation System
   Matches in-game #death-window & #revive-button
   ========================================================================== */

/* Fullscreen Background & Mount Wrapper */
.death-mount-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 12px;
  box-sizing: border-box;
}

/* Base Death Window Frame (.window.death style) */
.death-win {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(29, 39, 53, 0.97), rgba(18, 28, 40, 0.95));
  border: 1px solid #748495;
  border-radius: 5px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(10, 16, 24, 0.9);
  color: #e2eaf4;
  font-family: 'Noto Sans Thai', Tahoma, Arial, sans-serif;
  overflow: hidden;
  animation: death-in 0.3s ease-out;
}

@keyframes death-in {
  0% { opacity: 0; transform: translateY(-8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Titlebar */
.death-win .titlebar {
  height: 32px;
  padding: 0 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #536779 0%, #354b60 100%);
  border-bottom: 1px solid #76889b;
  color: #f2f6fb;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.death-win .titlebar .tb-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.death-win .titlebar .tb-icon {
  color: #ffd975;
  font-size: 13px;
}

.death-win .titlebar .tb-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.death-win .titlebar .tb-user {
  font-size: 11px;
  color: #b9d0e8;
  font-weight: 500;
}

.death-win .titlebar .tb-user b {
  color: #ffffff;
}

.death-win .titlebar .tb-tag {
  font-size: 10px;
  color: #9bb2c9;
  font-weight: normal;
}

.death-win .titlebar .win-close-btn {
  background: none;
  border: none;
  color: #dbe6f2;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}

.death-win .titlebar .win-close-btn:hover {
  color: #ffffff;
}

/* Window Body */
.death-win-body {
  padding: 14px 16px;
  box-sizing: border-box;
}

/* Revive Button Style (#revive-button) */
.btn-revive-style {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #e1e6ea 100%);
  border: 1px solid #a1adb8;
  border-radius: 2px;
  color: #34435a;
  font-family: 'Noto Sans Thai', Tahoma, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 1px #ffffff, 0 1px 2px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  user-select: none;
}

.btn-revive-style:hover {
  background: linear-gradient(180deg, #ffffff 0%, #d5e4f7 100%);
  border-color: #7f9abc;
  color: #1f3352;
  box-shadow: inset 0 1px #ffffff, 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-revive-style:active {
  background: linear-gradient(180deg, #d5e4f7 0%, #c4daf2 100%);
  transform: translateY(1px);
}

.btn-revive-style:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-revive-style.full-btn {
  width: 100%;
  padding: 10px;
  font-size: 14px;
}

/* Primary Play Button */
.btn-revive-style.btn-primary-play {
  background: linear-gradient(180deg, #ffffff 0%, #d8e9ff 100%);
  border: 1px solid #5b87b5;
  color: #153963;
  box-shadow: inset 0 1px #ffffff, 0 2px 4px rgba(0, 0, 0, 0.25);
}

.btn-revive-style.btn-primary-play:hover {
  background: linear-gradient(180deg, #ffffff 0%, #c3ddff 100%);
  border-color: #3b6c9e;
  color: #0d2847;
}

/* Danger Delete Button */
.btn-revive-style.btn-danger-del {
  background: linear-gradient(180deg, #ffffff 0%, #fae2e0 100%);
  border: 1px solid #c98884;
  color: #8c2620;
  font-size: 11px;
  padding: 4px 8px;
}

.btn-revive-style.btn-danger-del:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f7cfcd 100%);
  border-color: #b84f49;
}

/* Input Fields */
.death-input {
  box-sizing: border-box;
  width: 100%;
  background: #ffffff;
  border: 1px solid #8ca2b9;
  border-radius: 2px;
  color: #1a2a3a;
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: 'Noto Sans Thai', Tahoma, Arial, sans-serif;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.death-input:focus {
  border-color: #4979ab;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 2px rgba(73, 121, 171, 0.3);
}

.input-hint {
  font-size: 11px;
  color: #8fa6bf;
  margin: 4px 0 12px;
}

/* ==========================================================================
   LOGIN & REGISTER TABS
   ========================================================================== */
.death-tabs-bar {
  display: flex;
  background: rgba(18, 28, 40, 0.8);
  border-bottom: 1px solid #4a5c6e;
}

.death-tab {
  flex: 1;
  padding: 9px 12px;
  background: none;
  border: none;
  color: #8ea5bd;
  font-family: 'Noto Sans Thai', Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
}

.death-tab:hover {
  color: #d8e5f2;
}

.death-tab.active {
  color: #ffffff;
  font-weight: 700;
  background: rgba(36, 50, 68, 0.8);
  border-bottom-color: #79a2cb;
}

.login-field {
  margin-bottom: 12px;
}

.login-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #adc4db;
  margin-bottom: 5px;
}

.death-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 10px;
  color: #738a9f;
  font-size: 11px;
}

.death-divider:before,
.death-divider:after {
  content: '';
  flex: 1;
  height: 1px;
  background: #394c5f;
}

.alt-login-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-bottom-bar {
  padding: 8px 14px;
  background: rgba(14, 22, 32, 0.9);
  border-top: 1px solid #3c4e60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #7f97af;
}

.server-status-dot {
  display: flex;
  align-items: center;
  gap: 6px;
}

.server-status-dot i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 6px #34c759;
}

/* ==========================================================================
   3-CHARACTER SELECTION WINDOW
   ========================================================================== */
.char-select-win {
  max-width: 520px;
}

.char-select-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #384b5e;
  margin-bottom: 12px;
}

.char-select-subhead p {
  margin: 0;
  font-size: 12px;
  color: #8da4bd;
}

.char-select-subhead .slot-count {
  font-size: 12px;
  color: #adc5dc;
  white-space: nowrap;
}

.char-select-subhead .slot-count b {
  color: #ffd975;
}

.char-slots-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Occupied Character Slot Card */
.char-slot {
  position: relative;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.char-slot.occupied {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, rgba(32, 46, 64, 0.85) 0%, rgba(20, 30, 44, 0.95) 100%);
  border: 1px solid #556c84;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.char-slot.occupied:hover {
  border-color: #7898ba;
  background: linear-gradient(180deg, rgba(38, 54, 76, 0.9) 0%, rgba(24, 36, 52, 0.98) 100%);
}

.char-slot.active-slot {
  border-color: #689bd1;
  box-shadow: 0 0 0 1px #689bd1, 0 3px 12px rgba(18, 50, 90, 0.4);
}

.char-slot-badge {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #7b94ad;
  letter-spacing: 0.5px;
}

.char-avatar-box {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid #6c849e;
  background: radial-gradient(circle at 50% 35%, #3c5472, #182535);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.char-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
  image-rendering: auto;
}

.char-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.char-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.char-name {
  font-size: 15.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.char-status-tag {
  font-size: 10px;
  font-weight: 700;
  background: #2b5585;
  color: #dff0ff;
  border-radius: 3px;
  padding: 1px 6px;
  letter-spacing: 0.2px;
}

.char-class-text {
  font-size: 12px;
  font-weight: 600;
  color: #8cc4f5;
}

.char-level-text {
  font-size: 11.5px;
  color: #b0c3d6;
}

.char-level-text b {
  color: #ffffff;
}

.char-area-text {
  font-size: 11px;
  color: #7b94ad;
}

.char-actions-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* Empty Character Slot Card */
.char-slot.empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px dashed #4e647b;
  background: rgba(18, 28, 40, 0.5);
  padding: 14px 16px;
}

.char-slot.empty:hover {
  border-color: #7898ba;
  background: rgba(24, 36, 52, 0.65);
}

.empty-slot-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.empty-slot-icon {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  border: 1px dashed #59718a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #69839e;
  background: rgba(15, 23, 33, 0.6);
}

.empty-slot-text {
  display: flex;
  flex-direction: column;
}

.empty-slot-text strong {
  font-size: 13.5px;
  color: #b4c7dc;
}

.empty-slot-text span {
  font-size: 11px;
  color: #70879f;
}

/* Character Select Footer */
.char-select-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #384b5e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-tip {
  font-size: 11px;
  color: #738a9f;
}

/* Message / Notification Box */
.char-msg-box {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.char-msg-box.error {
  background: rgba(180, 40, 40, 0.2);
  border: 1px solid #a83e3e;
  color: #ff9b9b;
}

.char-msg-box.info {
  background: rgba(40, 100, 160, 0.2);
  border: 1px solid #3b6d9e;
  color: #9cd2ff;
}

/* ==========================================================================
   OVERLAY BACKDROP (In-game modal & Create Dialog)
   ========================================================================== */
.death-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(6, 12, 20, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

/* Character Creation Window */
.char-create-win {
  max-width: 440px;
}

.create-preview-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(18, 28, 40, 0.8);
  border: 1px solid #4a5c6e;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 14px;
}

.create-portrait {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  border: 1px solid #6b84a0;
  background: radial-gradient(circle at 50% 35%, #3c5472, #182535);
  overflow: hidden;
  flex-shrink: 0;
}

.create-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
}

.create-class-info h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #8cc4f5;
}

.create-class-info p {
  margin: 0;
  font-size: 11.5px;
  color: #8da4bd;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* Hide legacy elements when Death Window theme is active */
#online-login .login-card {
  display: none !important;
}

@media (max-width: 520px) {
  .char-slot.occupied {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .char-actions-col {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  .char-actions-col .select-play-btn {
    flex: 1;
  }
}
