* {
  box-sizing: border-box;
}

:root {
  --background: #100e0c;
  --panel: #1c1815;
  --panel-light: #29221c;
  --border: #44372b;
  --text: #eee8dc;
  --muted: #a99d8d;
  --accent: #c89b3c;
  --accent-hover: #e0b653;
  --input: #13110f;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 40px 20px;
  background:
    radial-gradient(circle at top, #30251b 0%, var(--background) 45%);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 20px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #8a6827, #c89b3c);
  font-size: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.header h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.api-login {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
  padding: 9px 11px;
  background: rgba(28, 24, 21, 0.9);
  border: 1px solid var(--border);
  border-radius: 10px;
}

#npc-api-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#npc-api-group label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

#npc-api {
  width: 210px;
  height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#npc-api::placeholder,
input::placeholder,
textarea::placeholder {
  color: #686052;
}

#npc-api:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  background: #181410;
  box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.12);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/*
 * MENU
 */

.main-menu {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 6px;
  background: rgba(28, 24, 21, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.menu-item {
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.menu-item:hover:not(:disabled) {
  color: var(--text);
  background: var(--panel-light);
}

.menu-item.active {
  color: var(--text);
  background: rgba(200, 155, 60, 0.12);
  border-color: rgba(200, 155, 60, 0.35);
}

.menu-item:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/*
 * LAYOUT
 */

.content-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: start;
}

/*
 * PANEL
 */

.panel {
  padding: 20px;
  background: rgba(28, 24, 21, 0.95);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.panel-header {
  margin-bottom: 28px;
}

.panel-header h2 {
  margin: 0 0 5px;
  font-size: 20px;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/*
 * FORM
 */

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 22px;
}

.field label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.optional {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--panel-light);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.hint {
  margin-top: 6px;
  color: #777064;
  font-size: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 18px;
}

.field-small {
  margin-bottom: 22px;
}

/*
 * BUTTON
 */

.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #8a6827, #c89b3c);
  color: #fff8e8;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(140, 100, 30, 0.25);
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}

.submit-button:hover {
  filter: brightness(1.1);
  box-shadow: 0 10px 30px rgba(180, 130, 40, 0.35);
}

.submit-button:active {
  transform: translateY(1px);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.arrow {
  font-size: 20px;
  line-height: 0;
}

/*
 * QUESTIONS
 */

.questions {
  margin-top: 30px;
}

.questions h2 {
  margin: 0 0 15px;
  font-size: 20px;
}

.questions article {
  margin-bottom: 12px;
  padding: 20px 22px;
  background: rgba(28, 24, 21, 0.9);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.questions article h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.questions article p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/*
 * NPC LIST
 */

.npc-list {
  padding: 20px;
  background: rgba(28, 24, 21, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.npc-list h2 {
  margin: 0 0 15px;
  font-size: 18px;
}

.npc-item {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.npc-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.npc-item.selected {
  border-color: var(--accent);
  background: rgba(200, 155, 60, 0.12);
  box-shadow:
    0 0 0 1px var(--accent),
    0 5px 15px rgba(0, 0, 0, 0.25);
}

/*
 * EMPTY / STATUS
 */

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 30px 10px;
}

.error-message {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(100, 35, 25, 0.15);
}

.error-message h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.error-message p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/*
 * FOOTER
 */

footer {
  width: 100%;
  max-width: 850px;
  margin: 25px auto 0;
  text-align: center;
  color: #686052;
  font-size: 12px;
}

.npc-note {
    width: 100%;
    /*min-height: 180px;*/
    box-sizing: border-box;

    margin-top: 16px;
    padding: 14px 16px;

    resize: vertical;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--input);
    color: var(--text);

    font: inherit;
    font-size: 14px;
    line-height: 1.6;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.npc-note::placeholder {
    color: var(--muted);
}

.npc-note:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(200, 155, 60, 0.12);
}
.npc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.npc-header-info {
    flex: 1;
}

.npc-header-info h2 {
    margin: 0;
}

.npc-portrait {
    width: 125px;
    height: 125px;

    object-fit: cover;

    border-radius: 10px;
    border: 1px solid var(--border);

    display: block;
}

/*
 * MOBILE
 */

@media (max-width: 800px) {
  .header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .api-login {
    width: 100%;
  }

  #npc-api {
    width: 100%;
  }

  #npc-api-group {
    flex: 1;
  }

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

@media (max-width: 650px) {
  body {
    padding: 25px 14px;
  }

  .header-title {
    gap: 14px;
  }

  .logo {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    font-size: 23px;
  }

  .header h1 {
    font-size: 24px;
  }

  .header p {
    font-size: 13px;
  }

  .api-login {
    align-items: flex-end;
  }

  .main-menu {
    overflow-x: auto;
  }

  .menu-item {
    white-space: nowrap;
  }

  .panel {
    padding: 20px;
    border-radius: 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .field-small {
    margin-bottom: 22px;
  }
}
