/* CCM – Canna Community Manager · Gold/Braun-Theme passend zum Wappen */
:root {
  --bg: #120e0b; --bg2: #1b1510; --card: #221a13; --card2: #2a2018; --line: #3a2d20;
  --text: #f1e7d6; --muted: #a8957a; --gold: #d4a64a; --gold2: #f0cf7a; --gold-dk: #9a7224;
  --green: #6fbf73; --red: #e06a5a; --blue: #6aa8e0;
  --r: 14px; --shadow: 0 8px 30px rgba(0,0,0,.35);
  --serif: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--sans); color: var(--text); min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -200px, #3a2a17 0%, transparent 70%), var(--bg); }
a { color: var(--gold2); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .02em; margin: 0 0 .4em; }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); background: linear-gradient(180deg, var(--gold2), var(--gold) 60%, var(--gold-dk)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2.sec { font-size: 1.15rem; color: var(--gold2); margin: 1.6em 0 .7em; }
h3 { font-size: 1.1rem; color: var(--gold2); }
.muted { color: var(--muted); } .small { font-size: .85em; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.grow { flex: 1; } .c { text-align: center; } .inline { display: inline; margin: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 16px 40px; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: rgba(18,14,11,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.brand b { font-family: var(--serif); color: var(--gold2); font-size: 1.15rem; display: block; line-height: 1; }
.brand small { color: var(--muted); font-size: .72rem; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a, .topbar nav .link { color: var(--text); padding: 6px 10px; border-radius: 8px; font-size: .92rem; }
.topbar nav a.on, .topbar nav a:hover { background: var(--card2); text-decoration: none; color: var(--gold2); }
@media (max-width: 560px) { .brand small { display: none; } .topbar nav a, .topbar nav .link { padding: 6px 7px; font-size: .85rem; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font: 600 .92rem var(--sans); cursor: pointer; transition: .15s; text-decoration: none !important; }
.btn:hover:not(:disabled) { border-color: var(--gold-dk); color: var(--gold2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold) 55%, var(--gold-dk)); color: #2a1c08; border-color: var(--gold-dk); box-shadow: 0 2px 10px rgba(212,166,74,.25); }
.btn.gold:hover:not(:disabled) { filter: brightness(1.08); color: #1c1205; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); } .btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: .82rem; } .btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--gold2); cursor: pointer; font: inherit; padding: 0; }
.icon { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: 4px 6px; border-radius: 6px; color: var(--text); }
.icon:hover { background: var(--card2); }

/* Cards / Flash */
.card { background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.flash { padding: 10px 14px; border-radius: 10px; margin: 0 0 14px; border: 1px solid; }
.flash.ok { border-color: #3d6b3f; background: #1b2a1b; } .flash.err { border-color: #7a3a30; background: #2e1714; } .flash.warn { border-color: var(--gold-dk); background: #2d2210; }
.empty { padding: 30px; text-align: center; } .empty p { color: var(--muted); margin-top: 0; }

/* Login */
.login { max-width: 400px; margin: 4vh auto; text-align: center; }
.login-logo { width: 180px; filter: drop-shadow(0 10px 30px rgba(212,166,74,.25)); }
.login h1 { margin: 10px 0 18px; }
.login .form { text-align: left; padding: 22px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; color: var(--muted); font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: #15100c; color: var(--text); font: 16px var(--sans); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,166,74,.18); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); }
input[type=file] { padding: 8px; }
input:disabled { opacity: .6; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; }
legend { color: var(--gold2); font-weight: 700; font-size: .88rem; padding: 0 6px; }
.multi .items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.mrow { display: flex; gap: 6px; align-items: center; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; }
.form label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }

/* Dialog */
dialog.dlg { width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid var(--gold-dk); border-radius: 16px;
  background: var(--card); color: var(--text); padding: 20px; box-shadow: 0 20px 80px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(5,3,2,.75); backdrop-filter: blur(3px); }
.secret { background: #0e0a07; border: 1px dashed var(--gold-dk); padding: 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; color: var(--gold2); }

/* Hero */
.hero { display: flex; gap: 28px; align-items: center; padding: 10px 0 6px; }
.hero > img { width: 150px; flex: none; filter: drop-shadow(0 12px 30px rgba(212,166,74,.25)); }
.hero p { max-width: 560px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 16px; }
.stats span { background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .88rem; color: var(--muted); }
.stats b { color: var(--gold2); }
div.stats.card { padding: 12px; border-radius: var(--r); }
@media (max-width: 640px) { .hero { flex-direction: column; text-align: center; gap: 10px; } .hero > img { width: 120px; } .hero .stats { justify-content: center; } }

/* Favoriten-Strip */
.strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.strip-item { position: relative; flex: 0 0 170px; height: 170px; border-radius: 12px; overflow: hidden; border: 1px solid var(--gold-dk); scroll-snap-align: start; }
.strip-item img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.strip-item:hover img { transform: scale(1.05); }
.strip-item span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: .78rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.8)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Grids */
.grid { display: grid; gap: 16px; }
.grid.runs { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); } .grid.two .form { padding: 18px; }
.grid.media { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
@media (max-width: 480px) { .grid.media { grid-template-columns: repeat(2, 1fr); } .grid.runs { grid-template-columns: 1fr; } }

.run-card { display: block; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: .2s; box-shadow: var(--shadow); }
.run-card:hover { transform: translateY(-3px); border-color: var(--gold-dk); text-decoration: none; }
.cover { position: relative; aspect-ratio: 16/10; background: #0e0a07; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover img.placeholder, .cover-lg img.placeholder { object-fit: contain; padding: 14px; opacity: .55; }
.cover .badge { position: absolute; top: 10px; left: 10px; }
.run-card .body { padding: 12px 14px 14px; }
.run-card h3 { margin: 0 0 2px; color: var(--text); font-size: 1.05rem; }
.meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: #000a; border: 1px solid var(--line); }
.s-aktiv { color: var(--green); border-color: #3d6b3f; } .s-geplant { color: var(--blue); border-color: #35577a; } .s-abgeschlossen { color: var(--muted); }
.r-admin { color: var(--gold2); border-color: var(--gold-dk); } .r-member { color: var(--green); } .r-viewer { color: var(--muted); }

/* Run-Detail */
.crumbs { margin: 0 0 10px; font-size: .9rem; }
.run-head { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; overflow: hidden; }
.cover-lg { background: #0e0a07; aspect-ratio: 4/3; } .cover-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.run-head .info { padding: 18px 20px; min-width: 0; }
.run-head .info h1 { margin-top: 6px; overflow-wrap: anywhere; }
@media (max-width: 720px) { .run-head { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 6px; margin: 22px 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.tabs a.on { color: var(--gold2); border-color: var(--gold); text-decoration: none; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.toolbar h2.sec { margin: 1em 0 .4em; }

/* Tabelle */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; color: var(--gold2); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #2c2219; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: rgba(212,166,74,.05); }
.chip { display: inline-block; background: #2f2416; border: 1px solid var(--gold-dk); color: var(--gold2); padding: 1px 8px; border-radius: 999px; font-size: .8rem; margin: 1px 3px 2px 0; white-space: nowrap; }
.chip.alt { background: #1c2a1c; border-color: #3d6b3f; color: #a9dcaa; }

/* Medien */
.dropzone { padding: 22px; text-align: center; border: 2px dashed var(--gold-dk); margin-bottom: 14px; transition: .2s; }
.dropzone.over { background: rgba(212,166,74,.08); border-color: var(--gold2); }
.dropzone p { margin: 4px 0; }
.progress { position: relative; height: 26px; background: #0e0a07; border-radius: 8px; overflow: hidden; margin-top: 12px; border: 1px solid var(--line); }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-dk), var(--gold)); transition: width .2s; }
.progress span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .8rem; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 7px 12px; cursor: pointer; font: 600 .85rem var(--sans); }
.seg button.on { background: var(--card2); color: var(--gold2); }
.tile { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: #0e0a07; border: 1px solid var(--line); cursor: zoom-in; aspect-ratio: 1; }
.tile.fav { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dk), 0 4px 18px rgba(212,166,74,.2); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: .3s; display: block; }
.tile:hover img { transform: scale(1.04); }
.play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 1.1rem; pointer-events: none; border: 2px solid rgba(255,255,255,.7); }
.star { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: var(--gold2); font-size: 1.2rem; cursor: pointer; line-height: 1; }
.star:disabled { cursor: default; }
.tile:not(.fav) .star { color: #fff; opacity: .75; }
.tile figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.85)); display: flex; flex-direction: column; font-size: .8rem; pointer-events: none; }
.tile figcaption .cap { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile figcaption .cap:empty { display: none; }

/* Lightbox */
dialog.lightbox { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: rgba(5,3,2,.96); color: var(--text); }
dialog.lightbox::backdrop { background: rgba(5,3,2,.96); }
.lb-body { position: absolute; inset: 50px 0 60px; display: flex; align-items: center; justify-content: center; }
.lb-body img, .lb-body video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-close { position: absolute; top: 10px; right: 14px; z-index: 2; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(0,0,0,.4); border: 0; color: #fff; font-size: 2.4rem; width: 48px; height: 70px; cursor: pointer; border-radius: 10px; }
.lb-nav.prev { left: 8px; } .lb-nav.next { right: 8px; }
.lb-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: rgba(0,0,0,.6); flex-wrap: wrap; }

/* Toast / Footer */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1000; background: var(--card2); border: 1px solid var(--gold-dk); color: var(--text); padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.err { border-color: var(--red); color: #ffd2cc; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px 16px 30px; }
