:root {
  --jungle-0: #0b1f15;
  --jungle-1: #12301f;
  --jungle-2: #1b4430;
  --jungle-3: #27603f;
  --leaf: #4caf50;
  --banana: #ffd23f;
  --banana-d: #d9a400;
  --coco: #8a5a33;
  --coco-d: #5e3b1f;
  --hibiscus: #ff5d8f;
  --sky: #4fc3f7;
  --text: #f4f1e6;
  --muted: #a9bfae;
  --danger: #ff6b4a;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--jungle-0); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Nunito, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, #2c6b45 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 0%, #3b5e1f 0%, transparent 55%),
    linear-gradient(180deg, var(--jungle-1), var(--jungle-0) 70%);
  background-attachment: fixed;
  padding: 0 24px 60px;
}

/* Blätter am Rand */
.leaves {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .14;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='%2389d185'%3E%3Cpath d='M20 200 C40 120 110 70 200 60 C150 110 100 160 20 200Z'/%3E%3Cpath d='M0 40 C50 30 90 0 110 -10 C90 40 50 60 0 40Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 440px;
}
header, .bar, main, .banner { position: relative; z-index: 1; max-width: 1280px; margin-left: auto; margin-right: auto; }

/* Kopf */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 54px; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); animation: swing 4s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes swing { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
h1 { font-family: Bungee, Nunito, sans-serif; font-weight: 400; font-size: clamp(26px, 4.5vw, 42px); margin: 0; line-height: 1; color: var(--banana); text-shadow: 0 4px 0 var(--coco-d), 0 8px 18px rgba(0,0,0,.4); letter-spacing: .5px; }
.tag { margin: 6px 0 0; font-weight: 900; text-transform: uppercase; letter-spacing: 6px; font-size: 13px; color: var(--muted); }

.status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(0,0,0,.28); font-weight: 800; font-size: 14px; border: 1px solid rgba(255,255,255,.08); }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.status.on .dot { background: var(--leaf); box-shadow: 0 0 10px var(--leaf); }
.status img { width: 22px; height: 22px; border-radius: 50%; }

.who { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.me img { width: 24px; height: 24px; border-radius: 50%; }
.me a { color: var(--muted); font-size: 12px; margin-left: 4px; text-decoration: none; }
.me a:hover { color: var(--banana); }

/* Anmeldung */
.gate { position: relative; z-index: 1; display: grid; place-items: center; min-height: 60vh; }
main.gate { min-height: 100vh; margin: 0; }
.gate-card { text-align: center; max-width: 420px; padding: 34px 28px; border-radius: 26px; background: rgba(14, 38, 25, .85); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.gate-card h1, .gate-card h2 { font-family: Bungee, sans-serif; font-weight: 400; color: var(--banana); font-size: 24px; margin: 8px 0 10px; text-shadow: none; }
.gate-card p { color: var(--muted); font-weight: 700; line-height: 1.5; margin: 0 0 22px; }
.gate-logo { font-size: 64px; }
.btn.discord { background: #5865f2; color: #fff; box-shadow: 0 4px 0 #3c45a5; font-size: 16px; padding: 0 22px; min-height: 48px; text-decoration: none; }
.btn.discord:active { box-shadow: 0 1px 0 #3c45a5; }
.gate-card .btn.banana { text-decoration: none; }

.banner { background: rgba(255,107,74,.15); border: 1px solid rgba(255,107,74,.4); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; font-weight: 700; }
.banner a { color: var(--banana); }

/* Steuerleiste */
.bar {
  position: sticky; top: 10px; z-index: 5;
  display: flex; align-items: end; gap: 12px; flex-wrap: wrap;
  padding: 14px; border-radius: var(--radius);
  background: rgba(14, 38, 25, .82); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
select, input[type=search], .row input {
  font: inherit; font-size: 15px; font-weight: 700; color: var(--text);
  background: var(--jungle-2); border: 2px solid var(--jungle-3); border-radius: 12px;
  padding: 9px 12px; min-height: 42px; outline: none; text-transform: none; letter-spacing: 0;
}
select { min-width: 200px; max-width: 280px; }
select:focus, input:focus { border-color: var(--banana); }
.ctrl { display: flex; gap: 8px; }
.search { flex: 1; min-width: 180px; position: relative; display: flex; align-items: center; }
.search span { position: absolute; left: 12px; font-size: 15px; }
.search input { width: 100%; padding-left: 36px; }

.btn {
  font: inherit; font-weight: 900; font-size: 15px; cursor: pointer;
  border: 0; border-radius: 12px; padding: 0 16px; min-height: 42px;
  color: #241405; background: var(--banana); box-shadow: 0 4px 0 var(--banana-d);
  transition: transform .08s, box-shadow .08s, filter .15s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--banana-d); }
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 4px 0 #b8401f; }
.btn.danger:active { box-shadow: 0 1px 0 #b8401f; }
.btn.ghost { background: var(--jungle-3); color: var(--text); box-shadow: 0 4px 0 #173a26; }
.btn.ghost:active { box-shadow: 0 1px 0 #173a26; }

/* Zuletzt gespielt */
.recent { position: relative; z-index: 1; max-width: 1280px; margin: 14px auto 0; display: flex; align-items: center; gap: 10px; }
.recent-title { font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
.recent-list { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font: inherit; font-size: 13px; font-weight: 800; color: var(--text); background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.chip:hover { border-color: var(--banana); }
.chip .who { color: var(--banana); }
.chip .ago { color: var(--muted); font-weight: 700; }
.chip img { width: 18px; height: 18px; }
.chip:first-child { background: rgba(255,210,63,.14); border-color: rgba(255,210,63,.4); }

/* Pads */
main { margin-top: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pad {
  --c: var(--leaf); --cd: #2e7d32;
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 128px; padding: 14px 10px 12px; border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 92%, #fff 8%), var(--c));
  color: #1c1206; border: 0; cursor: pointer; font: inherit;
  box-shadow: 0 7px 0 var(--cd), 0 12px 20px rgba(0,0,0,.35);
  transition: transform .08s, box-shadow .08s;
  text-align: center; user-select: none;
}
.pad:hover { transform: translateY(-2px); box-shadow: 0 9px 0 var(--cd), 0 16px 24px rgba(0,0,0,.4); }
.pad:active, .pad.hit { transform: translateY(6px); box-shadow: 0 1px 0 var(--cd), 0 4px 8px rgba(0,0,0,.3); }
.pad .em { font-size: 40px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.18)); }
.pad .em img { width: 42px; height: 42px; }
.pad .nm { font-weight: 900; font-size: 15px; line-height: 1.15; word-break: break-word; }
.pad .meta { font-size: 11px; font-weight: 800; opacity: .62; }
.pad.c1 { --c: var(--banana); --cd: var(--banana-d); }
.pad.c2 { --c: #66bb6a; --cd: #2e7d32; }
.pad.c3 { --c: #d7905a; --cd: var(--coco-d); }
.pad.c4 { --c: var(--hibiscus); --cd: #b8325c; }
.pad.c5 { --c: var(--sky); --cd: #1f88b8; }
.pad.c6 { --c: #b39ddb; --cd: #6a4fa8; }

.pad .tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.pad:hover .tools, .pad:focus-within .tools { opacity: 1; }
.tool { width: 30px; height: 30px; border-radius: 9px; border: 0; cursor: pointer; font-size: 14px; background: rgba(0,0,0,.22); color: #fff; display: grid; place-items: center; }
.tool:hover { background: rgba(0,0,0,.4); }

.pad.playing::after {
  content: ''; position: absolute; inset: -4px; border-radius: calc(var(--radius) + 4px);
  border: 3px solid var(--text); animation: pulse 1s ease-in-out infinite; pointer-events: none;
}
@keyframes pulse { 50% { opacity: .25; transform: scale(1.03); } }

.empty { text-align: center; color: var(--muted); font-size: 18px; font-weight: 700; padding: 60px 20px; }

/* Ziehen & Ablegen */
.drop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(11,31,21,.85); }
.drop div { font-family: Bungee, sans-serif; font-size: clamp(22px, 5vw, 40px); color: var(--banana); padding: 50px 60px; border: 4px dashed var(--banana); border-radius: 30px; }

/* Dialog */
dialog { border: 0; padding: 0; border-radius: 22px; background: var(--jungle-1); color: var(--text); width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(0,0,0,.6); }
form { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
h2 { font-family: Bungee, sans-serif; font-weight: 400; color: var(--banana); margin: 0 0 4px; font-size: 22px; }
.filepick { display: block; border: 2px dashed var(--jungle-3); border-radius: 14px; padding: 18px; text-align: center; cursor: pointer; font-weight: 800; color: var(--muted); }
.filepick:hover, .filepick.over { border-color: var(--banana); color: var(--text); }
.filepick input { display: none; }
.row { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.picks button { font-size: 20px; width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--jungle-2); cursor: pointer; }
.picks button:hover { background: var(--jungle-3); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.err { color: var(--danger); font-weight: 800; margin: 0; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.grow { flex: 1; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* Meldungen */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 420px; }
.toast { background: var(--jungle-2); border: 1px solid var(--jungle-3); padding: 10px 16px; border-radius: 12px; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: up .2s ease-out; }
.toast.bad { border-color: var(--danger); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 640px) {
  body { padding: 0 16px 40px; }
  .logo { font-size: 42px; }
  select { min-width: 0; max-width: none; width: 100%; }
  .field { flex: 1 1 100%; }
  .ctrl .btn span { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .pad { min-height: 108px; }
  .pad .em { font-size: 32px; }
  .pad .tools { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .logo, .pad.playing::after { animation: none; }
}
