/* Eissport Mondsee Kalender - CI: Gelb #ffed00, Cyan #0bbbef, Pink #ed1566, Dunkel #1d1d1b, Schrift Poppins.
   Poppins nicht von Google laden (DSGVO) - Schriftdateien optional selbst hosten unter assets/fonts/. */
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: local('Poppins'), local('Poppins Regular'), url('fonts/poppins-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: local('Poppins SemiBold'), url('fonts/poppins-600.woff2') format('woff2'); }

:root {
  --ink: #1d1d1b; --muted: #6b6b66; --line: #e2e2e2; --soft: #f0edeb;
  --yellow: #ffed00; --cyan: #0bbbef; --pink: #ed1566; --bg: #fff;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 14px/1.4 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
.public { padding: 8px; }

/* Buttons / Formulare */
.btn { border: 1px solid var(--ink); background: #fff; border-radius: var(--radius); padding: 6px 12px; cursor: pointer; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--yellow); border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: #f0dd00; }
.btn.danger { border-color: var(--pink); color: var(--pink); }
.btn.icon { padding: 6px 12px; font-size: 18px; line-height: 1; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid #bbb; border-radius: 6px; background: #fff;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 3px; }

/* Kalender-Kopf */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 8px; }
.cal-nav { display: flex; gap: 6px; }
.cal-title { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 150px; }
.cal-title strong { font-size: 18px; }
.cal-title span { color: var(--muted); }
.cal-extra { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px 3px 8px; cursor: pointer; }
.chip.off { opacity: .4; text-decoration: line-through; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); display: inline-block; }
.cal-error { color: var(--pink); }

/* Wochenraster (Desktop) */
.grid { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list { display: none; }
.grid-head, .grid-body { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
.grid-head { background: var(--cyan); color: var(--ink); position: sticky; top: 0; z-index: 3; }
.dayhead { padding: 6px 4px; text-align: center; border-left: 1px solid rgba(29,29,27,.25); display: flex; flex-direction: column; line-height: 1.2; }
.dayhead span { font-size: 11px; opacity: .75; }
.dayhead.today { background: var(--yellow); color: var(--ink); }
.dayhead.today span { opacity: .75; }
.timecol { position: relative; }
.tick { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.timecol .tick:first-child { transform: none; }
.col { position: relative; border-left: 1px solid var(--line);
  background-image:
    linear-gradient(to bottom, transparent calc(var(--slot) - 1px), #eee calc(var(--slot) - 1px), #eee var(--slot), transparent var(--slot)),
    linear-gradient(to bottom, transparent calc(var(--slot) * 2 - 1px), #d0d0d0 calc(var(--slot) * 2 - 1px), #d0d0d0 calc(var(--slot) * 2));
  background-size: 100% calc(var(--slot) * 2), 100% calc(var(--slot) * 2);
  background-repeat: repeat-y; }
.col.today { background-color: #fffde0; }
.col.clickable { cursor: cell; }
.ev { position: absolute; padding: 2px 5px; border-radius: 5px; overflow: hidden; font-size: 11.5px; line-height: 1.25;
  border: 1px solid rgba(0,0,0,.22); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.ev.clickable { cursor: pointer; }
.ev.clickable:hover { filter: brightness(.95); z-index: 2; }
.ev .ev-time { font-weight: 600; font-size: 10.5px; opacity: .9; }
.ev .ev-title { font-weight: 600; overflow-wrap: anywhere; }
.ev .ev-info { opacity: .9; font-size: 10.5px; overflow-wrap: anywhere; }
.ev.short .ev-time { display: inline; margin-right: 4px; }
.ev.short .ev-title { display: inline; }
.ev.short .ev-info { display: none; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--pink); z-index: 2; pointer-events: none; }
.nowline::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }

/* Tagesliste (Smartphone) */
.day { margin-bottom: 14px; }
.day h3 { margin: 0 0 6px; padding: 6px 10px; background: var(--cyan); color: var(--ink); border-radius: 6px; font-size: 14px; }
.day.today h3 { background: var(--yellow); color: var(--ink); }
.day .none { margin: 0 0 0 4px; color: var(--muted); }
.item { padding: 8px 10px; border-radius: 6px; margin-bottom: 6px; border: 1px solid rgba(0,0,0,.2); }
.item.clickable { cursor: pointer; }
.item .ev-cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.item .ev-time { font-weight: 600; }
.item .ev-title { font-weight: 600; }
.item .ev-info { font-size: 12.5px; opacity: .9; }

@media (max-width: 759px) {
  .grid { display: none; }
  .list { display: block; }
}

/* Admin */
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 12px 16px 40px; }
.admin-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; border-bottom: 3px solid var(--yellow); padding-bottom: 10px; margin-bottom: 16px; }
.admin-top h1 { font-size: 18px; margin: 0; flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.tab.active { background: var(--ink); color: #fff; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-width: 520px; background: #fff; }
.card.wide { max-width: 720px; }
.card h2 { margin: 0 0 6px; font-size: 16px; }
.login { max-width: 360px; margin: 60px auto; }
.cat-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.cat-row input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid #bbb; border-radius: 6px; background: #fff; }
.cat-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 4px 8px; border: 1px solid #bbb; border-radius: 6px; color: var(--ink); cursor: pointer; }
.scope { background: var(--soft); padding: 8px 10px; border-radius: 6px; margin-top: 10px; }
.scope label { display: flex; gap: 6px; align-items: center; color: var(--ink); margin: 3px 0; font-size: 13px; }
.msg { margin: 8px 0; padding: 8px 10px; border-radius: 6px; background: #e8f8e8; }
.msg.err { background: #fde3ec; color: #8a0b3a; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 20px 10px; overflow: auto; z-index: 20; }
.modal { background: #fff; border-radius: 12px; padding: 18px; width: 100%; max-width: 480px; }
.modal h2 { margin: 0 0 4px; font-size: 17px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.modal-actions .spacer { flex: 1; }
