﻿:root {
  color-scheme: dark;
  --bg: #040306;
  --ink: #fff7e8;
  --muted: #b9aa98;
  --faint: #75695f;
  --gold: #d8ad56;
  --gold-soft: rgba(216, 173, 86, 0.18);
  --ruby: #b71f31;
  --ruby-deep: #5f111c;
  --panel: rgba(13, 11, 14, 0.84);
  --panel-solid: rgba(17, 14, 17, 0.98);
  --line: rgba(216, 173, 86, 0.28);
  --line-soft: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.62);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(2, 2, 4, 0.88), rgba(4, 3, 6, 0.28) 48%, rgba(2, 2, 4, 0.9)),
    linear-gradient(180deg, rgba(31, 5, 10, 0.12), rgba(4, 3, 6, 0.98) 96%),
    url("darkeden-lobby.png") center / cover fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: 0.34;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  position: relative;
  width: min(1240px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(320px, 1fr) 430px;
  gap: 30px;
  align-items: center;
  padding: 44px 0;
}

.sidebar {
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.brand {
  max-width: 590px;
  text-shadow: 0 14px 42px #000;
}

.brand__mark {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 62px;
  align-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--gold);
  background:
    linear-gradient(135deg, rgba(216, 173, 86, 0.1), transparent 40%),
    rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  letter-spacing: 0;
}

.brand__mark span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1;
}

.brand__mark strong {
  color: #f7e5bd;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.mobile-menu {
  display: none;
}

.menu {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(216, 173, 86, 0.2);
  background: rgba(0, 0, 0, 0.34);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.menu__button {
  min-height: 48px;
  border: 1px solid transparent;
  background: transparent;
  color: #cfc1af;
  text-align: left;
  padding: 0 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.menu__button:hover,
.menu__button.is-active {
  border-color: rgba(216, 173, 86, 0.72);
  background:
    linear-gradient(90deg, rgba(183, 31, 49, 0.28), rgba(216, 173, 86, 0.1)),
    rgba(0, 0, 0, 0.28);
  color: #fff7e8;
}

.menu__button:hover {
  transform: translateX(2px);
}

.brand h1 {
  margin: 0;
  font-size: 86px;
  line-height: 0.94;
  letter-spacing: 0;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(216, 173, 86, 0.08), transparent 30%),
    linear-gradient(135deg, rgba(183, 31, 49, 0.18), transparent 46%),
    var(--panel);
  box-shadow: 0 28px 90px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  padding: 24px;
  border-radius: 8px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--ruby), transparent);
  opacity: 0.82;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.panel__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel__title div {
  display: grid;
  gap: 5px;
}

.panel__title span {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
fieldset legend {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(216, 173, 86, 0.26);
  background: rgba(0, 0, 0, 0.42);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

select {
  padding-right: 42px;
  cursor: pointer;
}

input:focus,
select:focus {
  border-color: rgba(216, 173, 86, 0.78);
  background: rgba(0, 0, 0, 0.56);
  box-shadow: 0 0 0 3px rgba(216, 173, 86, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

fieldset {
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented legend,
.mode legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.segmented label,
.mode label {
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.segmented label {
  display: grid;
  min-height: 78px;
  align-content: center;
  gap: 5px;
  padding: 14px;
}

.segmented input,
.mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label:has(input:checked),
.mode label:has(input:checked) {
  border-color: rgba(216, 173, 86, 0.82);
  background:
    linear-gradient(180deg, rgba(216, 173, 86, 0.16), rgba(183, 31, 49, 0.2)),
    rgba(0, 0, 0, 0.18);
  color: #fff7e8;
  box-shadow: inset 0 0 0 1px rgba(216, 173, 86, 0.14), 0 12px 30px rgba(0, 0, 0, 0.24);
}

.segmented label:not(:has(input:checked)),
.mode label:not(:has(input:checked)) {
  opacity: 0.72;
}

.segmented label:hover,
.mode label:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.segmented span {
  font-weight: 900;
}

.segmented small {
  color: var(--muted);
}

.mode {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mode label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: #eadcca;
  font-size: 14px;
  font-weight: 900;
}

.submit {
  position: relative;
  min-height: 54px;
  border: 1px solid rgba(255, 218, 137, 0.52);
  background:
    linear-gradient(180deg, rgba(229, 65, 75, 0.88), rgba(105, 18, 28, 0.96)),
    var(--ruby);
  color: white;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(105, 18, 28, 0.42);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 18px 40px rgba(105, 18, 28, 0.52);
}

.submit:disabled {
  opacity: 0.64;
  cursor: wait;
  transform: none;
}

.submit--secondary {
  background:
    linear-gradient(180deg, rgba(216, 173, 86, 0.44), rgba(95, 17, 28, 0.62)),
    rgba(0, 0, 0, 0.28);
}

.result {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(216, 173, 86, 0.26);
  background: rgba(0, 0, 0, 0.34);
  border-radius: 6px;
}

.result strong,
.result span {
  display: block;
}

.result strong {
  color: var(--gold);
  margin-bottom: 4px;
}

.result dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 0;
}

.result div,
.account-grid div {
  min-width: 0;
  padding: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.result dt,
.account-grid dt,
.log-item dt {
  color: var(--muted);
  font-size: 12px;
}

.result dd,
.account-grid dd,
.log-item dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.result.is-error {
  color: #ffd7d7;
  border-color: rgba(222, 54, 68, 0.56);
}

.balance-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.balance-card div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(216, 173, 86, 0.22);
  background:
    linear-gradient(180deg, rgba(216, 173, 86, 0.09), transparent),
    rgba(0, 0, 0, 0.28);
  border-radius: 6px;
}

.balance-card span,
.balance-card strong {
  display: block;
}

.balance-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.balance-card strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  overflow-wrap: anywhere;
}

.empty {
  min-height: 240px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.24);
  border-radius: 6px;
}

.empty strong {
  color: var(--gold);
  font-size: 18px;
}

.empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.log-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 2px;
}

.log-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(90deg, rgba(216, 173, 86, 0.08), transparent 42%),
    rgba(0, 0, 0, 0.28);
  border-radius: 6px;
}

.log-item strong,
.log-item span {
  display: block;
}

.log-item strong {
  color: var(--gold);
  margin-bottom: 4px;
}

.log-item span {
  color: #e9dac9;
  line-height: 1.5;
}

.log-item dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(216, 173, 86, 0.44);
  background: var(--gold-soft);
  color: #ffe5a5;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  font-style: normal;
  white-space: nowrap;
}

.badge.is-denied {
  border-color: rgba(222, 54, 68, 0.58);
  background: rgba(183, 31, 49, 0.18);
  color: #ffd7d7;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.is-modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow-y: auto;
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(216, 173, 86, 0.42);
  background:
    linear-gradient(180deg, rgba(216, 173, 86, 0.08), transparent 32%),
    linear-gradient(135deg, rgba(183, 31, 49, 0.2), transparent 46%),
    var(--panel-solid);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.76);
  border-radius: 8px;
}

.modal__panel--message {
  width: min(420px, 100%);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.32);
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal__header {
  display: grid;
  gap: 8px;
  padding-right: 38px;
}

.modal__header span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.modal__header strong {
  color: var(--ink);
  font-size: 24px;
  overflow-wrap: anywhere;
}

.modal__header .badge {
  justify-self: start;
}

.password-form {
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .panel {
    grid-column: 2;
  }
}

@media (max-width: 860px) {
  body {
    background-position: center top;
    background-attachment: scroll;
  }

  .shell {
    width: min(100% - 24px, 1240px);
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
    padding: 24px 0;
  }

  .sidebar,
  .brand,
  .panel {
    grid-column: auto;
  }

  .sidebar {
    justify-content: start;
  }

  .sidebar .brand__mark {
    display: none;
  }

  .mobile-menu {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(216, 173, 86, 0.22);
    background: rgba(0, 0, 0, 0.42);
    border-radius: 8px;
    backdrop-filter: blur(10px);
  }

  .mobile-menu span {
    color: var(--gold);
    font-size: 13px;
    font-weight: 900;
  }

  .menu {
    display: none;
  }

  .brand h1 {
    font-size: 44px;
  }

}

@media (max-width: 460px) {
  .panel,
  .modal__panel {
    padding: 18px;
  }

  .panel__title {
    display: grid;
  }

  .segmented,
  .mode,
  .result dl,
  .balance-card,
  .account-grid,
  .log-item dl {
    grid-template-columns: 1fr;
  }
}

