* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #07090f;
  --bg-soft: #121824;
  --panel: rgba(21, 18, 14, 0.93);
  --panel-2: rgba(27, 23, 18, 0.95);
  --line: rgba(245, 197, 66, 0.18);
  --line-bright: rgba(245, 197, 66, 0.36);
  --text: #f4ebd5;
  --muted: #b7ab94;
  --gold: #d7ad58;
  --gold-bright: #f3d08c;
  --blue: #5ea6ff;
  --green: #63d38a;
  --orange: #ffb84d;
  --red: #ff7777;
  --gray: #8a7f73;
}

body {
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(94, 166, 255, 0.12), transparent 22%),
    radial-gradient(circle at top right, rgba(243, 208, 140, 0.09), transparent 24%),
    radial-gradient(circle at bottom left, rgba(255, 119, 119, 0.08), transparent 24%),
    linear-gradient(180deg, #07090f, #11161f 28%, #0b0f16 62%, #07090f);
}

button,
input,
select,
textarea {
  font-family: Arial, Helvetica, sans-serif;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.nation-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 7%;
}

.intro {
  text-align: center;
  margin-bottom: 34px;
}

.badge,
.server-badge {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid rgba(243, 208, 140, 0.35);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(215, 173, 88, 0.08);
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: bold;
  text-transform: uppercase;
}

.intro h1 {
  margin-top: 16px;
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: 1px;
  color: #f7ecd3;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}

.intro p {
  max-width: 760px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  font-family: Arial, Helvetica, sans-serif;
}

.nation-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(290px, 470px));
  justify-content: center;
  gap: 28px;
}

.nation-card {
  position: relative;
  overflow: hidden;
  min-height: 350px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: white;
  text-align: left;
  background: var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.02),
    0 20px 60px rgba(0,0,0,.42);
  transition: 0.25s ease;
}

.nation-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-bright);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    0 22px 70px rgba(0,0,0,.5);
}

.nation-card.elmorad {
  background:
    linear-gradient(135deg, rgba(20, 44, 92, 0.94), rgba(13, 19, 30, 0.96)),
    linear-gradient(45deg, #132745, #0d121b);
}

.nation-card.karus {
  background:
    linear-gradient(135deg, rgba(74, 16, 16, 0.94), rgba(26, 35, 23, 0.96)),
    linear-gradient(45deg, #321010, #101612);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)),
    linear-gradient(135deg, transparent, rgba(243, 208, 140, 0.06));
  pointer-events: none;
}

.nation-logo-wrap {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(7, 10, 18, .35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
  position: relative;
  z-index: 1;
}

.nation-logo {
  width: 78px;
  height: 78px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}

.nation-kicker {
  display: block;
  position: relative;
  color: var(--gold-bright);
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-top: 18px;
  font-family: Arial, Helvetica, sans-serif;
}

.nation-card strong {
  display: block;
  position: relative;
  margin-top: 18px;
  font-size: 39px;
  letter-spacing: 2.2px;
  color: #fff4df;
}

.nation-card small {
  display: block;
  position: relative;
  max-width: 320px;
  margin-top: 14px;
  color: rgba(255, 244, 223, 0.76);
  line-height: 1.6;
  font-size: 14px;
  font-family: Arial, Helvetica, sans-serif;
}

.select-line {
  display: inline-block;
  position: relative;
  margin-top: 32px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(243, 208, 140, 0.26);
  background: linear-gradient(180deg, rgba(248, 219, 157, 0.12), rgba(215, 173, 88, 0.09));
  color: #f9ebcb;
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
}

.panel-screen {
  min-height: 100vh;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(33, 27, 20, 0.96), rgba(18, 15, 11, 0.96));
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
}

.topbar h2 {
  margin-top: 10px;
  font-size: clamp(24px, 3vw, 38px);
  color: #f6ebd2;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.user-status {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--gold-bright);
  background: rgba(243, 208, 140, 0.07);
  border: 1px solid rgba(243, 208, 140, 0.16);
  font-size: 14px;
  font-family: Arial, Helvetica, sans-serif;
}

.ko-btn {
  position: relative;
  border: 1px solid rgba(243, 208, 140, 0.24);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: bold;
  color: #fff1d2;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 8px 20px rgba(0,0,0,.18);
  transition: .18s ease;
}

.ko-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.ko-btn-primary {
  background: linear-gradient(180deg, #8a6032, #5d3e20 55%, #3c2916);
}

.ko-btn-secondary {
  background: linear-gradient(180deg, #4f5a68, #36404f 55%, #262c35);
}

.ko-btn-dark {
  background: linear-gradient(180deg, #433728, #2a2218 55%, #17120c);
}

.full {
  width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: 220px 240px 220px 1fr;
  gap: 16px;
  margin-top: 18px;
}

.realm-panel,
.server-panel,
.camp-panel,
.slot-panel {
  min-height: 640px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(29, 24, 18, 0.96), rgba(18, 15, 11, 0.96));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(243, 208, 140, 0.14);
}

.panel-title span {
  font-size: 17px;
  font-weight: bold;
  color: #f3e3be;
}

.panel-title small {
  color: var(--muted);
  text-align: right;
  font-family: Arial, Helvetica, sans-serif;
}

.realm-list,
.server-list,
.camp-list {
  display: grid;
  gap: 10px;
}

.realm-btn,
.server-btn,
.camp-btn {
  width: 100%;
  padding: 15px;
  border: 1px solid rgba(243, 208, 140, 0.12);
  border-radius: 14px;
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(66, 52, 35, 0.56), rgba(41, 31, 22, 0.72));
  transition: 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.realm-btn:hover,
.server-btn:hover,
.camp-btn:hover,
.realm-btn.active,
.server-btn.active,
.camp-btn.active {
  border-color: rgba(243, 208, 140, 0.34);
  background:
    linear-gradient(180deg, rgba(115, 84, 46, 0.68), rgba(58, 42, 27, 0.76));
}

.realm-btn.disabled {
  opacity: .52;
  cursor: not-allowed;
  filter: grayscale(.25);
}

.realm-btn strong,
.server-btn strong,
.camp-btn strong {
  display: block;
  font-size: 15px;
}

.realm-btn small,
.server-btn small,
.camp-btn small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
}

.empty-state {
  color: var(--muted);
  line-height: 1.6;
  padding: 16px;
  border: 1px dashed rgba(243, 208, 140, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  font-family: Arial, Helvetica, sans-serif;
}

.slot-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 16px;
}

.slot-card {
  padding: 18px;
  border: 1px solid rgba(243, 208, 140, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(77, 58, 35, 0.16), rgba(21, 17, 13, 0.45)),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    rgba(12, 10, 8, 0.9);
}

.slot-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.slot-header h3 {
  font-size: 28px;
  color: #fff1cf;
}

.status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  font-family: Arial, Helvetica, sans-serif;
}

.status-empty {
  color: #e6fff0;
  background: rgba(99, 211, 138, 0.12);
  border: 1px solid rgba(99, 211, 138, 0.34);
}

.status-building {
  color: #e4f1ff;
  background: rgba(94, 166, 255, 0.14);
  border: 1px solid rgba(94, 166, 255, 0.34);
}

.status-priest {
  color: #fff3db;
  background: rgba(255, 184, 77, 0.14);
  border: 1px solid rgba(255, 184, 77, 0.34);
}

.status-full {
  color: #ffe1e1;
  background: rgba(255, 119, 119, 0.14);
  border: 1px solid rgba(255, 119, 119, 0.35);
}

.status-old {
  color: #f0e8db;
  background: rgba(138, 127, 115, 0.18);
  border: 1px solid rgba(138, 127, 115, 0.36);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(243, 208, 140, 0.09);
  background: rgba(255, 255, 255, 0.04);
}

.metric small {
  display: block;
  color: var(--muted);
  margin-bottom: 5px;
  font-family: Arial, Helvetica, sans-serif;
}

.metric strong {
  font-size: 18px;
  color: #ffefce;
}

.slot-note {
  min-height: 52px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 16px;
  font-family: Arial, Helvetica, sans-serif;
}

.slot-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.slot-actions button {
  flex: 1;
  min-width: 140px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgba(243, 208, 140, 0.2);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(38,29,20,0.98), rgba(19,15,11,0.98));
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
}

.modal-card.large {
  width: min(760px, 100%);
}

.modal-card h3 {
  font-size: 25px;
  margin-bottom: 10px;
  color: #f5e5bd;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  font-size: 22px;
}

.muted,
#infoText {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
  font-family: Arial, Helvetica, sans-serif;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form {
  display: grid;
  gap: 14px;
}

.grid-form {
  grid-template-columns: repeat(2, 1fr);
}

.grid-full {
  grid-column: 1 / -1;
}

.form label {
  display: grid;
  gap: 7px;
  color: #e9d7b0;
  font-size: 14px;
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 13px 12px;
  border: 1px solid rgba(243, 208, 140, 0.12);
  border-radius: 12px;
  color: #fff4dd;
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.form textarea {
  min-height: 92px;
  resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: rgba(243, 208, 140, 0.42);
  box-shadow: 0 0 0 2px rgba(243, 208, 140, 0.08);
}

.optional {
  color: var(--muted);
  font-weight: normal;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr 1fr;
  }

  .slot-panel {
    grid-column: 1 / -1;
  }

  .realm-panel,
  .server-panel,
  .camp-panel,
  .slot-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .nation-screen,
  .panel-screen {
    padding: 16px;
  }

  .nation-cards {
    grid-template-columns: 1fr;
  }

  .nation-card {
    min-height: 300px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .grid-form,
  .slot-info,
  .metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .modal-actions {
    flex-direction: column;
  }
}
