:root {
  --sky: #ffeaf0;
  --ink: #5c3a42;
  --paper: #fffaf0;
  --pink: #ff7fa8;
  --mint: #62c9a2;
  --font: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #ffd5e0;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 800;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#app { position: relative; background: var(--sky); overflow: hidden; touch-action: manipulation; }
#game { display: block; width: 100%; height: 100%; touch-action: none; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; }
.dim { background: rgba(92, 58, 66, 0.35); justify-content: center; }

#title { justify-content: space-between; padding: 92px 0 44px; background: rgba(255, 245, 248, 0.3); }
.title-top, .title-bottom { display: flex; flex-direction: column; align-items: center; width: 100%; }
.faces { display: flex; gap: 8px; align-items: flex-end; }
.faces img { width: 78px; height: 84px; object-fit: contain; }
.bob { animation: bob 1.3s ease-in-out infinite; }
.bob.late { animation-delay: -0.65s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

h1 {
  margin: 16px 16px 0;
  font-size: 44px;
  line-height: 1.15;
  color: var(--pink);
  text-shadow: 3px 3px 0 #fff, 5px 5px 0 rgba(92, 58, 66, 0.25);
  white-space: nowrap;
  text-align: center;
}
.sub { margin: 12px 0 0; font-size: 16px; text-align: center; padding: 0 16px; }
.best { margin: 0 0 14px; font-size: 15px; color: #e08a00; }
.title-bottom .btn { width: calc(100% - 80px); }

.btn {
  display: block;
  min-height: 52px;
  padding: 8px 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  color: #fff;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.14);
}
.btn:active { transform: translateY(2px); }
.btn.pink { background: var(--pink); }
.btn.mint { background: var(--mint); }

.vs { margin: 0 0 10px; font-size: 15px; color: #e08a00; text-align: center; padding: 0 16px; }
.panel .vs { margin: 0; }
.panel .vs.win { color: #e0527f; }
.toast { position: absolute; left: 50%; top: 80px; transform: translateX(-50%); z-index: 30; margin: 0; max-width: calc(100% - 32px);
  padding: 10px 16px; background: rgba(92, 58, 66, 0.92); color: #fff; font-size: 15px; text-align: center; word-break: break-all; border-radius: 10px; }

.link { margin-top: 16px; background: none; border: 0; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; padding: 6px 10px; }
.links { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; }
.links a { color: rgba(92, 58, 66, 0.65); text-decoration: none; }

.panel {
  width: calc(100% - 40px);
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.panel .mascot { width: 96px; height: 96px; object-fit: contain; }
.panel h2 { margin: 0; font-size: 24px; color: var(--pink); }
.panel p { margin: 0; font-size: 17px; white-space: pre-line; line-height: 1.45; }
.panel .btn { width: 100%; }

.sound { position: absolute; top: 12px; right: 12px; width: 56px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 5; }
.sound img { width: 44px; height: 33px; display: block; margin: 0 auto; filter: drop-shadow(0 0 1px rgba(92, 58, 66, 0.35)); }
.sound:active img { transform: translateY(2px); }

.skip { position: absolute; right: 10px; padding: 6px 10px; border: 0; border-radius: 8px; background: rgba(92, 58, 66, 0.7); color: #fff; font: inherit; font-size: 12px; cursor: pointer; z-index: 5; }

.rail { display: none; }
.mbanner { position: fixed; left: 0; right: 0; bottom: env(safe-area-inset-bottom); height: 58px; display: flex; align-items: center; justify-content: center; }
body:not(.no-ads) { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
body.no-ads .mbanner { display: none; }
@media (min-width: 900px) and (min-height: 640px) {
  body:not(.no-ads) { gap: 40px; padding-bottom: env(safe-area-inset-bottom); }
  .mbanner { display: none; }
  body:not(.no-ads) .rail { display: flex; align-items: center; justify-content: center; flex: 0 0 160px; width: 160px; height: 600px; }
}
