/* ==========================================================================
   Find The Cubes Wiki — shared stylesheet
   ========================================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f6f6;
  color: #1a1a1a;
  font-family: Rubik, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
}

a {
  color: #006cb0;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Top global nav ---------- */
.global-nav {
  background: #0e1a2b;
  height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-mark {
  width: 18px;
  height: 18px;
  background: #4a90d9;
  flex: 0 0 auto;
}

.nav-title {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}

.nav-title:hover {
  color: #fff;
  text-decoration: underline;
}

.nav-search {
  margin-left: auto;
}

.nav-search input {
  width: 260px;
  max-width: 45vw;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #35435a;
  border-radius: 3px;
  background: #fff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 13px;
}

.nav-search input::placeholder {
  color: #8a8a8a;
}

.nav-login {
  color: #d3dae5;
  font-size: 13px;
  white-space: nowrap;
}

/* ---------- Wiki header ---------- */
.wiki-bar {
  background: #fff;
  border-bottom: 1px solid #d6d6d6;
}

.wiki-bar-inner {
  max-width: 1230px;
  margin: 0 auto;
  padding: 18px 20px 0;
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.wiki-logo {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border: 1px dashed #b9b9b9;
  background: #f1f1f1;
  color: #6b6b6b;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.wiki-head h1 {
  margin: 0 0 2px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.wiki-head p {
  margin: 0;
  font-size: 12px;
  color: #6b6b6b;
}

.tabs {
  max-width: 1230px;
  margin: 14px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 2px;
}

.tabs a {
  padding: 8px 14px;
  font-size: 13px;
  color: #4a4a4a;
  border-bottom: 3px solid transparent;
}

.tabs a:hover {
  text-decoration: none;
  color: #1a1a1a;
}

.tabs a.active {
  color: #1a1a1a;
  font-weight: 500;
  border-bottom-color: #0e1a2b;
}

/* Breadcrumb */
.breadcrumb {
  max-width: 1230px;
  margin: 0 auto;
  padding: 12px 20px 0;
  font-size: 12px;
  color: #6b6b6b;
}

.breadcrumb a {
  color: #006cb0;
}

.breadcrumb span {
  margin: 0 6px;
  color: #b0b0b0;
}

/* ---------- Layout ---------- */
.content {
  max-width: 1230px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.article {
  background: #fff;
  border: 1px solid #d6d6d6;
  padding: 22px 26px 26px;
}

.article h2 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 500;
  border-bottom: 1px solid #e3e3e3;
  padding-bottom: 8px;
}

.article h2:not(:first-child) {
  margin-top: 30px;
}

.article h3 {
  margin: 26px 0 10px;
  font-size: 17px;
  font-weight: 500;
}

.article h4 {
  margin: 20px 0 8px;
  font-size: 15px;
  font-weight: 500;
}

.article p {
  margin: 0 0 12px;
}

.article ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.article li {
  margin-bottom: 4px;
}

/* Intro / notice line under a heading */
.lead {
  color: #4a4a4a;
}

/* ---------- Image placeholders ---------- */
.img-slot {
  border: 1px dashed #b9b9b9;
  background: #f1f1f1;
  color: #6b6b6b;
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.img-slot.thumb {
  height: 240px;
  margin: 4px 0 6px;
}

.img-slot.side {
  height: 170px;
}

.img-slot.mini {
  height: 110px;
  margin-bottom: 8px;
}

.thumb-caption {
  font-size: 12px;
  color: #6b6b6b;
  margin: 0 0 18px;
}

/* ---------- Category cards ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 6px;
}

.card {
  border: 1px solid #d6d6d6;
  background: #f7f7f7;
  padding: 12px 14px;
}

.card h4 {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 500;
}

.card p {
  margin: 0;
  font-size: 13px;
  color: #4a4a4a;
}

/* ---------- Entry list (cubes / zones / items) ---------- */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 0 0 10px;
}

.entry {
  border: 1px solid #d6d6d6;
  background: #fafafa;
  padding: 10px 12px 12px;
}

.entry h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 500;
}

.entry dl {
  margin: 0;
  font-size: 13px;
}

.entry dt {
  color: #6b6b6b;
  font-size: 12px;
  margin-top: 6px;
}

.entry dd {
  margin: 0;
  color: #1a1a1a;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.6;
  background: #e6eef7;
  color: #14507e;
  white-space: nowrap;
}

.tag.rare {
  background: #f6e7c6;
  color: #7a5200;
}

.tag.legend {
  background: #f3d9f0;
  color: #7a2668;
}

.tag.locked {
  background: #ececec;
  color: #6b6b6b;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 14px;
}

table.wiki {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

table.wiki th,
table.wiki td {
  border: 1px solid #dcdcdc;
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}

table.wiki th {
  background: #f1f4f8;
  font-weight: 500;
  white-space: nowrap;
}

table.wiki tr:nth-child(even) td {
  background: #fafafa;
}

/* ---------- Update log ---------- */
.update {
  border-left: 3px solid #d6d6d6;
  padding: 2px 0 6px 14px;
  margin: 0 0 20px;
}

.update h4 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 500;
}

.update .ver-date {
  font-size: 12px;
  color: #6b6b6b;
  margin: 0 0 8px;
}

.update ul {
  margin: 0;
}

/* ---------- Sidebar ---------- */
.panel {
  background: #fff;
  border: 1px solid #d6d6d6;
  margin-bottom: 20px;
}

.panel h3 {
  margin: 0;
  padding: 8px 12px;
  background: #0e1a2b;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.panel-body {
  padding: 12px;
  font-size: 13px;
}

.panel-body p {
  margin: 0 0 8px;
}

.panel-body p:last-child {
  margin-bottom: 0;
}

.owner {
  font-weight: 500;
}

.owner span {
  color: #6b6b6b;
  font-weight: 400;
}

.note {
  font-size: 12px;
  color: #6b6b6b;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  border-bottom: 1px solid #ececec;
}

.nav-list li:last-child {
  border-bottom: 0;
}

.nav-list a {
  display: block;
  padding: 6px 0;
}

.nav-list a.current {
  font-weight: 500;
  color: #1a1a1a;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1230px;
  margin: 0 auto;
  padding: 18px 20px 36px;
  border-top: 1px solid #d6d6d6;
  font-size: 12px;
  color: #6b6b6b;
}

.site-footer p {
  margin: 0 0 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .content {
    grid-template-columns: 1fr;
  }

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

  .wiki-head h1 {
    font-size: 22px;
  }

  .tabs {
    overflow-x: auto;
  }
}

/* ==========================================================================
   v2 additions — auth, cube thumbnails, cube detail, edit form
   ========================================================================== */

/* ---- Auth area in top nav ---- */
.auth-area {
  color: #d3dae5;
  font-size: 13px;
  white-space: nowrap;
  margin-left: 12px;
}

.auth-area a {
  color: #fff;
}

.auth-area .who {
  color: #a9b6c9;
}

.auth-area .who strong {
  color: #fff;
  font-weight: 500;
}

/* ---- Cube thumbnails in the list ---- */
.entry-thumb {
  display: block;
  background: #fff;
  border: 1px solid #e3e3e3;
  margin-bottom: 8px;
  text-align: center;
  padding: 6px;
}

.entry-thumb img {
  width: 100%;
  max-width: 150px;
  height: auto;
  display: inline-block;
  image-rendering: auto;
}

/* ---- Cube detail layout ---- */
.cube-detail {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: start;
}

.cube-detail-img {
  background: #fff;
  border: 1px solid #d6d6d6;
  padding: 12px;
  text-align: center;
}

.cube-detail-img img {
  width: 100%;
  max-width: 196px;
  height: auto;
}

.cube-detail-body h3 {
  margin: 18px 0 8px;
}

/* ---- Auth / edit forms ---- */
.form-card {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #d6d6d6;
  padding: 22px 26px 26px;
}

.form-card h2 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 500;
  border-bottom: 1px solid #e3e3e3;
  padding-bottom: 8px;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field span {
  display: block;
  font-size: 12px;
  color: #6b6b6b;
  margin-bottom: 4px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #c9c9c9;
  border-radius: 3px;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
  background: #fff;
}

.field textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

button {
  padding: 8px 16px;
  border: 0;
  border-radius: 3px;
  background: #0e1a2b;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

button:hover {
  background: #1b2c45;
}

.form-msg {
  font-size: 13px;
}

.form-msg.ok {
  color: #1a7a3c;
}

.form-msg.err {
  color: #b02a2a;
}

.switch-line {
  font-size: 13px;
  color: #6b6b6b;
  margin-top: 14px;
}

/* ---- Edit panel (admin only) ---- */
.edit-panel {
  margin-top: 26px;
  border-top: 1px solid #e3e3e3;
  padding-top: 18px;
}

.edit-panel h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
}

.edit-panel .hint {
  font-size: 12px;
  color: #6b6b6b;
  margin: 0 0 14px;
}

@media (max-width: 640px) {
  .cube-detail {
    grid-template-columns: 1fr;
  }
}

.field-hint {
  font-size: 12px;
  color: #6b6b6b;
  margin: -6px 0 12px;
}

/* ==========================================================================
   Spoiler blocks — text hidden behind a black block until clicked
   ========================================================================== */

.spoiler {
  display: inline;
  background: #1a1a1a;
  color: transparent;
  border-radius: 2px;
  padding: 0 3px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease, color 0.12s ease;
  text-shadow: none;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.spoiler .spoiler-text {
  color: transparent;
}

.spoiler:hover {
  background: #333;
}

.spoiler.revealed {
  background: #fff3c4;
  color: #1a1a1a;
  cursor: pointer;
}

.spoiler.revealed .spoiler-text {
  color: #1a1a1a;
}

.spoiler:focus-visible {
  outline: 2px solid #4a90d9;
  outline-offset: 2px;
}

/* Hint tooltip when the block carries a non-spoiler hint */
.spoiler[data-hint]::after {
  content: " (" attr(data-hint) ")";
  color: #9aa4b2;
  background: #1a1a1a;
  font-size: 12px;
}

.spoiler.revealed[data-hint]::after {
  color: #6b6b6b;
  background: transparent;
}

/* Editing syntax hint box */
.syntax-hint {
  background: #f1f4f8;
  border: 1px solid #d6dde6;
  border-radius: 3px;
  padding: 9px 12px;
  font-size: 12px;
  color: #4a4a4a;
  margin: 0 0 16px;
}

.syntax-hint code {
  background: #fff;
  border: 1px solid #d6dde6;
  border-radius: 2px;
  padding: 0 4px;
  font-size: 12px;
  color: #14507e;
}

/* ==========================================================================
   Page editor — section blocks, checkboxes, secondary buttons
   ========================================================================== */

.section-editor {
  border: 1px solid #dfe4ea;
  background: #fbfcfd;
  border-radius: 4px;
  padding: 10px 12px 12px;
  margin-bottom: 12px;
}

.section-editor-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.section-editor-head .sec-heading {
  flex: 1;
}

.section-editor input[type="text"],
.section-editor textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #c9c9c9;
  border-radius: 3px;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
  background: #fff;
}

.section-editor textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

button.secondary {
  background: #eef1f5;
  color: #1a1a1a;
  border: 1px solid #c9d1db;
}

button.secondary:hover {
  background: #e2e8f0;
}

button.danger {
  background: #fbeaea;
  color: #b02a2a;
  border: 1px solid #efc7c7;
  padding: 6px 10px;
  font-size: 13px;
}

button.danger:hover {
  background: #f6d7d7;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-field input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkbox-field span {
  margin: 0;
  font-size: 13px;
  color: #4a4a4a;
}

/* TOC placeholder styling */
#section-toc .note {
  color: #9aa4b2;
}
