:root {
  --stone: #9c8f76;
  --stone-light: #b8ab92;
  --stone-dark: #7a6d5a;
  --stone-shadow: #5a4d3d;
  --engraved: #1a1510;
  --engraved-light: #2c2416;
  --text-secondary: #3d3020;
  --parchment: #e0d6c0;
  --parchment-dark: #c9b896;
  --sand: #d4c09a;
  --gold: #7d5a14;
  --gold-light: #9a7320;
  --success: #4a6b3a;
}

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

body {
  font-family: 'Crimson Pro', Georgia, serif;
  background: var(--parchment);
  color: var(--engraved);
  min-height: 100vh;
  background-image:
    linear-gradient(180deg, #e8dfc8 0%, var(--parchment) 20%, var(--parchment-dark) 100%);
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header — losa de piedra con título grabado */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header-inner {
  display: inline-block;
  background: linear-gradient(165deg, var(--stone-light) 0%, var(--stone) 40%, var(--stone-dark) 100%);
  border: 3px solid var(--stone-shadow);
  border-radius: 6px;
  padding: 1.25rem 2rem;
  box-shadow:
    6px 6px 0 var(--stone-shadow),
    inset 0 2px 0 rgba(255,255,255,0.3),
    inset 0 -2px 0 rgba(0,0,0,0.2);
}

.title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  font-weight: 700;
  color: var(--engraved);
  letter-spacing: 0.12em;
  text-shadow:
    1px 1px 0 rgba(255,255,255,0.4),
    -1px -1px 0 rgba(0,0,0,0.35),
    0 0 0 1px rgba(0,0,0,0.1);
}

.subtitle {
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

.auth-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.auth-user {
  font-weight: 600;
  color: var(--engraved);
}

.btn-logout {
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  padding: 0.4rem 0.9rem;
  background: var(--stone-light);
  color: var(--engraved);
  border: 2px solid var(--stone-dark);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--stone-shadow);
}

.btn-logout:hover {
  background: var(--stone-dark);
  color: var(--parchment);
}

.login-hint {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-style: italic;
}

.auth-gate {
  text-align: center;
  padding: 0.75rem 0;
}

.auth-gate .btn-link {
  font-size: 1.1rem;
}

.auth-gate-sep {
  margin: 0 0.75rem;
  color: var(--text-secondary);
}

.auth-toggle {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: var(--stone-light);
  border: 2px solid var(--stone-dark);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.pending-item strong {
  color: var(--engraved);
}

.btn-approve {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  background: var(--success);
  color: var(--parchment);
  border: 2px solid var(--stone-shadow);
  border-radius: 4px;
  cursor: pointer;
}

.btn-approve:hover {
  filter: brightness(1.15);
}

.pending-empty {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
}

.btn-link {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-link:hover {
  color: var(--gold-light);
}

/* Bloques tipo tabla de piedra */
.form-section {
  margin-bottom: 2rem;
}

.form-card {
  background: linear-gradient(165deg, var(--stone-light) 0%, var(--stone) 45%, var(--stone-dark) 100%);
  border: 3px solid var(--stone-shadow);
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow:
    5px 5px 0 var(--stone-shadow),
    inset 0 2px 0 rgba(255,255,255,0.25),
    inset 0 -2px 0 rgba(0,0,0,0.15);
}

.form-title {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  color: var(--engraved);
  text-align: center;
  text-shadow:
    1px 1px 0 rgba(255,255,255,0.35),
    -1px -1px 0 rgba(0,0,0,0.25);
}

.quote-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--engraved);
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

.input {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--stone-shadow);
  border-radius: 4px;
  background: var(--parchment);
  color: var(--engraved);
}

.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(154, 115, 32, 0.35);
}

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

.btn-submit {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  padding: 0.65rem 1.2rem;
  background: linear-gradient(180deg, var(--stone-dark) 0%, var(--stone-shadow) 100%);
  color: var(--parchment);
  border: 2px solid var(--engraved);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--engraved), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.1s, box-shadow 0.1s;
  margin-top: 0.25rem;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

.btn-submit:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--engraved), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-submit:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--engraved);
}

/* Título de la sección de mandamientos */
.quotes-title {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  color: var(--engraved);
  text-align: center;
  text-shadow:
    1px 1px 0 rgba(255,255,255,0.3),
    -1px -1px 0 rgba(0,0,0,0.2);
}

.quotes-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Cada frase = tablilla de piedra con texto grabado */
.quote-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1rem;
  row-gap: 0.2rem;
  align-items: start;
  background: linear-gradient(165deg, var(--stone-light) 0%, var(--stone) 45%, var(--stone-dark) 100%);
  border: 3px solid var(--stone-shadow);
  border-radius: 6px;
  padding: 1.15rem 1.25rem 1rem 2.15rem;
  box-shadow:
    5px 5px 0 var(--stone-shadow),
    inset 0 2px 0 rgba(255,255,255,0.2),
    inset 0 -2px 0 rgba(0,0,0,0.2);
  animation: tabletIn 0.4s ease-out;
}

/* Número romano grabado en el borde */
.quote-card::before {
  content: attr(data-num);
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--engraved);
  opacity: 0.9;
  text-shadow:
    1px 1px 0 rgba(255,255,255,0.35),
    -1px -1px 0 rgba(0,0,0,0.3);
}

@keyframes tabletIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Texto con efecto grabado en piedra */
.quote-text {
  grid-column: 1 / -1;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0.3rem;
  color: var(--engraved);
  text-shadow:
    1px 1px 0 rgba(255,255,255,0.35),
    -1px -1px 0 rgba(0,0,0,0.3),
    0 0 0 1px rgba(0,0,0,0.08);
  letter-spacing: 0.02em;
}

.quote-author {
  grid-column: 1 / -1;
  font-weight: 600;
  color: var(--engraved);
  font-size: 0.95rem;
  margin: 0;
  text-shadow:
    1px 1px 0 rgba(255,255,255,0.3),
    -1px -1px 0 rgba(0,0,0,0.2);
}

.quote-date {
  grid-column: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
  font-style: italic;
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
  align-self: center;
}

/* Likes estilo grabado en piedra */
.quote-votes {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
  gap: 0.9rem;
  margin-top: 0.1rem;
  white-space: nowrap;
}

.quote-votes span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-shadow:
    1px 1px 0 rgba(255,255,255,0.22),
    -1px -1px 0 rgba(0,0,0,0.18);
}

.btn-vote {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  transition: transform 0.12s ease, color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
  text-shadow:
    1px 1px 0 rgba(255,255,255,0.22),
    -1px -1px 0 rgba(0,0,0,0.18);
}

.btn-vote:hover {
  color: var(--engraved);
  transform: translateY(-1px);
}

.btn-vote:active {
  transform: translateY(0);
}

.btn-vote.active-like {
  color: var(--gold-light);
  font-weight: 700;
}

.btn-vote.active-dislike {
  color: var(--stone-shadow);
  font-weight: 700;
}

.quote-delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 26px;
  height: 26px;
  border: 2px solid var(--stone-shadow);
  border-radius: 4px;
  background: var(--stone-dark);
  color: var(--parchment);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.quote-delete:hover {
  background: var(--stone-shadow);
  color: var(--parchment);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-style: italic;
  display: none;
}

.empty-state.visible {
  display: block;
}

.quotes-list:not(:empty) ~ .empty-state {
  display: none;
}

@media (max-width: 500px) {
  .page {
    padding: 1rem;
  }

  .header-inner {
    padding: 1rem 1.25rem;
  }

  .form-card {
    padding: 1rem;
  }

  .quote-card {
    grid-template-columns: 1fr;
    row-gap: 0.25rem;
    padding: 0.95rem 0.95rem 0.95rem 1.9rem;
  }

  .quote-card::before {
    left: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
  }

  .quote-text,
  .quote-author,
  .quote-date,
  .quote-votes {
    grid-column: 1;
  }

  .quote-votes {
    justify-content: flex-start;
    margin-top: 0.35rem;
    gap: 0.75rem;
  }
}