/* VoinSMP Wunschbox – Pixel-Rahmen wie das Scoreboard im Spiel */
:root {
  --night: #050d2b;
  --deep: #08153e;
  --navy: #002797;
  --blue: #0068fb;
  --ice: #4fc3ff;
  --frost: #ddf6ff;
  --mist: #9fb4d9;
  --ok: #5cff8a;
  --bad: #ff5c7a;
  --px: 3px; /* eine "Minecraft-Pixel"-Einheit */
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--frost);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background:
    radial-gradient(1200px 520px at 50% -120px, #0b2a8a 0%, rgba(11, 42, 138, 0) 70%),
    linear-gradient(var(--night), #030820);
  background-attachment: fixed;
}

/* feines Block-Raster im Hintergrund */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(79, 195, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 195, 255, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(#000, transparent 70%);
}

a { color: var(--ice); }
code { background: rgba(79, 195, 255, .12); padding: 1px 6px; }

:focus-visible { outline: var(--px) solid var(--ice); outline-offset: 2px; }

/* ------------------------------------------------ Bühne + Rahmen */
.stage {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.board { position: relative; padding-top: 150px; }
.board.small { max-width: 440px; margin: 0 auto; }

.logo {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: 256px;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 0 rgba(0, 10, 50, .55));
  animation: drop .7s cubic-bezier(.2, 1.4, .4, 1) both;
}

@keyframes drop {
  from { transform: translate(-50%, -24px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.frame {
  position: relative;
  border: calc(8 * var(--px)) solid transparent;
  border-image: url("frame.png") 8 fill / calc(8 * var(--px)) stretch;
  image-rendering: pixelated;
  padding: 44px 18px 18px;
}

/* "Hörner" oben an den Ecken wie im Scoreboard */
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  top: calc(-8 * var(--px) - 7 * var(--px));
  width: calc(14 * var(--px));
  height: calc(8 * var(--px));
  background: var(--ice);
  clip-path: polygon(0 100%, 100% 100%, 25% 0);
  filter: drop-shadow(0 0 0 var(--navy));
}
.frame::before { left: calc(-3 * var(--px)); }
.frame::after { right: calc(-3 * var(--px)); transform: scaleX(-1); }

.board.small .frame { padding-top: 36px; }

/* ------------------------------------------------ Text */
h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4.6vw, 2.1rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.01em;
  text-align: center;
  text-shadow: 0 var(--px) 0 var(--navy);
}

h2 { margin: 0 0 6px; font-size: 1.45rem; text-shadow: 0 var(--px) 0 var(--navy); }

.lead {
  max-width: 52ch;
  margin: 0 auto 26px;
  text-align: center;
  color: var(--mist);
}

.foot {
  margin: 22px 0 0;
  text-align: center;
  color: #5f74a3;
  font-size: .9rem;
}

/* ------------------------------------------------ Formular */
.wish-form { display: grid; gap: 16px; }
.wish-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label { display: grid; gap: 6px; font-weight: 650; font-size: .95rem; }
.opt { color: var(--mist); font-weight: 400; }

input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--frost);
  font: inherit;
  font-weight: 400;
  background: #030a26;
  border: 2px solid #1a3a8f;
  border-radius: 0;
  box-shadow: inset 0 var(--px) 0 rgba(0, 0, 0, .45);
}
textarea { resize: vertical; min-height: 140px; }
input::placeholder, textarea::placeholder { color: #5d6f9a; }
input:focus, select:focus, textarea:focus { border-color: var(--ice); outline: none; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ice) 50%),
  linear-gradient(135deg, var(--ice) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }

.count { margin: -10px 0 0; text-align: right; font-size: .82rem; color: #6f82ad; }
.count.warn { color: var(--bad); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.error {
  margin: 0 0 18px;
  padding: 10px 14px;
  color: #ffd9e0;
  background: rgba(255, 92, 122, .12);
  border-left: var(--px) solid var(--bad);
}

/* ------------------------------------------------ Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  color: #fff;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(var(--ice), var(--blue) 55%);
  border: 0;
  border-radius: 0;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%,
    6px 100%, 0 calc(100% - 6px), 0 6px);
  box-shadow: inset 0 calc(-1 * var(--px)) 0 var(--navy), inset 0 var(--px) 0 rgba(255, 255, 255, .35);
  text-shadow: 0 2px 0 var(--navy);
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 var(--px) 0 var(--navy); }

.wish-form > .btn { justify-self: center; min-width: 240px; font-size: 1.05rem; padding: 14px 26px; }

.btn.ghost { background: #0d2266; box-shadow: inset 0 calc(-1 * var(--px)) 0 #00104a; text-shadow: none; }
.btn.ok { background: linear-gradient(#7dffa4, #1fb85a 60%); box-shadow: inset 0 calc(-1 * var(--px)) 0 #0b5c2a;
  text-shadow: 0 2px 0 #0b5c2a; }
.btn.danger { background: #3a0f22; color: #ffb3c2; box-shadow: inset 0 calc(-1 * var(--px)) 0 #1f0612; text-shadow: none; }
.btn.danger:hover { background: #6b1734; color: #fff; }

button.link { background: none; border: 0; padding: 0; color: #7f93c4; font: inherit; font-size: .8rem;
  text-decoration: underline; cursor: pointer; }
button.link:hover { color: var(--bad); }

/* ------------------------------------------------ Danke */
.done { text-align: center; padding: 10px 0 6px; }
.done p { color: var(--mist); margin: 0 auto 24px; max-width: 44ch; }
.done h2 { color: var(--ok); }

/* ------------------------------------------------ Admin */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  background: rgba(5, 13, 43, .92);
  border-bottom: var(--px) solid var(--navy);
  backdrop-filter: blur(6px);
}
.bar img { width: 52px; height: auto; }
.bar-title { font-weight: 800; font-size: 1.15rem; margin-right: auto; }
.bar .btn { padding: 8px 14px; font-size: .9rem; }

.admin-main { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px;
  color: var(--mist);
  text-decoration: none;
  font-weight: 650;
  background: #0a1a4f;
  border-bottom: var(--px) solid #061137;
}
.tab b { margin-left: 4px; padding: 0 7px; font-size: .82rem; color: var(--frost); background: #142f80; }
.tab.on { color: #fff; background: var(--blue); border-bottom-color: var(--navy); }
.tab.on b { background: var(--navy); }

.filter { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.filter input { flex: 1 1 240px; }
.filter select { flex: 0 1 220px; }
.filter .btn { padding: 10px 18px; }

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

.wish {
  border: calc(8 * var(--px) / 1.5) solid transparent;
  border-image: url("frame.png") 8 fill / calc(8 * var(--px) / 1.5) stretch;
  image-rendering: pixelated;
  padding: 6px 8px 8px;
}
.wish.is-done { opacity: .62; }
.wish.is-done .wish-text { text-decoration: line-through; text-decoration-color: rgba(221, 246, 255, .35); }

.wish header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.cat { padding: 2px 9px; font-size: .8rem; font-weight: 700; color: var(--night); background: var(--ice); }
.meta { font-size: .85rem; color: var(--mist); }
.muted { color: #6f82ad; font-style: italic; }

.wish-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.02rem; }

.notes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.notes li { padding: 8px 12px; background: rgba(79, 195, 255, .08); border-left: var(--px) solid var(--ice); }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { display: flex; gap: 12px; align-items: baseline; font-size: .8rem; color: #7f93c4; margin-top: 2px; }

.note-form { display: flex; gap: 8px; margin-top: 12px; align-items: flex-start; }
.note-form textarea { min-height: 44px; padding: 9px 11px; font-size: .95rem; }
.note-form .btn { white-space: nowrap; padding: 10px 14px; font-size: .9rem; }

.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.actions .btn { padding: 9px 16px; font-size: .9rem; }
form.inline { display: inline; margin: 0; }

.empty { text-align: center; color: var(--mist); padding: 50px 0; }

/* ------------------------------------------------ Klein */
@media (max-width: 560px) {
  :root { --px: 2px; }
  body { font-size: 16px; }
  .board { padding-top: 120px; }
  .logo { width: 200px; }
  .frame { padding: 40px 6px 8px; }
  .wish-form .row { grid-template-columns: 1fr; }
  .wish-form > .btn { width: 100%; min-width: 0; }
  .note-form { flex-direction: column; align-items: stretch; }
  .bar { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; }
}
