* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  color: #ccc;
  font-family: 'Poppins', sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.screen {
  position: fixed;
  inset: 0;
  background: #000;
}

.hidden {
  display: none !important;
}

/* ---------- Clock screen ---------- */

.top-row {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 24px 32px;
}

.top-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 20px);
  color: #ccc;
  letter-spacing: 0.02em;
}
.clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 16px;
}

.digits-row {
  display: flex;
  gap: 3vmin;
  justify-content: center;
}

.flip-card {
  position: relative;
  width: 38vmin;
  height: 52vmin;
  border-radius: 20px;
  background: linear-gradient(
    to bottom,
    rgba(58, 58, 58, 0.6),
    rgba(28, 28, 28, 0.6),
    rgba(46, 46, 46, 0.6)
  );
  overflow: hidden;
}

.flip-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.flip-top {
  top: 0;
  align-items: flex-end;
}

.flip-bottom {
  bottom: 0;
  align-items: flex-start;
  transform-origin: top center;
  transition: transform 0.22s cubic-bezier(0.4, 0, 1, 1);
}

.flip-bottom.folding {
  transform: rotateX(-90deg);
  transition: transform 0.22s cubic-bezier(0.4, 0, 1, 1);
}

.digit-text {
  font-family: 'Anton', sans-serif;
  font-size: 32vmin;
  line-height: 1;
  color: #e8e8e8;
  transform: translateY(50%);
}

.flip-bottom .digit-text {
  transform: translateY(-50%);
}

.fold-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #000;
  transform: translateY(-1px);
}

.ampm-label {
  position: absolute;
  left: 20px;
  bottom: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  color: #ccc;
}

.next-prayer {
  margin-top: 3vmin;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(14px, 2.4vmin, 26px);
  color: #aaa;
  text-align: center;
}

.gear-button {
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #1a1a1a;
  color: #ccc;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.15s;
}

.gear-button:hover,
.gear-button:focus-visible {
  background: rgba(255, 255, 255, 0.25);
  outline: none;
}

/* ---------- Settings / Prayer list screens ---------- */

#settings-screen,
#prayerlist-screen {
  padding: 20px 32px;
  display: flex;
  flex-direction: column;
}

.settings-heading {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: #fff;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.settings-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
}

.setting-card {
  background: #1a1a1a;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.setting-label {
  font-size: 16px;
  color: #ccc;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.format-row {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.format-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.format-caption {
  font-size: 12px;
  color: #ccc;
  margin-bottom: 4px;
}

.tv-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 50px;
  border: none;
  background: #555;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.tv-switch[data-checked="true"] {
  background: #2ecc71;
}

.tv-switch:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.tv-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.tv-switch[data-checked="true"] .tv-switch-thumb {
  transform: translateX(20px);
}

.method-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
}

.method-row .setting-label {
  font-size: 13px;
}

.setting-row-button,
.back-button {
  display: block;
  width: 100%;
  text-align: left;
  background: #1a1a1a;
  color: #ccc;
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.setting-row-button:hover,
.setting-row-button:focus-visible,
.back-button:hover,
.back-button:focus-visible {
  background: #2a2a2a;
  outline: 2px solid #fff;
}

.kofi-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: rgba(255, 94, 91, 0.75);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  margin-bottom: 12px;
  transition: background 0.15s;
}

.kofi-button:hover,
.kofi-button:focus-visible {
  background: rgba(255, 94, 91, 0.9);
  outline: 2px solid #fff;
}

.kofi-icon {
  font-size: 20px;
}

.credit-text {
  font-size: 11px;
  color: #555;
  margin-top: 4px;
}

.prayer-row {
  display: flex;
  justify-content: space-between;
  background: #141414;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 10px;
  font-size: 20px;
  color: #ccc;
}