/* 404 · smutná krabička */
.page-404 { background: var(--cream); }
.e404 { min-height: calc(100vh - var(--bar-h) - 44px); display: flex; align-items: center; padding: 40px 0 64px; overflow: hidden; }
.e404__in { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
@media (max-width: 820px) { .e404__in { grid-template-columns: 1fr; gap: 16px; text-align: center; } .e404__in .btn-row { justify-content: center; } .e404__text p { margin-left: auto; margin-right: auto; } }

.e404__art { position: relative; display: flex; flex-direction: column; align-items: center; padding-bottom: 40px; }
.sadbox { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 20px; touch-action: manipulation; }
.sadbox__svg { width: min(300px, 62vw); height: auto; overflow: visible; }
.sadbox__body { transform-origin: 106px 270px; animation: lookAround 4.8s ease-in-out infinite; }
@keyframes lookAround { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 50% { transform: rotate(0); } 75% { transform: rotate(6deg); } }
.sadbox__eye { transition: transform .4s; transform-box: fill-box; transform-origin: center; transform: translateY(2px); }
.sadbox__plus { transform-box: fill-box; transform-origin: center; transition: transform .4s; transform: scale(.8); }
.sadbox.is-happy .sadbox__body { animation: hop .6s ease, lookAround 6s ease-in-out .6s infinite; }
.sadbox.is-happy .sadbox__eye { transform: none; }
.sadbox.is-happy .sadbox__plus { transform: none; animation: wink .25s ease .6s 2; }
@keyframes wink { 50% { transform: scaleY(.1); } }
@keyframes hop { 40% { transform: translateY(-14px) rotate(-3deg); } 70% { transform: translateY(0) rotate(2deg); } }

.e404__floor { position: absolute; bottom: 30px; width: 70%; height: 22px; border-radius: 50%; background: radial-gradient(closest-side, rgba(120, 80, 0, .25), rgba(120, 80, 0, 0)); }
.e404__pill { position: absolute; bottom: 30px; left: 50%; animation: roll 7s ease-in-out infinite; }
.e404__pill .capsule { width: 46px; height: 18px; display: block; animation: spin 7s ease-in-out infinite; }
@keyframes roll { 0%, 100% { transform: translateX(-150px); } 50% { transform: translateX(110px); } }
@keyframes spin { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(720deg); } }

.e404__num {
  font-family: var(--f-head); font-weight: 800; font-size: clamp(6rem, 18vw, 11rem); line-height: .9; letter-spacing: -.04em;
  color: var(--sun); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; margin: 0 0 12px !important;
  text-shadow: 8px 8px 0 var(--sun-soft);
}
.e404 h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
.e404__msg { font-size: 1.12rem; color: var(--ink-soft); min-height: 3.4em; }
.e404 .btn-row { margin: 8px 0 20px; }
.e404__small { font-size: .9rem; color: var(--ink-soft); }
.e404__hint { font-family: var(--f-hand); font-size: 1.5rem; color: var(--amber-text); margin-top: 8px; transition: opacity .4s; }
.is-cheered .e404__hint { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .sadbox__body, .e404__pill, .e404__pill .capsule { animation: none !important; }
}
