/* ==========================================================================
   gridChat — meowrhino flat theme (paleta mínima, sin mix ni degradados)
   ========================================================================== */

/* 1) Paleta base (solo variables que decides tú) -------------------------- */
:root {
  /* Base (tu paleta) */
  --bg-1: #353535; /* fondo principal */
  --bg-2: #202020; /* contenedores / celdas */
  --text: #fcfaf1; /* texto principal */
  --muted: #707070; /* texto secundario */
  --accent: #f9d57b; /* acento 1 */
  --accent-2: #ec8051; /* acento 2 */

  /* Estados */
  --ok: #22c751;
  --warn: #ffd166;
  --danger: #f24a5e;

  /* Utilidades planas */
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5); /* única sombra negra */
  --grid-gap: 0; /* 0 = celdas 9×9 exactas */
  --ring: var(--accent); /* foco accesible */
}

/* 2) Base / Reset --------------------------------------------------------- */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}

body {
  margin: 0;
  height: 100dvh;

  /* Centra el grid #park en pantalla */
  display: flex;
  align-items: center; /* vertical */
  justify-content: center; /* horizontal */

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Arial;
  background: var(--bg-1);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 3) Grid (contenedor 90×90; celdas 9×9; sin líneas) --------------------- */
#park {
  width: 90dvw;
  height: 90dvh;
  display: grid;
  grid-template-columns: repeat(10, 9dvw);
  grid-template-rows: repeat(10, 9dvh);
  gap: var(--grid-gap);
  background: transparent; /* grid invisible */
}

/* 4) Celdas (planas) ------------------------------------------------------ */
.cell {
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease;
  border: none;
  border-radius: 0; /* sin bordes ni radios */
  box-shadow: none; /* sin sombra en celdas */
}
.cell:hover {
  background: var(--accent);
}

/* hover especial solo para la celda (10,10) = histórico */
.cell[data-row="10"][data-col="10"]:hover {
  background: var(--accent-2);
}

.cell:active {
  transform: translateY(0);
} /* sin “click” hundido */

/* 5) Tipografía ----------------------------------------------------------- */
h3,
.titlePreview {
  font-family: serif;
  color: var(--text);
  margin: 0 0 8px 0;
  letter-spacing: 0.2px;
  text-align: center;
}
.titlePreview {
  font-size: 1em;
  line-height: 1.3;
  max-width: 80%;
  margin: 0px;
}

/* 6) Modals / Paneles (planos + sombra negra) ---------------------------- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4); /* overlay simple */
  backdrop-filter: none; /* sin glass */
}
.modal.show {
  display: flex;
}

.panel {
  width: min(720px, 95vw);
  background: var(--bg-2);
  padding: 16px;
  max-height: 80vh;
  overflow: auto;
  border: none;
  border-radius: 0; /* sin bordes ni radios */
  box-shadow: var(--shadow); /* única sombra negra */
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--thread-color, transparent);
}

/* 7) Formularios ---------------------------------------------------------- */
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 6px;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-1);
  color: var(--text);
  border: none;
  border-radius: 0; /* plano */
  outline: none;
  transition: box-shadow 0.18s ease;
  box-shadow: none;
}
input[type="text"]:focus,
textarea:focus {
  box-shadow: 0 0 0 3px var(--ring);
}

/* 8) Botones — SOLO TEXTO (3 estados) ------------------------------------ */
button {
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text);
  padding: 0;
  box-shadow: none;
  cursor: pointer;
  transition: color 0.12s ease, text-decoration-color 0.12s ease;
  text-decoration: none;
}
button:hover {
  color: var(--accent);
  text-decoration: underline;
}
button:active {
  color: var(--accent-2);
  text-decoration: none;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

/* Variantes (solo color de texto) */
button.primary {
  color: var(--accent);
  padding: 20px;
  background: none;
}

button.primary:hover {
  color: var(--accent-2);
}

button.danger {
  color: var(--danger);
}
button.ghost {
  color: var(--muted);
}

/* 9) Utilidades de layout ------------------------------------------------- */
.row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}
.space {
  flex: 1;
}
.small,
.chip {
  font-size: 12px;
  color: var(--muted);
} /* chips → texto plano */

/* 10) Lista y burbujas de mensajes (planas) ------------------------------ */
.messages {
  padding: 12px;
  margin-top: 8px;
  max-height: 50vh;
  overflow: auto;
  border: none;
  border-radius: 0;
}

/* burbuja plana + franja lateral por remitente (sin border) */
.msg {
  position: relative;
  background: var(--bg-1);
  padding: 10px 12px;
  margin: 8px 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.msg::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--sender-color, var(--accent)); /* color por remitente */
}
.msg .meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

/* Alineación mine/other */
.msg.mine {
  margin-left: 18%;
}
.msg.other {
  margin-right: 18%;
}
@media (max-width: 640px) {
  .msg.mine {
    margin-left: 8%;
  }
  .msg.other {
    margin-right: 8%;
  }
}

/* 11) Accesibilidad: focus ----------------------------------------------- */
.cell:focus-visible,
button:focus-visible,
[data-modal-panel]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

/* 12) Clases “legacy” (desactivadas / por si las reactivas en JS) -------- */
.coord,
.badge {
  display: none !important;
} /* ocultas: ya no se usan */
