/* Gameficate Text Configurator — the same look as the Theme Configurator, with a wide table of texts. */
/* ---------- Tokens and reset ---------- */
:root {
  --navy: #17324d;
  --navy-2: #214667;
  --ink: #1f2a37;
  --muted: #5b6b7c;
  --line: #dce6ef;
  --soft: #f4f8fb;
  --bg: #eef4f9;
  --orange: #ff7a3d;
  --orange-d: #e35f1e;
  --teal: #13a89e;
  --font: 'Nunito', system-ui, sans-serif;
  --display: 'Baloo 2', 'Nunito', sans-serif;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #ffc83d;
  outline-offset: 2px;
}

/* ---------- Top bar ---------- */
.top {
  height: 68px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  z-index: 2;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffb057, var(--orange) 55%, var(--orange-d));
}
.logo .badge.brand svg {
  width: 100%;
  height: 100%;
}
.logo .word {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.logo .word span {
  color: #ffc83d;
}
.logo .word small {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  opacity: 0.75;
  margin-left: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.95;
}
.name input {
  width: 200px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0 10px;
  font-weight: 800;
}
.spacer {
  flex: 1;
}
.tb {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  white-space: nowrap;
}
.tb:hover {
  background: rgba(255, 255, 255, 0.24);
}
.tb.primary {
  background: var(--orange);
  border-color: var(--orange);
}

/* ---------- Settings column and cards ---------- */
.wrap {
  flex: 1;
  display: flex;
  min-height: 0;
}
.controls {
  width: 440px;
  flex: 0 0 auto;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border-right: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card h3 {
  font-family: var(--display);
  font-size: 18px;
  color: var(--navy);
}
.help,
.small {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.45;
}
.hex,
.field input[type='text'],
select,
textarea {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 14px;
}
.hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}
textarea {
  height: auto;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.4;
}
/* ---------- Fields, logo, buttons, switches ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
}
.field input[type='range'] {
  width: 100%;
  accent-color: var(--orange);
}
.btn {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  background: var(--soft);
  border: 2px solid var(--line);
  color: var(--navy);
}
.btn.sm {
  height: 32px;
  font-size: 13px;
}
.btn:hover {
  border-color: #bfd0e0;
}
/* ---------- Preview frame and XML view ---------- */
.preview {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
}
.pbar select {
  width: auto;
  min-width: 180px;
}
.frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: #0e2236;
  box-shadow: 0 10px 30px rgba(23, 50, 77, 0.15);
}
.frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.xml {
  background: #0f2539;
  color: #d7e6f5;
  border-radius: 14px;
  padding: 14px 16px;
  font:
    12.5px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre;
  overflow: auto;
  max-height: 420px;
}
.note {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.5;
  max-width: 1100px;
}
.note code {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 5px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 800;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
  z-index: 10;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Layout: controls · table · preview ---------- */
.controls {
  width: 330px;
}
.texts {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 20px;
  gap: 10px;
  overflow: hidden;
}
.side {
  width: 520px;
  flex: 0 0 auto;
  overflow-y: auto;
  padding: 14px 16px 20px;
  background: #fff;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.side .pbar select {
  min-width: 0;
  width: auto;
  max-width: 190px;
}
.btn.icon {
  width: 32px;
  padding: 0;
}
.show-side {
  position: fixed;
  right: 0;
  top: 120px;
  padding: 10px 12px;
  border-radius: 12px 0 0 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  z-index: 3;
}

/* ---------- Languages ---------- */
.lang-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lang-row {
  display: grid;
  grid-template-columns: 1fr 64px 28px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--soft);
  font-weight: 800;
  font-size: 14px;
}
.lang-row small {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.lang-row .bar {
  height: 8px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.lang-row .bar i {
  display: block;
  height: 100%;
  background: var(--teal);
}
.lang-row .x {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}
.lang-row .x:hover {
  background: #fff;
  color: #c0392b;
}
.add-row {
  display: flex;
  gap: 8px;
}
.add-row select {
  flex: 1;
  min-width: 0;
}
details.custom-lang summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
}
details.custom-lang .grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.field input[type='search'] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 14px;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seg button {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
}
.seg button[aria-pressed='true'] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ---------- Texts table ---------- */
.tbar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--muted);
}
.tbar b {
  color: var(--navy);
}
.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.ttable {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: calc(220px + var(--cols, 1) * 260px);
}
.ttable th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: var(--navy);
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
  text-align: start;
  white-space: nowrap;
}
.ttable th small {
  font-weight: 700;
  opacity: 0.75;
}
.ttable td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ttable tr:nth-child(even) td {
  background: #fafcfe;
}
.ttable th:first-child,
.ttable td.key {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  box-shadow: 2px 0 0 var(--line);
}
.ttable th:first-child {
  z-index: 2;
  background: var(--navy);
}
.ttable tr:nth-child(even) td.key {
  background: #fafcfe;
}
.ttable td.key {
  width: 220px;
  font:
    12px/1.35 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  color: var(--navy);
  word-break: break-all;
}
.ttable td.key .tag {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #fff2e8;
  color: var(--orange-d);
  font: 800 11px var(--font);
}
.ttable td.key .note {
  display: block;
  margin-top: 4px;
  font: 700 11.5px var(--font);
  color: var(--muted);
}
.ttable td.key .row-act {
  margin-top: 6px;
  display: flex;
  gap: 4px;
}
.ttable td.key .row-act button {
  padding: 2px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: #fff;
  font: 800 11.5px var(--font);
  color: var(--navy);
}
.cell {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  resize: vertical;
}
.cell::placeholder {
  color: #8a99a9;
  font-weight: 600;
}
.cell.own {
  border-color: var(--teal);
  background: #f2fbfa;
}
.cell.missing::placeholder {
  color: #c0782f;
  font-style: italic;
}
.cell.warn {
  border-color: #e0a100;
  background: #fffaeb;
}
.more {
  text-align: center;
}
.empty {
  padding: 30px;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
}
@media (max-width: 1400px) {
  .side {
    width: 420px;
  }
}
@media (max-width: 1280px) {
  .top .tb {
    font-size: 0;
    padding: 0 10px;
  }
  .top .tb::first-letter {
    font-size: 16px;
  }
}
details.custom-lang input,
details.custom-lang select,
.card > .field input[type='text'] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 14px;
}

/* Opened inside Craft (?embedded=1, js/EmbedBridge.js): Craft's window has the title, so the logo makes room. */
.embedded .top .logo {
  display: none;
}
