:root {
  --accent: #d90429;
  --accent-dark: #9b0220;
  --bg: #ffffff;
  --card: #1c2541;
  --text: #edf2f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 30px 20px 30px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg) url("img/background.png") repeat;
  color: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

body.not-ready {
  visibility: hidden;
}

body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  background: url("img/for_back.png") bottom center / contain no-repeat;
  pointer-events: none;
  z-index: -1;
}

header {
  text-align: center;
  color: #380505
}

p {
  margin: 0rem 0;   /* smaller vertical margin */
}

h1 {
  margin: 0 0 0.5rem;
  letter-spacing: 0.08em;
}

.subtitle {
  margin: 0 0 2rem;
  opacity: 0.8;
}

.calendar {
  width: min(1100px, 95vw);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.door {
  position: relative;
  border-radius: 12px;
  background: #fff;
  background: var(--card);
  border: 2px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1rem;
  text-align: center;
  min-height: 60px;
  aspect-ratio: 1 / 1;
  flex: 1 1 105px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.row-break {
  flex-basis: 100%;
  height: 0;
}

.door:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.door.locked {
  cursor: not-allowed;
  filter: brightness(0.5);
  transform: none;
}

.door-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  border-radius: 0;
  background: transparent;
  font-weight: 800;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  box-shadow: none;
  color: #570b19;
  -webkit-text-stroke: 0.2px #ffffff; /* outline thickness and color */-webkit-text-stroke: 0.2px #ffffff; /* outline thickness and color */
}

.door-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 160;
  
}

.door.locked .door-title {
  opacity: 0.8;
}

.status {
  margin-top: 0rem;
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 550;
}

.status.available {
  color: #500000;
    text-shadow:
    0 0 4px #ffffff,
    0 0 8px #ffffff,
    0 0 12px #ffffff;
}

.status.locked-text {
  color: #ffffff;
  text-shadow:
    0 0 4px #000000,
    0 0 8px #000000,
    0 0 12px #000000;
  
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 1rem;
}

.backdrop.visible {
  display: flex;
}

.body-image-overlay {
  display: none;
}

.body-foreground {
  display: none;
}

.popup {
  background-color: #fff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--text);
  border-radius: 14px;
  aspect-ratio: 1 / 1;
  width: min(520px, 90vw, 90vh);
  max-width: 1024px;
  max-height: 1024px;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: auto;
}

.popup h2 {
  margin: 0 0 0.25rem;
  color:#500000;
  opacity:0;
}

.popup .day-label {
  opacity: 0.8;
  margin-bottom: 0.75rem;
  color:#9b0220;
  font-weight: 800;
  font-size: 2.5rem;

}

#popup-message {
  display: inline-block;
  text-align: left;
  margin: 0.25rem auto 0;
  width: fit-content;
  max-width: 100%;
  white-space: pre-wrap;
  color:#000000;
  font-size: 1.3rem;
}

.popup-footer {
  margin-top: auto;
  text-align: right;
  width: 100%;
}

.popup button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(217, 4, 41, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.popup button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(217, 4, 41, 0.45);
}

.popup button:active {
  transform: translateY(0);
}
