/* 우리 여행 모음집 — 레트로 게임 화면
   도트 글꼴 '갈무리'는 11px·22px·33px(갈무리11), 14px(갈무리14)에서만 쓰기 — 그래야 점이 칸에 딱 맞아 또렷하다 */
@font-face { font-family: 'Galmuri11'; src: url(/fonts/Galmuri11.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Galmuri11'; src: url(/fonts/Galmuri11-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Galmuri14'; src: url(/fonts/Galmuri14.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --ink: #1B1B2F; --white: #FFFFFF; --yel: #FFD447; --p1: #FF7AA2; --p2: #4FE0B0;
  --sky: #8ED1FC; --sea: #3E7BFA; --land: #9BD56E; --edge: #3F7F3A; --red: #FF4D5E;
  --dim: #9A9CC0; --soft: #C9CBE8; --slot: #3A3A5A;
}
* { box-sizing: border-box; -webkit-font-smoothing: none; font-synthesis: none; }
html, body { margin: 0; background: var(--sky); }
body {
  font-family: 'Galmuri11', monospace; font-size: 11px; line-height: 16px; color: var(--ink);
  word-break: keep-all; overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }

.app {
  max-width: 430px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: 16px 16px 0; position: relative; display: flex; flex-direction: column; gap: 14px; overflow-x: hidden;
}
.t14 { font-family: 'Galmuri14', monospace; font-size: 14px; line-height: 21px; }
.h22 { font-family: 'Galmuri11', monospace; font-weight: 700; font-size: 22px; line-height: 28px; margin: 0; }
.h33 { font-family: 'Galmuri11', monospace; font-weight: 700; font-size: 33px; line-height: 33px; margin: 0; }
.b { font-weight: 700; }
.yel { color: var(--yel); } .dim { color: var(--dim); } .soft { color: var(--soft); } .pink { color: var(--p1); } .mint { color: var(--p2); }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 창 */
.win {
  background: var(--ink); color: var(--white); border: 3px solid var(--white);
  box-shadow: 0 0 0 3px var(--ink), 5px 5px 0 3px rgba(27, 27, 47, 0.25);
  padding: 10px 12px; position: relative;
}
.win.flush { padding: 0; overflow: hidden; }
.win .sep { border-top: 2px dashed var(--slot); }

/* 버튼 */
.btn {
  font-family: 'Galmuri14', monospace; font-size: 14px; line-height: 21px;
  min-height: 44px; padding: 8px 14px; border: 3px solid var(--ink); background: var(--white); color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.btn:active { box-shadow: 1px 1px 0 var(--ink); translate: 3px 3px; }
.btn.y { background: var(--yel); }
.btn.red { background: var(--red); color: var(--white); }
.btn.big { font-family: 'Galmuri11', monospace; font-weight: 700; font-size: 22px; line-height: 28px; min-height: 58px; width: 100%; }
.btn.small { min-height: 36px; padding: 4px 10px; box-shadow: 3px 3px 0 var(--ink); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.flat { background: transparent; border: none; padding: 6px 0; cursor: pointer; font-family: 'Galmuri11', monospace; font-size: 11px; line-height: 16px; }
.flat.yel { color: var(--yel); }
.win .btn { border-color: var(--white); box-shadow: none; }
.win .btn:active { translate: none; }

/* 메뉴 (전체·국내·해외) */
.menu { display: flex; gap: 16px; }
.menu a {
  display: flex; align-items: center; gap: 6px; padding: 4px 0; text-decoration: none;
  font-family: 'Galmuri14', monospace; font-size: 14px; line-height: 21px; color: var(--dim);
}
.menu a.on { color: var(--white); }
.menu .cur { width: 10px; height: 14px; display: inline-block; }

/* HUD */
.hud { padding: 6px 10px; }
.hud .me { color: var(--yel); }

/* 진행 막대 */
.bar { display: inline-flex; gap: 2px; vertical-align: middle; }
.bar i { width: 8px; height: 10px; background: var(--slot); display: block; }
.bar i.on { background: var(--yel); }

/* 아이템 칸 */
.items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.item { padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.item .num { font-weight: 700; font-size: 22px; line-height: 22px; }

/* 세이브 슬롯 · 목록 */
.slot {
  display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: none;
  border-top: 2px dashed var(--slot); padding: 8px 0; color: var(--white); text-align: left; cursor: pointer; text-decoration: none;
}
.slot:first-of-type { border-top: none; }
.thumb { width: 44px; height: 44px; flex-shrink: 0; border: 2px solid var(--white); background: #2A2A44 center / cover no-repeat; image-rendering: pixelated; }
.thumb.wide { width: 48px; height: 38px; }

/* 지도 */
.sea {
  background-color: var(--sea);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='16' shape-rendering='crispEdges'%3E%3Crect x='4' y='4' width='6' height='2' fill='%236FA0FF'/%3E%3Crect x='19' y='12' width='6' height='2' fill='%236FA0FF'/%3E%3C/svg%3E");
  background-size: 30px 16px;
}
.map { position: relative; }
.map svg { display: block; width: 100%; height: auto; }
.map .land { fill: var(--land); stroke: var(--edge); stroke-width: 0.8px; vector-effect: non-scaling-stroke; }
.map .land.faded { fill: #C7E7A9; stroke: #86AE72; }
.map .tap { cursor: pointer; }
.map .provline { fill: none; stroke: var(--edge); stroke-width: 1.6px; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .vis { fill: none; stroke: var(--white); stroke-width: 1.2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .nophoto { fill: var(--yel); stroke: var(--white); stroke-width: 1.2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .sel { fill: rgba(255, 212, 71, 0.9); stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .inset { fill: none; stroke: var(--white); stroke-width: 1.5px; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.map image { image-rendering: pixelated; pointer-events: none; }
.map .lab { position: absolute; font-size: 11px; line-height: 16px; white-space: nowrap; pointer-events: none; color: #1F4D1F; text-align: center; }
.map .lab.on { background: var(--ink); color: var(--white); }
.map .badge { position: absolute; background: var(--ink); color: var(--yel); padding: 3px 6px; }
.map .badge.tl { left: 8px; top: 8px; color: var(--white); }
.map .badge.br { right: 8px; bottom: 8px; }

/* 칩 */
.chip { background: var(--white); border: 2px solid var(--ink); padding: 3px 8px; display: inline-flex; align-items: center; gap: 4px; }
.win .chip { color: var(--ink); }
.chip button { background: none; border: none; padding: 0 0 0 4px; cursor: pointer; font-size: 11px; }

/* 대화창 */
.dialog { display: flex; gap: 10px; align-items: flex-start; }
.portrait { padding: 4px; border: 2px solid var(--white); flex-shrink: 0; }
.dialog .del { background: none; border: none; color: var(--dim); cursor: pointer; padding: 0 0 0 8px; font-size: 11px; }

/* 사진 */
.photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.photos button { aspect-ratio: 1; border: 2px solid var(--white); padding: 0; background: #2A2A44 center / cover no-repeat; cursor: pointer; position: relative; }
.photos button .star { position: absolute; left: -4px; top: -6px; }
.cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #2A2A44; }
.cover-empty { aspect-ratio: 16 / 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--dim); }

/* 입력 */
.field {
  width: 100%; height: 44px; padding: 0 10px; border: 3px solid var(--white); border-radius: 0; -webkit-appearance: none; appearance: none;
  background: var(--white); color: var(--ink); box-shadow: inset 2px 2px 0 var(--soft);
  font-family: 'Galmuri14', monospace; font-size: 14px; line-height: 21px;
}
select.field { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 10px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 28px; }
.qlabel { display: flex; align-items: center; gap: 6px; color: var(--yel); }
.qlabel .n { background: var(--yel); color: var(--ink); padding: 0 5px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; min-height: 44px; border: 3px solid #5A5C80; background: transparent; color: var(--white); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg button[aria-pressed="true"] { border-color: var(--white); color: var(--ink); }
.seg button.p1[aria-pressed="true"] { background: var(--p1); }
.seg button.p2[aria-pressed="true"] { background: var(--p2); }
.seg button.plain[aria-pressed="true"] { background: var(--yel); }
.newphotos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.newphotos .ph { aspect-ratio: 1; border: 2px solid var(--white); background: #2A2A44 center / cover no-repeat; position: relative; padding: 0; cursor: pointer; }
.newphotos .ph.cover { border-color: var(--yel); }
.newphotos .ph .star { position: absolute; left: -4px; top: -6px; }
.newphotos .add { aspect-ratio: 1; border: 2px dashed var(--dim); background: transparent; color: var(--white); font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* 바닥 장식 · 떠 있는 버튼 */
.ground {
  margin: auto -16px 0; height: 44px; flex-shrink: 0;
  background-color: #9C5B34;
  background-image: linear-gradient(#5BBF4A 0 12px, #3F7F3A 12px 15px, transparent 15px), linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 6px, transparent 6px 12px);
  background-size: 100% 100%, 12px 12px; background-position: 0 0, 0 15px;
}
.spacer { height: 72px; flex-shrink: 0; }
.fab {
  position: fixed; z-index: 20; right: max(16px, calc(50vw - 199px)); bottom: calc(18px + env(safe-area-inset-bottom));
  font-family: 'Galmuri14', monospace; font-size: 14px; line-height: 21px;
  min-height: 52px; padding: 0 16px; background: var(--yel); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.cloud { position: absolute; pointer-events: none; }

/* 모달 · 알림 */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(27, 27, 47, 0.7); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 400px; max-height: 92vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.viewer img { width: 100%; max-height: 62vh; object-fit: contain; background: #000; }
.toast {
  position: fixed; z-index: 60; left: 16px; right: 16px; top: calc(12px + env(safe-area-inset-top)); margin: 0 auto; max-width: 398px;
  background: var(--ink); color: var(--white); border: 3px solid var(--white); box-shadow: 0 0 0 3px var(--ink); padding: 10px 12px;
}
.toast.err { color: var(--yel); }
.loading { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .blink { animation: none; } }
