:root {
  --paper: #fdfcf8;
  --ink: #231f1c;
  --ink-soft: #7b7064;
  --ink-rule: #d5cbb9;
  --accent-red: #e85545;
  --accent-yolk: #ffd23f;
  --font-jp: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  background-color: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  font-family: var(--font-jp);
  position: relative;
  overflow-x: hidden;
}

/* Ultra-subtle warm drawing paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ========== Centered Header ========== */
.site-header {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 42px 48px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-title {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 70ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

.brand:hover {
  transform: translateY(-1px) scale(1.018);
}

.brand:active {
  transition-duration: 40ms;
  transform: translateY(1px) scale(0.985);
}

.brand:focus-visible {
  outline: 3px solid var(--accent-red);
  outline-offset: 8px;
  border-radius: 14px;
}

.brand-emblem {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  margin-bottom: 5px;
  overflow: visible;
  transform-origin: 50% 80%;
  transition: transform 140ms cubic-bezier(0.2, 1.35, 0.4, 1);
}

.brand:hover .brand-emblem {
  animation: mascot-wiggle 320ms cubic-bezier(0.25, 1.3, 0.4, 1) forwards;
}

.brand-emblem .flag-group {
  transform-origin: 21px 13px;
  transition: transform 160ms cubic-bezier(0.2, 1.35, 0.4, 1);
}

.brand:hover .brand-emblem .flag-group {
  transform: rotate(11deg);
}

@keyframes mascot-wiggle {
  0%   { transform: rotate(0deg) translateY(0); }
  35%  { transform: rotate(-6deg) translateY(-2px); }
  70%  { transform: rotate(3deg) translateY(-1px); }
  100% { transform: rotate(-2deg) translateY(-1px); }
}

.brand-wordmark {
  height: 54px;
  width: auto;
  display: block;
  overflow: visible;
}

/* ========== Main Gallery Shelf ========== */
.stage {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 48px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shelf {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 48px 40px;
}

/* Oink-style flat color-block tile + Neal.fun snappy press */
.game-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  width: 320px;
  max-width: 100%;
  outline: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 70ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* Day 1 single-piece gallery proportion */
.game-tile:only-child {
  width: min(100%, 510px);
}

/* Snappy 40ms click squish */
.game-tile:active {
  transition-duration: 40ms;
  transform: translateY(1px) scale(0.982);
}

.game-tile:focus-visible .tile-block {
  outline: 3px solid var(--accent-red);
  outline-offset: 6px;
}

.tile-block {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 16px;
  background-color: var(--tile-color, var(--accent-yolk));
  overflow: hidden;
  isolation: isolate;
}

/* Oink luminous hover veil */
.tile-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transition: opacity 100ms ease;
}

.game-tile:hover .tile-block::after {
  opacity: 0.13;
}

/* Subtle warm tonal spotlight circle inside the flat color block */
.tile-glow {
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 52%;
  top: 53%;
  transform: translate(-50%, -50%);
  background: rgba(255, 249, 224, 0.24);
  pointer-events: none;
  z-index: 0;
}

/* Default artwork layout for future single-image games */
.art-hero {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82%;
  height: auto;
  max-height: 82%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 100ms cubic-bezier(0.2, 0.9, 0.3, 1);
  filter: drop-shadow(0 8px 0 rgba(88, 44, 20, 0.07));
}

.game-tile:hover .art-hero {
  transform: translate(-50%, calc(-50% - 6px)) rotate(-1.2deg);
}

/* Omrice custom composition: star-eyed judge tucked cleanly behind the plate rim */
.art-chef {
  position: absolute;
  left: 12.2%;
  top: 11.4%;
  width: 32.5%;
  height: auto;
  z-index: 1;
  pointer-events: none;
  transform: rotate(-5.5deg);
  transform-origin: bottom center;
  transition: transform 100ms cubic-bezier(0.2, 0.9, 0.3, 1);
  filter: drop-shadow(0 4px 0 rgba(74, 37, 17, 0.07));
}

.game-tile:hover .art-chef {
  transform: translateY(-9px) rotate(-9deg) scale(1.03);
}

/* Omrice hero artwork: sleeve bleeds past right edge; right-anchored pivot prevents exposing cut edge */
.art-omrice {
  position: absolute;
  right: -2.2%;
  bottom: 4.5%;
  width: 92%;
  height: auto;
  z-index: 2;
  pointer-events: none;
  transform-origin: right 22%;
  transition: transform 100ms cubic-bezier(0.2, 0.9, 0.3, 1);
  filter: drop-shadow(0 8px 0 rgba(88, 44, 20, 0.07));
}

.game-tile:hover .art-omrice {
  transform: translateY(-8px) rotate(-1.2deg) scale(1.015);
}

/* Cream-white hand-drawn joy rays & sparkle accents inside the color block */
.tile-doodles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  transition: transform 100ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

.game-tile:hover .tile-doodles {
  transform: translateY(-3px) scale(1.02);
}

/* Title ONLY below the color block + hand-drawn ketchup-red wave */
.tile-caption {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.tile-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.35;
  color: var(--ink);
}

.title-wave {
  width: 62px;
  height: 8px;
  display: block;
  overflow: visible;
  opacity: 0.9;
  transition: transform 100ms cubic-bezier(0.2, 0.9, 0.3, 1), opacity 100ms ease;
}

.game-tile:hover .title-wave {
  transform: scaleX(1.16);
  opacity: 1;
}

/* ========== Minimal Footer: Wavy Hairline + Peeking Smiley Buddy ========== */
.site-footer {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 48px 32px;
}

.footer-rule-wrap {
  position: relative;
  width: 100%;
  height: 44px;
  display: flex;
  align-items: flex-end;
}

.footer-wave-rule {
  width: 100%;
  height: 8px;
  display: block;
  overflow: visible;
}

.footer-doodle {
  position: absolute;
  right: 12%;
  bottom: 0;
  width: 68px;
  height: 44px;
  pointer-events: none;
  overflow: visible;
}

/* Subtle natural blink on footer smiley buddy */
.doodle-eye-lid {
  transform-origin: center;
  transform-box: fill-box;
  animation: gentle-blink 5.4s infinite;
}

@keyframes gentle-blink {
  0%, 94%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(0.12); }
}

.footer-copy {
  margin-top: 14px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  user-select: none;
}

/* ========== Responsive Mobile (390×844) ========== */
@media (max-width: 640px) {
  .site-header {
    padding: 34px 22px 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand-emblem {
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
  }

  .brand-wordmark {
    height: 44px;
  }

  .stage {
    padding: 14px 22px 32px;
  }

  .game-tile:only-child {
    width: 100%;
  }

  .tile-block {
    border-radius: 15px;
  }

  .tile-caption {
    margin-top: 20px;
  }

  .tile-title {
    font-size: 1.18rem;
  }

  .title-wave {
    width: 56px;
  }

  .site-footer {
    padding: 6px 22px 28px;
  }

  .footer-rule-wrap {
    height: 38px;
  }

  .footer-doodle {
    right: 10%;
    width: 58px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doodle-eye-lid,
  .brand:hover .brand-emblem {
    animation: none !important;
  }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
