:root {
  --pastel-red: #ffd6d6;
  --pastel-yellow: #fff6bf;
  --pastel-blue: #d6eaff;
  --pastel-green: #d7ffd6;
  --text: #1b1b1b;
  --white: #ffffff;
  --rx: 15vmin; /* horizontal radius from center */
  --ratio: 4/3; /* diamond height:width ratio */
  --ry: calc(var(--rx) * var(--ratio)); /* vertical radius from center */
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  overflow: hidden; /* avoid vertical scrollbar on mobile */
}

#app {
  height: 100vh; /* fallback */
  display: flex;
  flex-direction: column;
}

/* Use dynamic viewport units where supported to account for mobile UI chrome */
@supports (height: 100dvh) {
  #app { height: 100dvh; }
}
@supports (height: 100svh) {
  #app { height: 100svh; }
}

.header {
  padding: 12px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.meta {
  display: flex;
  gap: 12px;
  font-size: 14px;
}

.viewer {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative; /* for bottom-positioned hints */
}

/* Board for four separate diamonds */
.diamond-board {
  position: relative;
  width: 90vmin;
  height: 90vmin;
}

.mini-diamond {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  aspect-ratio: 3 / 4; /* taller than wide */
}

.diamond-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.diamond-text {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-weight: 700;
  font-size: clamp(28.8px, 7.2vw, 52.8px);
  fill: var(--text);
}



.pos-top { transform: translate(-50%, -50%) translateY(calc(-1 * var(--ry))); }

.pos-right { transform: translate(-50%, -50%) translateX(var(--rx)); }

.pos-bottom { transform: translate(-50%, -50%) translateY(var(--ry)); }

.pos-left { transform: translate(-50%, -50%) translateX(calc(-1 * var(--rx))); }

/* Background theme classes */
.bg-red { background: var(--pastel-red); }
.bg-yellow { background: var(--pastel-yellow); }
.bg-blue { background: var(--pastel-blue); }
.bg-green { background: var(--pastel-green); }

/* Click zones for navigation */
.nav-zone {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 50vw;
  z-index: 2;
}
.nav-left { left: 0; }
.nav-right { right: 0; }

/* Subtle navigation hints within viewer */
.nav-hints {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  font-size: 5vmin;
  color: rgba(0, 0, 0, 0.5); /* light gray */
  pointer-events: none; /* don't block clicks/swipes */
}

/* Variant: place nav-hints at the top and center text */
.nav-hints.top {
  top: calc(12px + env(safe-area-inset-top));
  bottom: auto;
  justify-content: center;
}

@media (max-width: 430px) {
    :root {
        --rx: 20vmin;
    }
    .mini-diamond {
        width: 50%;
        height: 50%;
    }
}