body {
  font-family: Arial, sans-serif;
  background: #eef5fb;
  margin: 0;
  text-align: center;
  color: #1f2937;
}

/* ===== snow ===== */
#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ===== header ===== */
header {
  padding: 20px 16px 10px;
  position: relative;
  z-index: 1;
}

h1 {
  margin: 0 0 12px;
  font-size: 28px;
}

#snowSecret {
  cursor: pointer;
  user-select: none;
}

#countdown {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.subInfo {
  font-size: 14px;
  color: #5b6470;
  margin-bottom: 4px;
  line-height: 1.5;
}

/* ===== creator ===== */
.creatorBadge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 4px 0 12px;
}

.creatorAvatar {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #d6b347;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  display: block;
}

.creatorCredit {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #7a6a52;
}

/* ===== header toolbar ===== */
.headerToolbar {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 2;
}

.headerToolbar input,
.headerToolbar select,
.headerToolbar button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cfd8e3;
  font-size: 14px;
  box-sizing: border-box;
}

.headerToolbar input {
  width: 220px;
}

.headerToolbar select {
  min-width: 120px;
}

.headerToolbar button {
  background: #7da7ff;
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

.headerToolbar button:hover {
  background: #6a96f4;
}

/* ===== tabs ===== */
.tabsWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 1180px;
  width: 100%;
  margin: 18px auto 0;
  padding: 0 20px;
  box-sizing: border-box;
}

.tabs button {
  width: 100%;
  padding: 14px 12px;
  border: none;
  border-radius: 12px;
  background: #d8f2ff;
  color: #2d5468;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.tabs button:hover {
  background: #ccecff;
}

.tabs button.active {
  background: #bfe7fb;
  color: #1c4a61;
}

/* ===== stats ===== */
.slotStats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-size: 16px;
}

.availableDot,
.reservedDot,
.mineDot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  vertical-align: middle;
}

.availableDot {
  background: #8bd18b;
}

.reservedDot {
  background: #d98c8c;
}

.mineDot {
  background: #6f8cff;
}

/* ===== grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 30px;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

/* ===== slot ===== */
.slot {
  background: #fffaf2;
  border-radius: 12px;
  text-align: left;
  min-height: 128px;
  padding: 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition:
    background-color 0.28s ease,
    border-color 0.28s ease,
    transform 0.18s ease,
    box-shadow 0.22s ease;
}

.slot.available {
  border: 2px solid #8bd18b;
  cursor: pointer;
}

.slot.reserved {
  border: 2px solid #d98c8c;
  background: #f7eaea;
  cursor: pointer;
}

.slot.locked {
  border: 2px solid #bababa;
  background: #ececec;
}

.slot.available:hover,
.slot.reserved:hover {
  transform: translateY(-2px);
}

.slot.available:hover {
  background-color: #e9f8e9;
  box-shadow: 0 8px 18px rgba(139, 209, 139, 0.28);
}

.slot.reserved:hover {
  background-color: #f4dfdf;
  box-shadow: 0 8px 18px rgba(217, 140, 140, 0.24);
}

.slot.selected.highlightAvailable {
  background-color: #e9f8e9;
  box-shadow: 0 8px 20px rgba(139, 209, 139, 0.34);
}

.slot.selected.highlightReserved {
  background-color: #f4dfdf;
  box-shadow: 0 8px 20px rgba(217, 140, 140, 0.30);
}

.slot.myReservation {
  border-color: #6c7cff;
  box-shadow: 0 0 0 3px rgba(108, 124, 255, 0.14);
}

.timeRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.timeUTC {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.timeLocal {
  margin-top: 8px;
  font-size: 13px;
  color: #5b6470;
}

.statusAvailable {
  font-size: 13px;
  font-weight: 700;
  color: #3f9b3f;
  white-space: nowrap;
}

.statusReserved {
  font-size: 13px;
  font-weight: 700;
  color: #c95555;
  white-space: nowrap;
}

.statusMine {
  font-size: 12px;
  font-weight: 700;
  color: #5b60df;
  margin-top: 6px;
}

.bookingInfo {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.bookingInfo.compact {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  word-break: break-word;
}

.bookingMeta {
  color: #6b7280;
  font-weight: 700;
}

.adminNotePreview {
  margin-top: 8px;
  font-size: 12px;
  color: #7a5c1f;
  background: rgba(255, 236, 179, 0.5);
  border-radius: 8px;
  padding: 6px 8px;
}

/* ===== modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.modalBox {
  background: #fff;
  width: 100%;
  max-width: 380px;
  padding: 24px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.modalBox h3 {
  margin: 0 0 4px;
}

.modalBox input,
.modalBox textarea {
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.modalBox button {
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: #7da7ff;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.modalBox button:hover {
  background: #6a96f4;
}

.selectedSlotInfo {
  background: #eef5ff;
  color: #38557a;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}

.reservedDetail {
  background: #fff8f8;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  text-align: left;
  line-height: 1.45;
}

/* ===== admin panel ===== */
.adminPanel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: calc(100% - 32px);
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%);
  z-index: 1300;
}

.adminPanel.show {
  display: block;
}

.adminPanel h3 {
  margin: 0 0 16px;
  font-size: 28px;
  text-align: center;
}

.adminPanel h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

#adminLogin,
#adminControls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#adminControls {
  display: none;
  margin-bottom: 14px;
}

.adminUserInfo {
  font-size: 14px;
  color: #374151;
  text-align: center;
  word-break: break-word;
}

.adminSection {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: #fafcff;
}

.adminSection label {
  font-size: 13px;
  font-weight: 700;
  color: #4b5563;
}

.adminSection input,
.adminSection textarea,
.adminSection button,
#adminLogin button,
.adminPanel > button {
  box-sizing: border-box;
  font-size: 14px;
}

.adminSection input,
.adminSection textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
}

.adminSection textarea {
  min-height: 84px;
  resize: vertical;
}

.adminSection button,
#adminLogin button,
.adminPanel > button {
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: #7da7ff;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.adminSection button:hover,
#adminLogin button:hover,
.adminPanel > button:hover {
  background: #6a96f4;
}

.adminSelectedSlotLabel {
  font-size: 13px;
  color: #5b6470;
  background: #f3f6fb;
  border-radius: 8px;
  padding: 8px 10px;
}

.logsBox {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.logItem {
  background: #f6f9fc;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.buttonRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ===== toast ===== */
.toastContainer {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #fff;
  background: rgba(41, 53, 65, 0.94);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  animation: toastIn 0.25s ease;
  font-size: 14px;
  text-align: left;
  white-space: pre-line;
}

.toast.success {
  background: rgba(58, 140, 88, 0.96);
}

.toast.error {
  background: rgba(190, 78, 78, 0.96);
}

.toast.hide {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* ===== effects ===== */
.slot.successFlash {
  animation: successFlashAnim 1.2s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes successFlashAnim {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(125, 167, 255, 0);
  }
  35% {
    transform: scale(1.02);
    box-shadow: 0 0 18px rgba(125, 167, 255, 0.35);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(125, 167, 255, 0);
  }
}

/* ===== responsive ===== */
@media (max-width: 980px) {
  .headerToolbar {
    position: static;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 14px;
  }
}

@media (max-width: 700px) {
  header {
    padding: 14px 12px 8px;
  }

  h1 {
    font-size: 24px;
    margin: 0 0 8px;
  }

  #countdown {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.35;
  }

  .headlineCountdown {
    font-size: 16px;
    margin-bottom: 6px;
    line-height: 1.35;
  }

  .subInfo {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 2px;
  }

  .creatorBadge {
    margin: 4px 0 10px;
  }

  .creatorAvatar {
    width: 76px;
    height: 76px;
  }

  .creatorCredit {
    margin-top: 6px;
    font-size: 12px;
  }

  .tabs {
    grid-template-columns: 1fr;
    margin-top: 12px;
    padding: 0 14px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
    gap: 12px;
  }

  .headerToolbar {
    flex-direction: column;
    align-items: stretch;
    max-width: 360px;
    margin: 14px auto 0;
    gap: 8px;
  }

  .headerToolbar input,
  .headerToolbar select,
  .headerToolbar button {
    padding: 9px 11px;
  }

  .headerToolbar input,
  .headerToolbar select {
    width: 100%;
  }

  .slot {
    min-height: 116px;
    padding: 12px;
  }

  .timeUTC {
    font-size: 16px;
  }

  .bookingInfo {
    font-size: 13px;
  }

  .bookingInfo.compact {
    font-size: 14px;
  }

  .adminPanel {
    width: calc(100% - 20px);
    padding: 18px;
    max-height: 90vh;
  }

  .adminPanel h3 {
    font-size: 24px;
  }

  .buttonRow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .timeRow {
    flex-direction: column;
    align-items: flex-start;
  }

  .slotStats {
    line-height: 1.7;
    font-size: 14px;
  }

  h1 {
    font-size: 22px;
  }

  .creatorAvatar {
    width: 70px;
    height: 70px;
  }

  .toastContainer {
    top: 12px;
    right: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

.adminPanel {
  position: fixed;
}

.adminCloseBtn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: #eef4ff;
  color: #4b6fbf;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.adminCloseBtn:hover {
  background: #dfeaff;
}

@media (max-width: 700px) {
  .adminCloseBtn {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
}
