/* ============================================================
   Dan & Kevin Daily Routines — Minecraft theme
   Panels  = inventory GUI gray (#c6c6c6) com bevel claro/escuro
   Rows    = inventory slots (bevel invertido, afundado)
   Botões  = blocos 3D (highlight topo, sombra base), radius zero
   Cores   = grass / dirt / stone / XP green / gold
   Type    = Press Start 2P (display) + VT323 (texto corrido)
   ============================================================ */

:root {
  --grass: #5d9c3c;
  --grass-deep: #4a7d2f;
  --dirt: #6b4a2f;
  --dirt-deep: #54381f;
  --panel: #c6c6c6;
  --panel-dark: #9a9a9a;
  --slot: #8b8b8b;
  --ink: #23231f;
  --muted: #565650;
  --xp: #7efc20;
  --gold: #fcdb00;
  --lava: #d34e1f;
  --dan: #3f6fa3;
  --kevin: #c05a2e;
  --bevel-out: inset 3px 3px 0 rgba(255, 255, 255, 0.5), inset -3px -3px 0 rgba(0, 0, 0, 0.35);
  --bevel-in: inset 3px 3px 0 rgba(0, 0, 0, 0.35), inset -3px -3px 0 rgba(255, 255, 255, 0.28);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "VT323", "Segoe UI", sans-serif;
  font-size: 1.25rem;
  color: var(--ink);
  background-color: var(--dirt-deep);
  background-image:
    repeating-conic-gradient(rgba(0, 0, 0, 0.16) 0% 25%, transparent 0% 50%),
    repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0% 25%, transparent 0% 50%);
  background-size: 32px 32px, 16px 16px;
  image-rendering: pixelated;
  padding: 24px 16px calc(48px + env(safe-area-inset-bottom));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---- painel principal = janela de inventory ---- */
.tag {
  position: relative;
  max-width: 42rem;
  margin: 0 auto;
  background: var(--panel);
  border: 3px solid #141414;
  border-radius: 0;
  padding: 28px 22px 22px;
  box-shadow: var(--bevel-out), 0 22px 0 rgba(0, 0, 0, 0.25);
}

/* grama no topo do painel — a faixa verde que fecha o "bloco" */
.tag::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  height: 14px;
  background:
    repeating-conic-gradient(var(--grass) 0% 25%, var(--grass-deep) 0% 50%);
  background-size: 14px 14px;
  border: 3px solid #141414;
  border-bottom: 0;
}

.tag-eye { display: none; }

.mast {
  padding: 10px 4px 14px;
  border-bottom: 3px solid rgba(0, 0, 0, 0.28);
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-weight: 400;
  font-size: clamp(1rem, 3.4vw, 1.45rem);
  line-height: 1.35;
  letter-spacing: 0;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
}

.btn-solid,
.btn-ghost,
.who,
.punch,
.kill {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 0;
}

/* ---- calendário = fileira de blocos ---- */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-dow {
  text-align: center;
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  color: var(--muted);
  padding-bottom: 2px;
}

.cal-day {
  position: relative;
  min-height: 2.9rem;
  border: 2px solid #141414;
  border-radius: 0;
  background: var(--panel-dark);
  box-shadow: var(--bevel-out);
  font-family: "VT323", monospace;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.cal-day.selected {
  background: var(--grass);
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.cal-day.today {
  outline: 3px solid var(--gold);
  outline-offset: 0;
}

.cal-day.perfect::after {
  content: "★";
  position: absolute;
  top: 0;
  right: 3px;
  font-size: 0.6rem;
  color: var(--gold);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.cal-mon {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

.day-meta {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ---- next up = bloco de ouro ---- */
.next-up {
  position: sticky;
  top: 10px;
  z-index: 20;
  background: var(--gold);
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-out), 0 6px 0 rgba(0, 0, 0, 0.3);
  color: var(--ink);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.next-kicker {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.next-body {
  margin: 4px 0 0;
  font-family: "VT323", monospace;
  font-size: 1.5rem;
  line-height: 1.1;
  font-weight: 400;
}

/* ---- progresso = XP bar ---- */
.progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.progress-bar {
  height: 14px;
  background: #141414;
  border: 2px solid #141414;
  border-radius: 0;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--xp);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  width: 0%;
}

.progress-label {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  color: var(--muted);
}

/* ---- bandas do dia ---- */
.band {
  margin-bottom: 16px;
}

.band-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 8px;
}

.band-head h2 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.band-head span {
  font-family: "VT323", monospace;
  font-size: 1.05rem;
  color: var(--muted);
}

/* ---- cada rotina = slot de inventory ---- */
.ticket {
  display: grid;
  grid-template-columns: 5.6rem 1fr auto;
  gap: 0 10px;
  align-items: center;
  background: var(--slot);
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-in);
  margin-bottom: 8px;
  min-height: 4.3rem;
  position: relative;
}

.ticket.is-now {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.ticket.is-done {
  opacity: 0.6;
}

.ticket.is-done .title-input {
  text-decoration: line-through;
}

.stub {
  background: #3a3a3a;
  color: #fff;
  height: 100%;
  min-height: 4.3rem;
  display: grid;
  place-items: center;
  border-right: 3px solid #141414;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.12);
}

.stub input.time-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  text-align: center;
  padding: 0 2px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.mid {
  padding: 8px 8px 8px 4px;
  display: grid;
  gap: 4px;
}

.title-input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.3rem;
  line-height: 1.1;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
  padding: 0;
  resize: none;
  overflow: hidden;
  display: block;
  overflow-wrap: break-word;
}

.title-input::selection { background: var(--grass); }

.who {
  justify-self: start;
  background: #141414;
  color: #dedede;
  border-radius: 0;
  padding: 0 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.45rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.8;
}

.who.dan { background: var(--dan); color: #fff; }
.who.kevin { background: var(--kevin); color: #fff; }

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
}

/* checkbox = botão 3D, vira grass quando feito */
.punch {
  width: 3rem;
  height: 3rem;
  border-radius: 0;
  background: var(--panel);
  border: 3px solid #141414;
  box-shadow: var(--bevel-out);
  color: transparent;
  font-size: 1.2rem;
  font-weight: 800;
}

.punch[aria-pressed="true"] {
  background: var(--grass);
  box-shadow: var(--bevel-in);
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.kill {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.1rem;
}

/* ---- formulários ---- */
.add,
.note,
.tools {
  margin-top: 18px;
}

.add-title,
.note span {
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}

.add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.add-row label {
  display: grid;
  gap: 4px;
  font-size: 1rem;
  color: var(--muted);
}

.add-row .grow { flex: 1 1 10rem; }

.add-row input,
.add-row select,
.note textarea {
  min-height: 2.9rem;
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-in);
  background: var(--panel);
  font: inherit;
  padding: 6px 10px;
  color: var(--ink);
}

.note textarea {
  width: 100%;
  min-height: 4.8rem;
  resize: vertical;
}

/* botão sólido = bloco de lava/redstone */
.btn-solid {
  min-height: 2.9rem;
  padding: 0 16px;
  background: var(--lava);
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-out);
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.btn-solid:active { box-shadow: var(--bevel-in); }

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 3px solid rgba(0, 0, 0, 0.28);
}

.btn-ghost {
  min-height: 2.7rem;
  padding: 0 12px;
  background: var(--panel-dark);
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-out);
  color: var(--ink);
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
}

.btn-ghost:active { box-shadow: var(--bevel-in); }

.btn-ghost.danger {
  background: var(--lava);
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  body { padding: 12px 10px calc(32px + env(safe-area-inset-bottom)); }
  .tag { padding: 24px 14px 16px; }
  .ticket { grid-template-columns: 4.9rem 1fr auto; }
  .stub { min-height: 4.6rem; }
  .title-input { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .star.pop,
  .confetti { animation: none !important; }
}

/* ---- céu de estrelas = noite do jogo ---- */
.sky {
  background: #101010;
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-in);
  padding: 12px 14px 10px;
  margin-bottom: 18px;
}

.sky-stars {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.star {
  color: #3a3a3a;
  font-size: 1.55rem;
  line-height: 1;
  transition: color 0.25s, transform 0.25s;
  user-select: none;
}

.star.lit {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(252, 219, 0, 0.7);
}

.star.pop {
  animation: starpop 0.45s ease-out;
}

@keyframes starpop {
  0% { transform: scale(0.3); }
  60% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

.sky-stats {
  margin: 8px 0 0;
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.sync-status {
  color: #6a6a6a;
}

.sync-status:not(:empty)::before {
  content: " · ";
}

.confetti {
  position: fixed;
  top: -14px;
  width: 10px;
  height: 10px;
  z-index: 60;
  pointer-events: none;
  animation: confall 2.6s ease-in forwards;
}

@keyframes confall {
  to {
    transform: translateY(108vh) rotate(660deg);
    opacity: 0.85;
  }
}

/* ---- special snack = cards de item ---- */
.snack {
  margin-bottom: 18px;
}

.snack-title {
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 8px;
}

.snack-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.snack-opt {
  position: relative;
  border: 3px solid #141414;
  background: var(--panel);
  box-shadow: var(--bevel-in);
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  display: grid;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.snack-opt img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
}

.snack-name {
  padding: 6px 10px;
  font-size: 1.1rem;
  line-height: 1.1;
}

.snack-opt.picked {
  outline: 3px solid var(--xp);
  outline-offset: 2px;
}

.snack-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0;
  border: 2px solid #141414;
  background: var(--grass);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

/* ---- abas = botões de menu ---- */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.tab {
  min-height: 3rem;
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-out);
  background: var(--panel-dark);
  color: var(--ink);
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
  cursor: pointer;
}

.tab.active {
  background: var(--grass);
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
  box-shadow: var(--bevel-in);
}

.view[hidden] {
  display: none;
}

.outing-target {
  margin: 0 0 12px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- house rules = placas ---- */
.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.rule {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  background: var(--panel);
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-in);
  padding: 10px 12px;
}

.rule span {
  font-size: 1.2rem;
  line-height: 1.2;
}

.rule-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.rule-add input {
  flex: 1;
  min-height: 2.9rem;
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-in);
  background: var(--panel);
  font: inherit;
  padding: 6px 10px;
  color: var(--ink);
}

/* ---- outings ---- */
.outing {
  background: var(--panel);
  border: 3px solid #141414;
  border-radius: 0;
  box-shadow: var(--bevel-in);
  padding: 10px 12px;
  margin-bottom: 8px;
  display: grid;
  gap: 4px;
}

.outing-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.outing-title {
  font-size: 1.3rem;
  line-height: 1.1;
}

.outing-note {
  margin: 0;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.2;
}
