:root {
  --bg: #120b0f;
  --bg-soft: #1a1116;
  --card: #1e1419;

  --text: #f4f1ec;
  --muted: #b6aeb5;

  --accent: #c8a35f;
  --accent-soft: rgba(200,163,95,.18);

  --border: #33232b;
}

/* ======================================
   LIGHT MODE
====================================== */

body.light {
  --bg: #f6f2ee;
  --bg-soft: #ffffff;
  --card: #ffffff;

  --text: #1c1618;
  --muted: #8a7f86;

  --accent: #c8a35f;
  --accent-soft: rgba(200,163,95,.18);

  --border: #e8e1db;
}

/* ======================================
   BASE
====================================== */

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

body {
  font-family: 'Inter', sans-serif;

  background:
    radial-gradient(circle at 20% 10%, rgba(200,163,95,.06), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(200,163,95,.05), transparent 50%),
    radial-gradient(circle at top, var(--bg-soft), var(--bg));

  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.app {
  width: 100%;
  max-width: 980px;
}

/* ======================================
   HEADER
====================================== */

header {
  margin-bottom: 28px;
  text-align: center;   /* CENTRALIZA TUDO */
}

header h1 {
  font-size: 2.3rem;
  font-weight: 700;
  background: linear-gradient(90deg, #c8a35f, #f1d77a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: .95rem;
  max-width: 720px;
  margin-left: auto;   /* CENTRALIZA BLOCO */
  margin-right: auto;  /* CENTRALIZA BLOCO */
}


/* ======================================
   CARD
====================================== */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(36,24,32,.85), rgba(30,20,25,.92));
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 22px;
  box-shadow:
    0 22px 60px rgba(0,0,0,.65),
    inset 0 1px 0 rgba(255,255,255,.05);
}

/* Gold border light */
body.light .card {
  background: #ffffff;
  border: 1px solid rgba(200,163,95,.55);
  box-shadow:
    0 18px 40px rgba(0,0,0,.08),
    inset 0 0 0 1px rgba(200,163,95,.18);
}

/* ======================================
   CONTROLS
====================================== */

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.control-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Direction buttons gold border light */
body.light .control-group button {
  border: 1px solid rgba(200,163,95,.55);
}

/* ======================================
   INPUTS
====================================== */

select {
  background: #140c10;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .95rem;
  outline: none;
  flex: 1;
  min-width: 0;
}

/* Gold border light — selector */
body.light select {
  background: #ffffff;
  border: 1px solid rgba(200,163,95,.55);
}

textarea {
  width: 100%;
  max-width: 100%;
  min-height: 120px;
  background: #140c10;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  color: var(--text);
  resize: vertical;
  font-size: .9rem;
  line-height: 1.5;
  margin-bottom: 16px;
  display: block;
}

/* Gold border light — input */
body.light textarea {
  background: #ffffff;
  border: 1px solid rgba(200,163,95,.55);
}

textarea::placeholder {
  color: var(--muted);
}

/* ======================================
   OUTPUT
====================================== */

.output {
  min-height: 120px;
  background: linear-gradient(180deg, #140c10, #0f080c);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  font-size: 28px;
  line-height: 1.6;
  text-align: center;
}

/* Gold border light — output */
body.light .output {
  background: #ffffff;
  border: 1px solid rgba(200,163,95,.55);
}

/* ======================================
   ACTIONS
====================================== */

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Reset button gold border light */
body.light .actions button:not(.primary) {
  border: 1px solid rgba(200,163,95,.55);
}

/* ======================================
   BUTTONS
====================================== */

button {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 16px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  font-size: .9rem;
  transition:background .25s ease border-color .25s ease box-shadow .25s ease;
}



button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

button.primary {
  background: linear-gradient(135deg, #c8a35f, #f1d77a);
  color: #1a1208;
  border: none;
}

/* ======================================
   FOOTER
====================================== */

footer {
  margin-top: 28px;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
}

/* ======================================
   RESPONSIVE
====================================== */

@media (max-width: 600px) {
  header h1 { font-size: 1.8rem; }
  .output { font-size: 1.25rem; }
}

/* ======================================
   RANGE
====================================== */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(to right, var(--border), var(--accent));
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: -5px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: none;
}

/* Alignment fix */

.zoom-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-control input[type="range"] {
  flex: 1;
}

button, a, img {
  touch-action: manipulation;
}

/* BOTÃO TAMANHO FIXO */
#themeToggle {
  width: 40px;     /* tamanho do botão */
  height: 40px;
  padding: 6px;      /* remove padding global */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ÍCONE MAIOR DENTRO */
#themeToggle img {
  width: 50px;     /* aumenta só o ícone */
  height: 50px;
  display: block;
}

/* ===============================
   HEADER ENTRY ANIMATION
================================ */

header h1 {
  opacity: 0;
  transform: translateY(18px);
  animation: titleFade 1.5s ease forwards;
}

header p {
  opacity: 0;
  transform: translateY(18px);
  animation: subtitleFade 1s ease forwards;
  animation-delay: .25s; /* entra depois */
}

/* KEYFRAMES */

@keyframes titleFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes subtitleFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.unicode-alert-text {
  font-size: .75rem;
  color: var(--muted);
  margin-right:auto;   /* empurra botões pra direita */
  line-height: 1.2;
  max-width: 520px;    /* evita invadir botões */
}

/* ======================================
   MOBILE OPTIMIZATION PATCH
   Elegant Fonts
====================================== */

@media (max-width: 768px) {

  /* APP PADDING */
  body {
    padding: 20px 12px;
  }

  /* HEADER */
  header {
    margin-bottom: 20px;
  }

  header h1 {
    font-size: 1.7rem;
  }

  header p {
    font-size: .85rem;
    line-height: 1.35;
    padding: 0 6px;
  }

  /* CARD */
  .card {
    padding: 16px;
    border-radius: 16px;
  }

  /* CONTROLS STACK */
  .controls {
    flex-wrap: wrap;
    gap: 10px;
  }

  select {
    flex: 100%;
  }

  .control-group {
    width: 100%;
    justify-content: space-between;
  }

  /* TEXTAREA */
  textarea {
    min-height: 100px;
    font-size: .85rem;
  }

  /* OUTPUT */
  .output {
    min-height: 100px;
    font-size: 1.2rem;
    padding: 14px;
  }

  /* RANGE SLIDER */
  input[type="range"] {
    height: 8px;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -6px;
  }

  /* ACTION BUTTONS STACK */
  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .actions button {
    width: 100%;
  }

  /* ALERT TEXT */
  .unicode-alert-text {
    margin-right: 0;
    max-width: 100%;
  }

}

/* ======================================
   HEADER COMPACT — MOBILE
====================================== */

@media (max-width: 768px) {

  /* Sobe tudo da página */
  body {
    padding: 16px 12px;
  }

  /* Aproxima título da ferramenta */
  header {
    margin-bottom: 16px;
  }

  /* Título menor e mais compacto */
  header h1 {
    font-size: 1.3rem;
    line-height: 1.2;
  }

  /* Parágrafo mais curto */
  header p {
    font-size: .82rem;
    line-height: 1.3;
    margin-top: 4px;
  }

  /* Card mais justo */
  .card {
    padding: 16px;
  }

}
/* ===============================
   SITE FOOTER
================================ */

.site-footer{
  margin-top:40px;
  border-top:1px solid var(--border);
  padding-top:30px;
}

.how-to{
  background:var(--bg-soft);
  border:1px solid var(--border);
  border-radius:16px;
  padding:22px;
  margin-bottom:20px;
}

.how-to h2{
  margin-bottom:12px;
  font-size:1.3rem;
}

.how-to p{
  color:var(--muted);
  font-size:.9rem;
  margin-bottom:12px;
}

.how-to ol{
  padding-left:18px;
  line-height:1.6;
  font-size:.9rem;
}

.how-to li{
  margin-bottom:10px;
}

.note{
  font-size:.8rem;
  color:var(--muted);
  margin-top:12px;
}

.footer-links{
  display:flex;
  justify-content:center;
  gap:18px;
  font-size:.85rem;
}

.footer-links a{
  color:var(--muted);
  text-decoration:none;
  transition:color .25s ease;
}

.footer-links a:hover{
  color:var(--accent);
}

/* ======================================
   FOOTER PAGES
====================================== */
.footer-page {
  width: 100%;
}

.footer-page .card h2 {
  margin-bottom: 12px;
}

.footer-page .card p {
  color: var(--text);
  line-height: 1.7;
  font-size: .96rem;
}

.footer-page .card strong {
  color: var(--text);
}

.footer-bottom-links {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-size: .85rem;
}

.footer-bottom-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color .25s ease;
}

.footer-bottom-links a:hover {
  color: var(--accent);
}


.footer-credit,
.footer-bottom-credit {
  margin-top: 14px;
  text-align: center;
}

.footer-credit a,
.footer-bottom-credit a {
  display: inline-block;
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--accent);
  text-decoration: none;
  transition: opacity .25s ease, transform .25s ease;
}

.footer-credit a:hover,
.footer-bottom-credit a:hover {
  opacity: .92;
  transform: translateY(-1px);
}
