/* ===== Cabine 2000 · estilo Y2K ===== */
[hidden] { display: none !important; }
:root {
  --rosa: #ff4fc3;
  --rosa-claro: #ffd3f1;
  --azul: #3fb6ff;
  --azul-claro: #c9efff;
  --lilas: #c7b3ff;
  --tinta: #2a1840;
  --branco: #ffffff;
  --sombra: 0 6px 0 rgba(42, 24, 64, .18), 0 14px 30px rgba(120, 40, 140, .25);
  --pixel: "Pixelify Sans", "VT323", monospace;
  --led: "VT323", monospace;
  --redonda: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--redonda);
  color: var(--tinta);
  background: #fbd7f3;
  overflow-x: hidden;
}
.fundo {
  position: fixed; inset: 0; z-index: -1;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='%23ffffff' opacity='.75'%3E%3Cpath d='M20 8l2.2 6.8L29 17l-6.8 2.2L20 26l-2.2-6.8L11 17l6.8-2.2z'/%3E%3Cpath d='M86 64l1.4 4.3 4.3 1.4-4.3 1.4L86 75.4l-1.4-4.3-4.3-1.4 4.3-1.4z'/%3E%3Ccircle cx='70' cy='18' r='2'/%3E%3Ccircle cx='28' cy='92' r='2.5'/%3E%3Cpath d='M98 100c-3-4-9-1-6 4l6 6 6-6c3-5-3-8-6-4z' opacity='.8'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(160deg, #ffc4ec 0%, #e2c8ff 45%, #b8ebff 100%);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----- telas ----- */
.tela { display: none; min-height: calc(100vh - 48px); padding: 24px 16px 32px; align-items: center; justify-content: center; flex-direction: column; gap: 18px; }
.tela.ativa { display: flex; }

/* ----- janela estilo sistema operacional antigo ----- */
.janela {
  width: min(560px, 100%);
  background: #fff7fd;
  border: 3px solid var(--tinta);
  border-radius: 14px;
  box-shadow: var(--sombra);
  overflow: hidden;
}
.janela-barra {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px;
  background: linear-gradient(180deg, #8fd8ff 0%, #3fa8ff 48%, #2387e8 52%, #59b8ff 100%);
  color: #fff; font-family: var(--pixel); font-size: 15px; letter-spacing: .02em;
  border-bottom: 3px solid var(--tinta);
  text-shadow: 1px 1px 0 #1660b0;
}
.janela-botoes { display: flex; gap: 5px; }
.janela-botoes i { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--tinta); background: linear-gradient(#fff, #ffd3f1); }
.janela-botoes i:last-child { background: linear-gradient(#ffb3d9, #ff4fc3); }
.janela-corpo { padding: 22px 22px 24px; text-align: center; }

/* ----- menu ----- */
.selo-topo { font-family: var(--pixel); color: var(--rosa); margin: 0 0 4px; letter-spacing: .1em; }
.logo-cromado {
  margin: 0; font-family: var(--redonda); font-weight: 700; line-height: .92;
  font-size: clamp(56px, 15vw, 96px);
  background: linear-gradient(180deg, #ffffff 0%, #e6e9f5 30%, #9aa6c8 48%, #ffffff 52%, #c9b3ff 75%, #ff8fdc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px var(--tinta);
  filter: drop-shadow(4px 4px 0 var(--rosa));
}
.sub { margin: 14px auto 18px; max-width: 420px; font-size: 16px; line-height: 1.45; }
.botoes-menu { display: grid; gap: 12px; max-width: 320px; margin: 0 auto; }
.contador {
  display: inline-block; margin: 18px 0 0; font-family: var(--led); font-size: 20px;
  background: #111; color: #7dff7a; padding: 2px 10px; border-radius: 4px; border: 2px solid var(--tinta);
}
.letreiro { width: min(560px, 100%); overflow: hidden; border: 3px solid var(--tinta); border-radius: 10px; background: #111; color: #ffe14d; font-family: var(--pixel); font-size: 15px; padding: 6px 0; white-space: nowrap; }
.letreiro span { display: inline-block; padding-left: 100%; animation: rolar 22s linear infinite; }
@keyframes rolar { to { transform: translateX(-100%); } }

/* ----- botões bolha (aqua) ----- */
.btn-bolha {
  position: relative; font-family: var(--redonda); font-weight: 700; font-size: 17px;
  color: var(--tinta); padding: 12px 20px; min-height: 48px;
  border: 3px solid var(--tinta); border-radius: 999px; cursor: pointer;
  box-shadow: 0 4px 0 var(--tinta);
  transition: transform .08s, box-shadow .08s;
}
.btn-bolha::after { content: ""; position: absolute; left: 14%; right: 14%; top: 4px; height: 38%; border-radius: 999px; background: linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.1)); pointer-events: none; }
.btn-bolha:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--tinta); }
.btn-bolha:focus-visible, .chip:focus-visible, .btn-mini:focus-visible, .card-layout:focus-visible, .slot:focus-visible { outline: 3px dashed var(--azul); outline-offset: 3px; }
.btn-bolha:disabled { opacity: .45; cursor: not-allowed; }
.btn-bolha.rosa { background: linear-gradient(#ffb3e6, #ff4fc3); }
.btn-bolha.azul { background: linear-gradient(#c9efff, #3fb6ff); }
.btn-bolha.cinza { background: linear-gradient(#ffffff, #d7d9e8); }
.btn-bolha.grande { font-size: 20px; padding: 14px 26px; }
.linha-botoes { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.linha-botoes.coluna { flex-direction: column; }

.titulo-pixel { font-family: var(--pixel); font-size: 28px; margin: 0 0 14px; color: var(--rosa); text-shadow: 2px 2px 0 var(--tinta); }
h3 { font-family: var(--pixel); font-size: 17px; margin: 18px 0 8px; text-align: left; }

/* ----- layouts ----- */
.grade-layouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.card-layout {
  background: #fff; border: 3px solid var(--tinta); border-radius: 12px; padding: 12px 8px 10px; cursor: pointer;
  font-family: var(--redonda); font-weight: 700; font-size: 14px; color: var(--tinta);
  display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 3px 0 var(--tinta);
}
.card-layout[aria-checked="true"] { background: var(--rosa-claro); box-shadow: 0 3px 0 var(--tinta), 0 0 0 4px var(--rosa); }
.mini-layout { display: grid; gap: 3px; padding: 5px; background: var(--lilas); border: 2px solid var(--tinta); border-radius: 4px; }
.mini-layout i { display: block; width: 26px; height: 20px; background: #fff; border: 1.5px solid var(--tinta); }

/* ----- câmera digital ----- */
.digicam {
  width: min(680px, 100%);
  background: linear-gradient(160deg, #f4f5fa 0%, #c9ccd9 40%, #e9eaf2 60%, #a9adc0 100%);
  border: 3px solid var(--tinta); border-radius: 26px; padding: 14px; box-shadow: var(--sombra);
}
.digicam-topo { display: flex; justify-content: space-between; align-items: center; padding: 2px 8px 10px; }
.marca { font-family: var(--pixel); font-weight: 700; letter-spacing: .12em; color: #4a4f66; }
.led { width: 12px; height: 12px; border-radius: 50%; background: #5a5; border: 2px solid var(--tinta); }
.led.gravando { background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b; }
.lcd { position: relative; aspect-ratio: 4 / 3; background: #111; border: 4px solid #2b2f40; border-radius: 10px; overflow: hidden; }
.lcd video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lcd video.espelhado { transform: scaleX(-1); }
.hud span { position: absolute; font-family: var(--led); font-size: 22px; color: #fff; text-shadow: 1px 1px 0 #000; }
.hud-ce { top: 8px; left: 10px; } .hud-cd { top: 8px; right: 10px; }
.hud-be { bottom: 6px; left: 10px; } .hud-bd { bottom: 6px; right: 10px; color: #ff9a1f !important; text-shadow: 0 0 6px rgba(255,140,0,.8) !important; }
.bateria { display: inline-flex; gap: 2px; padding: 2px; border: 2px solid #fff; border-radius: 3px; }
.bateria i { width: 6px; height: 10px; background: #7dff7a; }
.contagem { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--pixel); font-size: clamp(80px, 22vw, 160px); color: #fff; text-shadow: 4px 4px 0 var(--rosa), -2px -2px 0 var(--tinta); pointer-events: none; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.ativo { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.aviso-camera { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; background: #1b1430; color: #fff; font-size: 16px; line-height: 1.45; }
.digicam-baixo { padding-top: 12px; }
.miniaturas { display: flex; gap: 6px; justify-content: center; margin-top: 12px; min-height: 10px; }
.miniaturas img { width: 64px; aspect-ratio: 4/3; object-fit: cover; border: 2px solid var(--tinta); border-radius: 4px; background: #fff; }

/* ----- chips ----- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.janela-corpo .chips { justify-content: flex-start; }
.chip {
  font-family: var(--redonda); font-weight: 700; font-size: 14px; color: var(--tinta);
  background: #fff; border: 2px solid var(--tinta); border-radius: 999px; padding: 7px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-checked="true"] { background: var(--rosa); color: #fff; }
.chip .amostra { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--tinta); }

/* ----- upload ----- */
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.slot {
  aspect-ratio: 4 / 3; border: 3px dashed var(--tinta); border-radius: 10px; background: #fff;
  display: grid; place-items: center; cursor: pointer; overflow: hidden; padding: 0;
  font-family: var(--pixel); font-size: 16px; color: #8a6aa8;
}
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot.cheio { border-style: solid; }

/* ----- editor ----- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 22px; width: min(1080px, 100%); align-items: start; }
.area-tira { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#tira { max-width: 100%; max-height: 82vh; height: auto; border-radius: 6px; box-shadow: var(--sombra); touch-action: none; cursor: grab; background: #fff; }
#tira.arrastando { cursor: grabbing; }
.dica { margin: 0; font-family: var(--pixel); font-size: 15px; background: rgba(255,255,255,.7); padding: 4px 10px; border-radius: 6px; }
.painel { width: 100%; }
.painel .janela-corpo { text-align: left; }
.painel .titulo-pixel { text-align: center; }
.adesivos { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.adesivos button { aspect-ratio: 1; border: 2px solid var(--tinta); border-radius: 10px; background: #fff; cursor: pointer; padding: 4px; }
.adesivos button:hover { background: var(--rosa-claro); }
.adesivos canvas { width: 100%; height: 100%; display: block; }
.controles-adesivo { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.controles-adesivo::before { content: "adesivo:"; font-family: var(--pixel); margin-right: 4px; }
.btn-mini { width: 40px; height: 40px; border: 2px solid var(--tinta); border-radius: 10px; background: linear-gradient(#fff, #e3e5f2); font-size: 18px; cursor: pointer; }
.campo { display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
.campo input { font: inherit; font-weight: 500; padding: 10px 12px; border: 2px solid var(--tinta); border-radius: 10px; background: #fff; }
.campo-check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 15px; }
.campo-check input { width: 20px; height: 20px; accent-color: var(--rosa); }

.rodape { text-align: center; font-size: 13px; padding: 0 16px 18px; color: #5a3d78; }

@media (max-width: 820px) {
  .editor { grid-template-columns: 1fr; }
  #tira { max-height: 70vh; }
}
@media (max-width: 480px) {
  .janela-corpo { padding: 18px 14px 20px; }
  .digicam { padding: 10px; border-radius: 20px; }
  .btn-bolha { font-size: 16px; padding: 11px 16px; }
  .btn-bolha.grande { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .letreiro span { animation: none; padding-left: 12px; }
  .flash.ativo { animation: none; }
}
.adesivos .grupo-adesivos { grid-column: 1 / -1; margin: 6px 0 0; font-family: var(--pixel); font-size: 14px; color: var(--tinta); }
.adesivos { max-height: 360px; overflow-y: auto; padding-right: 4px; }
.adesivos img { width: 100%; height: 100%; object-fit: contain; display: block; }
