/* Home page */

/* Section heading */
.intro { width: 1200px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 30px 20px; overflow: hidden; }
.intro h2 { font-size: 56px; line-height: 1.3; white-space: pre; }
.intro p { width: 500px; font-size: 22px; font-weight: 700; text-align: center; white-space: pre-wrap; overflow-wrap: break-word; }

/* Loop album: stickers on a squared page; the tabs on top switch the order */
.loops { width: 1200px; display: flex; flex-direction: column; padding: 20px 20px 10px; overflow-anchor: none; }
.album-tabs { position: relative; z-index: 1; display: flex; gap: 6px; padding-left: 24px; margin-bottom: -3px; }
.album-tab {
  padding: 9px 18px 6px; border: 3px solid #000; border-bottom: 0; border-radius: 14px 14px 0 0; cursor: pointer;
  background: #fbcf6f; color: #000; font: 700 17px/1.2 "Baloo 2", sans-serif; white-space: nowrap;
  transform-origin: bottom; -webkit-tap-highlight-color: transparent;
  transition: padding .42s var(--bounce), background-color .2s, transform .42s var(--bounce);
}
.album-tab[aria-pressed="true"] { padding-top: 13px; background: var(--yellow); }
.album-tab:active { transform: scale(1.06, .88); transition-duration: 80ms; }
.album {
  position: relative; display: flex; flex-direction: column; gap: 22px;
  padding: 24px 24px 0; border: 3px solid #000; border-radius: 22px;
  background-color: var(--paper);
  background-image: linear-gradient(#e4e1da 1px, transparent 1px), linear-gradient(90deg, #e4e1da 1px, transparent 1px);
  background-size: 22px 22px;
}
.album-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.album-jp { font: 900 28px/1.1 "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, "Noto Sans JP", sans-serif; letter-spacing: .02em; }
.album-sub { font: 700 14px/1.2 "Baloo 2", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.loops-grid { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 30px 20px; }

/* Sticker: the loop as a die-cut sticker (white edge, black outline) with a slight tilt that straightens on hover.
   Its number is a tag in the loop's colour stuck on the top-left corner, the heart sits on the bottom-right one. */
.st {
  position: relative; display: block; padding: 8px;
  border: var(--line) solid #000; border-radius: 26px; background: #fff; box-shadow: 4px 7px 0 rgba(0, 0, 0, .16);
  transform: rotate(var(--r, 0deg)); transition: transform .42s var(--bounce), box-shadow .2s;
}
.st[hidden] { display: none; }
/* on hover the sticker straightens and lifts */
@media (hover: hover) { .st:hover { z-index: 1; transform: translateY(-6px) scale(1.04); box-shadow: 6px 12px 0 rgba(0, 0, 0, .14); } }
.st:has(.st-face:active) { transform: scale(1.04, .94); transition-duration: 80ms; }
.st-face { display: block; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #efefef; -webkit-tap-highlight-color: transparent; }
.st-face > video, .st-face > img { width: 100%; height: 100%; object-fit: cover; }
.st-no {
  position: absolute; z-index: 2; left: -10px; top: -12px; rotate: -8deg; padding: 7px 10px 2px; pointer-events: none;
  border: var(--line) solid #000; border-radius: 12px; background: var(--c, var(--yellow)); box-shadow: 0 3px 0 #000;
  font: 400 26px/1 Lalezar, sans-serif; color: #fff; -webkit-text-stroke: 5px #000; paint-order: stroke fill;
}
.st-foot { position: absolute; z-index: 2; right: -8px; bottom: -10px; display: flex; }
/* Holo: a loop that holds a title gets a foil sticker and a ribbon saying which title. The foil shifts by fading
   between two foil layers: an opacity animation runs on the compositor, a moving gradient would repaint every frame */
.st.holo::before, .st.holo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.st.holo::before { background: linear-gradient(115deg, #ffb3e6, #9fdcff 25%, #ffe873 50%, #a6f7c0 75%, #c9a8ff); }
.st.holo::after { background: linear-gradient(65deg, #ffe873, #a6f7c0 25%, #c9a8ff 50%, #ffb3e6 75%, #9fdcff); opacity: 0; will-change: opacity; animation: holo 5s ease-in-out infinite alternate; }
.st.holo > .st-face { position: relative; z-index: 1; }
@keyframes holo { 0%, 30% { opacity: 0; } 100% { opacity: 1; } }
/* the title: a foil band across the top-right corner, cut by the sticker's edge */
.st-sash { position: absolute; z-index: 2; inset: 0; border-radius: 23px; overflow: hidden; pointer-events: none; }
.st-sash > span {
  position: absolute; right: -44px; top: 26px; width: 180px; rotate: 45deg; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 0 3px; border-block: var(--line) solid #000; background: linear-gradient(115deg, #ffb3e6, #9fdcff 30%, #ffe873 55%, #a6f7c0 80%, #c9a8ff);
  font: 800 10px/1 "Baloo 2", sans-serif; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.st-sash svg, .lp-holo svg { flex: none; width: 13px; height: 13px; margin-top: -2px; overflow: visible; }
.lp-holo {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 4px 10px; white-space: nowrap; border: var(--line) solid #000; border-radius: 999px;
  background: linear-gradient(115deg, #ffb3e6, #9fdcff 30%, #ffe873 55%, #a6f7c0 80%, #c9a8ff); font: 800 13px/1.1 "Baloo 2", sans-serif;
}
.st-foot .like { position: static; height: 38px; padding: 0 12px 0 9px; border: var(--line) solid #000; border-radius: 19px; background: #fff; box-shadow: 0 3px 0 #000; }
.st-foot .like.is-empty { padding: 0 8px; }

/* One loop, big: a sticker that grows out of the album (/loop/N) */
html.lp-open { overflow: hidden; }
.lp { position: fixed; inset: 0; z-index: 50; display: grid; justify-items: center; align-content: center; gap: 18px; padding: 20px; background: rgba(246, 246, 246, .9); overscroll-behavior: contain; }
.lp[hidden] { display: none; }
.lp-card {
  position: relative; width: min(480px, 100%); max-height: calc(100vh - 130px); max-height: calc(100svh - 130px); overflow: auto; display: flex; flex-direction: column; gap: 12px;
  padding: 12px; border: 3px solid #000; border-radius: 28px; background: #fff; box-shadow: 0 8px 0 #000;
}
.lp-head { display: flex; align-items: center; gap: 12px; padding: 2px 2px 0; }
.lp-no { position: static; flex: none; rotate: -6deg; }
.lp-title { flex: 1; min-width: 0; padding-top: 6px; font-size: 36px; }
.lp-close {
  position: relative; flex: none; display: grid; place-items: center; width: 46px; height: 46px;
  border: 3px solid #000; border-radius: 50%; background: #fff; cursor: pointer; transition: transform .42s var(--bounce);
}
.lp-close > svg:last-child { width: 18px; height: 18px; }
/* a hat sitting on top of the button, lifted on hover */
.lp-hat { position: absolute; left: 5px; top: -13px; width: 30px; height: 18px; transform-origin: 50% 100%; transition: transform .42s var(--bounce); }
@media (hover: hover) { .lp-close:hover .lp-hat { transform: translateY(-6px) rotate(-10deg); } }
.lp-face { position: relative; aspect-ratio: 1; border: 3px solid #000; border-radius: 18px; overflow: hidden; background: #efefef; touch-action: pan-y; }
.lp-face > video, .lp-face > img { width: 100%; height: 100%; object-fit: cover; }
.lp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* the arrows sit under the card */
.lp-nav { display: flex; gap: 22px; }
.lp-nav .lp-round { width: 56px; height: 56px; box-shadow: 0 5px 0 #000; }
.lp-nav .lp-round svg { width: 24px; height: 24px; }
.lp-btn, .lp-round { border: 3px solid #000; background: #fff; color: #000; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .42s var(--bounce); }
.lp-btn { position: relative; height: 44px; padding: 3px 16px 0; border-radius: 22px; font: 700 16px/1 "Baloo 2", sans-serif; white-space: nowrap; }
.lp-round { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.lp-round svg { width: 20px; height: 20px; }
@media (hover: hover) { .lp-btn:hover, .lp-round:hover { transform: translateY(-3px); } }
.lp-btn:active, .lp-round:active, .lp-close:active { transform: scale(1.08, .86); transition-duration: 80ms; }
.lp-tip { position: absolute; left: 50%; bottom: calc(100% + 8px); padding: 5px 10px 3px; border-radius: 10px; background: #000; color: var(--yellow); font-size: 14px; white-space: nowrap; transform: translateX(-50%); }
/* the heart goes right, big; with no likes yet it says Like */
.lp-like { margin-left: auto; }
.lp-like .like, .lp-like .like.is-empty { position: static; height: 46px; padding: 0 18px 0 14px; border: var(--line) solid #000; box-shadow: none; font-size: 18px; gap: 7px; }
.lp-like .like-n:empty { display: inline; }
.lp-like .like-n:empty::before { content: "Like"; }
.lp-like .like svg { width: 24px; height: 24px; }
.lp-like .like-burst { left: 26px; top: 20px; }
/* Under the album: one pill that opens the rest and closes it again (the arrow turns) */
.loops-foot { width: 100%; display: flex; justify-content: center; padding: 18px 0 40px; }
.loops-toggle {
  display: inline-flex; align-items: center; gap: 12px; padding: 15px 30px 12px; border: var(--line) solid #000; border-radius: 999px;
  background: var(--yellow); color: #000; cursor: pointer; white-space: nowrap; font: 800 17px/1 "Baloo 2", sans-serif;
  letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 5px 0 #000; -webkit-tap-highlight-color: transparent;
  transition: transform .42s var(--bounce);
}
.loops-toggle::after {
  content: ""; width: 9px; height: 9px; margin: -6px 2px 0 0; border-right: 3.5px solid #000; border-bottom: 3.5px solid #000;
  rotate: 45deg; transition: rotate .42s var(--bounce), margin .42s var(--bounce);
}
.loops-toggle[aria-expanded="true"]::after { rotate: -135deg; margin-top: 5px; }
@media (hover: hover) { .loops-toggle:hover { transform: translateY(-3px); } }
.loops-toggle:active { transform: scale(1.08, .88); transition-duration: 80ms; }

/* The walk-off and the loop builder: two stickers side by side (stacked on phones) */
.duo { width: 1200px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 40px 20px 10px; }
.duo-card { position: relative; display: flex; flex-direction: column; padding: 10px; border: var(--line) solid #000; border-radius: 26px; background: #fff; box-shadow: 4px 7px 0 rgba(0, 0, 0, .2); color: #000; text-decoration: none; transition: transform .42s var(--bounce); }
.duo-walk { rotate: -1.5deg; } .duo-build { rotate: 1.5deg; }
@media (hover: hover) { .duo-card:hover { transform: translateY(-6px) scale(1.02); } }
.duo-walk:active { transform: scale(1.03, .95); transition-duration: 80ms; }
.duo-face { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 180px; padding: 18px 22px; border-radius: 18px; overflow: hidden; }
.duo-walk .duo-face { background: #000; color: var(--yellow); }
.duo-build .duo-face { background: #fcc448 url(/media/grid-tile.svg) 0 0 / 15px auto; }
.duo-copy h3 { font-size: 34px; line-height: 1; }
.duo-copy p { margin-top: 6px; font-size: 18px; font-weight: 700; }
.duo-walk .duo-copy h3 { font-size: 46px; }
.duo-walk .duo-copy p { white-space: nowrap; }
/* today's duel on the card: a small label over the situation */
.duo-walk .duo-copy p.duo-today { max-width: 270px; white-space: normal; line-height: 1.25; }
.duo-day { display: block; margin-bottom: 4px; color: #fff; font: 800 13px/1 "Baloo 2", sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.duo-rive { flex: none; width: 140px; height: 170px; }
.duo-rive { opacity: .6; }
.duo-vs { flex: none; display: flex; align-items: center; gap: 6px; }
/* the two loops: videos, or their AVIF images when autoplay is blocked */
.duo-vs > video, .duo-vs > img { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; border: 2px solid var(--yellow); }
.duo-vs > :first-child { rotate: -4deg; } .duo-vs > :last-child { rotate: 4deg; }
.duo-vs b { font: 400 34px/1 Lalezar, sans-serif; color: #fff; -webkit-text-stroke: 4px #000; paint-order: stroke fill; }
/* the loop's walk-off record in the popup */
.lp-duel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 2px; }
.lp-duel[hidden] { display: none; }
.lp-rate { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px 4px; border-radius: 999px; background: #000; color: var(--yellow); font: 800 12px/1 "Baloo 2", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.lp-rate b { font: 400 20px/1 Lalezar, sans-serif; color: #fff; letter-spacing: 0; }
.lp-crown { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 4px 8px; white-space: nowrap; border: var(--line) solid #000; border-radius: 999px; background: var(--yellow); font: 800 13px/1.1 "Baloo 2", sans-serif; }
.lp-crown svg { width: 18px; height: 13px; fill: #fff; stroke: #000; stroke-width: 5; stroke-linejoin: round; overflow: visible; }
.lp-more { padding: 6px 10px 4px; background: #fff; }

@media (min-width: 810px) and (max-width: 1199.98px) {
  .intro, .loops { width: 100%; }
  .loops-grid { gap: 30px 14px; }
  .st { padding: 6px; border-radius: 22px; }
  .st-face { border-radius: 16px; }
  .st-no { left: -8px; top: -10px; padding: 6px 8px 1px; font-size: 22px; -webkit-text-stroke-width: 4px; }
  .st-foot { right: -6px; bottom: -9px; }
  .st-foot .like { height: 34px; padding: 0 10px 0 7px; font-size: 14px; }
  .st-foot .like.is-empty { padding: 0 7px; }
  .st-sash { border-radius: 19px; }
  .st-sash > span { right: -48px; top: 20px; font-size: 8.5px; }
  .st-sash svg { width: 11px; height: 11px; }
  .duo { width: 100%; }
  /* half a tablet is too narrow for the title beside the duel: one centred column, as on phones */
  .duo-walk .duo-face { flex-direction: column; justify-content: center; gap: 14px; padding: 18px 16px 20px; text-align: center; }
  .duo-walk .duo-copy h3 { font-size: 40px; }
  .duo-walk .duo-copy p.duo-today { max-width: none; }
  .duo-copy h3 { font-size: 28px; }
  .duo-rive { width: 120px; height: 150px; }
}

@media (max-width: 809.98px) {
  .intro, .loops { width: 100%; }
  .intro h2 { font-size: 48px; }
  .intro p { width: 100%; font-size: 18px; }
  .loops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 14px; }
  .loops { padding: 20px 14px 10px; }
  .album-tabs { padding-left: 12px; }
  .album-tab { padding: 8px 12px 5px; font-size: 15px; }
  .album-tab[aria-pressed="true"] { padding-top: 11px; }
  .album { gap: 18px; padding: 18px 12px 0; }
  .album-jp { font-size: 22px; }
  .album-sub { font-size: 12px; }
  .st { padding: 6px; border-radius: 22px; }
  .st-face { border-radius: 16px; }
  .st-no { left: -8px; top: -10px; padding: 6px 8px 1px; font-size: 21px; -webkit-text-stroke-width: 4px; }
  .st-foot { right: -6px; bottom: -9px; }
  .st-foot .like { height: 34px; padding: 0 10px 0 7px; font-size: 14px; }
  .st-foot .like.is-empty { padding: 0 7px; }
  .st-sash { border-radius: 19px; }
  .st-sash > span { right: -48px; top: 20px; font-size: 8.5px; }
  .st-sash svg { width: 11px; height: 11px; }
  .lp { padding: 12px; }
  .lp-title { font-size: 30px; }
  .loops-toggle { padding: 13px 24px 10px; font-size: 15px; }
  .duo { width: 100%; grid-template-columns: 1fr; gap: 22px; padding: 30px 16px 0; }
  .duo-face { min-height: 140px; padding: 14px 16px; }
  .duo-copy h3 { font-size: 26px; }
  /* the walk-off card stacks on one centred axis: title, today's duel, then the two loops big */
  .duo-walk .duo-face { flex-direction: column; justify-content: center; gap: 16px; padding: 20px 14px 22px; text-align: center; }
  .duo-walk .duo-copy p.duo-today { max-width: none; }
  .duo-walk .duo-copy h3 { font-size: 38px; white-space: nowrap; }
  .duo-copy p { font-size: 15px; }
  .duo-rive { width: 100px; height: 130px; }
  .duo-vs { gap: 8px; }
  .duo-vs > video, .duo-vs > img { width: 112px; height: 112px; border-radius: 14px; }
  .duo-vs b { font-size: 34px; -webkit-text-stroke: 4px #000; }
}
