@font-face {
  font-family: 'Minecraft';
  src: url('./fonts/MinecraftRegular-Bmg3.otf') format('opentype');
  font-weight: 400;
}

@font-face {
  font-family: 'Minecraft';
  src: url('./fonts/MinecraftBold-nMK1.otf') format('opentype');
  font-weight: 700;
}

@font-face {
  font-family: 'Minecraft Italic';
  src: url('./fonts/MinecraftItalic-R8Mo.otf') format('opentype');
  font-style: italic;
}

@font-face {
  font-family: 'Minecraft Bold Italic';
  src: url('./fonts/MinecraftBoldItalic-1y1e.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
}

:root {
  --yellow-1: #0f0d07;
  --yellow-2: #1a180e;
  --yellow-3: #292307;
  --yellow-4: #372b00;
  --yellow-5: #433600;
  --yellow-6: #504303;
  --yellow-7: #645518;
  --yellow-8: #7e6d21;
  --yellow-9: #f2ce1b;
  --yellow-10: #e8c400;
  --yellow-11: #f9d52b;
  --yellow-12: #f8ebb4;

  --gray-1: #0d0d0d;
  --gray-2: #181818;
  --gray-3: #222;
  --gray-4: #292929;
  --gray-5: #313131;
  --gray-6: #3a3a3a;
  --gray-7: #484848;
  --gray-8: #606060;
  --gray-9: #6e6e6e;
  --gray-10: #7b7b7b;
  --gray-11: #b4b4b4;
  --gray-12: #eee;

  --card: var(--gray-2);
  --text: var(--gray-12);
  --muted: var(--gray-9);
  --accent: var(--yellow-9);
  --danger: #c0392b;
  --success: #27ae60;
  --shadow: #0a0a0a;
  --surface-border: var(--gray-5);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Minecraft', 'Courier New', monospace;
  margin: 0;
  background: var(--yellow-2);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(0deg, transparent 0, transparent 96px, rgba(0, 0, 0, 0.15) 96px, rgba(0, 0, 0, 0.15) 112px),
    linear-gradient(90deg, transparent 0, transparent 96px, rgba(0, 0, 0, 0.15) 96px, rgba(0, 0, 0, 0.15) 112px);
  background-size: 128px 128px, 128px 128px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 960px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

h1, h2, h3, h4 {
  margin: 0 0 8px;
  font-family: 'Minecraft', 'Courier New', monospace;
  letter-spacing: 0.5px;
}

p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  box-shadow: 0 6px 0 var(--shadow);
  padding: 12px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pill {
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--gray-3);
  color: var(--text);
  border: 1px solid var(--surface-border);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: var(--gray-1);
  border: 2px solid var(--gray-4);
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--gray-5);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--gray-5);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--gray-6);
  box-shadow: 0 6px 0 var(--shadow);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.block {
  width: 100%;
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--gray-1);
  color: var(--text);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 10px;
  font-family: 'Minecraft', 'Courier New', monospace;
  font-size: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--gray-3);
  border: 1px solid var(--surface-border);
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
}

.balance-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.balance-amount {
  font-size: 32px;
  font-weight: 700;
}

.subtext {
  color: var(--muted);
  font-size: 13px;
}

.progress {
  background: var(--gray-4);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  height: 14px;
  width: 100%;
  overflow: hidden;
}

.progress .bar {
  height: 100%;
  background: var(--yellow-9);
  width: 0;
  transition: width 200ms ease;
}

.list {
  display: grid;
  gap: 10px;
}

.template {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  background: var(--gray-3);
}

.template .info {
  display: grid;
  gap: 2px;
}

.template .name {
  font-weight: 700;
}

.template .desc {
  font-size: 12px;
  color: var(--muted);
}

.template .delta {
  font-weight: 700;
  color: var(--accent);
}

.calendar {
  display: grid;
  gap: 8px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.day {
  position: relative;
  border: 1px solid var(--surface-border);
  background: var(--gray-3);
  border-radius: 6px;
  min-height: 64px;
  padding: 8px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--shadow);
}

.day.placeholder {
  border: none;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.day.selected {
  border-color: var(--accent);
  box-shadow: 0 4px 0 var(--accent);
}

.day .date {
  font-size: 12px;
  color: var(--muted);
}

.day .net {
  font-weight: 700;
}

.day .net.positive {
  color: var(--accent);
}

.day .net.negative {
  color: var(--danger);
}

.day .badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.badge {
  border-radius: 4px;
  padding: 2px 6px;
  background: var(--gray-4);
  border: 1px solid var(--surface-border);
  font-size: 11px;
  text-transform: uppercase;
}

.transactions {
  display: grid;
  gap: 8px;
}

.tx {
  border: 1px solid var(--surface-border);
  background: var(--gray-3);
  border-radius: 6px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.tx .line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tx .delta {
  font-weight: 700;
}

.tx .delta.positive {
  color: var(--accent);
}

.tx .delta.negative {
  color: var(--danger);
}

.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--surface-border);
  background: var(--gray-4);
  border-radius: 6px;
  font-size: 12px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.request {
  border: 1px solid var(--surface-border);
  background: var(--gray-3);
  padding: 10px;
  border-radius: 6px;
  display: grid;
  gap: 6px;
}

.request .meta {
  color: var(--muted);
  font-size: 12px;
}

.small {
  font-size: 12px;
}

.hero {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 2px solid var(--surface-border);
  border-radius: 6px;
  background: var(--gray-3);
  box-shadow: 0 8px 0 var(--shadow);
}

.logo-mark {
  width: 64px;
  height: 64px;
  background: var(--accent);
  border: 2px solid var(--gray-5);
  border-radius: 12px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 0 var(--shadow);
}

.status {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.divider {
  height: 1px;
  background: var(--surface-border);
  margin: 6px 0;
}

.template-manager {
  display: grid;
  gap: 8px;
}

.template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--gray-3);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
}

.template-row .name {
  font-weight: 700;
}

.template-row .muted {
  color: var(--muted);
  font-size: 12px;
}

.celebrate {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.spark {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 1px solid var(--gray-5);
  border-radius: 3px;
  animation: pop 900ms ease-out forwards;
}

@keyframes pop {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-120px) scale(0.4);
    opacity: 0;
  }
}

.empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.link {
  text-decoration: underline;
  cursor: pointer;
}

.alert {
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--gray-4);
  border: 1px solid var(--surface-border);
  color: var(--muted);
  font-size: 13px;
}
