html,
body {
  margin: 0;
  padding: 0;
}

body {
  padding-top: 128px;
  padding-bottom: 290px;
  background-color: #efefef;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.9), transparent 36%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.65), transparent 30%),
    radial-gradient(circle at 10% 80%, rgba(0, 0, 0, 0.08), transparent 35%),
    radial-gradient(circle, rgba(100, 100, 100, 0.22) 1.2px, transparent 1.2px),
    linear-gradient(180deg, #f5f5f5 0%, #e9e9e9 55%, #dedede 100%);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    26px 26px,
    100% 100%;
  background-attachment: fixed;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 245, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 200ms ease;
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(120, 120, 120, 0.2);
}

.loading-card p {
  margin: 0;
  font-family: "Verdana";
  font-size: 12px;
  color: #333;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: rgba(0, 0, 0, 0.65);
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.main-header {
  background: transparent;
  padding: 10px 16px 8px 16px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.title {
  text-align: center;
  margin: 0;
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1f1f1f;
  line-height: 1.05;
}

.subtitle {
  margin: 0;
  text-align: center;
  font-family: "Verdana";
  color: #4f4f4f;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: center;
  width: fit-content;
  margin: 6px auto 0 auto;
  font-family: "Verdana";
}

.filters label {
  font-size: 12px;
  color: #2f2f2f;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.filters select {
  font-size: 12px;
  padding: 6px 32px 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 120, 120, 0.35);
  background-color: rgba(250, 250, 250, 0.98);
  color: #222;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-position: calc(100% - 12px) 50%;
  background-size: 10px 6px;
  background-repeat: no-repeat;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.filters select:hover {
  border-color: rgba(80, 80, 80, 0.55);
}

.filters select:focus {
  outline: none;
  border-color: rgba(70, 70, 70, 0.75);
  box-shadow: 0 0 0 2px rgba(70, 70, 70, 0.15);
  transform: translateY(-1px);
}

#card-container {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 20px 80px 20px;
  padding-right: 6px;
}

.card {
  width: 100%;
  border: none;
  border-radius: 5px;
  box-shadow: none;
  background: transparent;
  cursor: grab;
}

.card:active {
  cursor: grabbing;
}

.card.is-selected {
  outline: 2px solid #666;
  outline-offset: 2px;
}

.card-content {
  padding: 8px;
  font-family: "Verdana";
  color: #777;
}

.card-content h2 {
  margin: 6px 0 0 0;
  font-size: 10px;
  text-align: center;
  font-weight: 500;
  line-height: 1.2;
  display: none;
}

.card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
}

.card img {
  transition: transform 160ms ease;
}

.card:hover img {
  transform: rotate(-5deg);
}

.card-content ul {
  display: none;
}

.footer {
  display: flex;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 10px;
}

button {
  text-align: center;
  background-color: #666;
  border: none;
  padding-left: 10px;
  padding-right: 10px;
  height: 40px;
  border-radius: 10px;
  color: white;
  font-size: 22px;
  cursor: pointer;
  margin: 5px;
}

.calendar-section {
  margin: 0;
  padding: 0 2px;
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 14px;
  z-index: 30;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  max-height: none;
  overflow: visible;
}

.planner-stacks {
  display: flex;
  gap: 14px;
  overflow: visible;
  padding: 36px 2px 12px 2px;
  width: 100%;
}

.day-stack {
  flex: 1 1 0;
  min-width: 210px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
  padding: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  overflow: visible;
  position: relative;
}

.day-stack h3 {
  margin: 0 0 6px 0;
  font-family: "Verdana";
  font-size: 10px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.day-cell {
  min-height: 210px;
  position: relative;
  overflow: visible;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
}

.day-cell:empty::before {
  content: "+";
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-family: "Verdana";
  font-size: 34px;
  font-weight: 600;
  color: #8f8f8f;
  line-height: 1;
  pointer-events: none;
}

.day-cell:empty::after {
  content: "drag to add";
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translate(-50%, -50%);
  font-family: "Verdana";
  font-size: 10px;
  color: #9a9a9a;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  pointer-events: none;
}

.day-cell.is-drop-target {
  background-color: #f4f4f4;
}

.planner-item {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: transform 220ms ease, box-shadow 220ms ease;
  z-index: 1;
}

.planner-item.is-lifted {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.planner-item img {
  width: 186px;
  height: 186px;
  object-fit: contain;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

.planner-item span {
  display: none;
}

.planner-remove-x {
  all: unset;
  appearance: none;
  display: grid;
  place-items: center;
  position: absolute;
  top: 6px;
  right: 6px;
  transform: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-family: Arial, sans-serif;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  z-index: 420;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
}

.planner-item:hover .planner-remove-x {
  opacity: 1;
  visibility: visible;
}

.planner-remove-x:hover {
  background: #ff4d4f;
}

/* default stacked look */
.day-cell .planner-item:nth-child(1) {
  transform: translate(calc(-50% - 5px), calc(-50% + 4px)) rotate(-24deg);
  z-index: 1;
}
.day-cell .planner-item:nth-child(2) {
  transform: translate(calc(-50% + 7px), calc(-50% - 6px)) rotate(17deg);
  z-index: 2;
}
.day-cell .planner-item:nth-child(3) {
  transform: translate(calc(-50% - 8px), calc(-50% - 2px)) rotate(-11deg);
  z-index: 3;
}
.day-cell .planner-item:nth-child(4) {
  transform: translate(calc(-50% + 3px), calc(-50% + 7px)) rotate(28deg);
  z-index: 4;
}
.day-cell .planner-item:nth-child(5) {
  transform: translate(calc(-50% - 2px), calc(-50% - 8px)) rotate(-30deg);
  z-index: 5;
}
.day-cell .planner-item:nth-child(6) {
  transform: translate(calc(-50% + 9px), calc(-50% + 2px)) rotate(8deg);
  z-index: 6;
}
.day-cell .planner-item:nth-child(7) {
  transform: translate(calc(-50% - 6px), calc(-50% - 4px)) rotate(22deg);
  z-index: 7;
}

.day-cell .planner-shoe {
  transform: translate(-50%, calc(-50% + 58px)) rotate(-2deg);
}

.day-cell:hover .planner-item {
  transform: translate(-50%, -50%) rotate(0deg) scale(1.5);
  z-index: 300;
}

.day-cell:hover .planner-glasses {
  transform: translate(-50%, calc(-50% - 265px)) rotate(-4deg) scale(1.5);
}

.day-cell:hover .planner-top {
  transform: translate(-50%, calc(-50% - 195px)) rotate(0deg) scale(1.5);
}

.day-cell:hover .planner-layer {
  transform: translate(calc(-50% - 98px), calc(-50% - 220px)) rotate(-8deg)
    scale(1.5);
}

.day-cell:hover .planner-watch {
  transform: translate(calc(-50% + 140px), calc(-50% - 172px)) rotate(8deg)
    scale(1.5);
}

.day-cell:hover .planner-bottom {
  transform: translate(-50%, calc(-50% - 56px)) rotate(2deg) scale(1.5);
}

.day-cell:hover .planner-accessory {
  transform: translate(calc(-50% + 170px), calc(-50% + 6px)) rotate(12deg)
    scale(1.5);
}

.day-cell:hover .planner-accessory[data-accessory-slot="2"] {
  transform: translate(calc(-50% - 170px), calc(-50% + 6px)) rotate(-12deg)
    scale(1.5);
}

.day-cell:hover .planner-shoe {
  transform: translate(-50%, calc(-50% + 56px)) rotate(-2deg) scale(1.5);
}
