/* Base comum as duas telas. Valores vindos das telas do desenho. */

:root {
  --vermelho: #d61a1e;
  --vermelho-escuro: #b01418;
  --tinta: #111111;
  --cinza-janela: #dedede;
  --visor: #061211;
  --visor-letra: #8fe0cf;
  --visor-letra-2: #6fb3a5;
  --azul-caneta: #1d2a5c;
}

* { box-sizing: border-box; }

/* .win é display:flex, que ganha do atributo hidden. Sem isto, janela
   fechada continua na tela. */
[hidden] { display: none !important; }

/* A página não rola, no computador nem no celular: é uma área de trabalho,
   não um documento. A letra no fundo pode vazar da tela sem criar barra. */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
  background: #fff;
  color: var(--tinta);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  -webkit-text-size-adjust: 100%;
}

body.travado { overflow: hidden; }

a { color: var(--vermelho-escuro); }
a:hover { color: #000; }

button { font-family: inherit; cursor: pointer; }

/* Foco sempre visivel: o site tem que dar pra usar no teclado. */
:focus-visible {
  outline: 2px solid var(--vermelho);
  outline-offset: 2px;
}

.fora-da-tela {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Pula direto para o conteudo, no teclado */
.pular {
  position: absolute; left: 8px; top: -60px; z-index: 999;
  background: var(--tinta); color: #fff; padding: 8px 12px;
  text-decoration: none; transition: top .15s;
}
.pular:focus { top: 8px; }

/* ---------------------------------------------------------- etiqueta dymo */

.dymo {
  display: inline-block;
  background: linear-gradient(180deg, #232425, #0b0b0c 55%, #151617);
  color: #f4f4f0;
  font-family: 'Archivo', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-stretch: 78%;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 2px 8px 1px;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 1px 2px rgba(0, 0, 0, .5);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .25);
}

/* ------------------------------------------------------------------ janela */

.win {
  background: var(--cinza-janela);
  border: 1px solid #000;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .3);
  display: flex;
  flex-direction: column;
}

.tbar {
  height: 22px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  background: repeating-linear-gradient(180deg, #fff 0 1px, #c4c4c4 1px 2px);
  border-bottom: 1px solid #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.tbar .name {
  background: var(--cinza-janela);
  padding: 0 6px;
  display: flex;
  align-items: center;
  height: 16px;
  max-width: 60%;
  overflow: hidden;
}
.tbar .espaco { flex: 1; }

.box {
  width: 13px; height: 13px;
  border: 1px solid #000;
  background: linear-gradient(135deg, #fff, #b9b9b9);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #7a7a7a;
  padding: 0;
  flex: none;
}
.box:hover { background: linear-gradient(135deg, #fff, #9a9a9a); }

/* O de fechar: X preto sobre vermelho. */
.box.fechar {
  background: linear-gradient(135deg, #ef3b3f, var(--vermelho-escuro));
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .45), inset -1px -1px 0 rgba(0, 0, 0, .3);
  display: grid;
  place-items: center;
}
.box.fechar:hover { background: linear-gradient(135deg, #ff5155, #c4171b); }
.box.fechar svg { display: block; width: 70%; height: 70%; }

.inset {
  border: 1px solid #808080;
  border-right-color: #fff;
  border-bottom-color: #fff;
  background: #fff;
}

.pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid #000;
  border-radius: 5px;
  background: linear-gradient(180deg, #fafafa, #cfcfcf);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #959595;
  color: var(--tinta);
  font-size: 12px;
  text-decoration: none;
}
.pbtn:hover { background: linear-gradient(180deg, #fff, #c0c0c0); }
.pbtn[disabled] { opacity: .45; cursor: default; }
.pbtn.on,
.pbtn.red {
  background: linear-gradient(180deg, #ef3b3f, var(--vermelho-escuro));
  color: #fff;
}
.pbtn.red {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 0 0 2px var(--cinza-janela), 0 0 0 3px #000, inset 1px 1px 0 rgba(255, 255, 255, .4);
}
.pbtn.red:hover { background: linear-gradient(180deg, #ff4b4f, #c4171b); color: #fff; }

.ico {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  background: none;
  border: 0;
  color: var(--tinta);
  text-align: center;
}
.ico span {
  font-size: 11px;
  line-height: 1.2;
  background: #fff;
  padding: 0 3px;
  word-break: break-word;
}
.ico.sel span { background: var(--tinta); color: #fff; }

/* ------------------------------------------------------------ papel do leia-me */

.paper {
  background: repeating-linear-gradient(180deg, #f6f4ee 0 27px, #b9c9d6 27px 28px);
  color: var(--azul-caneta);
  font-family: 'Reenie Beanie', 'Comic Sans MS', cursive;
  font-size: 25px;
  line-height: 28px;
  padding: 10px 18px 14px 44px;
  position: relative;
}
.paper::before {
  content: "";
  position: absolute;
  left: 32px; top: 0; bottom: 0;
  width: 1px;
  background: rgba(214, 26, 30, .55);
}
.paper p { margin: 0; }
.paper .assina { color: var(--vermelho); font-size: 30px; }

/* ------------------------------------------------------------------- barras */

.seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  background: #fff;
  border: 2px solid var(--tinta);
  border-radius: 6px;
  margin: 0;
  cursor: pointer;
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 22px;
  background: #fff;
  border: 3px solid var(--tinta);
  border-radius: 6px;
}
.seek::-moz-range-thumb {
  width: 14px; height: 18px;
  background: #fff;
  border: 3px solid var(--tinta);
  border-radius: 6px;
}

/* --------------------------------------------------------- linhas de lista */

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #e4e4e4;
  background: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--tinta);
  text-align: left;
  cursor: pointer;
}
.row .nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tag { font-size: 10px; margin-left: auto; flex: none; }
.row.cur { background: var(--tinta); color: #fff; }
.row.locked { color: #6b6b6b; cursor: default; }
.row.locked .tag { color: var(--vermelho-escuro); }

.frow {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid #e4e4e4;
  background: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--tinta);
  text-align: left;
  cursor: pointer;
}
.frow .nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .info { margin-left: auto; font-size: 10px; flex: none; }
.frow:hover { background: #f1f1f1; }
.frow.cur { background: var(--tinta); color: #fff; }
.frow.locked { color: #6b6b6b; cursor: default; }
.frow.locked:hover { background: none; }
.frow.locked .info { color: var(--vermelho-escuro); }

.side {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 5px 10px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 11px;
  color: var(--tinta);
  text-align: left;
  cursor: pointer;
  letter-spacing: .02em;
}
.side .nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side:hover { background: rgba(17, 17, 17, .08); }
.side.sel { background: var(--tinta); color: #fff; }

.hatch { background: repeating-linear-gradient(45deg, #fff 0 6px, #e6e6e6 6px 12px); }

/* ----------------------------------------------------------- mudo e solo */

.ms {
  width: 26px; height: 18px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid #000;
  border-radius: 3px;
  background: linear-gradient(180deg, #fafafa, #cfcfcf);
  color: var(--tinta);
  padding: 0;
  font-family: inherit;
}
.ms.m-on { background: #e0b020; }
.ms.s-on { background: #3fae5a; }

.lane {
  height: var(--altura-faixa, 50px);
  border-bottom: 1px solid #c9c9c9;
  position: relative;
  padding: 4px 0;
  background: #fff;
}

/* Volume da faixa. Fininho, para caber na cabeça junto do M e do S. */
.vol {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 42px;
  height: 16px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.vol::-webkit-slider-runnable-track {
  height: 5px;
  border: 1px solid #000;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--tinta) 0 var(--cheio, 100%), #fff var(--cheio, 100%));
}
.vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 9px;
  height: 15px;
  margin-top: -6px;
  border: 1px solid #000;
  border-radius: 2px;
  background: linear-gradient(180deg, #fafafa, #cfcfcf);
  box-shadow: inset 1px 1px 0 #fff;
}
.vol::-moz-range-track {
  height: 5px;
  border: 1px solid #000;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--tinta) 0 var(--cheio, 100%), #fff var(--cheio, 100%));
}
.vol::-moz-range-thumb {
  width: 9px;
  height: 15px;
  border: 1px solid #000;
  border-radius: 2px;
  background: linear-gradient(180deg, #fafafa, #cfcfcf);
}
.lane canvas { display: block; width: 100%; height: 100%; }
.lane.dim canvas { opacity: .22; }

/* --------------------------------------------------------------- rabiscos */

.decor { position: absolute; z-index: 1; pointer-events: none; }

/* Letra de caneta. É opt-in: se ficasse em .tag, vazava para as etiquetas das
   listas, e "4:02" ou "12 fotos" nessa fonte não dá pra ler. */
.caneta { font-family: 'Sedgwick Ave Display', 'Permanent Marker', cursive; line-height: 1; }

/* ----------------------------------------------------------------- visor */

.visor {
  background: var(--visor);
  border: 1px solid #000;
  font-family: 'VT323', monospace;
  color: var(--visor-letra);
}

/* ------------------------------------------------------- a letra no fundo */

/* Fica atrás de tudo, não recebe clique e não entra na seleção de texto. */
.letra-fundo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity .7s ease;
}
.letra-fundo.apagando { opacity: 0; }

/* A letra cresce do meio da tela para fora. A caixa de cima é presa pela base
   no centro, então cada verso novo empurra os anteriores para cima e o que
   está sendo escrito fica sempre no meio. A de baixo é presa pelo topo no
   mesmo centro, e desce. */
/* Sobe quando o texto encosta no limite de baixo (ver segurarNoLimite). */
.letra-bloco {
  position: absolute;
  inset: 0;
  transition: transform .35s ease;
}
.letra-alto {
  position: absolute;
  left: 0; right: 0;
  bottom: 50%;
}
.letra-baixo {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
}

.letra-verso {
  margin: 0;
  font-family: 'Special Elite', 'IBM Plex Mono', ui-monospace, monospace;
  color: #cfcfcf;
  line-height: 1.35;
  white-space: nowrap;
  text-align: center;
}
/* respiro entre estrofes */
.letra-verso.nova-estrofe { margin-top: .7em; }

/* O cursor da máquina de escrever. */
.letra-cursor {
  display: inline-block;
  width: .52em;
  height: .95em;
  margin-left: .06em;
  vertical-align: -.12em;
  background: #bdbdbd;
  animation: pisca .9s steps(1) infinite;
}
@keyframes pisca { 50% { opacity: 0; } }

/* ---------------------------------------------------------------- aviso */

.aviso {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9000;
  background: var(--tinta);
  color: #fff;
  padding: 9px 14px;
  font-size: 12px;
  max-width: 80vw;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .3);
  animation: entra .18s ease-out;
}
@keyframes entra { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
