/* ===================================================================
   BG12 — folha de estilos isolada. Tudo mora dentro de .bg12-wrap
   ou de .bg12-modalbg, para nunca colidir com o CSS do Blogger nem
   de qualquer outra página onde isto seja embebido.
   =================================================================== */

.bg12-wrap, .bg12-wrap *,
.bg12-modalbg, .bg12-modalbg * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.bg12-wrap, .bg12-wrap * {
  user-select: none;
  -webkit-user-select: none;
}

html, body { background: #ffffff; }
body { margin: 0; }

.bg12-wrap {
  --shell-1: #ecd79b; --shell-2: #dcc07f; --shell-3: #cdae66;
  --shell-border: #b99a55;
  --brand-text: #4a3f28; --brand-sub: #8a6d3b;
  --trim-1: #574930; --trim-2: #3a2f1d; --trim-border: #241d10;
  --trim-text: #ecd79b;
  --hint-text: #8a7548;
  --speaker-dot: #7c6538;

  background: #ffffff;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 10px 34px;
  font-family: Arial, Helvetica, sans-serif;
}

.bg12-wrap.theme-blue {
  --shell-1: #cfe1ee; --shell-2: #9bbdd6; --shell-3: #6f95b8; --shell-border: #557ea3;
  --brand-text: #1f3b52; --brand-sub: #3c6280;
  --trim-1: #2c4457; --trim-2: #1b2c3a; --trim-border: #101c26; --trim-text: #d8ecff;
  --hint-text: #5a7c94; --speaker-dot: #3c6280;
}
.bg12-wrap.theme-orange {
  --shell-1: #f3c893; --shell-2: #eaa15a; --shell-3: #d2822f; --shell-border: #b5661c;
  --brand-text: #5a3110; --brand-sub: #8a5620;
  --trim-1: #5a3618; --trim-2: #3c220d; --trim-border: #251405; --trim-text: #ffe6c2;
  --hint-text: #96612c; --speaker-dot: #8a5620;
}
.bg12-wrap.theme-black {
  --shell-1: #57565a; --shell-2: #3a3a3d; --shell-3: #232326; --shell-border: #141416;
  --brand-text: #eceae4; --brand-sub: #b9b6ad;
  --trim-1: #17171a; --trim-2: #0c0c0e; --trim-border: #000000; --trim-text: #f0ece0;
  --hint-text: #9a978f; --speaker-dot: #9a978f;
}
.bg12-wrap.theme-white {
  --shell-1: #fbfaf6; --shell-2: #eeece4; --shell-3: #dcd9cd; --shell-border: #c3bfae;
  --brand-text: #423d31; --brand-sub: #7c7561;
  --trim-1: #45423a; --trim-2: #2c2a24; --trim-border: #1a1814; --trim-text: #f5f1e6;
  --hint-text: #8a8474; --speaker-dot: #7c7561;
}
.bg12-wrap.theme-verde {
  --shell-1: #d7e2bd; --shell-2: #b6c894; --shell-3: #93a970; --shell-border: #7c9059;
  --brand-text: #2f3a1d; --brand-sub: #55663a;
  --trim-1: #3d4a28; --trim-2: #26301a; --trim-border: #161d0f; --trim-text: #eaf1d8;
  --hint-text: #61713f; --speaker-dot: #55663a;
}
.bg12-wrap.theme-vinho {
  --shell-1: #e9c3c0; --shell-2: #cf9691; --shell-3: #b06e68; --shell-border: #92544e;
  --brand-text: #4a201d; --brand-sub: #773934;
  --trim-1: #4e2723; --trim-2: #331715; --trim-border: #200d0c; --trim-text: #f7dcd9;
  --hint-text: #8a4b46; --speaker-dot: #773934;
}

/* -------- barra superior: título + ícones -------- */

.bg12-headerbar {
  width: 100%; max-width: 360px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding: 0 4px; gap: 8px;
}
.bg12-headerbar h1 { font-size: 0.8rem; letter-spacing: 0.06em; color: #4a3f28; margin: 0; font-weight: 800; }
.bg12-quem { font-size: 0.58rem; color: #8a7548; display: block; font-weight: 400; letter-spacing: 0.02em; margin-top: 2px; }
.bg12-iconbtns { display: flex; gap: 8px; flex: 0 0 auto; }
.bg12-iconbtn {
  width: 30px; height: 30px; border-radius: 50%;
  background: #ecd79b; border: 1px solid #b99a55; color: #4a3f28;
  font-size: 0.85rem; font-weight: 800; font-family: Georgia, serif;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 0 #b99a55; cursor: pointer; touch-action: manipulation;
  position: relative;
}
.bg12-iconbtn:active { transform: translateY(1px); box-shadow: 0 1px 0 #b99a55; }
.bg12-iconbtn.tem-conta::after {
  content: ""; position: absolute; top: 1px; right: 1px;
  width: 7px; height: 7px; border-radius: 50%; background: #6d8a45; border: 1px solid #fff;
}

/* -------- consola física -------- */

.bg12-console {
  width: 100%; max-width: 360px;
  background: linear-gradient(155deg, var(--shell-1) 0%, var(--shell-2) 55%, var(--shell-3) 100%);
  border-radius: 34px;
  padding: 16px 16px 18px;
  box-shadow: 0 18px 30px -12px rgba(74,63,40,0.40), inset 0 2px 0 rgba(255,255,255,0.45), inset 0 -6px 14px rgba(0,0,0,0.18);
  border: 1px solid var(--shell-border);
  position: relative;
}

.bg12-topplate { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.bg12-solar {
  width: 34px; height: 18px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, #33465f 0 6px, #24344a 6px 7px), linear-gradient(160deg, #3d5a7a, #1f2c3d);
  border: 1px solid #1a2635;
}
.bg12-brand { text-align: center; line-height: 1; }
.bg12-brand b { display: block; font-size: 0.86rem; letter-spacing: 0.08em; color: var(--brand-text); }
.bg12-brand span { display: block; font-size: 0.48rem; letter-spacing: 0.14em; color: var(--brand-sub); margin-top: 2px; }
.bg12-speaker { display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; }
.bg12-speaker i { width: 4px; height: 4px; border-radius: 50%; background: var(--speaker-dot); display: block; }

/* -------- ecrã LCD -------- */

.bg12-screenbezel {
  background: #2c2a22; border-radius: 12px; padding: 14px 12px;
  box-shadow: inset 0 0 0 2px #17150f, inset 0 6px 14px rgba(0,0,0,0.5);
}
.bg12-screeninner {
  background: #a9ba86; border-radius: 4px; overflow: hidden; position: relative;
  box-shadow: inset 0 0 10px rgba(30,40,15,0.45);
}
.bg12-screeninner canvas {
  display: block; width: 100%; height: auto;
  /* A tela é feita à medida do aparelho pelo jogo.js, portanto não se pede
     ao navegador que amplie nada: era daí que vinha a letra esborratada. */
  image-rendering: auto;
}
.bg12-scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(30,38,18,0.03) 0px, rgba(30,38,18,0.03) 1px, transparent 1px, transparent 3px);
}
.bg12-screeninner.bg12-crisp .bg12-scanlines { display: none; }

/* -------- 4 botões pequenos entre o LCD e a carcaça -------- */

.bg12-miniRow { display: flex; justify-content: center; gap: 8px; margin-top: 7px; }
.bg12-mini {
  width: 42px; height: 16px; border-radius: 7px;
  background: linear-gradient(160deg, var(--trim-1), var(--trim-2));
  border: 1px solid var(--trim-border);
  color: var(--trim-text);
  font-size: 0.5rem; letter-spacing: 0.03em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 0 var(--trim-border);
  cursor: pointer; touch-action: manipulation;
}
.bg12-mini:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--trim-border); }
.bg12-mini.off { opacity: 0.42; }

.bg12-status {
  display: flex; justify-content: space-between;
  padding: 6px 4px 0; font-size: 0.58rem; letter-spacing: 0.08em; color: var(--brand-sub);
}

/* -------- comandos -------- */

.bg12-controls {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-top: 14px; padding: 0 2px;
}
.bg12-dpad {
  position: relative;
  width: 112px; height: 112px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 8px;
}
.bg12-dpad button {
  border-radius: 50%;
  background: linear-gradient(160deg, var(--trim-1), var(--trim-2));
  border: 1px solid var(--trim-border);
  color: var(--trim-text);
  font-size: 0.68rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--trim-border), inset 0 1px 0 rgba(255,255,255,0.15);
  touch-action: none;
  width: 100%; height: 100%;
}
.bg12-dpad button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--trim-border), inset 0 1px 0 rgba(255,255,255,0.15); }
.bg12-dpad .up    { grid-column: 2; grid-row: 1; }
.bg12-dpad .left  { grid-column: 1; grid-row: 2; }
.bg12-dpad .right { grid-column: 3; grid-row: 2; }
.bg12-dpad .down  { grid-column: 2; grid-row: 3; }
.bg12-dpad .mid {
  position: absolute; left: 50%; top: 50%; width: 10px; height: 10px;
  transform: translate(-50%, -50%);
  background: var(--trim-border); border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}

.bg12-abgroup { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.bg12-ab { display: flex; gap: 14px; }
.bg12-round {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.35);
  font-weight: 800; font-size: 0.85rem; color: #fbeecb;
  box-shadow: 0 4px 0 rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.25);
  touch-action: none;
}
.bg12-round:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.35); }
.bg12-round.a { background: linear-gradient(160deg, #d3654a, #a5402a); }
.bg12-round.b { background: linear-gradient(160deg, #3f7aa8, #285476); }

.bg12-smallbtns { display: flex; gap: 10px; margin-top: 2px; }
.bg12-pill {
  padding: 5px 9px; border-radius: 9px;
  background: linear-gradient(160deg, var(--trim-1), var(--trim-2));
  border: 1px solid var(--trim-border); color: var(--trim-text);
  font-size: 0.5rem; letter-spacing: 0.09em;
  box-shadow: 0 3px 0 var(--trim-border);
  touch-action: none;
}
.bg12-pill:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--trim-border); }

.bg12-hint { text-align: center; color: var(--hint-text); font-size: 0.56rem; margin-top: 10px; letter-spacing: 0.03em; }

@media (min-width: 480px) {
  .bg12-console, .bg12-headerbar { max-width: 430px; }
  .bg12-dpad { width: 130px; height: 130px; gap: 10px; }
  .bg12-round { width: 46px; height: 46px; font-size: 0.9rem; }
}
@media (max-width: 340px) {
  .bg12-wrap { padding: 10px 6px 24px; }
  .bg12-console { border-radius: 26px; padding: 12px 10px 14px; }
  .bg12-dpad { width: 96px; height: 96px; gap: 6px; }
  .bg12-round { width: 36px; height: 36px; font-size: 0.74rem; }
  .bg12-headerbar h1 { font-size: 0.68rem; }
  .bg12-mini { width: 38px; }
}

/* -------- ecrã inteiro: 80% LCD / 20% comandos -------- */

.bg12-wrap.bg12-fs {
  position: fixed; inset: 0; z-index: 99999;
  background: #17150f; padding: 10px; justify-content: center; overflow: hidden;
}
.bg12-fs .bg12-headerbar { max-width: 480px; margin-bottom: 6px; }
.bg12-fs .bg12-headerbar h1, .bg12-fs .bg12-headerbar .bg12-iconbtn { filter: brightness(1.15); }
.bg12-fs .bg12-console { max-width: 480px; height: calc(100% - 40px); display: flex; flex-direction: column; padding: 10px 14px 12px; }
.bg12-fs .bg12-topplate { display: none; }
.bg12-fs .bg12-screenbezel { flex: 1 1 80%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.bg12-fs .bg12-screeninner { height: 100%; display: flex; align-items: center; justify-content: center; }
.bg12-fs .bg12-screeninner canvas { width: auto; height: 100%; max-width: 100%; }
.bg12-fs .bg12-status { flex: 0 0 auto; }
.bg12-fs .bg12-controls { flex: 0 0 20%; margin-top: 8px; align-items: center; }
.bg12-fs .bg12-hint { display: none; }

/* ===================================================================
   Janela flutuante — conta, jogos, teclas, aspecto
   =================================================================== */

.bg12-modalbg {
  position: fixed; inset: 0; background: rgba(30,26,16,0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 100000; padding: 16px;
  font-family: Arial, Helvetica, sans-serif;
}
.bg12-modalbg.open { display: flex; }

.bg12-modal {
  background: #fbf6e8;
  border: 1px solid #d8c79a;
  border-radius: 14px;
  max-width: 360px; width: 100%;
  max-height: 88vh;
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: 0 20px 40px rgba(30,26,16,0.35);
  color: #3b2f1c;
}
.bg12-modalhead {
  padding: 14px 42px 0 18px;
  flex: 0 0 auto;
}
.bg12-modalhead h2 { font-size: 0.95rem; margin: 0; letter-spacing: 0.03em; color: #4a3f28; font-family: Georgia, serif; }
.bg12-modalhead p { font-size: 0.7rem; margin: 3px 0 0; color: #8a7548; }
.bg12-modalclose {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; font-size: 1.3rem; line-height: 1;
  color: #8a7548; cursor: pointer; padding: 4px 8px;
}

.bg12-tabs {
  display: flex; gap: 2px; padding: 10px 12px 0;
  overflow-x: auto; flex: 0 0 auto;
  border-bottom: 1px solid #e6dcc0;
  -webkit-overflow-scrolling: touch;
}
.bg12-tabs button {
  border: none; background: none; font-family: inherit;
  font-size: 0.72rem; color: #8a7548; padding: 7px 9px 8px;
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.bg12-tabs button.on { color: #4a3f28; border-bottom-color: #b99a55; font-weight: 700; }

.bg12-tabbody { padding: 14px 18px 18px; overflow-y: auto; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }

/* -------- aviso dos cookies: uma tira sóbria em baixo, sem tapar o jogo -------- */
.bg12-aviso {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #fbf6e9; border-top: 1px solid #ddd0ac;
  padding: 12px 16px 14px; box-shadow: 0 -4px 18px rgba(60, 45, 15, 0.1);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  font-family: Georgia, "Times New Roman", serif;
}
.bg12-aviso[hidden] { display: none; }
.bg12-aviso p { margin: 0; flex: 1 1 240px; font-size: 0.74rem; line-height: 1.5; color: #5c4d31; }
.bg12-aviso div { display: flex; gap: 8px; margin-left: auto; }
.bg12-aviso button {
  font-family: inherit; font-size: 0.72rem; cursor: pointer;
  padding: 7px 14px; border: 1px solid #c9bb95; background: #fff; color: #5c4d31;
  border-radius: 2px;
}
.bg12-aviso button.ok { background: #4a3f28; border-color: #4a3f28; color: #f6efdc; }
@media (max-width: 420px) {
  .bg12-aviso { padding: 10px 12px 12px; }
  .bg12-aviso div { margin-left: 0; width: 100%; }
  .bg12-aviso button { flex: 1 1 0; }
}
.bg12-painel { display: none; }
.bg12-painel.on { display: block; }

.bg12-modal p { font-size: 0.78rem; line-height: 1.55; margin: 0 0 12px; color: #5c4d31; }
.bg12-modal h3 { font-size: 0.78rem; margin: 16px 0 6px; color: #4a3f28; font-family: Georgia, serif; font-weight: 700; }
.bg12-modal h3:first-child { margin-top: 0; }
.bg12-modal a { color: #7a6532; }

.bg12-campo { margin-bottom: 10px; }
.bg12-campo label { display: block; font-size: 0.66rem; letter-spacing: 0.06em; color: #6b5c3f; margin-bottom: 4px; text-transform: uppercase; }
.bg12-campo input {
  width: 100%; font-family: inherit; font-size: 0.85rem;
  padding: 9px 10px; border: 1px solid #ddd0ab; border-radius: 8px;
  background: #fffdf7; color: #3b2f1c; -webkit-user-select: text; user-select: text;
}
.bg12-campo input:focus { outline: none; border-color: #b99a55; background: #fff; }

.bg12-btn {
  font-family: inherit; font-size: 0.8rem; padding: 9px 16px;
  border: 1px solid #b99a55; border-radius: 8px;
  background: #ecd79b; color: #4a3f28; cursor: pointer;
  box-shadow: 0 2px 0 #b99a55;
}
.bg12-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #b99a55; }
.bg12-btn.leve { background: #fbf6e8; box-shadow: none; }
.bg12-btn[disabled] { opacity: 0.55; }
.bg12-linhabtn { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.bg12-ligacao { background: none; border: none; font-family: inherit; font-size: 0.74rem; color: #7a6532; text-decoration: underline; cursor: pointer; padding: 4px 0; }

.bg12-recado { font-size: 0.74rem; line-height: 1.45; margin: 0 0 10px; padding: 8px 10px; border-left: 3px solid #c9b57f; background: #fdfaf1; color: #5c4d31; }
.bg12-recado.mau { border-left-color: #b56a55; background: #fdf4f1; }
.bg12-recado.vazio { display: none; }

.bg12-lista { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.bg12-lista th, .bg12-lista td { text-align: left; padding: 6px 4px; border-bottom: 1px solid #ece2c9; color: #5c4d31; }
.bg12-lista th { font-weight: 700; color: #4a3f28; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; }
.bg12-lista td.num, .bg12-lista th.num { text-align: right; white-space: nowrap; }

.bg12-jogolinha { border-bottom: 1px solid #ece2c9; padding: 9px 0; }
.bg12-jogolinha:last-child { border-bottom: none; }
.bg12-jogolinha b { font-size: 0.78rem; color: #4a3f28; display: block; }
.bg12-jogolinha span { font-size: 0.72rem; color: #6b5c3f; line-height: 1.45; }
.bg12-jogolinha em { font-style: normal; color: #9a8757; font-size: 0.66rem; }

.bg12-teclas { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.bg12-teclas td { padding: 7px 2px; border-bottom: 1px solid #ece2c9; color: #5c4d31; }
.bg12-teclas td.acc { text-align: right; }
.bg12-teclabtn {
  font-family: Consolas, monospace; font-size: 0.72rem; min-width: 74px;
  padding: 5px 8px; border: 1px solid #ddd0ab; border-radius: 6px;
  background: #fffdf7; color: #3b2f1c; cursor: pointer;
}
.bg12-teclabtn.a-ouvir { border-color: #b56a55; background: #fdf4f1; color: #8a4636; }

.bg12-swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.bg12-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); padding: 0; }
.bg12-swatch.selected { border-color: #4a3f28; }
.sw-yellow { background: linear-gradient(155deg, #ecd79b, #cdae66); }
.sw-blue   { background: linear-gradient(155deg, #cfe1ee, #6f95b8); }
.sw-orange { background: linear-gradient(155deg, #f3c893, #d2822f); }
.sw-black  { background: linear-gradient(155deg, #57565a, #232326); }
.sw-white  { background: linear-gradient(155deg, #fbfaf6, #dcd9cd); }
.sw-verde  { background: linear-gradient(155deg, #d7e2bd, #93a970); }
.sw-vinho  { background: linear-gradient(155deg, #e9c3c0, #b06e68); }

.bg12-interruptor { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #ece2c9; font-size: 0.78rem; color: #5c4d31; }
.bg12-interruptor:last-of-type { border-bottom: none; }
.bg12-interruptor button {
  font-family: inherit; font-size: 0.7rem; padding: 5px 12px;
  border: 1px solid #ddd0ab; border-radius: 20px; background: #fffdf7; color: #6b5c3f; cursor: pointer; min-width: 66px;
}
.bg12-interruptor button.on { background: #ecd79b; border-color: #b99a55; color: #4a3f28; }

@media (max-width: 360px) {
  .bg12-modalbg { padding: 8px; }
  .bg12-modal { max-height: 92vh; }
  .bg12-tabbody { padding: 12px 14px 16px; }
  .bg12-modalhead { padding: 12px 40px 0 14px; }
  .bg12-tabs { padding: 8px 8px 0; }
}
