@font-face {
  font-family: "Omori";
  src: url("OMORI_GAME2.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #070504;
  --paper: #d8cab8;
  --paper-deep: #cdbdaa;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #101210;
  font-family: "Omori", "Courier New", monospace;
}

button {
  font: inherit;
}

.album-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: url("test bg.gif") center / cover no-repeat, url("bg.jpg") center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 32px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  z-index: 10;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.camera-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(2px 2px 0 #000);
}

.title-text {
  font-family: "Omori", "Courier New", monospace;
  font-size: clamp(2.8rem, 4.8vw, 4.2rem);
  font-weight: bold;
  color: #ffffff;
  margin: 0;
  line-height: 1;
  letter-spacing: 0.5px;
  text-transform: lowercase;
  -webkit-text-stroke: 2px #000000;
  text-shadow:
    3px 3px 0 #000000,
    -1px -1px 0 #000000,
    1px -1px 0 #000000,
    -1px 1px 0 #000000,
    1px 1px 0 #000000;
}

.back-btn {
  font-family: "Omori", "Courier New", monospace;
  font-size: 1rem;
  padding: 3px 14px;
  background: #ffffff;
  color: #000000;
  border: 2px solid #000000;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, transform 0.15s ease;
}

.back-btn:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.cards-track {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
  padding: 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cards-track::-webkit-scrollbar {
  display: none;
}

.card {
  position: relative;
  width: clamp(180px, 15.5vw, 230px);
  background: #ffffff;
  border: 2.5px solid #000000;
  box-shadow: 4px 6px 14px rgba(0, 0, 0, 0.45);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), z-index 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0 -8px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  user-select: none;
}

.card:hover {
  z-index: 15;
  transform: scale(1.08) rotate(0deg);
  box-shadow: 8px 16px 26px rgba(0, 0, 0, 0.65);
}

.card-photo {
  width: 100%;
  aspect-ratio: 1 / 1.12;
  overflow: hidden;
  border: 1.5px solid #000000;
  background: #111111;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 8px 4px 4px 4px;
  background: #ffffff;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-title {
  margin: 0;
  font-family: "Omori", "Courier New", monospace;
  font-size: 1.05rem;
  font-weight: bold;
  color: #000000;
  line-height: 1.1;
  letter-spacing: -0.2px;
}

.card-subtitle {
  margin: 0;
  font-family: "Omori", "Courier New", monospace;
  font-size: 0.78rem;
  color: #222222;
  line-height: 1.1;
}

.card-add-btn {
  width: 22px;
  height: 22px;
  background: #fdf579;
  border: 1.5px solid #000000;
  font-family: "Omori", "Courier New", monospace;
  font-size: 1.05rem;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 0 2px 0;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

.card-add-btn:hover {
  background: #f9ee42;
  transform: scale(1.1);
}

.bottom-bar {
  position: absolute;
  bottom: 22px;
  left: 32px;
  z-index: 5;
  pointer-events: none;
}

.status-text {
  font-family: "Omori", "Courier New", monospace;
  font-size: 1.15rem;
  color: #39ff14;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.85);
  letter-spacing: 0.5px;
}

/* Reader Modal Overlay */
.reader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: block;
  padding: 0;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  color: #030201;
  background: var(--paper);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.reader.is-open {
  visibility: visible;
  opacity: 1;
}

.reader-inner {
  position: relative;
  width: min(690px, calc(100% - 48px));
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(100px, 15svh, 150px) 0 clamp(60px, 10svh, 100px);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.reader h1 {
  margin: 0 0 clamp(40px, 6vw, 60px);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-align: left;
}

.reader-close {
  position: fixed;
  top: 22px;
  right: 26px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0 0 4px;
  border: 1.5px solid rgba(18, 13, 10, 0.3);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(216, 202, 184, 0.85);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.reader-close:hover,
.reader-close:focus-visible {
  outline: none;
  background: rgba(226, 214, 199, 0.98);
}

.poem-text {
  font-family: "Omori", "Courier New", monospace;
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  line-height: 1.35;
  white-space: pre-wrap;
}

body.reader-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .album-shell {
    padding: 16px 14px 44px 14px;
  }

  .title-text {
    font-size: clamp(2.1rem, 7vw, 3rem);
  }

  .camera-icon {
    font-size: 1.8rem;
  }

  .back-btn {
    padding: 3px 10px;
    font-size: 0.9rem;
  }

  .cards-track {
    justify-content: flex-start;
    padding: 10px 16px;
    gap: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .card {
    width: clamp(160px, 48vw, 200px);
    margin: 0;
    scroll-snap-align: center;
    box-shadow: 3px 5px 10px rgba(0, 0, 0, 0.4);
  }

  .card-add-btn {
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
  }

  .bottom-bar {
    bottom: 14px;
    left: 16px;
    right: 16px;
  }

  .status-text {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
  }

  .reader-close {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }

  .reader-inner {
    width: calc(100% - 32px);
    padding-top: 80px;
  }
}
