@layer components, utilities, accessibility;

@layer components {
:root{
  --bg:#111;
  --elev:#1a1a1a;
  --elev-rgb: 26, 26, 26;
  --participant-pill-bg:#2a2a2a;
  --dropdown-separator: rgba(255,255,255,0.28);
  --names-divider: rgba(255,255,255,0.58);
  --text:#e7ebf0;
  --muted:#a0a0a0;
  --accent:#ff7a00;
  --accent-weak:#2d2d2d;
  --ring:#333;
  --content-w: 900px;
  --desktop-scale: 1;
  --control-h: calc(52px * var(--desktop-scale));
  --rail-h: calc(40px * var(--desktop-scale));
  --card-radius: calc(20px * var(--desktop-scale));
  --space-1: calc(6px * var(--desktop-scale));
  --space-2: calc(12px * var(--desktop-scale));
  --space-3: calc(16px * var(--desktop-scale));
  --space-4: calc(24px * var(--desktop-scale));
  --error: #ff6b6b;
  --warning: #ffb347;
  --loading-bar-width: 0;
}
/* Version: 2025-01-19-V5-FULL-MOBILE-OPTIMIZED */
body.light-mode { --bg:#f6f7f9; --elev:#ffffff; --elev-rgb: 255, 255, 255; --participant-pill-bg:#eef0f3; --dropdown-separator: rgba(0,0,0,0.12); --names-divider: rgba(0,0,0,0.32); --text:#141a20; --muted:#5b6672; --accent:#b55300; --accent-weak:#f3e3d4; --ring:#d3d8de; }

/* Desktop scaling optional: set --desktop-scale >1 if needed */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  /* MOBILE OPTIMIERUNG: Smooth scrolling für bessere UX */
  scroll-behavior: smooth;
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body{
  background:var(--bg);
  color:var(--text);
  font:500 calc(16px * var(--desktop-scale))/1.5 system-ui,Segoe UI,Roboto,Helvetica,Arial;
  transition: background .3s ease, color .3s ease;
  /* MOBILE OPTIMIERUNG: Verhindern von Pull-to-Refresh auf mobilen Browsern */
  overscroll-behavior-y: contain;
  /* MOBILE OPTIMIERUNG: Besseres Scrolling auf iOS */
  -webkit-overflow-scrolling: touch;
  /* Smooth page load - verhindert Flash beim Reload */
  opacity: 1;
  /* Responsive Skalierung basierend auf Auflösung */
  zoom: 1;
}

/* Layout helpers without priority overrides. */
.u-flex-col-gap12 { display: flex; flex-direction: column; gap: 12px; }
.u-grid-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.u-flex-column { display: flex; flex-direction: column; }
.u-gap-12 { gap: 12px; }
.u-text-right { text-align: right; }
.u-text-left { text-align: left; }
.is-hidden-pe { opacity: 0; pointer-events: none; }
.is-visible-pe { opacity: 1; pointer-events: auto; }
.ready-waiting-large { font-size: 1.5em; }
.icon-20 { width: 20px; height: 20px; }
.input-pill { width: 100%; padding: 14px 16px; font-size: 16px; border-radius: 999px; border: 1px solid var(--ring); background: var(--bg); color: var(--text); cursor: pointer; outline: none; }
.form-error { color: var(--error); font-size: 14px; text-align: center; margin: -8px 0 0 0; min-height: 1.2em; }
.dialog-muted { color: var(--muted); font-size: 14px; text-align: center; margin-bottom: 16px; }
.dialog-content-left { text-align: left; }
.history-pairings { display: flex; flex-direction: column; gap: 12px; }
.history-pairings-box {
  background: var(--participant-pill-bg);
  border-radius: 16px;
  padding: 16px 18px;
}
.history-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.history-arrow { width: 24px; height: 24px; color: var(--text); flex-shrink: 0; }
.history-pairings .u-warning,
#historyDataDisplay .u-warning,
#historyDataDisplayMobile .u-warning { --u-warning-color: var(--text); }
.history-box-single {
  background: var(--participant-pill-bg);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-notice {
  background: var(--participant-pill-bg);
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid var(--ring);
  text-align: center;
}
.history-notice-text {
  color: var(--text);
  font-weight: 600;
}
.history-box-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.history-box-title {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  font-weight: 700;
  text-align: left;
}
.history-box-spacer { width: 24px; height: 1px; }
.history-pairings { display: flex; flex-direction: column; gap: 12px; }
.history-pair-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.history-name { font-size: 15px; font-weight: 600; color: var(--text); text-align: left; }
.dashboard-section { display: flex; flex-direction: column; gap: 12px; }
.dashboard-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.dashboard-year-panel { --dashboard-gap: 12px; display: flex; flex-direction: column; }
.dashboard-year-row { margin-bottom: 12px; }
.dashboard-year-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dashboard-year-tab {
  border: 0;
  border-radius: 12px;
  background: var(--participant-pill-bg);
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
  padding: 10px 16px;
  cursor: pointer;
  line-height: 1;
}
.dashboard-year-tab.active {
  color: var(--text);
  background: var(--participant-pill-bg);
  box-shadow: none;
}
.dashboard-year-tab:active { transform: scale(0.99); }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--dashboard-gap); grid-auto-rows: 1fr; }
.dashboard-card {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--ring);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 112px;
}
.dashboard-card-title { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.dashboard-card-value { font-size: 18px; font-weight: 800; }
.dashboard-card-sub { font-size: 12px; color: var(--muted); }
.dashboard-card-compact .dashboard-card-sub { display: none; }
.dashboard-names-card {
  margin-top: 12px;
  background: var(--participant-pill-bg);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dashboard-names-title { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; font-weight: 700; text-align: left; }
.dashboard-names-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dashboard-name-row {
  display: block;
}
.dashboard-name-item {
  display: inline;
  text-align: left;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  padding: 0;
}
.dashboard-name-item::after {
  content: none;
}
.dashboard-names-empty { color: var(--muted); font-weight: 500; text-align: center; }
.dashboard-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dashboard-stat { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ring); background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.dashboard-stat-label { color: var(--muted); font-weight: 600; }
.dashboard-stat-value { font-weight: 700; }
.dashboard-tabs { display: flex; gap: 6px; padding: 4px; height: 52px; border-radius: 999px; border: 1px solid var(--ring); background: rgba(var(--elev-rgb), 0.18); margin-bottom: 12px; --dash-tab-inset: 4px; }
.dashboard-tabs { position: relative; overflow: hidden; }
.dashboard-tabs::before {
  content: '';
  position: absolute;
  top: var(--dash-tab-inset);
  bottom: var(--dash-tab-inset);
  left: 0;
  width: var(--dash-tab-w, 0px);
  transform: translateX(var(--dash-tab-x, 0px));
  background: var(--participant-pill-bg);
  border-radius: 999px;
  transition: none;
}
.dashboard-tabs.tab-highlight-ready::before {
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.dashboard-tab { flex: 1; height: 100%; border: 0; border-radius: 999px; padding: 0 12px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.dashboard-tab.active { background: transparent; color: var(--text); }
.dashboard-tab:active { transform: scale(0.98); }
body.light-mode .dashboard-tabs { background: rgba(0, 0, 0, 0.06); }
.dashboard-year-list { display: flex; flex-direction: column; gap: 16px; }
.history-year-row { display: flex; width: 100%; margin: 0 0 12px; }
#history-section-mobile .history-year-row { margin: 0 0 12px; }
#history-section-mobile .history-year-section { margin-top: 0; }
#history-section-mobile .mobile-fullscreen-section + .mobile-fullscreen-section { margin-top: 12px; }
#history-section-desktop #historyDataDisplay { margin-top: 6px; }
#history-section-mobile #historyDataDisplayMobile { margin-top: 0; }
.history-year-row .history-year-wrapper { width: 100%; }
#history-section-mobile .history-year-wrapper { height: auto; display: flex; }
.history-year-row .history-year-button {
  width: 100%;
  padding: calc(12px * var(--desktop-scale)) calc(18px * var(--desktop-scale));
  border-radius: 999px;
  background: var(--participant-pill-bg);
  font-size: calc(16px * var(--desktop-scale));
  min-height: var(--control-h);
}
#history-section-mobile .history-year-button { height: auto; font-weight: 500; }
.sr-hidden {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.history-year-wrapper { display: inline-flex; align-items: center; height: 32px; padding: 0; border: 0; background: transparent; }
.history-year-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 2px; height: 100%; padding: 0 10px 0 12px; border: 0; border-radius: 999px; background: var(--participant-pill-bg); color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; line-height: 1; text-align: left; }
.history-year-button .truncate { display: block; line-height: 1; }
.history-year-button:focus { outline: none; box-shadow: none; }
.history-year-button:focus-visible { outline: none; box-shadow: none; }
.history-year-button.open { border-top-left-radius: var(--card-radius); border-top-right-radius: var(--card-radius); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.history-year-button:active { transform: scale(0.99); }
.history-year-caret { width: 16px; height: 16px; pointer-events: none; }
.suppress-menu-hover #host-view .mi::before { opacity: 0; }

/* Motion helpers; state values live in the utilities layer. */
.will-change-transform { will-change: transform, opacity; }
.icon-rotate-180 { transform: rotate(180deg); }
.fade-out { transition: opacity .25s ease; }
.fade-in { transition: opacity .25s ease; }

/* Skalierung entfernt - Standard für alle Auflösungen */
.header{position:sticky;top:0;z-index:11;background:#111;position:relative;width:100%;margin-left:0}
body.light-mode .header{background:#f5f5f5}
@media (min-width: 1001px){
  .header{border-bottom:1px solid var(--ring);}
}
.loading-bar{position:absolute;top:0;left:0;height:3px;background-color:var(--accent);width:var(--loading-bar-width, 0%);transition:width .4s ease;opacity:1}
.bar{width:100%;min-height:calc(44px * var(--desktop-scale));padding:var(--space-1) var(--space-3);display:grid;grid-template-columns:1fr minmax(300px, var(--content-w)) 1fr;align-items:center;gap:var(--space-2)}
.bar{position:relative;}
.header-left{display:flex;align-items:center;gap:var(--space-4);justify-self:start;position:relative;height:var(--control-h);}
.burger{margin-left:var(--space-4);margin-right:0;}
.brand{font-weight:700;font-size:calc(22px * var(--desktop-scale));white-space:nowrap;display:flex;align-items:center;justify-content:center;cursor:pointer;height:var(--control-h);min-height:var(--control-h);max-height:var(--control-h);margin-left:0;flex-shrink:0;position:relative;}
.brand-name{width:calc(112px * var(--desktop-scale));height:var(--control-h);display:flex;align-items:center;justify-content:center;}
.host-superscript{
  display:none;
  position:absolute;
  top:4px;
  right:-18px;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.2px;
  color:var(--muted);
}
body[data-role="host"] .host-superscript{display:inline}
.progress{justify-self:center;display:flex;align-items:center;justify-content:center;width:100%;height:var(--rail-h);min-height:var(--rail-h);max-height:var(--rail-h);}
.track{height:var(--rail-h);min-height:var(--rail-h);max-height:var(--rail-h);border-radius:999px;overflow:hidden;position:relative;width:100%;max-width:var(--content-w);display:flex;align-items:center;justify-content:center;border:1px solid var(--ring);box-sizing:border-box;}
.fill{position:absolute;left:0;top:0;height:100%;width:0;background:var(--accent);border-radius:0;transition:width .5s ease;z-index:0}
.fill{width:var(--fill-width, 0%);}
.fill.no-transition{transition:none}
#progressText{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:#fff;font-weight:700;font-size:calc(18px * var(--desktop-scale));z-index:1}
body.light-mode #progressText{color:#111}
.burger{border:none;background:transparent;color:var(--text);width:calc(22px * var(--desktop-scale));height:var(--control-h);min-height:var(--control-h);max-height:var(--control-h);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;opacity:.9;z-index:92;flex-shrink:0;}
.burger:hover{opacity:1}
.burger:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:8px;}
.burger-lines{position:relative;width:calc(22px * var(--desktop-scale));height:calc(14px * var(--desktop-scale))}
.burger-lines::before,.burger-lines::after,.burger-lines span{content:"";position:absolute;left:0;right:0;height:2px;background:var(--text);border-radius:2px;transition:transform .15s ease,opacity .15s ease}
.burger-lines::before{top:0}
.burger-lines span{top:calc(6px * var(--desktop-scale))}
.burger-lines::after{bottom:0}
/* === SIDEBAR STRUKTUR === */
.side {
  position: fixed;
  top: 0;
  left: 0;
  width: calc(100px * var(--desktop-scale));
  height: 100vh;
  background: #111;
  z-index: 9;
  display: flex;
  flex-direction: column;
  padding-top: calc(44px * var(--desktop-scale));
  overflow: hidden;
}
body.light-mode .side { background: #f5f5f5; }
.side.expanded,
body.sidebar-expanded .side { width: calc(300px * var(--desktop-scale)); }

/* === SIDEBAR BODY === */
.side-body {
  padding: var(--space-4) 0 calc(8px * var(--desktop-scale)) 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

/* === SIDEBAR FOOTER === */
.side-footer {
  padding: calc(8px * var(--desktop-scale));
  flex-shrink: 0;
  flex-grow: 0;
}
.side.expanded .side-footer,
body.sidebar-expanded .side .side-footer { padding: calc(16px * var(--desktop-scale)); }

#host-footer-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* === MENU ITEMS === */
.side .mi {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: calc(10px * var(--desktop-scale)) 0;
  flex-direction: column;
  gap: calc(2px * var(--desktop-scale));
  min-height: var(--control-h);
  flex-shrink: 0;
  position: relative;
}
.side.expanded .mi,
body.sidebar-expanded .side .mi {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: var(--space-2) calc(18px * var(--desktop-scale)) var(--space-2) calc(32px * var(--desktop-scale));
  flex-direction: row;
  gap: var(--space-2);
  min-height: var(--control-h);
}

/* === MENU ITEM TEXT === */
.side .mi-text {
  display: block;
  font-size: calc(10px * var(--desktop-scale));
  text-align: center;
  margin-top: 4px;
  margin-bottom: 0;
  line-height: 1.2;
}
.side.expanded .mi-text,
body.sidebar-expanded .side .mi-text {
  display: block;
  font-size: calc(16px * var(--desktop-scale));
  text-align: left;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.5;
  padding-left: 2px;
}

/* === MENU SEPARATOR === */
.menu-separator {
  height: 1px;
  background: var(--ring);
  flex-shrink: 0;
  margin: 6px 8px;
}
.side .menu-separator { margin: 6px -8px; }
.side.expanded .menu-separator,
body.sidebar-expanded .side .menu-separator { margin: 6px 8px; }
body:not(.sidebar-expanded) .side #host-menu-items .menu-separator { display: none; }
body:not(.sidebar-expanded) .side #guest-menu .menu-separator { display: none; }
.menu-separator.menu-separator-full {
  margin: 6px -16px;
  width: calc(100% + 32px);
}

/* === SIDEBAR HIDDEN === */
.side-header { display: none; }
.live-clock { font-size: 14px; color: var(--muted); text-align: center; padding: 8px 0; }
body:not(.sidebar-expanded) .side .live-clock { display: none; }
.side.expanded .live-clock,
body.sidebar-expanded .side .live-clock { display: block; }
body[data-role="host"] #guest-live-clock { display: none; }
body[data-role="guest"] #host-menu-items { display: none; }
body[data-role="host"] #guest-menu { display: none; }
body[data-role="guest"] #host-footer-items { display: none; }
.side .burger { display: flex; align-items: center; }
.mi{display:flex;align-items:center;gap:var(--space-2);border-radius:999px;cursor:pointer;border:none;font-size:calc(18px * var(--desktop-scale));font-weight:600;-webkit-tap-highlight-color: transparent;user-select:none;-webkit-user-select:none;position:relative;overflow:hidden;padding:var(--space-2) var(--space-3);min-height:var(--control-h);margin:calc(4px * var(--desktop-scale)) calc(8px * var(--desktop-scale));}
.mi::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(128, 128, 128, 0.15);border-radius:999px;opacity:0;transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);}
body:not(.sidebar-expanded) .side .mi{border-radius:16px;}
body:not(.sidebar-expanded) .side .mi::before{border-radius:16px;}
.mi.tap-flash::before{opacity:1;transition:none;}
.mi.mi-centered{justify-content:center;padding:12px}
.mi .sub{margin-left:auto;font-size:12px;color:var(--muted)}
body:not(.sidebar-expanded) .side .mi .sub{display:none}
.mi-icon{width:24px;height:24px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;position:relative;z-index:1;display:flex;align-items:center;justify-content:center;}
.side .mi-icon{width:24px;height:24px;align-self:center;}
.side.expanded .mi-icon,
body.sidebar-expanded .side .mi-icon{width:24px;height:24px;align-self:center;}
.mi-icon svg { width: 24px; height: 24px; display: block; }
.mi-text{white-space:nowrap;overflow:hidden;position:relative;z-index:1;}
body:not(.sidebar-expanded) .side .mi-text{white-space:normal;word-break:break-word;max-width:100%;line-height:1.2;}
.mi-text-short{display:none;}
.mi-text-long{display:inline;}
body:not(.sidebar-expanded) .side .mi-text-short{display:inline;}
body:not(.sidebar-expanded) .side .mi-text-long{display:none;}
.mi-text-line1, .mi-text-line2{display:inline;}
.mi-text-line1::after{content:' ';}
body:not(.sidebar-expanded) .side .mi-text-line1, body:not(.sidebar-expanded) .side .mi-text-line2{display:block;}
body:not(.sidebar-expanded) .side .mi-text-line1::after{content:'';}
.mi.danger{color:#ff6b6b;font-weight:700;}
.mi.danger::before{background:rgba(255,107,107,0.15);}
body.light-mode .mi.danger::before{background:rgba(255,107,107,0.12);}

/* Hover/Active Feedback */
.mi:hover::before,
.mi:active::before{opacity:1;}
.mi:active::before{transition:none;}
body.light-mode .mi::before{background:rgba(128, 128, 128, 0.12);}
#miMobileLogout { color: #ff6b6b; font-weight: 700; }
#miMobileLogout::before { background: rgba(255, 107, 107, 0.15); }
body.light-mode #miMobileLogout::before { background: rgba(255, 107, 107, 0.12); }
body[data-user-logged-in="true"] #miMobileLogin { color: #ff6b6b; font-weight: 700; }
body[data-user-logged-in="true"] #miMobileLogin::before { background: rgba(255, 107, 107, 0.15); }
body.light-mode[data-user-logged-in="true"] #miMobileLogin::before { background: rgba(255, 107, 107, 0.12); }
.header-right{justify-self:end;display:flex;align-items:center;gap:calc(8px * var(--desktop-scale));height:calc(44px * var(--desktop-scale));min-height:calc(44px * var(--desktop-scale));max-height:calc(44px * var(--desktop-scale));}
.header-pill{
  display:none;
  align-items:center;
  justify-content:center;
  height:calc(40px * var(--desktop-scale));
  padding:0 calc(16px * var(--desktop-scale));
  border-radius:999px;
  background:var(--elev);
  border:1px solid var(--ring);
  color:var(--text);
  font-weight:800;
  font-size:calc(14px * var(--desktop-scale));
  cursor:pointer;
  line-height:1;
}
.header-pill:active{transform:scale(0.98)}
.header-pill:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.header-pill:hover{border-color:rgba(255,255,255,0.22)}
body.light-mode .header-pill:hover{border-color:rgba(0,0,0,0.18)}
.icon-btn{cursor:pointer;border-radius:50%;width:calc(40px * var(--desktop-scale));height:calc(40px * var(--desktop-scale));min-height:calc(40px * var(--desktop-scale));max-height:calc(40px * var(--desktop-scale));display:grid;place-items:center;background:var(--elev);border:1px solid var(--ring);flex-shrink:0;box-sizing:border-box;}
.icon-btn svg{width:calc(22px * var(--desktop-scale));height:calc(22px * var(--desktop-scale));fill:var(--muted);transition:fill .2s ease}
.icon-btn:hover svg{fill:var(--text)}
.icon-btn:active{transform:scale(0.95)}
.icon-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.host-icon{cursor:pointer;border-radius:50%;width:calc(40px * var(--desktop-scale));height:calc(40px * var(--desktop-scale));min-height:calc(40px * var(--desktop-scale));max-height:calc(40px * var(--desktop-scale));display:grid;place-items:center;background:var(--elev);border:1px solid var(--ring);font-size:calc(14px * var(--desktop-scale));font-weight:600;position:relative;transition:all .2s ease;flex-shrink:0;box-sizing:border-box;}
.host-icon svg{width:calc(22px * var(--desktop-scale));height:calc(22px * var(--desktop-scale));stroke:var(--muted);transition:stroke .2s ease}
.host-widget:hover .host-icon svg{stroke:var(--text)}
body:not(.light-mode) .sun{display:none}
body.light-mode .moon{display:none}
body.light-mode .sun{fill:var(--text);}
#share-feedback{position:absolute;top:calc(100% + 8px);right:0;background:var(--elev);padding:8px 12px;border-radius:8px;border:1px solid var(--ring);font-size:12px;opacity:0;transform:translateY(-10px);transition:opacity .2s ease, transform .2s ease;pointer-events:none}
#share-feedback.visible{opacity:1;transform:translateY(0)}
#mobile-copy-feedback{position:fixed;bottom:100px;left:50%;transform:translateX(-50%);background:var(--elev);padding:10px 16px;border-radius:8px;border:1px solid var(--ring);font-size:14px;opacity:0;pointer-events:none;z-index:101}
#mobile-copy-feedback.visible{opacity:1;transform:translateX(-50%) translateY(0);}

.connection-status {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #c0392b;
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
}
.connection-status.visible {
  transform: translateY(0);
}

.ready-box { background: var(--elev); border-radius: var(--card-radius); width: 100%; max-width: var(--content-w); margin: calc(13px * var(--desktop-scale)) auto calc(32px * var(--desktop-scale)); box-shadow: none; position: relative; height: calc(256px * var(--desktop-scale)); padding: var(--space-3) var(--space-4) var(--space-4); display: grid; }
#ready-box-form { grid-row: 1 / -1; grid-column: 1 / 1; width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
#ready-box-result { grid-row: 1 / -1; grid-column: 1 / 1; width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; }

.form-header { grid-row: 1; align-self: start; width: 100%;}
.form-header h2 { margin: 0 0 calc(6px * var(--desktop-scale)) 0; font-size: calc(24px * var(--desktop-scale)); font-weight: 700; min-height: calc(36px * var(--desktop-scale)); text-align: center; }
.form-header h2 .cursor { color: var(--accent); font-weight: 400; display: inline-block; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.form-header hr { border: none; height: 1px; background: var(--ring); width: 40%; max-width: calc(300px * var(--desktop-scale)); margin: 0 auto; transition: opacity 0.3s ease; }

.central-animation-container { grid-row: 2; display: grid; place-items: center; position: relative; width: 100%; height: 100%; }
.central-animation-container > * { grid-area: 1 / 1; transition: opacity 0.3s ease-in-out; }
.central-animation-container.view-switched #participant-dropdown-wrapper { opacity: 0; pointer-events: none; }
.central-animation-container.view-switched #waiting-text { opacity: 1; pointer-events: auto; }

#waiting-text { opacity: 0; font-weight: 700; font-size: clamp(1.2em, 5vw, 1.8em); pointer-events: none; display:flex; align-items:center; justify-content:center; height:100%; text-align: center;}
.result-user-name { text-align: center; font-size: calc(24px * var(--desktop-scale)); font-weight: 700; }
.result-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; }
.result-headline { font-size: 1.5em; font-weight: 800; text-align: center; margin:0; }
.result-slot { position: relative; display: grid; place-items: center; margin-top: var(--space-3); min-height: calc(40px * var(--desktop-scale)); min-width: calc(200px * var(--desktop-scale)); }
#result-name{ color:var(--accent); font-size:1.5em; font-weight:700; transition: opacity 0.3s ease; }
#reveal-button { position: absolute; width: 100%; height: 100%; top: 0; left: 0; transition: opacity 0.3s ease; }
#result-container.revealed #reveal-button { opacity: 0; pointer-events: none; }
#result-container:not(.revealed) #result-name { opacity: 0; }

#participant-dropdown-wrapper { width: 100%; }
/* MOBILE FIX: Font-size 16px verhindert Auto-Zoom auf iOS */
#participantButton { width: 100%; display: inline-flex; align-items: center; justify-content: space-between; border-radius: 999px; padding: calc(12px * var(--desktop-scale)) calc(18px * var(--desktop-scale)); text-align: left; color: var(--text); background: var(--participant-pill-bg); transition: none; border: 0; font-size: calc(16px * var(--desktop-scale)); }
#participantButton .truncate { display: block; line-height: 1; }
#participantButton:focus { outline: none; box-shadow: none; }
#participantButton:focus-visible { outline: none; box-shadow: none; }
#participantButton.open { box-shadow: none; border-top-left-radius: var(--card-radius); border-top-right-radius: var(--card-radius); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
#participantButton:active { transform: scale(0.99); }

.dd-container {
  position: fixed;
  z-index: 50;
  display: none;
  opacity: 1;
  transition: none;
  top: var(--dd-top, auto);
  left: var(--dd-left, auto);
  width: var(--dd-width, 852px);
  box-sizing: border-box;
}
.history-dd { z-index: 120; }
.dd-container.open { display: block; }
.dd-container.visible { opacity: 1; }
.dd-mask { 
  overflow: hidden;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  background: var(--participant-pill-bg);
  border: 0;
  border-top: 1px solid var(--dropdown-separator);
}
.dd-list {
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
  height: var(--dd-list-height, auto);
}
.dd-list::-webkit-scrollbar { display: none; }
.dd-list { scrollbar-width: none; }
.dd-list li { padding-bottom: 0; }
/* MOBILE FIX: Font-size 16px für Touch-Targets */
.dd-item { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: calc(12px * var(--desktop-scale)) calc(18px * var(--desktop-scale)); font-size: 16px; background: transparent; border-radius: 0; transition: background-color .2s ease-out; border: none; }
.dd-container.snapped .dd-item { transition: background-color .2s ease-out, border-radius .16s ease-out; }
.dd-item .truncate { display: block; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-item:hover { background-color: rgba(255, 255, 255, 0.08); }
.dd-item:active { background-color: rgba(255, 255, 255, 0.12); transform: scale(0.99); }
.dd-item.selected { 
  background-color: rgba(255, 255, 255, 0.06);
}
.ready-box-button { min-height: var(--control-h); display: inline-flex; align-items: center; justify-content: center; }
#participantButton { min-height: var(--control-h); }

body.light-mode .dd-item {
    background: transparent;
}
body.light-mode .dd-item:hover {
    background-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .dd-item:active {
    background-color: rgba(0, 0, 0, 0.12);
}
body.light-mode .dd-item.selected {
    background-color: rgba(0, 0, 0, 0.06);
}

/* MOBILE FIX: Font-size 16px für Buttons */
.dialog-box button,.ready-box-button{padding:calc(14px * var(--desktop-scale)) calc(24px * var(--desktop-scale));border:none;border-radius:999px;background:var(--accent);color:#fff;font-weight:600;font-size:calc(16px * var(--desktop-scale));cursor:pointer;transition:background .2s, transform .1s}
.dialog-box button:hover:not(:disabled),.ready-box-button:hover:not(:disabled){background:#ff8c26}

.dialog-box button:active:not(:disabled),.ready-box-button:active:not(:disabled){ 
  transform: scale(0.97);
  transition: transform 0.05s ease;
}
.dialog-box button:disabled,.ready-box-button:disabled{opacity:0.5;cursor:not-allowed}

.ready-box-button, .dialog-box button { -webkit-tap-highlight-color: rgba(0,0,0,0); }

/* Touch-Geräte: kein "sticky hover" Highlight */
@media (hover: none) and (pointer: coarse) {
  .dialog-box button:hover:not(:disabled),.ready-box-button:hover:not(:disabled){background:var(--accent)}
  .dialog-box button:focus,.ready-box-button:focus,
  .dialog-box button:focus-visible,.ready-box-button:focus-visible{outline:none;box-shadow:none}
  .ready-box-button{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
  #readyBtn{-webkit-tap-highlight-color:rgba(0,0,0,0)}
}

#readyBtn { 
    display: block;
	grid-row: 3;
    justify-self: center;
    align-self: end;
	width: 100%;
	transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}
#readyBtn.transformed { 
	width: 30%;
    min-width: 150px;
}

#readyBtn span { display: inline-block; transition: opacity 0.25s ease; white-space: nowrap; }

.status-box { background: var(--elev); border-radius: var(--card-radius) var(--card-radius) 2px 2px; padding: calc(18px * var(--desktop-scale)); display: none; gap: calc(8px * var(--desktop-scale)); width: 100%; max-width: var(--content-w); margin: calc(32px * var(--desktop-scale)) auto 0; box-shadow: none; }
.status-box .title{font-weight:700;text-align:center}
.dialog-overlay {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding-top:60px;
  opacity:0;
  pointer-events:none;
  transition:opacity .3s ease;
  z-index:80;
}
.dialog-overlay.visible{opacity:1;pointer-events:auto;}

/* Command Palette Style Dialog Box */
.dialog-box {
  background: rgba(var(--elev-rgb), 0.75);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius:20px;
  width:min(560px, 94%);
  max-width:560px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.4), 0 16px 32px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
  transform:translateY(-20px) scale(0.92);
  transition:transform .4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .4s ease;
  opacity:0;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:0;
}
.dialog-overlay.visible .dialog-box {
  transform:translateY(0) scale(1);
  opacity:1;
}

body.light-mode .dialog-box {
  background: rgba(var(--elev-rgb), 0.85);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2), 0 16px 32px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
}
.dialog-box.dialog-box-large{width:min(760px, 100%);}
.dialog-box h2{text-align:center;font-size:22px;font-weight:700;margin:0;padding:8px 12px 0;}
/* Guest dialogs without headline and with tight padding */











.dialog-box .dialog-content{padding:4px 4px 8px;margin:0;overflow:visible;}



.dialog-overlay.visible .dialog-box{transform:scale(1);}
/* MOBILE FIX: Font-size 16px für Inputs */
.dialog-box input, .dialog-box textarea{padding:calc(14px * var(--desktop-scale)) calc(16px * var(--desktop-scale));border-radius:999px;border:1px solid var(--ring);background:#1a1a1a;color:var(--text);font-size:calc(16px * var(--desktop-scale));width:100%;transition:border-color .2s ease, background .2s ease}
.dialog-box input:focus, .dialog-box textarea:focus{border-color:var(--accent);background:#1f2329;outline:none}
.dialog-box textarea{min-height: calc(160px * var(--desktop-scale)); resize: vertical; line-height: 1.6;}
body.light-mode .dialog-box input, body.light-mode .dialog-box textarea{background: #f5f5f5;}
body.light-mode .dialog-box input:focus, body.light-mode .dialog-box textarea:focus{background: #fff; border-color:var(--accent);}
.dialog-box input.error{border-color:#ff4444;animation:shake .3s}
@keyframes shake{0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)}}
.dialog-link{font-size:13px;color:var(--muted);text-align:center;margin-top:4px;display:block;cursor:pointer;text-decoration:none;transition:color .2s ease}
.dialog-link:hover{color:var(--text)}
#login-selection-view, #normal-login-view, #host-login-view, #register-view, #change-pw-view{display:flex;flex-direction:column;gap:16px;width:100%}
.login-option-btn{padding:0 32px;height:52px;font-size:16px;font-weight:600;border-radius:999px;border:none;background:var(--accent);color:#fff;cursor:pointer;transition:all .2s ease;text-align:center;display:flex;align-items:center;justify-content:center}
.login-option-btn:hover{background:#ff8c26}
.login-option-btn:active{transform:scale(0.98)}

/* Login Panel Input & Button Styling */
#login-side-panel input[type="password"],
#login-side-panel input[type="text"] {
  width: 100%;
  padding: 0 20px;
  font-size: 16px;
  border-radius: 999px;
  border: 1px solid var(--ring);
  background: var(--bg);
  color: var(--text);
  outline: none;
  height: 52px;
  transition: border-color 0.2s ease;
}

#login-side-panel input[type="password"]:focus,
#login-side-panel input[type="text"]:focus {
  border-color: var(--accent);
}

#login-side-panel button:not(.side-panel-close):not(.login-option-btn) {
  padding: 0 24px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  height: 52px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#login-side-panel button:not(.side-panel-close):not(.login-option-btn):hover {
  background: #ff8c26;
}

#login-side-panel button:not(.side-panel-close):not(.login-option-btn):active {
  transform: scale(0.98);
}

#normalUsernameSelect, #registerUsernameSelect{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:20px;padding-right:40px;padding-top:0;padding-bottom:0}
body.light-mode #normalUsernameSelect, body.light-mode #registerUsernameSelect{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")}
.dialog-title-wrapper { display: flex; justify-content: center; align-items: center; width: 100%; position: relative; gap: 16px; }
.dialog-title-wrapper h2 { text-align: center; margin: 0; }
.dialog-title-wrapper .year-selector-wrapper { position: absolute; right: 0; }


.editor-row{display:grid;grid-template-columns:1fr 1fr 1.5fr;gap:16px;align-items:center;margin-bottom:16px}
.last-year-editor .editor-row { grid-template-columns: 1fr 1fr; }
.editor-row.rules-editor-row{grid-template-columns: 1fr; gap:16px;}
.editor-row.rules-editor-row .input-with-button{width:100%}
.editor-row.rules-editor-row input{text-align:center; padding-left:16px;}
.test-draw-row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;align-items:stretch;margin-bottom:16px}
.test-draw-row > div{padding:14px 16px;font-size:16px;border-radius:999px;background:var(--bg);color:var(--text);border:1px solid var(--ring);height:52px;display:flex;align-items:center;justify-content:center;font-weight:500}
@media (min-width: 1001px){
  #edit-rules-content .rules-editor-row{position:relative;border-radius:999px;overflow:hidden;cursor:grab;transition:box-shadow .15s ease;}
  #edit-rules-content .rules-editor-row::before{content:'';position:absolute;inset:0;border-radius:inherit;background:rgba(255,255,255,0.04);opacity:0;transition:opacity .15s ease;pointer-events:none;}
  #edit-rules-content .rules-editor-row:hover::before,
  #edit-rules-content .rules-editor-row:focus-within::before{opacity:1;}
  #edit-rules-content .rules-editor-row:hover,
  #edit-rules-content .rules-editor-row:focus-within{box-shadow:inset 0 0 0 1px var(--ring);}
  body.light-mode #edit-rules-content .rules-editor-row::before{background:rgba(0,0,0,0.04);}
  #edit-rules-content .rules-editor-row.dragging{opacity:0.75;cursor:grabbing;}
  #edit-rules-content .rules-editor-row .input-with-button input{padding-left:48px;padding-right:48px;text-align:center;}
  #edit-rules-content .rules-editor-row .remove-rule-btn{position:absolute;left:12px;right:auto;top:50%;transform:translateY(-50%);width:22px;height:22px;border:none;background:transparent;color:var(--muted);cursor:pointer;font-size:18px;line-height:1;opacity:0;transition:opacity .15s ease;display:grid;place-items:center;padding:0;}
  #edit-rules-content .rules-editor-row:hover .remove-rule-btn,
  #edit-rules-content .rules-editor-row:focus-within .remove-rule-btn{opacity:1;}
}
.test-draw-row.is-duplicate > div { border: 1px solid #ff4444; box-shadow: 0 0 8px rgba(255,68,68,0.3); }
.editor-row input{text-align:center}
/* MOBILE FIX: Font-size 16px */
.editor-row input, .editor-row select{padding:12px 14px;font-size:16px;border-radius:999px;background:var(--bg);color:var(--text);border:1px solid var(--ring);height:52px;transition:border-color .2s ease}
.editor-row input:focus, .editor-row select:focus{border-color:var(--accent);outline:none}
.last-year-editor select { text-align: center; }
.editor-row select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a0a0' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708 .708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 1.2rem center;padding-right:36px}
.editor-row button{padding:10px 16px;height:100%;border-radius:999px;background:var(--accent-weak);color:var(--muted);border:none;cursor:pointer;transition:all .2s ease}
.editor-row button:hover{background:var(--ring);color:var(--text)}
.editor-row button:active{transform:scale(0.96)}

.participant-editor-row { display: flex; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.participant-editor-row > div { flex: 1; min-width: 0; }
.participant-editor-row .participant-editor-row-input { line-height: 1.25; }
.participant-editor-header { text-align: center; margin-bottom: 8px; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: 0.3px; }
/* MOBILE FIX: Font-size 16px */
.participant-editor-row .participant-editor-row-input { text-align:center; padding:12px 14px; font-size:16px; border-radius:999px; background:var(--bg); color:var(--text); border:1px solid var(--ring); height:52px; width: 100%; transition:border-color .2s ease; }
.participant-editor-row .participant-editor-row-input:focus{border-color:var(--accent);outline:none}
.participant-editor-row .tags-wrapper { overflow-x: auto; scrollbar-width: none; border-radius: 10px; }
.participant-editor-row .tags-wrapper::-webkit-scrollbar { display: none; }

/* Teilnehmer bearbeiten Dialog - spezifische Klasse */
.participant-editor-actions{display:grid;grid-template-columns:auto 1fr;gap:12px;margin-top:20px;align-items:stretch}
.participant-row-delete{display:none;}
@media (min-width: 1001px){
  #participants-editor-list .participant-editor-row{position:relative;border-radius:999px;transition:box-shadow .15s ease;cursor:grab;overflow:hidden;}
  #participants-editor-list .participant-editor-row::before{content:'';position:absolute;inset:0;border-radius:inherit;background:rgba(255,255,255,0.04);opacity:0;transition:opacity .15s ease;pointer-events:none;}
  #participants-editor-list .participant-editor-row:hover::before,
  #participants-editor-list .participant-editor-row:focus-within::before{opacity:1;}
  #participants-editor-list .participant-editor-row:hover,
  #participants-editor-list .participant-editor-row:focus-within{box-shadow:inset 0 0 0 1px var(--ring);}
  body.light-mode #participants-editor-list .participant-editor-row::before{background:rgba(0,0,0,0.04);}

  /* Platz f?r das Delete-Icon links, Text bleibt zentriert */
  #participants-editor-list .participant-editor-row .participant-editor-row-input[name="name"]{padding-left:42px;padding-right:42px;}
  #participants-editor-list .participant-row-delete{display:inline-flex;align-items:center;justify-content:center;position:absolute;left:12px;top:50%;transform:translateY(-50%);opacity:0;transition:opacity .15s ease;cursor:pointer;width:22px;height:22px;border:none;background:transparent;color:var(--muted);font-size:18px;line-height:1;z-index:2;}
  #participants-editor-list .participant-editor-row:hover .participant-row-delete,
  #participants-editor-list .participant-editor-row:focus-within .participant-row-delete{opacity:1;}
  #participants-editor-list .participant-editor-row.dragging{opacity:0.75;cursor:grabbing;}
}
.participant-editor-actions button:last-child{background:var(--accent);color:#fff;border:none;padding:0 24px;height:52px;border-radius:999px;font-weight:600;font-size:16px;cursor:pointer;transition:all .2s ease}
.participant-editor-actions button:last-child:hover{transform:scale(1.02)}
.participant-editor-actions button:last-child:active{transform:scale(0.98)}

/* Anleitung bearbeiten Dialog - spezifische Klasse */
.rules-editor-actions{display:grid;grid-template-columns:auto 1fr;gap:12px;margin-top:20px;align-items:stretch}
.rules-editor-actions button:last-child{background:var(--accent);color:#fff;border:none;padding:0 24px;height:52px;border-radius:999px;font-weight:600;font-size:16px;cursor:pointer;transition:all .2s ease}
.rules-editor-actions button:last-child:hover{transform:scale(1.02)}
.rules-editor-actions button:last-child:active{transform:scale(0.98)}

/* Test-Ziehung Dialog - spezifische Klasse */
.test-draw-actions{display:grid;grid-template-columns:1fr;gap:12px;margin-top:20px}
.test-draw-actions button{background:var(--accent);color:#fff;border:none;padding:0 24px;height:52px;border-radius:999px;font-weight:600;font-size:16px;cursor:pointer;transition:all .2s ease}
.test-draw-actions button:hover{transform:scale(1.02)}
.test-draw-actions button:active{transform:scale(0.98)}
.add-participant-btn{width:52px;height:52px;border-radius:50%;background:var(--elev);border:1px solid var(--ring);color:var(--text);cursor:pointer;display:grid;place-items:center;transition:all .2s ease;padding:0}
.add-participant-btn svg{width:28px;height:28px;stroke:var(--text)}
.add-participant-btn:hover{transform:scale(1.05)}
.add-participant-btn:active{transform:scale(0.95)}
.dialog-content .editor-form-container{max-width:100%;margin:0 auto;padding:0 16px}
.input-with-button{position:relative;display:flex;align-items:center;width:100%}
.editor-row .input-with-button input{padding-left:40px;padding-right:40px;flex:1;width:100%;text-align:center}
.input-with-button button{position:absolute;right:0;top:50%;transform:translateY(-50%);height:100%;background:transparent;border:none;color:var(--muted);cursor:pointer;font-size:20px;font-weight:bold;padding:0 14px;transition:color .2s ease}
.input-with-button button:hover{color:var(--text)}
.input-with-button button:active{transform:translateY(-50%) scale(0.95)}
.editor-name-display{padding:14px 16px;font-size:16px;border-radius:999px;background:var(--bg);color:var(--text);border:1px solid var(--ring);height:52px;display:flex;align-items:center;justify-content:center;font-weight:500}
.participant-list-grid { display: flex; flex-direction: column; gap: 12px; }
.participant-list-grid > .editor-name-display {
  justify-content: flex-start;
  text-align: left;
  border-radius: 16px;
  padding: 16px 18px;
  min-height: 112px;
  background: var(--participant-pill-bg);
  border: none;
}
.history-pairings .editor-name-display {
  background: transparent;
  border: none;
  padding: 0;
  height: auto;
  min-height: 0;
  font-weight: 600;
}
.participant-list-grid .editor-name-display {
  background: var(--participant-pill-bg);
  border: none;
}
.rules-list li,
.dashboard-card,
.dashboard-stat {
  background: var(--participant-pill-bg);
  border: none;
}


.tags-input-container {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--ring);
  min-height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tags-input-container::-webkit-scrollbar {
  display: none;
}
.tag-item { display: inline-flex; align-items: center; background-color: var(--accent-weak); padding: 5px 10px; border-radius: 999px; font-size: 14px; flex-shrink: 0; }
.tag-item span { margin-right: 6px; }

/* Desktop scaling for high-res screens */
:is(
  .login-option-btn,
  #login-side-panel input[type="password"],
  #login-side-panel input[type="text"],
  #login-side-panel button:not(.side-panel-close):not(.login-option-btn),
  #normalUsernameSelect,
  #registerUsernameSelect,
  .test-draw-row > div,
  .editor-row input,
  .editor-row select,
  .participant-editor-row .participant-editor-row-input,
  .participant-editor-actions button:last-child,
  .rules-editor-actions button:last-child,
  .test-draw-actions button,
  .status-item
){
  height: var(--control-h);
  min-height: var(--control-h);
  font-size: calc(16px * var(--desktop-scale));
}

.add-participant-btn{width:var(--control-h);height:var(--control-h);}
.editor-name-display{min-height:var(--control-h);height:var(--control-h);}
.tags-input-container{min-height:var(--control-h);}
.tag-item button { all: unset; cursor: pointer; font-weight: bold; line-height: 1; padding: 2px; }
/* MOBILE FIX: Font-size 16px */
.tags-input-container input { flex-grow: 1; border: none; background: transparent; color: var(--text); padding: 4px; outline: none; font-size:16px; min-width: 80px;}

main{display:flex;flex-direction:column;align-items:center;justify-content:flex-start}
#host-view { display: none; height: 100%; overflow: hidden; }
body.in-host-view #host-view { display: flex; flex-direction: column; }
body.in-host-view main { display: none; }
#host-view-content { padding: 16px 16px 0; display: flex; flex-direction: column; height: 100%; }
#host-view-host, #host-view-guest { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex-grow: 1; padding-bottom: 16px; }
.host-view-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 8px 16px; }
.host-view-footer .mi { margin: 0; width: auto; padding: 10px 16px; }
.host-view-footer .live-clock { text-align: right; }
.test-draw-stats { margin-top:20px; font-size:14px; color:var(--muted); text-align:center; font-weight:500; }

.status-overview-columns{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:20px;padding:0 8px}
.status-column{display:flex;flex-direction:column;gap:12px}
.status-column h3{font-size:16px;font-weight:600;margin-bottom:8px;color:var(--muted);text-align:center;letter-spacing:0.3px}
.status-item{padding:14px 16px;background:var(--bg);border:1px solid var(--ring);border-radius:999px;text-align:center;font-size:16px;font-weight:500;height:52px;display:flex;align-items:center;justify-content:center}

.last-year-repeat-marker { background-color: rgba(255, 165, 0, 0.2); border-color: #ffa500; }

.past-results-container {
  padding: 0 16px;
  margin: 0;
}

.year-selector-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.year-selector-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 18px;
    font-weight: 600;
    padding: 8px 20px 8px 0;
    cursor: pointer;
}
.year-selector-select:focus {
    outline: none;
}
.year-selector-arrow {
    position: absolute;
    right: 0;
    pointer-events: none;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23a0a0a0'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Mobile Back Button im Header */
#mobile-dialog-back {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 6px;
}
#mobile-dialog-back svg {
    width: 28px;
    height: 28px;
    stroke: var(--text);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
#mobile-dialog-title {
    display: none;
    font-size: 18px;
    font-weight: 600;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    min-height: 32px;
    position: relative;
    padding: 0;
}

/* Fullscreen Content Container */
#fullscreen-content {
  display: none;
}


.mobile-actions{display:none}
#mobile-progress { display: none; }


/* === COMMAND PALETTE WITH LIQUID GLASS - NOV 2025 === */

.side-panel {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translate(-50%, -20px) scale(0.92);
  width: 90%;
  max-width: 560px;
  height: auto;
  max-height: calc(100vh - 80px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;

  /* Liquid Glass Effect */
  background: rgba(var(--elev-rgb), 0.75);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.18);

  /* Premium Shadow Stack */
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.4),
    0 16px 32px rgba(0, 0, 0, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.2);

  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-panel.visible {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Light Mode Liquid Glass */
body.light-mode .side-panel {
  background: rgba(var(--elev-rgb), 0.85);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.2),
    0 16px 32px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Backdrop mit Heavy Blur */
.side-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-panel-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

body.light-mode .side-panel-backdrop {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}

/* Command Palette Header mit Glass Effekt */
.side-panel-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  background: rgba(255, 255, 255, 0.03);
}

body.light-mode .side-panel-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.5);
}

.side-panel-header h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
#history-panel-title { line-height: 32px; }

/* Desktop: Zurück-Pfeil ausblenden, normale Header */
@media (min-width: 1025px) {
  .history-back-button {
    display: none;
  }

  /* History Header: Title links, X rechts, Dropdown absolut zentriert */
  #history-side-panel .side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    position: relative;
  }

  #history-side-panel .side-panel-header h2 {
    text-align: left;
  }

  #history-side-panel .history-year-selector {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
  }

  #history-side-panel .side-panel-close {
    z-index: 1;
  }

  /* Participants Header: Title | X */
  #participants-side-panel .side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
  }

  #participants-side-panel .side-panel-header h2 {
    text-align: left;
  }
}

/* Glass Close Button */
.side-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.side-panel-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 122, 0, 0.5);
  transform: scale(1.08) rotate(90deg);
}

.side-panel-close:active {
  transform: scale(0.95) rotate(90deg);
}

body.light-mode .side-panel-close {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .side-panel-close:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(217, 97, 0, 0.4);
}

.side-panel-close svg {
  width: 16px;
  height: 16px;
  stroke: var(--text);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Glass Content Area */
.side-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-height: 0;
  background: rgba(255, 255, 255, 0.01);
}

body.light-mode .side-panel-content {
  background: rgba(255, 255, 255, 0.3);
}

/* Glass Scrollbar */
.side-panel-content::-webkit-scrollbar {
  width: 6px;
}

.side-panel-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  margin: 4px 0;
}

.side-panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  transition: background 0.2s ease;
}

.side-panel-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 122, 0, 0.6);
}

body.light-mode .side-panel-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
}

body.light-mode .side-panel-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

body.light-mode .side-panel-content::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 97, 0, 0.5);
}

/* Rules List - Einheitlicher Stil wie andere Panels */
.rules-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rules-list li {
  position: relative;
  background: var(--bg);
  border-radius: 999px;
  border: 1px solid var(--ring);
  padding: 14px 24px;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rules-box {
  background: var(--participant-pill-bg);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.rules-box-title {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  font-weight: 700;
  text-align: left;
}
.countdown-circle {
  width: min(92vw, 520px);
  height: min(62vw, 280px);
  border-radius: 22px;
  background: var(--participant-pill-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
.countdown-title {
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  font-weight: 700;
}
.countdown-time {
  font-size: 54px;
  font-weight: 800;
  color: var(--text);
}
.countdown-sub {
  font-size: 18px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.rules-list.rules-list-plain { gap: 8px; padding-left: 0; margin-left: 0; text-align: left; }
.rules-list.rules-list-plain li {
  background: transparent;
  border: none;
  padding: 0;
  min-height: 0;
  text-align: left;
  justify-content: flex-start;
  display: block;
}
/* Mobile: Command Palette nur für Anleitung */
@media (max-width: 1024px) {
  /* Anleitung bleibt Command Palette - mittig unter Header */
  #rules-side-panel {
    width: 94%;
    max-width: 560px;
    max-height: 80vh;
    border-radius: 18px;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    transition: none;
  }

  #rules-side-panel.visible {
    display: flex;
  }

  /* Wer ist dabei - auf Mobile ausblenden (Content wird direkt in main eingefügt) */
  #participants-side-panel {
    display: none;
  }

  /* Fullscreen Panels ohne Animation auf Mobile */
  #history-side-panel,
  #edit-participants-side-panel,
  #edit-rules-side-panel,
  #test-draw-side-panel {
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    transform: none;
    transition: none;
    display: none;
  }

  #history-side-panel.visible,
  #edit-participants-side-panel.visible,
  #edit-rules-side-panel.visible,
  #test-draw-side-panel.visible {
    display: flex;
  }

  /* Header für Fullscreen Panels */
  #participants-side-panel .side-panel-header,
  #history-side-panel .side-panel-header,
  #edit-participants-side-panel .side-panel-header,
  #edit-rules-side-panel .side-panel-header,
  #test-draw-side-panel .side-panel-header {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
  }

  body.light-mode #participants-side-panel .side-panel-header,
  body.light-mode #history-side-panel .side-panel-header,
  body.light-mode #edit-participants-side-panel .side-panel-header,
  body.light-mode #edit-rules-side-panel .side-panel-header,
  body.light-mode #test-draw-side-panel .side-panel-header {
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  /* History Mobile: Zurück-Pfeil + Title + Dropdown */
  #history-side-panel .side-panel-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 16px 20px;
  }

  #history-side-panel .side-panel-header h2 {
    font-size: 18px;
    margin: 0;
    text-align: left;
    grid-column: 2;
  }

  #history-side-panel .side-panel-close {
    display: none;
  }

  #history-side-panel .history-back-button {
    grid-column: 1;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  body.light-mode #history-side-panel .history-back-button {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  #history-side-panel .history-year-selector {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    grid-column: 3;
  }

  /* Participants Mobile: Zurück-Pfeil + Title */
  #participants-side-panel .side-panel-close {
    display: none;
  }

  #participants-side-panel .history-back-button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }

  body.light-mode #participants-side-panel .history-back-button {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  #participants-side-panel .side-panel-header h2 {
    flex: 1;
    margin: 0;
    font-size: 18px;
  }

  /* History: Year Selector NICHT ausblenden auf Mobile - bleibt im Header */
  #history-side-panel .side-panel-content {
    padding-top: 20px;
  }

  .side-panel-header {
    padding: 18px 20px 15px;
  }

  .side-panel-header h2 {
    font-size: 17px;
  }

  .side-panel-content {
    padding: 20px;
  }

  .rules-list {
    gap: 10px;
  }

  .rules-list li {
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 999px;
  }

  main, #host-view {
    padding-top: 4px;
    padding-left: 16px;
    padding-right: 16px;
    /* MOBILE FIX: Safe Area Insets für iPhone */
    padding-bottom: max(130px, calc(130px + env(safe-area-inset-bottom))); /* Mehr Platz für höhere Bar */
    margin-left: 0;
  }
  body:not(.mobile-dialog-active):not(.in-host-view) {
    overflow: hidden;
  }
  body.mobile-bottom-ui main,
  body.mobile-bottom-ui #host-view {
    padding-bottom: max(104px, calc(104px + env(safe-area-inset-bottom)));
  }
  body.mobile-bottom-ui .ready-box {
    height: calc(228px * var(--desktop-scale));
  }
  body.mobile-bottom-ui .status-box {
    margin-top: 0;
  }
  .header { margin-left: 0; border-bottom: 1px solid var(--ring); }
  .ready-box { margin: 4px auto 4px; border-radius: 0 0 20px 20px; }
  .side { display: none; }
  .header-left .burger { display: none; }
  .header-right { display: flex; }
  body.in-host-view .header-right { display: none; }
  body.in-host-view .brand { display: none; }
  #theme-toggle,
  #share-link,
  #share-feedback { display: none; }
  #hostWidget { display: flex; }
  .bar { grid-template-columns: auto 1fr auto; }
  .header-left { grid-column: 1; }
  .progress { grid-column: 2; }
  .header-right { grid-column: 3; justify-self: end; }
  
  #desktop-progress { display: none; }

  .status-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    margin: 4px auto 0;
    position: relative;
  }
  .status-box .title {
    display: none;
  }

  #mobile-progress {
    display: flex;
    width: 100%;
  }
  #mobile-progress .track { height: 32px; }
  #mobile-progress #progressTextMobile { color: #fff; font-weight: 700; font-size: 16px; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); z-index:1; }
  body.light-mode #mobile-progress #progressTextMobile { color: #111; }

  #drawStatus { display: none; }

  /* --- FINALES "LIQUID GLASS" DESIGN (V9) --- */
  .mobile-actions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: max(48px, env(safe-area-inset-bottom)); /* **DEUTLICH HÖHER POSITIONIERT** */
    left: 8px;
    right: 8px;
    height: 72px;
    padding: 0;
    z-index: 10;
    border-radius: 36px;
    isolation: isolate;
    overflow: hidden;
    touch-action: none;
    background: linear-gradient(to bottom, rgba(var(--elev-rgb), 0.5), rgba(var(--elev-rgb), 0.4));
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    --nav-hl-x: 0px;
    --nav-hl-y: 0px;
    --nav-hl-w: 0px;
    --nav-hl-h: calc(100% - 8px);
    --nav-press-scale: 0.95;
  }

  .mobile-actions::after {
    content: '';
    position: absolute;
    inset: 0;
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    filter: url(#glass-distortion);
    z-index: -2;
    border-radius: inherit;
  }

  body.light-mode .mobile-actions {
    background: linear-gradient(to bottom, rgba(var(--elev-rgb), 0.75), rgba(var(--elev-rgb), 0.65));
    border-color: rgba(0, 0, 0, 0.08);
  }

  body.mobile-bottom-ui .mobile-actions {
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .mobile-actions .nav-highlight{
    position: absolute;
    top: 0;
    left: 0;
    transform: translate3d(var(--nav-hl-x), var(--nav-hl-y), 0);
    width: var(--nav-hl-w);
    height: var(--nav-hl-h, calc(100% - 8px));
    background: rgba(128, 128, 128, 0.25);
    border-radius: calc(var(--nav-hl-h, calc(100% - 8px)) / 2);
    z-index: 0;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, width;
  }

  .mobile-actions.nav-highlight-dragging .nav-highlight { transition: none; }
  .mobile-actions:not(.nav-highlight-ready) .nav-highlight { transition: none; }
  body.light-mode .mobile-actions .nav-highlight { background: rgba(128, 128, 128, 0.18); }

  .nav-icon-btn {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    flex: 1;
    height: 100%;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  
  .nav-icon-btn.active {
    color: var(--text);
  }

  /* Die Pille für den aktiven Button */
  .nav-icon-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: calc(100% - 6px);
    height: calc(100% - 8px);
    background: rgba(128, 128, 128, 0.25);
    border-radius: 30px;
    z-index: -1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .nav-icon-btn.active::before {
    transform: translate(-50%, -50%) scale(1);
  }

  /* Symmetrie-Korrektur für den ersten und letzten Button */
  .nav-icon-btn:first-child.active::before {
    transform: translate(calc(-50% + 1px), -50%) scale(1);
  }
  .nav-icon-btn:last-child.active::before {
    transform: translate(calc(-50% - 1px), -50%) scale(1);
  }

  body.light-mode .nav-icon-btn::before {
      background: rgba(128, 128, 128, 0.18);
  }

  /* Single moving highlight replaces per-button pill */
  .nav-icon-btn::before { content: none; }
  
  .nav-icon-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }

  .nav-icon-btn svg {
    width: 30px;
    height: 30px;
  }

  .nav-icon-btn:disabled { cursor: default; opacity: 0.65; }
  .nav-icon-btn.placeholder { pointer-events: none; }
  .nav-icon-btn.placeholder::before { display: none; }
  .nav-icon-btn.placeholder:active { transform: none; }
  .nav-question { font-size: 28px; font-weight: 800; line-height: 1; }

  .nav-label {
    display: none; /* Labels entfernt */
  }
  
  /* Spezifische Icon-Anpassungen */
  .nav-icon-btn:not(#mobile-share-btn) svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  #mobile-share-btn svg { fill: currentColor; }
  #mobile-home-btn.active svg path { fill: currentColor; }
  #mobile-home-btn.active svg polyline { stroke: var(--bg); }
  #mobile-dashboard-btn.active svg rect { fill: currentColor; stroke: none; }
  #mobile-dashboard-btn.active svg line { stroke: var(--bg); }
  #mobile-settings-btn.active svg path { fill: currentColor; stroke: none; }
  #mobile-settings-btn.active svg circle { fill: var(--bg); stroke: none; }
  #mobile-rules-btn svg .book-fill-top { fill: none; stroke: none; }
  #mobile-rules-btn svg .book-outline { fill: none; stroke: currentColor; stroke-width: 2; }
  #mobile-rules-btn.active svg .book-fill-top { fill: currentColor; }
  #mobile-countdown-btn.active svg circle { fill: currentColor; stroke: none; }
  #mobile-countdown-btn.active svg line { stroke: var(--bg); }
  
  #mobile-theme-toggle .sun, body.light-mode #mobile-theme-toggle .moon { display: none; }
  body.light-mode #mobile-theme-toggle .sun { display: block; }

  /* Mobile Dialog Mode */
  body.mobile-dialog-active {
    overscroll-behavior-x: contain;
    overflow: hidden;
    height: 100vh;
  }
  
  body.mobile-dialog-active .brand,
  body.mobile-dialog-active .progress {
    display: none;
  }
  
  body.mobile-dialog-active #mobile-dialog-back,
  body.mobile-dialog-active #mobile-dialog-title {
    display: flex;
    align-items: center;
    gap: 2px;
  }

body.mobile-dialog-active .header-left {
  gap: 8px;
}

  body.mobile-dialog-active.history-view .brand,
  body.mobile-dialog-active.settings-view .brand {
    display: flex;
  }
  body.mobile-dialog-active.history-view #mobile-dialog-title,
  body.mobile-dialog-active.settings-view #mobile-dialog-title {
    display: none;
  }
  body.mobile-dialog-active.rules-view .brand {
    display: flex;
  }
  body.mobile-dialog-active.rules-view #mobile-dialog-title {
    display: none;
  }
  body.mobile-dialog-active.countdown-view .brand {
    display: flex;
  }
  body.mobile-dialog-active.countdown-view #mobile-dialog-title {
    display: none;
  }

  body.in-host-view:not(.mobile-dialog-active) #mobile-dialog-back {
    display: flex;
    align-items: center;
  }
  body.in-host-view:not(.mobile-dialog-active) .brand {
    display: none;
  }
  body.in-host-view:not(.mobile-dialog-active) #mobile-dialog-back svg {
    stroke: #fff;
  }
  body.mobile-dialog-active.no-mobile-back #mobile-dialog-back {
    display: none;
  }
  body.mobile-dialog-active.history-view #mobile-dialog-back,
  body.mobile-dialog-active.settings-view #mobile-dialog-back {
    display: none;
  }
  
  body.mobile-dialog-active main,
  body.mobile-dialog-active #host-view,
  body.mobile-dialog-active .status-box {
    display: none;
  }

body.mobile-dialog-active #fullscreen-content {
  display: block;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: max(130px, calc(130px + env(safe-area-inset-bottom)));
  background: var(--bg);
  z-index: 10;
}
  body.mobile-dialog-active.countdown-view #fullscreen-content {
    overflow: hidden;
  }

  #fullscreen-content .mobile-fullscreen-section {
    background: rgba(var(--elev-rgb), 0.72);
    border: none;
    border-radius: 18px;
    padding: 16px;
    box-shadow: none;
  }
  #fullscreen-content .participant-list-section {
    background: transparent;
    border: none;
    padding: 0;
  }
  #fullscreen-content .dashboard-section {
    background: transparent;
    border: none;
    padding: 0;
  }
  #fullscreen-content .rules-section {
    background: transparent;
    border: none;
    padding: 0;
  }
  #fullscreen-content .history-year-section,
  #fullscreen-content .history-mobile-section {
    background: transparent;
    border: none;
    padding: 0;
  }
  #fullscreen-content .countdown-section {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 220px);
    padding-top: 12px;
  }
  body.mobile-dialog-active.countdown-view #fullscreen-content .countdown-section {
    min-height: 0;
    padding-top: 0;
    justify-content: center;
  }

  #fullscreen-content .mobile-fullscreen-section.mobile-scrollable {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }

  #fullscreen-content .mobile-fullscreen-section + .mobile-fullscreen-section {
    margin-top: 12px;
  }

  /* Mobile: Einstellungen */
  #fullscreen-content .settings-list { display: flex; flex-direction: column; gap: 12px; }
  #fullscreen-content .settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: none;
    background: var(--participant-pill-bg);
  }
  #fullscreen-content .settings-item.settings-action {
    width: 100%;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }
  #fullscreen-content .settings-item.settings-action .settings-item-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: currentColor;
    color: var(--muted);
  }
  #fullscreen-content .settings-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  #fullscreen-content .settings-item-title { font-weight: 700; }
  #fullscreen-content .settings-item-subtitle { font-size: 13px; color: var(--muted); }
  #fullscreen-content .settings-mode-label { font-size: 18px; font-weight: 800; letter-spacing: 0.2px; }
  #fullscreen-content .settings-switch { position: relative; width: 54px; height: 32px; flex-shrink: 0; }
  #fullscreen-content .settings-switch input { opacity: 0; width: 0; height: 0; }
  #fullscreen-content .settings-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(128, 128, 128, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background 0.2s ease;
  }
  body.light-mode #fullscreen-content .settings-slider { border-color: rgba(0, 0, 0, 0.12); }
  #fullscreen-content .settings-slider::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
  }
  #fullscreen-content .settings-switch input:checked + .settings-slider { background: rgba(255, 122, 0, 0.45); }
  #fullscreen-content .settings-switch input:checked + .settings-slider::before { transform: translate(22px, -50%); }

  body.mobile-dialog-active.history-view #mobile-dialog-title {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
    position: relative;
    justify-content: flex-start;
    padding-right: 0;
  }

  .mobile-history-title {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    line-height: 32px;
  }

  /* Mobile Fullscreen Dialog Styles */
  .dialog-overlay.mobile-fullscreen {
    padding: 0;
    align-items: flex-start;
    background: var(--bg);
    padding-top: 56px;
    z-index: 5;
    transition: none;
  }

  .dialog-overlay.mobile-fullscreen .dialog-box {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    max-width: 100%;
    width: 100%;
    box-shadow: none;
    transform: scale(1);
    transition: none;
  }

  .dialog-overlay.mobile-fullscreen h2 {
    display: none;
  }

  .dialog-overlay.mobile-fullscreen .dialog-content {
    padding: 8px;
    margin: 0;
    overflow: visible;
  }

  .dialog-overlay.mobile-fullscreen .dialog-content .editor-form-container {
    transform: none;
    padding: 0;
    max-height: none;
    overflow: visible;
  }

  .dialog-overlay.mobile-fullscreen .editor-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  .dialog-overlay.mobile-fullscreen .participant-editor-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  .dialog-overlay.mobile-fullscreen .test-draw-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  .dialog-overlay.mobile-fullscreen .editor-row input,
  .dialog-overlay.mobile-fullscreen .editor-row select,
  .dialog-overlay.mobile-fullscreen .participant-editor-row-input {
    height: auto;
    padding: 8px 10px;
    font-size: 14px;
  }

  .dialog-overlay.mobile-fullscreen .test-draw-row > div {
    height: auto;
    padding: 8px 10px;
    font-size: 14px;
  }

  .dialog-overlay.mobile-fullscreen .editor-actions {
    margin-top: 12px;
    gap: 8px;
  }

  .dialog-overlay.mobile-fullscreen .dialog-box button {
    padding: 10px;
    font-size: 14px;
  }

  .dialog-overlay.mobile-fullscreen .participant-editor-header {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .dialog-overlay.mobile-fullscreen .tags-input-container {
    min-height: 36px;
    padding: 4px 8px;
  }

  .dialog-overlay.mobile-fullscreen .tag-item {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
  }

  .dialog-overlay.mobile-fullscreen .tag-item span {
    margin-right: 4px;
  }

  .dialog-overlay.mobile-fullscreen .tags-input-container input {
    font-size: 14px;
    min-width: 60px;
  }

  .dialog-overlay.mobile-fullscreen .status-overview-columns {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dialog-overlay.mobile-fullscreen .status-item {
    height: auto;
    padding: 10px 12px;
    font-size: 14px;
  }


  .dialog-overlay.mobile-fullscreen .past-results-container {
    max-height: none;
    overflow: visible;
    padding: 0;
    margin: 0;
  }

  .dialog-overlay.mobile-fullscreen .dialog-title-wrapper {
    flex-direction: row;
    justify-content: center;
    position: relative;
  }

  .dialog-overlay.mobile-fullscreen .dialog-title-wrapper .year-selector-wrapper {
    position: absolute;
    right: 0;
  }

  .dialog-overlay.mobile-fullscreen .participant-list-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
  }

  .dialog-overlay.mobile-fullscreen .editor-name-display {
    height: auto;
    padding: 8px 10px;
    font-size: 13px;
  }
  
  /* Mobile Header Year Selector - Center Position */
  body.mobile-dialog-active.history-view .track {
    display: none;
  }

  body.mobile-dialog-active.history-view .progress {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
  }

  body.mobile-dialog-active.history-view .progress .year-selector-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    position: fixed;
    left: 50vw;
    top: 28px;
    transform: translate(-50%, -50%);
    z-index: 10001;
  }

  body.mobile-dialog-active.history-view .progress .year-selector-wrapper > div {
    position: relative;
    display: inline-block;
  }

  body.mobile-dialog-active.history-view .progress .year-selector-select,
  body.mobile-dialog-active.history-view .progress #historyYearSelect {
    font-size: 18px;
    font-weight: 600;
    padding: 0 24px 0 0;
    border: none;
    border-bottom: none;
    background: transparent;
    color: var(--text);
    text-align: center;
    min-width: auto;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  body.mobile-dialog-active.history-view .progress .year-selector-wrapper svg {
    width: 16px;
    height: 16px;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
  }

  body.mobile-dialog-active.history-view #historyDialog .year-selector-wrapper {
    display: none;
  }

  body.mobile-dialog-active.history-view #historyDataDisplay {
    padding-top: 0;
  }

  /* Select Dropdown Options sichtbar machen */
  #historyYearSelect option {
    background: var(--bg);
    color: var(--text);
    padding: 8px;
  }

  body.light-mode #historyYearSelect option {
    background: #f5f5f5;
    color: #1a1a1a;
  }
  
  body.mobile-dialog-active.history-view .year-selector-wrapper .year-selector-arrow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
  }
  

}

@media (max-width: 600px) {
  /* Kompakter für kleine Screens */
  #rules-side-panel {
    width: 95%;
    max-height: 75vh;
    border-radius: 16px;
    left: 50%;
    transform: translateX(-50%);
  }

  .side-panel-header {
    padding: 16px 18px 14px;
  }

  .side-panel-content {
    padding: 18px;
  }

  .side-panel-header h2 {
    font-size: 16px;
  }

  .side-panel-close {
    width: 30px;
    height: 30px;
  }

  .side-panel-close svg {
    width: 14px;
    height: 14px;
  }

  .rules-list {
    gap: 8px;
  }

  .rules-list li {
    padding: 12px 18px;
    font-size: 14px;
    border-radius: 999px;
  }

  /* History Year Selector kompakter */
  #history-side-panel .history-year-wrapper { height: 30px; }
  #history-side-panel .history-year-button { font-size: 15px; padding: 0 10px 0 12px; }
  #history-side-panel .history-year-button svg { width: 14px; height: 14px; }

  #history-side-panel .side-panel-header {
    grid-template-columns: 30px 1fr 30px;
  }

  /* Kleinere Anpassungen für sehr kleine Bildschirme */
  .dialog-overlay.mobile-fullscreen .editor-row input,
  .dialog-overlay.mobile-fullscreen .editor-row select,
  .dialog-overlay.mobile-fullscreen .participant-editor-row-input {
    padding: 6px 8px;
    font-size: 13px;
  }

  .dialog-overlay.mobile-fullscreen .test-draw-row > div {
    padding: 6px 8px;
    font-size: 13px;
  }

  .dialog-overlay.mobile-fullscreen .status-overview-columns {
    gap: 10px;
  }

  .dialog-overlay.mobile-fullscreen .status-item {
    padding: 8px 10px;
    font-size: 13px;
  }


  .dialog-overlay.mobile-fullscreen .dialog-box button {
    padding: 8px;
    font-size: 13px;
  }

  .dialog-overlay.mobile-fullscreen .participant-editor-header {
    font-size: 11px;
    margin-bottom: 3px;
  }

  .dialog-overlay.mobile-fullscreen .tags-input-container {
    min-height: 32px;
    padding: 3px 6px;
  }

  .dialog-overlay.mobile-fullscreen .editor-name-display {
    padding: 8px 10px;
    font-size: 13px;
  }


  main, #host-view {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: max(120px, calc(120px + env(safe-area-inset-bottom)));
  }
}

/* Host Login Dialog – compact, clean layout */
#hostLoginDialog .dialog-box {
  max-width: 460px;
  margin: 80px auto 0;
  border-radius: 24px;
  padding: 24px 24px 20px;
}

#hostLoginDialog .dialog-box h2 {
  margin-bottom: 16px;
  text-align: center;
}

#hostLoginDialog .dialog-content {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}


#hostLoginDialog input[type="password"] {
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--ring);
}

#hostLoginDialog #hostLoginBtn {
  border-radius: 14px;
  font-weight: 600;
  margin-top: 4px;
  margin-bottom: 0;
}


#hostLoginDialog .dialog-link {
  display: block;
  margin-top: -4px;
  text-align: center;
  font-size: 14px;
}


#login-error-msg:empty { margin:0; min-height:0; padding:0; }


#login-error-msg { margin-top:4px; min-height:0; }

/* Notification Area - Mobile Only */
.notification-area {
    display: none; /* Hidden by default, JS toggles flex/none */
}

@media (max-width: 1024px) {
    .notification-area {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0 12px;
        display: none; /* Managed by JS */
        flex-direction: column;
        
        /* Show up to 4 items (72px * 4 + 2px * 3 gaps = 294px) */
        max-height: calc(72px * 4 + 2px * 3);
        overflow-y: auto;
        overscroll-behavior: contain; /* Prevents body scroll */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: y mandatory;
        
        pointer-events: auto;
        margin-top: 20px;
    }

    body.mobile-bottom-ui .notification-area {
        max-height: calc(72px * 3 + 2px * 2);
        margin-top: 12px;
    }
    
    .notification-area.has-items {
        display: flex;
    }
    
    .notification-area::-webkit-scrollbar { 
        display: none; 
    }
    
    .notification-item {
        background: #1f1f1f;
        color: #e2e2e2;
        padding: 0 24px; /* Vertical centering via flex, fixed height */
        height: 72px; /* Fixed height for snap precision */
        
        border-radius: 24px; /* Always fully rounded */
        margin-bottom: 2px; /* The gap */
        
        display: flex;
        align-items: center;
        gap: 16px;
        
        border: none;
        box-shadow: none;
        
        width: 100%;
        flex-shrink: 0;
        
        scroll-snap-align: start;
        scroll-snap-stop: always;
        
        transform: translateX(-100%);
        animation: slideInLeft 0.35s cubic-bezier(0.05, 0.7, 0.1, 1) forwards;
        
        font-size: 15px;
        font-family: 'Roboto', system-ui, sans-serif;
        pointer-events: auto;
        box-sizing: border-box;
    }

    /* Dynamically rounded edges for the visible stack */
    .notification-item.is-visible-top {
        border-top-left-radius: 24px;
        border-top-right-radius: 24px;
    }

    .notification-item.is-visible-bottom {
        border-bottom-left-radius: 24px;
        border-bottom-right-radius: 24px;
    }

    /* Notification Item without Animation (for initial load) */
    .notification-item.no-anim {
        animation: none;
        transform: translateX(0);
    }

    body.light-mode .notification-item {
        background: #ffffff;
        color: #1a1a1a;
    }
    
    .notification-item.slide-out {
        animation: slideOutLeft 0.3s cubic-bezier(0.3, 0, 0.8, 0.15) forwards;
    }
}

.notification-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-title {
    font-weight: 500;
    font-size: 13px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification-text {
    font-size: 16px;
    font-weight: 400;
}

/* Animation Keyframes - Pure Slide */
@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* Toasts (fixed overlay, not in layout flow) */
.toast-notification {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    pointer-events: none;
    z-index: 20000;
    max-width: min(560px, calc(100vw - 24px));
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(var(--elev-rgb), 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: opacity 180ms ease, transform 180ms ease;
}
.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast-notification.error {
    border-color: rgba(255, 107, 107, 0.35);
    background: rgba(50, 12, 12, 0.82);
}
.toast-notification.success {
    border-color: rgba(76, 175, 80, 0.35);
    background: rgba(10, 38, 16, 0.82);
}
body.light-mode .toast-notification {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.15);
}
body.light-mode .toast-notification.error {
    background: rgba(255, 235, 238, 0.96);
}
body.light-mode .toast-notification.success {
    background: rgba(232, 245, 233, 0.96);
}

/* Vereinheitlichtes Design fuer Anleitung + Dashboard */
#rules-panel-content .rules-list li,
#fullscreen-content .rules-list li {
    background: var(--participant-pill-bg);
    border: none;
}
.dashboard-card,
.dashboard-stat {
    color: var(--text);
}
.dashboard-card-title,
.dashboard-card-sub,
.dashboard-stat-label {
    color: var(--text);
}

/* Light Theme Modernisierung */
body.light-mode .header {
    background: var(--bg);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
body.light-mode .ready-box {
    background: var(--elev);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
}
body.light-mode .side-panel {
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}
body.light-mode .side-panel-header {
    background: rgba(255,255,255,0.8);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
body.light-mode .mobile-actions {
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}
body.light-mode .mobile-actions .nav-highlight {
    background: rgba(0,0,0,0.12);
}
}

@layer utilities {
  .hidden { display: none; }
  .u-text-center { text-align: center; }
  .u-p-20 { padding: 20px; }
  .u-error { color: var(--error); }
  .u-warning { color: var(--u-warning-color, var(--warning)); }
  .u-muted { color: var(--muted); }
  .d-none { display: none; }
  .d-block { display: block; }
  .d-grid { display: grid; }
  .d-flex { display: flex; }
  .d-inline-block { display: inline-block; }
  .overflow-hidden { overflow: hidden; }
  .opacity-0 { opacity: 0; }
  .opacity-1 { opacity: 1; }
  .transition-none { transition: none; }
  .fade-out { opacity: 0; }
  .fade-in { opacity: 1; }
  .position-relative { position: relative; }
}

@layer accessibility {
  body.preload *,
  body.preload *::before,
  body.preload *::after {
    transition: none;
    animation: none;
  }

  @media (prefers-reduced-motion: reduce) {
    #participantButton,
    .dd-mask,
    .dd-item {
      transition: none;
    }
  }
}
