/* =========================================================
   여행 다이어리 테마 (빈티지 고지도 · 세피아)
   색깔은 여기 :root 에 모아 두었어요. 이 값만 바꾸면 전체 분위기가 바뀝니다.
   (이름이 --sky 인 것들은 예전 하늘색 자리예요. 이름은 그대로 두고 색만 세피아로 바꿨어요)
   ========================================================= */
:root {
  --paper: #f3e9d4;        /* 바탕 종이색 (빛바랜 양피지) */
  --paper-dark: #e4d3b0;   /* 조금 진한 종이색 */
  --card: #fbf6ea;         /* 카드 종이색 */
  --ink: #47331f;          /* 글자색 (진한 갈색 잉크) */
  --ink-soft: #85705a;     /* 흐린 글자 */
  --line: #dfcca6;         /* 테두리 */
  --sky: #c29a66;          /* 포인트 색 (밝은 캐러멜) */
  --sky-dark: #8b5a2e;     /* 진한 포인트 (버튼) */
  --sky-deeper: #6b4220;
  --sky-light: #f1e4c8;    /* 연한 포인트 */
  --accent-rgb: 194, 154, 102; /* 포인트 색을 반투명하게 쓸 때 (r, g, b) */
  --star: #d9982b;
  --danger: #b54a3a;
  --stamp-red: #b3412e;    /* 도장 빨강 */
  --shadow: 0 4px 14px rgba(110, 75, 35, 0.12), 0 1px 3px rgba(110, 75, 35, 0.08);
  --shadow-lift: 0 14px 30px rgba(110, 75, 35, 0.18), 0 3px 8px rgba(110, 75, 35, 0.10);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

/* hidden 표시가 붙은 요소는 꾸미기와 상관없이 항상 숨기기 */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background-color: var(--paper);
  /* 오래된 종이 결(노이즈) + 다이어리의 옅은 점무늬 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.32  0 0 0 0 0.18  0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(rgba(140, 100, 55, 0.09) 1px, transparent 1px);
  background-size: 180px 180px, 18px 18px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =========================================================
   맨 위: 제목
   ========================================================= */
.site-header {
  text-align: center;
  padding: 40px 16px 4px;
  background: linear-gradient(180deg, rgba(228, 207, 168, 0.55) 0%, rgba(243, 233, 212, 0) 100%);
}
.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--sky-dark);
}
.site-header h1 {
  margin: 4px 0 0;
  font-family: "Gaegu", "Gowun Dodum", "Malgun Gothic", sans-serif;
  font-size: 2.8rem;
  line-height: 1.2;
}
.subtitle {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.stats {
  display: inline-flex;
  gap: 14px;
  margin-top: 18px;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.stat-icon {
  font-size: 1.1rem;
  align-self: center;
}
.stat-num {
  font-family: "Gaegu", "Gowun Dodum", sans-serif;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--sky-deeper);
}
.stat-label {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* =========================================================
   3D 지구본
   ========================================================= */
.globe-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 8px;
  text-align: center;
}
.globe-wrap {
  position: relative;
  width: 100%;
  /* 화면 높이의 62%, 폭보다 조금 크게까지, 그래도 300~580px 사이 */
  height: 440px;
  height: clamp(300px, min(62vh, 108vw), 580px);
  overflow: hidden;
  border-radius: var(--radius);
  /* 지구본 뒤로 은은하게 밝아지는 빛 */
  background: radial-gradient(ellipse at 50% 48%, rgba(255, 249, 232, 0.9) 0%, rgba(243, 233, 212, 0) 66%);
}
/* 휴대폰 주소창이 들어갔다 나왔다 해도 크기가 흔들리지 않게 (지원하는 브라우저만) */
@supports (height: 1svh) {
  .globe-wrap {
    height: clamp(300px, min(62svh, 108vw), 580px);
  }
}
.globe {
  position: absolute;
  inset: 0;
  z-index: 0;       /* 핀들이 말풍선·비행기보다 아래에 그려지게 */
  text-align: left; /* 가운데 정렬이 핀 위치를 밀어내지 않게 */
}

/* 이모지 핀 (지구본 위의 점에 압정 끝이 오도록 위로 올려 그려요)
   위치는 globe.gl 이 transform 으로 옮겨 주니까, 출발점은 항상 왼쪽 위(0, 0) */
.globe-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.25s;
}
.globe-pin-emoji {
  position: absolute;
  left: 50%;
  bottom: 9px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 18px;
  line-height: 1;
  background: var(--card);
  border: 2px solid var(--sky-dark);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(70, 45, 20, 0.35);
  transform: translateX(-50%);
  transition: transform 0.15s;
  pointer-events: auto;
}
/* 압정 꼬리 */
.globe-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 11px solid var(--sky-dark);
  transform: translateX(-50%);
  pointer-events: none;
}
.globe-pin:hover .globe-pin-emoji,
.globe-pin:focus-visible .globe-pin-emoji {
  transform: translateX(-50%) scale(1.15);
}
.globe-pin:focus-visible {
  outline: none;
}
.globe-pin:focus-visible .globe-pin-emoji {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.6);
}
/* 지구 뒤편으로 넘어간 핀은 숨기기 */
.globe-pin.is-behind,
.globe-pin.is-behind * {
  opacity: 0;
  pointer-events: none;
}

/* 비행기 */
.plane-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.globe-plane {
  position: absolute;
  left: 0;
  top: 0;
  color: #6b2f17;
  opacity: 0;
  will-change: transform;
  filter: drop-shadow(0 1px 1px rgba(60, 35, 15, 0.35));
}
.globe-plane svg {
  display: block;
  fill: currentColor;
}

/* 나라 위에 마우스를 올렸을 때 이름표 (globe.gl 의 기본 검은 상자를 종이 느낌으로) */
.float-tooltip-kap,
.scene-tooltip {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.globe-country-label {
  padding: 4px 10px;
  font-family: "Gowun Dodum", sans-serif;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

/* ----- 말풍선 ----- */
.globe-bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(270px, calc(100% - 24px));
  transform: translate(-50%, -100%);
  text-align: left;
  transition: opacity 0.2s;
}
.globe-bubble.below {
  transform: translate(-50%, 0);
}
.globe-bubble.is-behind {
  opacity: 0;
  pointer-events: none;
}
.bubble-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
  transform-origin: var(--tail-x, 50%) 100%;
  animation: bubble-pop 0.22s ease-out;
}
.globe-bubble.below .bubble-card {
  transform-origin: var(--tail-x, 50%) 0;
}
/* 말풍선 꼬리 */
.bubble-card::after {
  content: "";
  position: absolute;
  left: var(--tail-x, 50%);
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: var(--card);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}
.globe-bubble.below .bubble-card::after {
  top: -8px;
  bottom: auto;
  transform: translateX(-50%) rotate(225deg);
}
/* 추억 재생 때는 종이가 펼쳐지듯 열려요 */
.bubble-card.replay {
  padding: 16px 18px 14px;
  transform-origin: 50% 0;
  animation: bubble-unfold 0.6s cubic-bezier(0.2, 0.8, 0.3, 1.1);
}
.globe-bubble.below .bubble-card.replay {
  transform-origin: 50% 0;
}
@keyframes bubble-pop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes bubble-unfold {
  0% { opacity: 0; transform: perspective(700px) rotateX(-88deg); }
  60% { opacity: 1; transform: perspective(700px) rotateX(10deg); }
  100% { transform: perspective(700px) rotateX(0); }
}
.bubble-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.bubble-close:hover {
  background: var(--paper);
}
.bubble-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 22px;
}
.bubble-emoji {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  background: var(--sky-light);
  border-radius: 50%;
}
.bubble-city {
  margin: 0;
  font-family: "Gaegu", "Gowun Dodum", sans-serif;
  font-size: 1.4rem;
  line-height: 1.15;
  word-break: keep-all;
}
.bubble-country {
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.bubble-dates {
  align-self: flex-start;
  padding: 2px 10px;
  font-size: 0.8rem;
  color: var(--sky-deeper);
  background: var(--sky-light);
  border-radius: 999px;
}
.bubble-review {
  margin: 0;
  padding-top: 8px;
  border-top: 1.5px dashed var(--line);
  font-size: 0.92rem;
  word-break: keep-all;
}
.bubble-card.replay .bubble-city {
  font-size: 1.6rem;
}

/* 추억 재생 진행 표시 · 안내 문구 */
.replay-progress {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 4;
  margin: 0;
  padding: 4px 16px;
  font-family: "Gowun Batang", serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--card);
  background: rgba(71, 51, 31, 0.82);
  border-radius: 999px;
  transform: translateX(-50%);
  white-space: nowrap;
}
.globe-message {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: min(320px, calc(100% - 32px));
  margin: 0;
  color: var(--ink-soft);
  transform: translate(-50%, -50%);
}

/* 범례 · 나침반 장식 */
.globe-legend {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  pointer-events: none;
}
.globe-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-visited {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(184, 92, 56, 0.82);
  border: 1px solid rgba(104, 72, 40, 0.75);
}
.legend-route {
  width: 18px;
  border-top: 2px dashed rgba(122, 52, 26, 0.9);
}
.compass {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 1;
  width: 64px;
  height: 64px;
  color: rgba(107, 66, 32, 0.42);
  font-family: "Gowun Batang", serif;
  pointer-events: none;
}

.globe-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 6px;
}
.globe-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.replay-btn {
  min-width: 150px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================================================
   여권 도장 "쾅!"
   ========================================================= */
.stamp-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(60, 40, 20, 0.14), rgba(60, 40, 20, 0) 55%);
  animation: stamp-layer-fade 2.1s ease-in forwards;
}
.stamp,
.stamp-bang {
  grid-area: 1 / 1;
}
.stamp {
  --ink: var(--stamp-red);
  position: relative;
  width: min(240px, 62vw);
  aspect-ratio: 1;
  opacity: 0.92;
  mix-blend-mode: multiply;
  transform: rotate(var(--tilt, -8deg));
  animation: stamp-press 0.42s cubic-bezier(0.25, 0.7, 0.3, 1.25) both;
}
/* 찍히는 순간 잉크가 퍼지는 동그라미 */
.stamp::before {
  content: "";
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  animation: ink-splash 0.7s 0.26s ease-out;
}
.stamp-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.stamp-ink circle,
.stamp-ink line {
  fill: none;
  stroke: var(--ink);
}
.stamp-ink text {
  fill: var(--ink);
  font-family: "Gowun Batang", "Gowun Dodum", serif;
  font-weight: 700;
}
.stamp-ring-text {
  letter-spacing: 2px;
}
.stamp-small {
  font-size: 11px;
  letter-spacing: 2px;
}
.stamp-date {
  font-size: 17px;
  letter-spacing: 2px;
}
.stamp-star {
  font-size: 13px;
}
.stamp-emoji {
  font-size: 40px;
}
.stamp-bang {
  font-family: "Gaegu", "Gowun Dodum", sans-serif;
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--stamp-red);
  text-shadow: 2px 2px 0 var(--card), -2px -2px 0 var(--card), 2px -2px 0 var(--card), -2px 2px 0 var(--card);
  transform: translate(min(125px, 34vw), max(-110px, -30vw)) rotate(14deg);
  animation: bang-pop 0.5s 0.24s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
@keyframes stamp-press {
  0% { opacity: 0; transform: rotate(var(--tilt, -8deg)) scale(2.6); filter: blur(6px); }
  60% { opacity: 0.92; transform: rotate(var(--tilt, -8deg)) scale(0.92); filter: blur(0); }
  80% { transform: rotate(var(--tilt, -8deg)) scale(1.04); }
  100% { opacity: 0.92; transform: rotate(var(--tilt, -8deg)) scale(1); }
}
@keyframes ink-splash {
  0% { opacity: 0.22; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(1.35); }
}
@keyframes bang-pop {
  0% { opacity: 0; transform: translate(min(125px, 34vw), max(-110px, -30vw)) rotate(14deg) scale(0.2); }
  100% { opacity: 1; transform: translate(min(125px, 34vw), max(-110px, -30vw)) rotate(14deg) scale(1); }
}
@keyframes stamp-layer-fade {
  0%, 76% { opacity: 1; }
  100% { opacity: 0; }
}
/* 도장이 찍히는 순간 페이지가 살짝 흔들려요 */
body.stamp-shake .site-header,
body.stamp-shake .globe-section,
body.stamp-shake .container {
  animation: page-shake 0.38s ease-out;
}
@keyframes page-shake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 3px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, -1px); }
  100% { transform: translate(0, 0); }
}
/* "움직임 줄이기" 를 켠 사람에게는 조용히 나타났다 사라지기만 */
.stamp-layer.calm .stamp {
  animation: none;
}
.stamp-layer.calm .stamp::before,
.stamp-layer.calm .stamp-bang {
  display: none;
}

/* =========================================================
   전체 폭
   ========================================================= */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 56px;
}

h2 {
  font-family: "Gaegu", "Gowun Dodum", sans-serif;
  font-size: 1.7rem;
  margin: 36px 0 16px;
}
.panel h2 {
  margin-top: 4px;
}
.count {
  font-family: "Gowun Dodum", sans-serif;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* =========================================================
   입력 폼 (다이어리 한 장)
   ========================================================= */
.panel {
  position: relative;
  margin-top: 36px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow);
}
/* 위쪽에 붙인 마스킹테이프 장식 */
.panel::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 120px;
  height: 26px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(201, 168, 118, 0.55);
  border-radius: 3px;
}

form label,
legend {
  display: block;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

input[type="text"],
input[type="date"],
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fffdf7;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.35);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 14px;
}
legend {
  margin-bottom: 6px;
}

/* ----- 별점 ----- */
.stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 2px;
}
.stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.stars label {
  font-size: 2rem;
  line-height: 1;
  color: var(--paper-dark);
  cursor: pointer;
  margin: 0;
  transition: color 0.12s, transform 0.12s;
}
.stars label:hover {
  transform: scale(1.15);
}
.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
  color: var(--star);
}
.stars input:focus-visible + label {
  outline: 2px solid var(--sky-dark);
  border-radius: 6px;
}

/* ----- 이모지 고르기 ----- */
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.emoji-btn {
  font-size: 1.45rem;
  width: 46px;
  height: 46px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fffdf7;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.emoji-btn:hover {
  transform: translateY(-2px);
}
.emoji-btn.selected {
  border-color: var(--sky-dark);
  background: var(--sky-light);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.4);
}

/* 이모지 고르는 영역 전체 (연한 종이 상자) */
.emoji-box {
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}

/* "· 선택됨 🌸" 미리보기 */
.emoji-preview {
  margin-left: 6px;
  color: var(--sky-deeper);
}
.emoji-preview.warn {
  color: var(--danger);
}

/* 종류별 탭 (책갈피 느낌) */
.emoji-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 4px;
  overflow-x: auto;          /* 화면이 좁으면 옆으로 밀어서 보기 */
  scrollbar-width: thin;
}
.emoji-tab {
  flex-shrink: 0;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.emoji-tab:hover {
  color: var(--ink);
  border-color: var(--sky);
}
.emoji-tab.active {
  color: #fff;
  background: var(--sky-dark);
  border-color: var(--sky-dark);
}
.emoji-tab:focus-visible {
  outline: 2px solid var(--sky-deeper);
  outline-offset: 2px;
}

/* 직접 입력 칸 */
.emoji-custom {
  margin: 14px 0 4px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--line);
}
.emoji-custom input {
  max-width: 220px;
  font-size: 1.2rem;
}
.emoji-custom input.selected {
  border-color: var(--sky-dark);
  background: var(--sky-light);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.4);
}
.emoji-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
kbd {
  padding: 0 5px;
  font-family: inherit;
  font-size: 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
}

/* ----- 버튼 ----- */
.buttons {
  display: flex;
  gap: 10px;
}
.btn {
  padding: 11px 22px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fffdf7;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover {
  background: var(--paper);
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  color: #fff;
  background: var(--sky-dark);
  border-color: var(--sky-dark);
  box-shadow: 0 4px 10px rgba(139, 90, 46, 0.3);
}
.btn.primary:hover {
  background: var(--sky-deeper);
}
.btn.primary:disabled:hover {
  background: var(--sky-dark);
}
.btn.small {
  padding: 6px 14px;
  font-size: 0.85rem;
}
.btn.danger {
  color: var(--danger);
}
.btn.danger:hover {
  background: #f8e8e2;
}

.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.3em;
  margin: 0 0 10px;
}

/* =========================================================
   여행 카드
   ========================================================= */
.trip-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* 마우스를 올리면 살짝 떠오르기 */
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}
.card.editing {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.55), var(--shadow);
}
/* 카드 위쪽 띠 (여권 스탬프 느낌) */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--sky);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-emoji {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  font-size: 1.9rem;
  background: var(--sky-light);
  border-radius: 50%;
}
.card-city {
  margin: 0;
  font-family: "Gaegu", "Gowun Dodum", sans-serif;
  font-size: 1.55rem;
  line-height: 1.15;
  word-break: keep-all;
}
.card-country {
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.card-dates {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 12px;
  font-size: 0.85rem;
  color: var(--sky-deeper);
  background: var(--sky-light);
  border-radius: 999px;
}
.card-stars {
  color: var(--star);
  font-size: 1.1rem;
  letter-spacing: 2px;
}
.card-stars .off {
  color: var(--paper-dark);
}
.card-review {
  margin: 2px 0 8px;
  padding-top: 10px;
  border-top: 1.5px dashed var(--line);
  word-break: keep-all;
}
.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: auto;
}

.empty {
  color: var(--ink-soft);
  text-align: center;
  padding: 40px 16px;
  background: rgba(251, 246, 234, 0.6);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
}

/* 움직임을 줄이도록 설정한 사람에게는 애니메이션을 끕니다 */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .card:hover {
    transform: none;
  }
  .bubble-card,
  .bubble-card.replay {
    animation: none;
  }
  body.stamp-shake .site-header,
  body.stamp-shake .globe-section,
  body.stamp-shake .container {
    animation: none;
  }
}

/* =========================================================
   휴대폰 화면 (폭 600px 이하)
   ========================================================= */
@media (max-width: 600px) {
  .site-header {
    padding: 30px 16px 0;
  }
  .site-header h1 {
    font-size: 2.2rem;
  }
  .globe-section {
    padding: 0 8px 4px;
  }
  .compass {
    width: 42px;
    height: 42px;
    top: 8px;
    right: 8px;
  }
  .globe-legend {
    left: 10px;
    bottom: 8px;
    font-size: 0.72rem;
  }
  .globe-pin-emoji {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .replay-progress {
    font-size: 0.85rem;
  }
  .stats {
    gap: 10px;
    margin-top: 14px;
  }
  .stat {
    padding: 8px 16px;
  }
  .stat-num {
    font-size: 1.6rem;
  }
  .panel {
    padding: 24px 18px 20px;
  }
  .row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .emoji-btn {
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
  }
  .emoji-box {
    padding: 12px 10px;
  }
  .emoji-custom input {
    max-width: none;
  }
  .buttons .btn {
    flex: 1;
  }
  .trip-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* 터치 화면(마우스 없음)에서는 손가락으로 누른 뒤 카드가 떠 있는 채로 남지 않게 */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
}
