html, body {
  height: 100%;
  margin: 0;
}

body {
  background: #000;
  overflow: hidden;
  touch-action: none;
}

.app {
  width: 100vw;
  height: 100vh;
}

.grid {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.cell {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  touch-action: none;
}

.cell[data-col="0"] {
  box-shadow: inset -1px 0 0 #000;
}

.cell[data-row="0"] {
  box-shadow: inset 0 -1px 0 #000;
}

.cell[data-row="0"][data-col="0"] {
  box-shadow: inset -1px 0 0 #000, inset 0 -1px 0 #000;
}

.cell:focus {
  outline: none;
}

.cell-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

.cell-title,
.panel-title {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.48);
  color: rgba(255, 255, 255, 0.95);
  font: 600 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0.2px;
  text-align: left;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

.slider {
  position: absolute;
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
}

.menu {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  pointer-events: auto;
}

.menu-btn {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 0;
  background: #7c3aed;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(.2,.8,.2,1), box-shadow 180ms ease;
}

.menu-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
}

.menu.is-open .menu-btn {
  transform: scale(1);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.menu-items {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.menu-item {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.9);
  color: rgba(255, 255, 255, 0.96);
  display: grid;
  place-items: center;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}

.menu.is-open .menu-item {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.menu-item--tl { left: -10px; top: -10px; }
.menu-item--tr { right: -10px; top: -10px; }
.menu-item--bl { left: -10px; bottom: -10px; }
.menu-item--br { right: -10px; bottom: -10px; }

.menu.is-open .menu-item--tl { transform: translate(-36px, -36px) scale(1); }
.menu.is-open .menu-item--tr { transform: translate(36px, -36px) scale(1); }
.menu.is-open .menu-item--bl { transform: translate(-36px, 36px) scale(1); }
.menu.is-open .menu-item--br { transform: translate(36px, 36px) scale(1); }

.menu-item:focus {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.strip {
  height: 100%;
  display: flex;
  will-change: transform;
}

.strip.vertical {
  width: 100%;
  flex-direction: column;
}

.panel {
  position: relative;
  height: 100%;
  flex: 0 0 auto;
}

.panel--vline {
  box-shadow: inset -1px 0 0 #000;
}

.panel--hline {
  box-shadow: inset 0 -1px 0 #000;
}

.panel.vertical {
  width: 100%;
  height: auto;
  flex: 0 0 auto;
}

.panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal-card {
  position: absolute;
  inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: #0f0f10;
  color: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 24px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
}

.modal-img {
  width: 100%;
  height: min(55vh, 520px);
  object-fit: cover;
  background: #000;
  display: block;
  user-select: none;
}

.modal-body {
  padding: 16px 16px 18px;
  overflow: auto;
}

.modal-title {
  font: 600 18px/1.25 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin-bottom: 8px;
}

.modal-desc {
  font: 400 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: rgba(255, 255, 255, 0.78);
}

