*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  
  background: #1d4ed8; 
  color: #e5e7eb;
  transition: background 1.5s ease;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

body.time-morning {
  animation: morning-gradient 6s ease-in-out forwards;
}

body.time-day {
  background: #1d4ed8; 
}

body.time-evening {
  animation: evening-gradient 6s ease-in-out forwards;
}

body.time-night {
  background-color: #020617;
  background-image: none;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(.55rem, env(safe-area-inset-top)) max(.7rem, env(safe-area-inset-right)) max(.7rem, env(safe-area-inset-bottom)) max(.7rem, env(safe-area-inset-left));
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.header {
  width: 100%;
  max-width: 390px; 
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  margin-bottom: 0.25rem;
  min-height: 92px;
  padding: 7px 8px;
  border: 1.5px solid rgba(212,175,55,.72);
  border-radius: 1.45rem;
  background: linear-gradient(105deg, rgba(0,45,36,.97), rgba(0,24,31,.97));
  box-shadow: 0 10px 28px rgba(0,0,0,.42), inset 0 0 18px rgba(15,95,70,.2);
}

.header-actions { display:flex; align-items:center; gap:.45rem; }
.header-share-button { width:38px; height:34px; padding:2px 5px; border-radius:999px; border:1px solid #4b5563; background:rgba(15,23,42,.9); color:#e5e7eb; display:flex; align-items:center; justify-content:center; gap:2px; }
.header-share-button img { width:18px; height:18px; border-radius:5px; }
.header-share-button svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-emblem {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  object-fit: cover;
  border-radius: 1rem;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.55));
}

.brand-copy { display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:0; line-height:1; }

.logo-emoji {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.6));
}

.brand-text {
  display:block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 7vw, 2rem);
  font-weight: 700;
  letter-spacing: -.035em;
  white-space: nowrap;
  color: #fffdf3;
  text-shadow: 0 2px 4px rgba(0,0,0,.7);
}

.brand-text::first-letter { color:#f0bd3e; }

.brand-subtitle {
  display:block;
  width:100%;
  margin-top:.38rem;
  padding-top:.32rem;
  border-top:1px solid rgba(229,184,58,.72);
  color:#f6d37a;
  font-family:Georgia, "Times New Roman", serif;
  font-size:clamp(.66rem, 3vw, .82rem);
  letter-spacing:.06em;
  text-align:center;
  white-space:nowrap;
}

.loading-bar {
  width: 100%;
  background-color: #1f2937; 
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 0.5rem 0; 
}

.loading-bar-inner {
  width: 100%;
  height: 100%;
  background-color: #facc15; 
  border-radius: 3px;
  animation: loading-indeterminate 1.5s infinite linear;
}

@keyframes loading-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.install-button {
  margin: 0.1rem 0 0.3rem;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  border: none;
  font-size: 0.8rem;
  background: #facc15;
  color: #111827;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.install-button:active {
  transform: scale(0.96);
}

.special-info {
  font-size: 0.9rem;
  font-weight: 600;
  color: #facc15; 
  text-align: center;
  margin: 0.25rem 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.menu-button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
}

.menu-button span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #e5e7eb;
}

.menu-button:active {
  transform: scale(0.96);
}

/* NEU: Container für Ort + GPS-Button */
.location-header {
  display: flex;
  align-items: center;
  justify-content: center; /* Zentriert den Inhalt */
  gap: 0.5rem;
  width: 100%;
  max-width: 390px;
  height: 1.2rem; /* Behält die Höhe des alten Elements bei */
  margin-bottom: 0.25rem; /* Abstand zur Uhr */
}

/* NEU: GPS-Button-Stil */
.gps-button-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0; /* Verhindert, dass der Button schrumpft */
}

.gps-button-main svg {
  stroke: #e5e7eb;
}

.gps-button-main:active {
  transform: scale(0.96);
}
/* ENDE NEU */


.clock-section {
  background: radial-gradient(circle at top, #1e293b 0, #020617 60%);
  padding: 1rem;
  border-radius: 1.2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  width: 100%; 
  max-width: 390px; 
  position: relative;
  /* Klick-Funktion entfernt */
  /* cursor: pointer; */ 
  -webkit-tap-highlight-color: transparent;
  user-select: none; 
  min-height: 372px; 
}

.location-time-row {
  width: 100%;
  max-width: 390px;
  min-height: 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 .25rem;
}

.location-time-row::before { content: ""; }

/* MODIFIZIERT: .clock-location */
.clock-location {
  text-align: right; /* Text rechtsbündig, da Button links ist (oder center) */
  text-align: center;
  margin: 0; 
  font-size: 1rem;
  font-weight: 600;
  color: #facc15; 
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  /* height: 1.2rem; */ /* ENTFERNT: Höhe ist jetzt auf .location-header */
  /* width: 100%; */   /* ENTFERNT: Breite wird von Flexbox verwaltet */
  max-width: 340px; /* Begrenzt die Breite, falls der Name zu lang ist */
  
  /* NEU: Stellt sicher, dass langer Text gut aussieht */
  flex-shrink: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  grid-column: 2;
}

.digital-clock {
  grid-column: 3;
  justify-self: end;
  min-width: 58px;
  padding: .22rem .42rem;
  border: 1px solid rgba(250,204,21,.72);
  border-radius: .5rem;
  background: rgba(2,6,23,.72);
  color: #fff8d5;
  font: 700 .92rem/1.1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .04em;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.32);
}

#clock {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto; 
  margin: 0 auto; 
}

/* ENTFERNT: Alle Qibla-CSS-Regeln (.qibla-display, .compass-wrapper, etc.) */


.times-section {
  width: 100%;
  max-width: 390px; 
  background: #020617;
  border-radius: 1.2rem;
  padding: 0.8rem 1rem 1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.section-header h2 {
  margin: 0; 
  font-size: 1rem;
}

/* NEU: Container für die Buttons rechts oben */
.section-header-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-vaktija {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  cursor: pointer;
  text-decoration: none;
}

.btn-vaktija:active {
  transform: scale(0.96);
}

.btn-vaktija svg {
  stroke: #e5e7eb;
}

/* NEU: Stil für Qibla-Button */
.btn-qibla {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  cursor: pointer;
  text-decoration: none;
}
.btn-qibla .logo-emoji {
  font-size: 18px; /* Kleiner als der Header-Logo */
  line-height: 1;
  filter: none;
}
.btn-qibla:active {
  transform: scale(0.96);
}
/* ENDE NEU */


.times-section h2 {
  margin-top: 0;
}

#times-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#times-table th,
#times-table td {
  padding: 0.25rem 0.2rem;
}

#times-table tr {
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

#times-table td:first-child {
  padding-left: 0.4rem;
}

#times-table th {
  text-align: left;
  font-weight: 600;
  color: #e5e7eb;
}

#times-table td {
  color: #e5e7eb;
}

.time-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.range {
  font-size: 0.75rem;
  color: #9ca3af;
}

.current-prayer {
  background: rgba(250, 204, 21, 0.12);
  box-shadow: inset 2px 0 0 #facc15;
  border-radius: 0.6rem;
}

.current-prayer td {
  color: #fefce8;
}

.current-prayer .range {
  color: #fef9c3;
}

.fasting-row .color-dot {
  width: 12px;
  height: 12px;
}

.fasting-current {
  background: rgba(74, 222, 128, 0.15);
  box-shadow: inset 2px 0 0 #4ade80;
}

.fasting-past {
  background: rgba(22, 163, 74, 0.12);
}

.current-detail-section {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
}

/* Feine goldgelbe Rahmen nur um Uhr und Gebetszeiten */
.clock-section,
.times-section {
  border: 1px solid rgba(250, 204, 21, .72);
}

.current-detail-section h3 {
  margin: 0 0 0.3rem;
  font-size: 0.9rem;
}

.current-detail-section p {
  margin: 0;
  font-size: 0.8rem;
  color: #cbd5f5;
}

/* Drawer / Slide-Panel */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 39;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 260px;
  max-width: 80vw;
  background: #020617;
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.7);
  transform: translateX(100%);
  transition: transform 0.22s ease-out;
  z-index: 40;
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-inner {
  display: flex;
  flex-direction: column;
  /* height: 100%; */ /* ENTFERNT: Erlaube dem Inhalt zu wachsen */
  padding: 0 1rem 1rem;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: .8rem 0 .55rem;
  background: #020617;
}

.app-version { margin:1.2rem 0 .25rem; text-align:center; color:#facc15; font-size:.78rem; font-weight:700; }
.update-section { margin-top:1rem; }
.update-actions { display:grid; gap:.55rem; }
.update-actions .btn { width:100%; min-height:38px; display:flex; align-items:center; justify-content:center; text-decoration:none; }
.exit-dialog { position:fixed; inset:0; z-index:100; background:rgba(2,6,23,.78); display:grid; place-items:center; padding:1rem; }
.exit-dialog[hidden] { display:none; }
.exit-card { width:min(310px,90vw); padding:1.1rem; border:1px solid #475569; border-radius:1rem; background:#020617; box-shadow:0 24px 70px #000; text-align:center; }
.exit-card h2 { margin:0 0 1rem; font-size:1rem; }
.exit-actions { display:flex; gap:.7rem; }
.closed-screen { min-height:100dvh; display:grid; place-content:center; justify-items:center; gap:.5rem; text-align:center; background:#020617; color:#f8fafc; }
.closed-screen img { width:96px; height:96px; border-radius:1.2rem; }
.closed-screen h1, .closed-screen p { margin:0; }
.closed-screen p { color:#facc15; }

.drawer-header h2 {
  margin: 0;
  font-size: 1rem;
}

.drawer-close {
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
}

.drawer-section {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.drawer-info-section {
  background: #111827; 
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #1f2937;
  margin-top: 0; 
}

.drawer-info-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.drawer-info-section .info-status {
  font-size: 0.9rem;
  color: #facc15; 
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}
.drawer-info-section .info-location {
  font-size: 0.85rem;
  color: #d1d5db;
  margin: 0.25rem 0;
  line-height: 1.4;
  word-wrap: break-word; 
}
.drawer-info-section .info-date {
  font-size: 0.85rem;
  color: #d1d5db;
  margin: 0.25rem 0 0 0;
  line-height: 1.4;
}

.drawer-section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.drawer-section label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
  color: #9ca3af;
}

.drawer-section input,
.drawer-section select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
  margin-bottom: 0.5rem;
}

.drawer-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-primary {
  background: #facc15;
  color: #111827;
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}

.drawer-section a.btn {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 0.4rem 0.6rem; 
  line-height: 1.5; 
}


.drawer-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.switch-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.footer {
  width: 100%;
  max-width: 390px; 
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
  padding: 0.5rem 1rem 1rem;
}

.footer a {
  color: #d1d5db;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* HIMMEL ANIMATIONEN */
@keyframes sun-rise {
  0% { top: 100%; opacity: 0.8; }
  100% { top: 15%; opacity: 1; }
}

@keyframes sun-set {
  0% { top: 15%; opacity: 1; }
  100% { top: 100%; opacity: 0.8; }
}

@keyframes moon-rise-set {
  0% { top: 100%; opacity: 0.8; }
  50% { top: 20%; opacity: 1; }
  100% { top: 100%; opacity: 0.8; }
}

@keyframes stars-shimmer {
  0% { background-position: 0 0; opacity: 0; }
  20% { opacity: 0.9; }
  100% { background-position: 80px 80px; opacity: 0.9; }
}

@keyframes morning-gradient {
  0% { background: linear-gradient(180deg, #020617, #022c43, #38bdf8); }
  100% { background: linear-gradient(180deg, #022c43, #38bdf8, #facc15); }
}

@keyframes evening-gradient {
  0% { background: linear-gradient(180deg, #1d4ed8, #38bdf8, #f97316); }
  100% { background: linear-gradient(180deg, #020617, #7c2d12, #f97316); }
}

.sky-animation-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; 
  overflow: hidden;
}

.sun, .moon {
  position: absolute;
  border-radius: 50%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  top: 110%; 
}

.sun {
  width: 120px;
  height: 120px;
  background: #facc15;
  box-shadow: 0 0 40px 15px #facc15, 0 0 80px 30px #f97316; 
}

.moon {
  width: 90px;
  height: 90px;
  background: #e5e7eb;
  box-shadow: 0 0 20px 8px #e5e7eb, 0 0 40px 15px #6b7280; 
}

.stars {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-position: 0 0;
  background-size: 40px 40px;
  opacity: 0;
}

body.time-morning .sun {
  animation: sun-rise 6s 1s ease-out forwards;
}
body.time-day .sun {
  opacity: 1;
  top: 15%;
}
body.time-evening .sun {
  animation: sun-set 6s 1s ease-in forwards;
}
body.time-night .moon {
  animation: moon-rise-set 36000s linear forwards; 
}
body.time-night .stars {
  animation: stars-shimmer 120s linear infinite alternate;
}

/* VAKTIJA-STILE (für it-vaktija.html) */

#vaktija-table .vaktija-weekend td {
  background: rgba(30, 41, 59, 0.5);
}
#vaktija-table .vaktija-juma td {
  background: rgba(14, 165, 233, 0.15);
}
#vaktija-table .vaktija-ramadan td {
  background: rgba(74, 222, 128, 0.15);
  color: #dcfce7;
}
#vaktija-table .vaktija-bayram td {
  background: rgba(249, 115, 22, 0.2);
  color: #fff7ed;
  font-weight: 600;
}
#vaktija-table .vaktija-today td {
  background: rgba(250, 204, 21, 0.2);
  color: #fefce8;
  font-weight: 600;
  box-shadow: inset 2px 0 0 #facc15;
}
.actions-row {
  display: flex;
  flex-wrap: wrap; 
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
}
.actions-row .print-bg-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-right: auto;
}
.actions-row button {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 0.5rem;
  background: #334155;
  color: #f1f5f9;
  cursor: pointer;
}
.actions-row button:active {
  transform: scale(0.97);
}

/* DRUCKSTILE */
@media print {
  
  body {
     background: #ffffff !important;
     color: #000000 !important;
  }
  
  .app-header, .month-controls, .actions-row, .offsets-section, .header, .menu-button, .btn-vaktija, .btn-qibla, .install-button, .drawer, .drawer-backdrop, .loading-bar, .clock-location, #clock, .qibla-display,
  /* NEU: GPS-Button im Druck ausblenden */
  .location-header .gps-button-main {
    display: none !important;
  }
  
  .app-main, .page {
    padding: 0 !important;
  }
  
  .monthly-vaktija-section {
    padding: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  
  #vaktija-table th,
  #vaktija-table td {
    color: #000 !important;
    border-color: #ccc !important;
  }
  #vaktija-table thead {
    background: #eee !important;
  }
  #vaktija-table .vaktija-today td {
     background: #ffedb3 !important; 
     color: #000 !important;
  }

  body.print-background {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    background: #020617 !important;
    color: #e5e7eb !important;
  }
  
  body.print-background .vaktija-table th,
  body.print-background .vaktija-table td {
     color: #e5e7eb !important;
     border-color: #1e293b !important;
  }
  
  body.print-background .vaktija-table thead {
     background: #1e293b !important;
  }
  
  body.print-background .vaktija-weekend td {
     background: rgba(30, 41, 59, 0.5) !important;
  }
  body.print-background .vaktija-juma td {
     background: rgba(14, 165, 233, 0.15) !important;
  }
  body.print-background .vaktija-ramadan td {
     background: rgba(74, 222, 128, 0.15) !important;
  }
  body.print-background .vaktija-bayram td {
     background: rgba(249, 115, 22, 0.2) !important;
  }
   body.print-background .vaktija-today td {
     background: rgba(250, 204, 21, 0.2) !important;
     color: #fefce8 !important;
     box-shadow: none !important;
  }
}




/* Vaktija-Uhr-Ansicht wie Vorlage: kräftige Karten, große Liste */
.clock-section {
  border-radius: 1.45rem;
  overflow: hidden;
  padding: 0.75rem;
  background: radial-gradient(circle at 50% 40%, #111827 0, #020617 64%);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

#clock {
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35));
}

.times-section {
  border-radius: 1.45rem;
  padding: 1rem 1.05rem 1.1rem;
  background: rgba(2, 6, 23, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.section-header {
  margin-bottom: 0.65rem;
}

.section-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.btn-vaktija,
.btn-qibla {
  width: 42px;
  height: 42px;
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
}

#times-table {
  border-collapse: separate;
  border-spacing: 0 0.28rem;
  font-size: 1.03rem;
}

#times-table td {
  padding: 0.38rem 0.52rem;
  vertical-align: middle;
}

#times-table td:first-child {
  width: 56%;
  padding-left: 0.62rem;
}

#times-table td:last-child {
  width: 44%;
  text-align: left;
  font-size: 1.18rem;
  font-weight: 650;
  line-height: 1.1;
}

#times-table td:last-child .range {
  margin-top: 0.12rem;
  font-size: 0.82rem;
  font-weight: 450;
  color: #a7adc0;
}

.time-name {
  gap: 0.62rem;
  font-size: 1.12rem;
}


.prayer-order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border: 2px solid #fff600;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.78);
  color: #fff600;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.35);
}

.color-dot,
.fasting-row .color-dot {
  width: 14px;
  height: 14px;
}

.current-prayer,
.fasting-current {
  border-radius: 0.85rem;
}

.current-prayer td:first-child,
.fasting-current td:first-child,
.fasting-past td:first-child {
  border-top-left-radius: 0.85rem;
  border-bottom-left-radius: 0.85rem;
}

.current-prayer td:last-child,
.fasting-current td:last-child,
.fasting-past td:last-child {
  border-top-right-radius: 0.85rem;
  border-bottom-right-radius: 0.85rem;
}

.current-prayer {
  background: rgba(250, 204, 21, 0.11);
  box-shadow: inset 3px 0 0 #facc15;
}

.fasting-current {
  background: rgba(74, 222, 128, 0.15);
  box-shadow: inset 3px 0 0 #4ade80;
}

.current-detail-section {
  margin-top: 0.9rem;
}


/* Namaz-Ton Einstellungen */
.prayer-sound-section {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 0.75rem;
}

.sound-master-row {
  margin: 0.1rem 0 0.55rem;
  color: #e5e7eb !important;
}

.sound-prayer-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 0.65rem;
  margin: 0.45rem 0 0.75rem;
}

.sound-prayer-row {
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(75, 85, 99, 0.75);
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.68);
  color: #d1d5db !important;
  display: grid;
  grid-template-columns: minmax(6.5rem, 0.8fr) minmax(9rem, 1.2fr);
  align-items: center;
  gap: 0.55rem;
}

.sound-prayer-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.sound-volume-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.1rem;
  align-items: center;
  gap: 0.4rem;
}

.sound-volume-slider {
  width: 100%;
  accent-color: #d4af55;
  touch-action: pan-y;
}

.sound-volume-slider:disabled {
  opacity: 0.45;
}

.sound-volume-value {
  color: #f7d989;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.prayer-alert {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(7px);
}

.prayer-alert[hidden] { display: none; }

.prayer-alert-card {
  width: min(92vw, 28rem);
  padding: 1.2rem;
  border: 1px solid rgba(218, 180, 84, 0.85);
  border-radius: 1.35rem;
  background: linear-gradient(160deg, #063e35, #021d1a);
  box-shadow: 0 1.4rem 4rem rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 235, 170, 0.08);
  text-align: center;
}

.prayer-alert-logo {
  display: block;
  width: min(100%, 21rem);
  max-height: 8rem;
  margin: 0 auto 1rem;
  object-fit: contain;
}

.prayer-alert-card p {
  margin: 0;
  color: #d8c184;
}

.prayer-alert-card h2 {
  margin: 0.35rem 0;
  color: #fff2c5;
  font-size: clamp(2rem, 9vw, 3.2rem);
}

.prayer-alert-card time {
  display: block;
  margin: 0 0 1rem;
  color: #f7d989;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 410px) {
  .sound-prayer-row {
    grid-template-columns: 1fr;
  }
}

.sound-prayer-row span,
.sound-master-row span {
  line-height: 1.2;
}


.sound-library-select {
  width: 100%;
  margin: 0.25rem 0 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(75, 85, 99, 0.9);
  border-radius: 0.7rem;
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  font-size: 0.9rem;
}


.sound-buttons {
  margin-top: 0.45rem;
}

@media (max-width: 360px) {
  .sound-prayer-list {
    grid-template-columns: 1fr;
  }
}

/* Wanduhr-/Display-Modus: nur Uhr + Liste, automatisch an Bildschirm angepasst */
.wall-display-section {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 0.75rem;
}

body.wall-display {
  overflow: hidden;
  overscroll-behavior: none;
}

body.wall-display .page {
  height: 100dvh;
  min-height: 100dvh;
  width: 100vw;
  padding: var(--wall-pad, 10px);
  gap: var(--wall-gap, 10px);
  justify-content: center;
  align-items: center;
}

body.wall-display.wall-landscape .page {
  flex-direction: row;
}

body.wall-display.wall-portrait .page {
  flex-direction: column;
}

body.wall-display .header,
body.wall-display .footer,
body.wall-display .clock-location,
body.wall-display .current-detail-section,
body.wall-display .section-header-buttons,
body.wall-display #loading-bar,
body.wall-display #install-button,
body.wall-display #special-day-info {
  display: none !important;
}

body.wall-display .clock-section,
body.wall-display .times-section {
  width: var(--wall-card-size, 340px) !important;
  height: var(--wall-card-size, 340px) !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 0 !important;
  flex: 0 0 auto;
  margin: 0 !important;
}

body.wall-display .clock-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wall-card-pad, 12px) !important;
}

body.wall-display #clock {
  width: calc(var(--wall-card-size, 340px) - (var(--wall-card-pad, 12px) * 2));
  max-width: calc(var(--wall-card-size, 340px) - (var(--wall-card-pad, 12px) * 2));
  height: auto;
  margin: 0;
}

body.wall-display .times-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--wall-card-pad, 12px) !important;
  overflow: hidden;
}

body.wall-display .section-header {
  justify-content: center;
  margin: 0 0 calc(var(--wall-list-font, 1rem) * 0.55) 0;
}

body.wall-display .section-header h2 {
  font-size: calc(var(--wall-list-font, 1rem) * 1.22);
  line-height: 1.05;
  text-align: center;
}

body.wall-display #times-table {
  border-spacing: 0 var(--wall-row-gap, 3px);
  font-size: var(--wall-list-font, 1rem);
}

body.wall-display #times-table td {
  padding: calc(var(--wall-list-font, 1rem) * 0.27) calc(var(--wall-list-font, 1rem) * 0.38);
}

body.wall-display #times-table td:first-child {
  padding-left: calc(var(--wall-list-font, 1rem) * 0.45);
}

body.wall-display #times-table td:last-child {
  font-size: calc(var(--wall-list-font, 1rem) * 1.08);
  line-height: 1.02;
}

body.wall-display #times-table td:last-child .range {
  font-size: calc(var(--wall-list-font, 1rem) * 0.68);
  line-height: 1.05;
  margin-top: 0.05rem;
}

body.wall-display .time-name {
  gap: calc(var(--wall-list-font, 1rem) * 0.45);
  font-size: calc(var(--wall-list-font, 1rem) * 0.98);
  line-height: 1.04;
}

body.wall-display .color-dot,
body.wall-display .fasting-row .color-dot {
  width: calc(var(--wall-list-font, 1rem) * 0.72);
  height: calc(var(--wall-list-font, 1rem) * 0.72);
}

body.wall-display .prayer-order-badge {
  width: calc(var(--wall-list-font, 1rem) * 1.22);
  height: calc(var(--wall-list-font, 1rem) * 1.22);
  font-size: calc(var(--wall-list-font, 1rem) * 0.58);
  border-width: 2px;
}

body.wall-display .drawer,
body.wall-display .drawer.open {
  overflow-y: auto;
}

@media (max-width: 390px) {
  .header-top { min-height:82px; padding:6px; border-radius:1.2rem; }
  .brand-emblem { width:66px; height:66px; flex-basis:66px; }
  .header-actions { gap: .3rem; }
  .header-share-button, .menu-button { width:32px; height:32px; }
}
