/* looks like no css. is css. */

body {
  margin: 0;
  padding-block: 12px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: #ffffff;
  color: #000000;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
}
#page { max-width: 600px; margin: 0 auto; }

a:link { color: #0000ee; }
a:visited { color: #551a8b; }
a:active { color: #ee0000; }

h1 { font-size: 32px; margin: 8px 0 0; }
h1 a:link, h1 a:visited { color: #000; text-decoration: none; }
.tagline { margin: 2px 0 0; font-size: 14px; font-style: italic; }

hr { border: 0; border-top: 1px solid #808080; border-bottom: 1px solid #ffffff; height: 0; margin: 12px 0; }

#nav { font-size: 14px; }
#nav b { font-weight: bold; }

.meta { font-size: 13px; color: #555; margin: 0; }

#clue { font-size: 22px; margin: 18px 0 4px; line-height: 1.35; }
#par { margin: 0 0 16px; }

/* letter boxes */
#boxes { position: relative; display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 14px; }
#boxes .cell {
  width: 28px; height: 30px; line-height: 30px;
  font-family: "Courier New", Courier, monospace;
  font-size: 20px; font-weight: bold;
  text-align: center;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  background: #fff; color: #000;
  cursor: text; user-select: none; -webkit-user-select: none;
}
#boxes .cell.cur { background: #ffffcc; }
#boxes .cell.given { background: #e0e0e0; color: #808080; }
#boxes .gap { width: 12px; }
#boxes.right .cell { background: #ccffcc; }
#boxes.wrong .cell { background: #ffcccc; }
/* donde se escribe de verdad: invisible, pero enfocable (16px para que iOS no haga zoom) */
#typer {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px;
  padding: 0; border: 0; margin: 0; opacity: 0;
  font-size: 16px; color: transparent; background: transparent; caret-color: transparent;
}

/* buttons that look like plain old links */
button {
  font: inherit;
  padding: 0; margin: 0 10px 6px 0;
  background: none; border: 0; border-radius: 0;
  color: #0000ee; cursor: pointer;
}
button span { text-decoration: underline; }
button::before { content: "["; }
button::after { content: "]"; }
button:active { color: #ee0000; }
button:focus-visible { outline: 1px dotted #000; }
button:disabled { color: #808080; cursor: default; }
button:disabled span { text-decoration: none; }

#msg { min-height: 32px; margin: 8px 0; font-weight: bold; display: flex; align-items: center; gap: 6px; }
#msg.ok { color: #008000; }
#msg.no { color: #cc0000; }

/* resaltado de las partes de la pista, como con marcador */
.hl-d { background: #99ccff; }
.hl-i { background: #ffcc66; }
.hl-r { background: #99ff99; }
#clue span { padding: 0 1px; }

/* ventana de ayudas: una cajita simple, como el resto de la página */
dialog#hintdlg {
  padding: 0; margin: auto;
  border: 0; background: transparent;
  width: min(320px, calc(100vw - 32px));
  max-width: none; overflow: visible;
}
dialog#hintdlg::backdrop { background: rgba(255, 255, 255, 0.75); }
.win { background: #fff; border: 1px solid #000; padding: 10px 14px 6px; }
.titlebar { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.titlebar #hinttitle { font-weight: bold; font-size: 18px; }
.titlebar button { margin: 0; font-size: 14px; }
.winbody { padding-top: 4px; }
.winbody p { margin: 0 0 4px; font-size: 14px; font-style: italic; color: #555; }
#hintopts { list-style: none; margin: 0; padding: 0; }
#hintopts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; border-top: 1px dotted #c0c0c0; }
#hintopts li:first-child { border-top: 0; }
#hintopts button { font-size: 17px; margin: 0; padding: 9px 0; text-align: left; }
#hintopts button span { padding: 0 3px; }
#hintopts button:disabled span { background: none; }
#hintopts small { color: #808080; font-size: 13px; }

#legend { font-size: 13px; margin: 8px 0 0; }
#legend span { padding: 0 3px; }

#howbox { margin: 12px 0 0; }
#howbox[hidden] { display: none; }
#howbox b { font-family: "Courier New", monospace; }

/* resultados de la comunidad, tipo encuesta de portal viejo */
#community { margin: 14px 0 0; }
#community[hidden] { display: none; }
table.poll { border-collapse: collapse; font-size: 14px; width: 100%; max-width: 360px; }
table.poll th { text-align: left; font-weight: normal; font-size: 12px; color: #555; padding: 0 6px 2px 0; }
table.poll td { padding: 1px 6px 1px 0; white-space: nowrap; }
table.poll td.barcell { width: 100%; padding-right: 10px; }
table.poll .bar { display: block; height: 11px; min-width: 1px; background: #808080; border: 1px solid #404040; }
table.poll tr.me td { font-weight: bold; }
table.poll tr.me .bar { background: #000080; }

#stats-row { font-size: 13px; }
button.small { font-size: 13px; margin: 0 0 0 6px; }

#share-row { margin: 0 0 8px; }
#sharemsg { font-size: 14px; color: #008000; }
#sharebox { display: block; width: 100%; max-width: 360px; font-family: "Courier New", monospace; font-size: 13px; resize: none; margin-bottom: 8px; }
#sharebox[hidden] { display: none; }

.scroll { overflow-x: auto; }
.new { color: #ff0000; font-weight: bold; font-style: italic; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .new { animation: none; } }

table.archive { border-collapse: collapse; width: 100%; font-size: 15px; }
table.archive td, table.archive th { border: 1px solid #808080; padding: 3px 6px; text-align: left; }
table.archive th { background: #c0c0c0; }
table.archive td.clue a:link, table.archive td.clue a:visited { color: inherit; text-decoration: none; }
table.archive td.clue a:hover { text-decoration: underline; }
table.archive .lbl { display: none; }

/* en el celular la tabla se vuelve una lista: número, fecha, par y estado arriba; la pista abajo, a todo lo ancho */
@media (max-width: 520px) {
  table.archive, table.archive tbody { display: block; }
  table.archive thead { display: none; }
  table.archive tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px;
    padding: 8px 0; border-bottom: 1px dotted #808080;
  }
  table.archive td { display: block; border: 0; padding: 0; }
  table.archive td.num { font-weight: bold; }
  table.archive td.date, table.archive td.par { font-size: 13px; color: #555; }
  table.archive td.mark { margin-left: auto; font-size: 13px; }
  table.archive td.clue { order: 1; width: 100%; font-size: 16px; margin-top: 2px; }
  table.archive td.clue a { display: block; padding: 2px 0; }
  table.archive .yr { display: none; }
  table.archive .lbl { display: inline; }
}

h1 { display: flex; align-items: center; gap: 8px; }
.icon, .icon-sm { image-rendering: pixelated; }
.icon-sm { vertical-align: -3px; }

#footer { font-size: 11px; color: #808080; text-align: center; }
.counter {
  font-family: "Courier New", monospace;
  background: #000; color: #00ff00;
  padding: 0 4px; letter-spacing: 2px;
}

/* mandá tu pista / panel de admin */
form.sub label, .fld > span { display: block; font-weight: bold; font-size: 15px; margin: 14px 0 3px; }
form.sub input, form.sub select, form.sub textarea,
.card input, .card select, .card textarea {
  font: inherit; font-size: 16px; /* 16px: que iOS no haga zoom */
  box-sizing: border-box; width: 100%; padding: 3px 4px; background: #fff; color: #000;
  border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080; border-radius: 0;
}
form.sub select, .card select { width: auto; }
form.sub textarea, .card textarea { resize: vertical; }
.note { font-size: 13px; color: #555; margin: 3px 0 0; }
.opt { font-weight: normal; color: #808080; font-style: italic; }
.markers { margin: 4px 0; }
.markers button { margin: 0 8px 4px 0; font-size: 15px; }
.markers button span { padding: 0 3px; }
.preview { font-size: 20px; line-height: 1.35; margin: 8px 0 0; padding: 6px 8px; border: 1px dotted #808080; min-height: 1.35em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#formmsg, .card .msg { font-size: 14px; color: #c00000; margin-left: 6px; }
#thanks { margin: 16px 0; }

.card .how { font-size: 15px; }
.card .row { display: flex; flex-wrap: wrap; gap: 0 12px; }
.card .row .fld { flex: 1 1 120px; }
.card .fld > span { font-size: 13px; margin-top: 8px; }
.card button { margin-right: 10px; }
.tab { font-size: 14px; margin-right: 6px; }
.tab.on { font-weight: bold; color: #000; }
.tab.on span { text-decoration: none; }
.warn { color: #c00000; }
