@font-face {
  font-family: 'Minecraftia';
  src: url('Minecraftia-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

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

:root {
  --mc-dirt:      #866043;
  --mc-grass-top: #5d9e3f;
  --mc-grass-side:#8AB34A;
  --mc-stone:     #898989;
  --mc-deepstone: #404040;
  --mc-wood:      #9c7a3c;
  --mc-sand:      #d9c97a;
  --mc-coal:      #1a1a1a;
  --mc-gold:      #f0d030;
  --mc-diamond:   #4ee8e8;
  --mc-redstone:  #e03c3c;
  --mc-lapis:     #1b4fc4;
  --mc-emerald:   #17dd62;

  --bg:       #1c1c1c;
  --surface:  #2a2a2a;
  --surface2: #333333;
  --border:   #555555;
  --border-light: #777777;
  --text:     #ffffff;
  --text-dim: #aaaaaa;
  --text-dimmer: #666666;

  --accent:   var(--mc-diamond);
  --green:    var(--mc-emerald);
  --red:      var(--mc-redstone);
  --yellow:   var(--mc-gold);

  --font: 'Minecraftia', 'Courier New', monospace;

  /* Minecraft button gradient */
  --btn-top:    #888888;
  --btn-mid:    #666666;
  --btn-shadow: #3a3a3a;
  --btn-hover-top: #999999;
  --btn-hover-mid: #777777;
}

html { font-size: 16px; image-rendering: pixelated; }

body {
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect width='32' height='32' fill='%231c1c1c'/%3E%3Crect x='0' y='0' width='16' height='16' fill='%23202020' opacity='0.4'/%3E%3Crect x='16' y='16' width='16' height='16' fill='%23202020' opacity='0.4'/%3E%3C/svg%3E");
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border: 2px solid var(--surface); }

/* ── Layout ── */
.page {
  max-width: 580px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}
.page.wide { max-width: 1080px; }

/* ── MC Panel (card) ── */
.card {
  background: var(--surface);
  border: 3px solid;
  border-color: var(--border-light) var(--border) var(--border) var(--border-light);
  outline: 3px solid #000;
  padding: 1.5rem;
  position: relative;
  image-rendering: pixelated;
}
.card + .card { margin-top: 1rem; }
.card-title {
  font-size: 0.875rem;
  color: var(--mc-gold);
  text-shadow: 2px 2px 0 #7a6000;
  margin-bottom: 0.3rem;
}
.card-sub {
  color: var(--text-dim);
  font-size: 0.65rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* ── Header ── */
.site-header {
  text-align: center;
  padding: 2rem 0 1.75rem;
  position: relative;
}
.site-header h1 {
  font-size: 1.5rem;
  color: var(--mc-gold);
  text-shadow: 3px 3px 0 #7a6000, 4px 4px 0 #000;
  letter-spacing: 2px;
  line-height: 1.3;
}
.site-header p {
  color: var(--text-dim);
  font-size: 0.65rem;
  margin-top: 0.5rem;
}

/* Grass strip under header */
.grass-strip {
  height: 8px;
  background: var(--mc-grass-top);
  border-top: 2px solid #7dc44e;
  border-bottom: 2px solid #3d7a1e;
  margin-bottom: 1.75rem;
  position: relative;
}
.grass-strip::after {
  content: '';
  display: block;
  height: 4px;
  background: var(--mc-dirt);
  border-bottom: 2px solid #5c3d1e;
}

/* ── Progress ── */
.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.step-dot .dot {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  outline: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-family: var(--font);
  color: var(--text-dimmer);
  background: var(--surface2);
  transition: all 0.2s;
  image-rendering: pixelated;
}
.step-dot .label {
  font-size: 0.55rem;
  color: var(--text-dimmer);
  font-family: var(--font);
  transition: color 0.2s;
}
.step-dot.active .dot {
  border-color: var(--mc-diamond);
  background: #1a4444;
  color: var(--mc-diamond);
  text-shadow: 0 0 6px var(--mc-diamond);
}
.step-dot.active .label { color: var(--mc-diamond); }
.step-dot.done .dot {
  border-color: var(--mc-emerald);
  background: #0d3320;
  color: var(--mc-emerald);
}
.step-dot.done .label { color: var(--mc-emerald); }
.step-line {
  width: 48px;
  height: 4px;
  background: var(--surface2);
  border-top: 2px solid #000;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 1.25rem;
  transition: background 0.2s;
}
.step-line.done { background: var(--mc-emerald); }

/* ── Form elements ── */
label {
  display: block;
  font-size: 0.65rem;
  font-family: var(--font);
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: #000000;
  border: 2px solid var(--border);
  outline: 2px solid #000;
  color: var(--text);
  font-size: 0.7rem;
  font-family: var(--font);
  padding: 0.55rem 0.7rem;
  transition: border-color 0.15s;
  image-rendering: pixelated;
  border-radius: 0;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: 2px solid var(--mc-diamond);
  border-color: var(--mc-diamond);
}
input.valid { border-color: var(--mc-emerald) !important; outline-color: var(--mc-emerald) !important; }
input.error { border-color: var(--mc-redstone) !important; outline-color: var(--mc-redstone) !important; }
textarea { resize: vertical; line-height: 1.7; }

/* ── Minecraft Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1rem;
  height: 36px;
  font-family: var(--font);
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  position: relative;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
  text-decoration: none;
  image-rendering: pixelated;
  /* MC button look */
  background: linear-gradient(to bottom, #888 0%, #888 50%, #666 50%, #666 100%);
  border-top: 2px solid #bbb;
  border-left: 2px solid #bbb;
  border-bottom: 2px solid #2a2a2a;
  border-right: 2px solid #2a2a2a;
  outline: 2px solid #000;
  transition: filter 0.1s;
}
.btn:hover:not(:disabled) {
  background: linear-gradient(to bottom, #aef 0%, #aef 50%, #8cd 50%, #8cd 100%);
  border-top-color: #ddf;
  border-left-color: #ddf;
  filter: none;
}
.btn:active:not(:disabled) {
  background: linear-gradient(to bottom, #666 0%, #666 50%, #888 50%, #888 100%);
  border-top-color: #2a2a2a;
  border-left-color: #2a2a2a;
  border-bottom-color: #bbb;
  border-right-color: #bbb;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Button variants */
.btn-primary {
  background: linear-gradient(to bottom, #5a9e3a 0%, #5a9e3a 50%, #3d7a22 50%, #3d7a22 100%);
  border-top-color: #8dcf60;
  border-left-color: #8dcf60;
  border-bottom-color: #1e4a0e;
  border-right-color: #1e4a0e;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(to bottom, #74c44e 0%, #74c44e 50%, #5aa030 50%, #5aa030 100%);
  border-top-color: #a0e070;
  border-left-color: #a0e070;
}
.btn-danger {
  background: linear-gradient(to bottom, #9e2020 0%, #9e2020 50%, #7a0e0e 50%, #7a0e0e 100%);
  border-top-color: #d05050;
  border-left-color: #d05050;
  border-bottom-color: #3a0000;
  border-right-color: #3a0000;
}
.btn-danger:hover:not(:disabled) {
  background: linear-gradient(to bottom, #c03030 0%, #c03030 50%, #9e1818 50%, #9e1818 100%);
}
.btn-green {
  background: linear-gradient(to bottom, #1a7a40 0%, #1a7a40 50%, #0e5520 50%, #0e5520 100%);
  border-top-color: #40c060;
  border-left-color: #40c060;
  border-bottom-color: #042010;
  border-right-color: #042010;
}
.btn-green:hover:not(:disabled) {
  background: linear-gradient(to bottom, #22a050 0%, #22a050 50%, #1a7a30 50%, #1a7a30 100%);
}
.btn-full { width: 100%; height: 42px; font-size: 0.75rem; }
.btn-sm { height: 28px; padding: 0 0.75rem; font-size: 0.6rem; }

/* ── Alerts ── */
.alert {
  padding: 0.6rem 0.75rem;
  font-size: 0.65rem;
  border-left: 4px solid;
  background: var(--surface2);
  margin-top: 0.65rem;
  font-family: var(--font);
  line-height: 1.6;
}
.alert-error { border-color: var(--mc-redstone); color: #ff8888; }
.alert-success { border-color: var(--mc-emerald); color: #88ffaa; }
.alert-info { border-color: var(--mc-diamond); color: var(--mc-diamond); }
.alert-warn { border-color: var(--mc-gold); color: var(--mc-gold); }

/* ── Vote rows ── */
.vote-section { margin-top: 1.25rem; }
.vote-section h3 {
  font-size: 0.65rem;
  color: var(--mc-gold);
  text-shadow: 1px 1px 0 #7a6000;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
}
.vote-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
.rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 2px solid var(--border);
  outline: 2px solid #000;
  font-family: var(--font);
  flex-direction: column;
  gap: 2px;
  line-height: 1;
  background: var(--surface2);
}
.rank-badge .rank-num { font-size: 0.65rem; color: var(--text); }
.rank-badge .rank-pts { font-size: 0.55rem; color: var(--mc-diamond); }
.rank-badge.hm { border-color: #7a6000; }
.rank-badge.hm .rank-pts { color: var(--mc-gold); }

/* ── Steps ── */
.step { display: none; }
.step.active { display: block; }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.6rem;
  font-family: var(--font);
  border: 2px solid;
  outline: 1px solid #000;
}
.badge-green { border-color: var(--mc-emerald); color: var(--mc-emerald); background: #0d3320; }
.badge-red { border-color: var(--mc-redstone); color: #ff8888; background: #3a0000; }
.badge-dim { border-color: var(--border); color: var(--text-dim); background: var(--surface2); }

/* ── Util ── */
.mt-1 { margin-top: 0.4rem; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1.25rem; }
.flex { display: flex; }
.flex-gap { gap: 0.5rem; }
.flex-between { justify-content: space-between; align-items: center; }
.hidden { display: none !important; }

/* ── Admin tabs ── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 3px solid var(--border);
  outline-bottom: 2px solid #000;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.65rem;
  font-family: var(--font);
  color: var(--text-dim);
  background: var(--surface2);
  border: 2px solid var(--border);
  border-bottom: none;
  outline: 1px solid #000;
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
  margin-right: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tab-btn:hover { color: var(--text); background: #3a3a3a; }
.tab-btn.active {
  color: var(--mc-gold);
  background: var(--surface);
  border-color: var(--mc-gold);
  text-shadow: 1px 1px 0 #7a6000;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Data table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.65rem;
  font-family: var(--font);
}
.data-table th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  color: var(--mc-gold);
  font-size: 0.6rem;
  text-shadow: 1px 1px 0 #7a6000;
  border-bottom: 2px solid var(--border);
  background: var(--surface2);
  text-transform: uppercase;
}
.data-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--surface2);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #303030; }
.data-table .mono {
  font-family: var(--font);
  font-size: 0.6rem;
  color: var(--text-dim);
}

/* ── Stat cards ── */
.stat-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.stat-card {
  flex: 1;
  min-width: 110px;
  background: var(--surface);
  border: 2px solid var(--border);
  outline: 2px solid #000;
  padding: 0.75rem 1rem;
  text-align: center;
}
.stat-card .stat-val {
  font-size: 1.5rem;
  color: var(--mc-diamond);
  text-shadow: 2px 2px 0 #1a6060;
  line-height: 1.2;
  font-family: var(--font);
}
.stat-card .stat-label {
  font-size: 0.55rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  font-family: var(--font);
  text-transform: uppercase;
}

/* ── Keys generated output ── */
.keys-generated {
  margin-top: 0.75rem;
  border: 2px solid var(--border);
  outline: 2px solid #000;
  overflow: hidden;
}
.keys-generated-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: var(--surface2);
  border-bottom: 2px solid var(--border);
  font-size: 0.6rem;
  color: var(--mc-gold);
  font-family: var(--font);
}

/* ── Leaderboard rank colors ── */
.leaderboard-rank { font-family: var(--font); font-size: 0.75rem; }
.rank-1 { color: var(--mc-gold); text-shadow: 1px 1px 0 #7a6000; }
.rank-2 { color: #c0c0c0; text-shadow: 1px 1px 0 #666; }
.rank-3 { color: #cd7f32; text-shadow: 1px 1px 0 #5a3000; }

/* ── Admin login ── */
.admin-login {
  max-width: 360px;
  margin: 5rem auto;
}

/* ── Creeper eyes decoration ── */
.site-header::before {
  content: '⬛⬜⬜⬛  ⬛⬜⬜⬛';
  font-size: 0.5rem;
  display: block;
  color: transparent;
  text-shadow: none;
}

@media (max-width: 600px) {
  .page { padding: 1.25rem 0.75rem 3rem; }
  .card { padding: 1rem; }
  .site-header h1 { font-size: 1.1rem; }
  .step-line { width: 28px; }
  .data-table td, .data-table th { padding: 0.4rem; }
  .stat-card .stat-val { font-size: 1.1rem; }
}
