@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=EB+Garamond:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --bg: #0a0604;
  --panel: rgba(22, 13, 8, 0.96);
  --panel-card: rgba(28, 16, 10, 0.98);
  --line: rgba(209, 160, 84, 0.25);
  --gold: #d1a054;
  --gold-bright: #ffd175;
  --gold-dim: #947137;
  --crimson: #8a2121;
  --crimson-bright: #c93434;
  --text: #f0e6d2;
  --text-dim: #b8a690;
  --muted: #8c7b68;
  --font-title: 'Cinzel', serif;
  --font-body: 'EB Garamond', serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(209, 160, 84, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(138, 33, 33, 0.08) 0%, transparent 40%),
    linear-gradient(135deg, #0d0705 0%, #160c08 50%, #0a0503 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
}

.auth-shell {
  width: min(1240px, 94vw);
  margin: 0 auto;
  padding: 36px 0 60px;
}

/* Header */
.auth-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--line);
}

.kicker {
  display: block;
  color: var(--gold);
  font-family: var(--font-title);
  letter-spacing: 0.2em;
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.auth-head h1 {
  font-family: var(--font-title);
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1;
  margin: 6px 0 10px;
  color: #fff;
  text-shadow: 0 4px 15px rgba(0,0,0,0.9);
}

.auth-head p {
  color: var(--text-dim);
  font-size: 16px;
  margin: 0;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 10px 18px;
  color: var(--gold-bright);
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(209, 160, 84, 0.08);
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
  transition: all 0.25s ease;
}
.back:hover {
  background: rgba(209, 160, 84, 0.2);
  border-color: var(--gold-bright);
  box-shadow: 0 0 20px rgba(209, 160, 84, 0.3);
  transform: translateY(-2px);
}

/* Grids & Cards */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0; }

.card {
  border: 4px solid #1c110b;
  border-top-color: #3d2417;
  border-bottom-color: #0d0704;
  border-radius: 6px;
  background: var(--panel-card);
  box-shadow: 
    0 15px 40px rgba(0,0,0,0.9),
    inset 0 0 0 1px rgba(209, 160, 84, 0.25),
    inset 0 0 25px rgba(0,0,0,0.8);
  padding: 24px;
  position: relative;
}

/* Session Box (MeBox) */
.mebox {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(35, 20, 12, 0.98), rgba(18, 10, 6, 0.98));
}
.mebox b {
  display: block;
  color: var(--gold-bright);
  font-family: var(--font-title);
  font-size: 24px;
}
.mebox span {
  display: block;
  color: var(--text-dim);
  font-size: 15px;
  margin-top: 4px;
}

/* Forms */
.formbox h2, .section-title h2 {
  margin: 0 0 16px;
  color: var(--gold-bright);
  font-family: var(--font-title);
  font-size: 24px;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.formbox label {
  display: block;
  color: var(--text-dim);
  font-size: 14px;
  margin: 14px 0 6px;
  font-family: var(--font-title);
  letter-spacing: 0.05em;
}
.formbox input, select {
  width: 100%;
  border: 1px solid rgba(209, 160, 84, 0.35);
  border-radius: 4px;
  background: #0d0704;
  color: var(--text);
  padding: 12px 16px;
  font-size: 16px;
  font-family: var(--font-body);
  transition: all 0.25s ease;
}
.formbox input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(209, 160, 84, 0.3);
  background: #140b07;
}

/* Buttons */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(209, 160, 84, 0.15), rgba(138, 33, 33, 0.15));
  color: var(--gold-bright);
  padding: 11px 20px;
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
  transition: all 0.25s ease;
}
button:hover, .btn:hover {
  background: var(--gold);
  color: #0d0704;
  box-shadow: 0 0 20px rgba(209, 160, 84, 0.4);
  transform: translateY(-2px);
}
button.primary {
  background: linear-gradient(135deg, var(--crimson), #661818);
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 15px rgba(138, 33, 33, 0.5);
}
button.primary:hover {
  background: #a82828;
  color: #fff;
  box-shadow: 0 0 25px rgba(209, 160, 84, 0.6);
}
button.danger, a.danger {
  border-color: rgba(138, 33, 33, 0.5);
  background: rgba(138, 33, 33, 0.15);
  color: #e66;
}
button.danger:hover, a.danger:hover {
  background: var(--crimson);
  color: #fff;
  border-color: var(--crimson-bright);
}

/* Navigation quick links bar */
.dash-nav-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 30px;
}
.dash-nav-bar a {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  background: rgba(22, 13, 8, 0.85);
  color: var(--text);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  transition: all 0.25s ease;
}
.dash-nav-bar a:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(209, 160, 84, 0.12);
  box-shadow: 0 0 15px rgba(209, 160, 84, 0.2);
}

/* Character & Save Cards */
.dash-card {
  border: 3px solid #23160e;
  border-top-color: #422718;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(24, 14, 9, 0.95), rgba(14, 8, 5, 0.98));
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(209, 160, 84, 0.2);
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 24px;
  align-items: center;
  transition: all 0.3s ease;
}
.dash-card:hover {
  border-color: var(--gold);
  box-shadow: 0 15px 40px rgba(0,0,0,0.95), 0 0 20px rgba(209, 160, 84, 0.25);
  transform: translateY(-2px);
}

/* Save Card with Game Scene Screen Painting */
.save-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: center;
  padding: 16px;
}
.save-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 2px solid rgba(209, 160, 84, 0.4);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.9);
}
.save-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.save-info h3 {
  margin: 0 0 6px;
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--gold-bright);
}
.save-info .save-meta {
  color: var(--text);
  font-size: 16px;
  margin: 4px 0;
}
.save-info .save-meta b {
  color: var(--gold);
}
.save-info .save-date {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 14px;
}

/* Character Card */
.dash-avatar {
  width: 90px;
  height: 90px;
  border: 2px solid var(--gold);
  border-radius: 4px;
  background: #0d0704;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
  flex-shrink: 0;
}
.dash-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dash-avatar span { font-size: 28px; color: var(--gold); }
.dash-avatar em { font-size: 10px; font-style: normal; color: var(--text-dim); text-transform: uppercase; margin-top: 2px; }

.dash-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.dash-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--crimson);
  border: 1px solid var(--gold);
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.25s ease;
}
.dash-actions a:hover {
  background: #a82828;
  box-shadow: 0 0 15px rgba(209, 160, 84, 0.4);
}

/* Empty Slate */
.save-empty-slate {
  padding: 36px 20px;
  text-align: center;
  border: 2px dashed rgba(209, 160, 84, 0.3);
  border-radius: 6px;
  background: rgba(14, 8, 5, 0.6);
}
.save-empty-slate .empty-icon { font-size: 42px; margin-bottom: 8px; color: var(--gold); }
.save-empty-slate p { color: var(--text-dim); font-size: 17px; margin-bottom: 18px; }

/* Admin Tables */
.table-wrap {
  overflow: auto;
  border: 2px solid #23160e;
  border-radius: 4px;
  background: #0d0704;
}
table { width: 100%; border-collapse: collapse; min-width: 800px; }
th, td { text-align: left; border-bottom: 1px solid rgba(209, 160, 84, 0.15); padding: 12px 14px; color: var(--text); }
th { color: var(--gold); font-family: var(--font-title); font-size: 12px; letter-spacing: 0.1em; background: rgba(209, 160, 84, 0.08); text-transform: uppercase; }

.hidden { display: none !important; }

@media(max-width: 840px) {
  .auth-head, .mebox { flex-direction: column; align-items: flex-start; }
  .grid.two, .grid.four, .dash-nav-bar { grid-template-columns: 1fr; }
  .save-card { grid-template-columns: 1fr; }
}


/* ==========================================================================
   KD_AUTH_FRIENDLY_THEMED_MESSAGES_V1
   ========================================================================== */

#msg.kd-auth-message {
  position: relative;

  display: block;

  width: 100%;
  min-height: 142px;

  margin: 22px 0 30px;
  padding: 0;

  overflow: hidden;

  border: 1px solid rgba(209,160,84,.58);
  border-radius: 8px;

  background:
    linear-gradient(
      90deg,
      rgba(10,6,4,.95) 0%,
      rgba(15,8,5,.86) 48%,
      rgba(20,10,6,.76) 100%
    ),
    url('./assets/ui_theme/scene_tactical_oil.jpg')
      center 44% / cover no-repeat;

  color: #efe2cd;

  white-space: normal;

  box-shadow:
    0 14px 34px rgba(0,0,0,.78),
    inset 0 0 0 1px rgba(255,220,157,.04),
    inset 0 0 42px rgba(111,58,24,.16);

  isolation: isolate;
}

#msg.kd-auth-message[hidden] {
  display: none !important;
}

#msg.kd-auth-message::before {
  content: "";

  position: absolute;
  inset: 0;

  z-index: -2;

  background:
    linear-gradient(
      90deg,
      rgba(6,3,2,.98) 0%,
      rgba(12,6,4,.90) 54%,
      rgba(12,6,4,.72) 100%
    );
}

#msg.kd-auth-message::after {
  content: "";

  position: absolute;
  inset: 5px;

  z-index: -1;

  pointer-events: none;

  border: 1px solid rgba(209,160,84,.20);
  border-radius: 5px;

  box-shadow:
    inset 0 0 26px rgba(209,160,84,.035);
}

#msg.kd-auth-message .kd-auth-message__content {
  position: relative;

  display: grid;

  grid-template-columns: 74px minmax(0,1fr);

  gap: 17px;

  align-items: center;

  min-height: 142px;

  padding: 20px 22px;
}

#msg.kd-auth-message .kd-auth-message__sigil {
  display: grid;
  place-items: center;

  width: 68px;
  height: 68px;

  border: 1px solid rgba(209,160,84,.40);
  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(209,160,84,.16),
      rgba(20,10,6,.72) 70%
    );

  box-shadow:
    0 0 24px rgba(209,160,84,.12),
    inset 0 0 16px rgba(0,0,0,.7);
}

#msg.kd-auth-message .kd-auth-message__sigil img {
  display: block;

  width: 46px;
  height: 46px;

  object-fit: contain;

  filter:
    drop-shadow(0 2px 5px rgba(0,0,0,.75))
    drop-shadow(0 0 6px rgba(209,160,84,.22));
}

#msg.kd-auth-message .kd-auth-message__copy {
  min-width: 0;
}

#msg.kd-auth-message .kd-auth-message__eyebrow {
  margin: 0 0 6px;

  color: #bd8e4e;

  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .18em;

  text-transform: uppercase;
}

#msg.kd-auth-message h3 {
  margin: 0 0 8px;

  color: #f0c579;

  font-family: var(--font-title);
  font-size: clamp(19px,3.2vw,27px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: .035em;

  text-shadow:
    0 2px 7px rgba(0,0,0,.85);
}

#msg.kd-auth-message p {
  max-width: 760px;

  margin: 0;

  color: #eadfce;

  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;

  text-shadow:
    0 2px 5px rgba(0,0,0,.90);
}

/* Error */
#msg.kd-auth-message.is-error {
  border-color: rgba(174,54,45,.76);

  box-shadow:
    0 14px 34px rgba(0,0,0,.78),
    0 0 23px rgba(122,30,25,.15),
    inset 0 0 0 1px rgba(224,94,79,.06);
}

#msg.kd-auth-message.is-error
.kd-auth-message__eyebrow {
  color: #ce7b67;
}

#msg.kd-auth-message.is-error
.kd-auth-message__sigil {
  border-color: rgba(171,55,44,.58);

  background:
    radial-gradient(
      circle,
      rgba(138,33,33,.26),
      rgba(18,8,6,.77) 72%
    );
}

/* Warning */
#msg.kd-auth-message.is-warning {
  border-color: rgba(196,139,67,.70);
}

/* Success */
#msg.kd-auth-message.is-success {
  border-color: rgba(111,145,80,.72);

  box-shadow:
    0 14px 34px rgba(0,0,0,.78),
    0 0 23px rgba(83,119,61,.14),
    inset 0 0 0 1px rgba(166,204,126,.05);
}

#msg.kd-auth-message.is-success
.kd-auth-message__eyebrow {
  color: #96b877;
}

#msg.kd-auth-message.is-success
.kd-auth-message__sigil {
  border-color: rgba(112,148,80,.54);

  background:
    radial-gradient(
      circle,
      rgba(89,126,66,.23),
      rgba(17,9,6,.76) 72%
    );
}

/* Info */
#msg.kd-auth-message.is-info {
  border-color: rgba(124,112,87,.60);
}

@media(max-width:840px) {

  #msg.kd-auth-message {
    min-height: 0;

    margin:
      16px 0
      max(24px,env(safe-area-inset-bottom,0px));
  }

  #msg.kd-auth-message .kd-auth-message__content {
    grid-template-columns: 52px minmax(0,1fr);

    gap: 13px;

    min-height: 116px;

    padding: 16px 15px;
  }

  #msg.kd-auth-message .kd-auth-message__sigil {
    width: 50px;
    height: 50px;
  }

  #msg.kd-auth-message .kd-auth-message__sigil img {
    width: 34px;
    height: 34px;
  }

  #msg.kd-auth-message h3 {
    margin-bottom: 6px;

    font-size: 19px;
  }

  #msg.kd-auth-message p {
    font-size: 15px;
    line-height: 1.45;
  }
}

@media(max-width:420px) {

  #msg.kd-auth-message {
    background-position:
      58% 45%;
  }

  #msg.kd-auth-message .kd-auth-message__content {
    grid-template-columns: 1fr;

    gap: 9px;

    padding: 16px 15px 18px;
  }

  #msg.kd-auth-message .kd-auth-message__sigil {
    width: 42px;
    height: 42px;
  }

  #msg.kd-auth-message .kd-auth-message__sigil img {
    width: 29px;
    height: 29px;
  }

  #msg.kd-auth-message .kd-auth-message__eyebrow {
    margin-bottom: 5px;

    font-size: 9px;
  }

  #msg.kd-auth-message h3 {
    font-size: 18px;
  }

  #msg.kd-auth-message p {
    font-size: 14.5px;
  }
}


/* ==========================================================================
   KD_AUTH_INSIDE_KAELEN_V2
   ========================================================================== */

.kd-auth-form-intro {
  margin: -4px 0 18px;
  color: #aa9a87;
  font-size: 13px;
  line-height: 1.45;
}

.kd-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.kd-auth-divider::before,
.kd-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(209,160,84,.42),
      transparent
    );
}

.kd-auth-divider span {
  color: #8d7d69;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.kd-google-login {
  display: grid;
  grid-template-columns: 46px minmax(0,1fr);
  gap: 13px;
  align-items: center;

  width: 100%;
  min-height: 62px;
  box-sizing: border-box;

  padding: 10px 13px;

  border:
    1px solid
    rgba(221,176,95,.58);

  border-radius: 7px;

  background:
    linear-gradient(
      90deg,
      rgba(48,25,13,.94),
      rgba(17,10,7,.93)
    );

  color: #eadcc8;
  text-decoration: none;

  box-shadow:
    inset 0 0 18px
    rgba(0,0,0,.40);

  transition:
    transform .15s ease,
    border-color .15s ease;
}

.kd-google-login:hover,
.kd-google-login:focus-visible {
  transform: translateY(-1px);

  border-color:
    rgba(242,198,117,.88);

  outline: none;
}

.kd-google-symbol {
  display: grid;
  place-items: center;

  width: 40px;
  height: 40px;

  border-radius: 50%;

  background: #f4f2ee;

  color: #4285f4;

  font-family: Arial,sans-serif;
  font-size: 20px;
  font-weight: 800;

  box-shadow:
    0 3px 12px
    rgba(0,0,0,.48);
}

.kd-google-login b {
  display: block;

  color: #f0c77d;

  font-family: var(--font-title);
  font-size: 15px;
}

.kd-google-login small {
  display: block;

  margin-top: 3px;

  color: #a2917d;

  font-size: 11.5px;
  line-height: 1.3;
}

.kd-auth-account-note {
  margin-top: 12px !important;

  text-align: center;

  color: #837565 !important;
}

@media(max-width:700px) {
  .kd-google-login {
    grid-template-columns:
      41px minmax(0,1fr);

    min-height: 58px;
  }

  .kd-google-symbol {
    width: 37px;
    height: 37px;
  }
}
