:root {
  color-scheme: light;
  --ink: #2f2635;
  --muted: #7a6c77;
  --line: #ead9d4;
  --paper: #fff8f6;
  --rose: #f06f9f;
  --coral: #f06d4f;
  --mint: #d9ddb2;
  --sky: #cdddea;
  --green: #244b35;
  --plum: #5a336e;
  --sun: #f5c86e;
  --brand-gradient: linear-gradient(160deg, #f4618e 0%, #d84b9d 48%, #8c45bb 100%);
  --brand-shadow: 0 10px 22px rgba(216, 75, 157, 0.24);
  --active-mood-color: #f5c84b;
  --shadow: 0 18px 50px rgba(91, 52, 78, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 12% 16%, rgba(240, 109, 79, 0.2), transparent 27%),
    radial-gradient(circle at 86% 10%, rgba(240, 111, 159, 0.22), transparent 24%),
    radial-gradient(circle at 72% 88%, rgba(36, 75, 53, 0.16), transparent 28%),
    linear-gradient(135deg, #fff4f1, #f7e8ee 42%, #edf1df 100%);
  color: var(--ink);
  font-family: Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone {
  position: relative;
  width: min(430px, 100vw);
  height: min(860px, 100vh);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(36, 33, 38, 0.08);
  box-shadow: var(--shadow);
}

.topbar {
  height: 86px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 12px;
  align-items: center;
  padding: 16px 18px 8px;
  background: rgba(255, 248, 246, 0.92);
  backdrop-filter: blur(16px);
  z-index: 5;
  position: relative;
}

.eyebrow,
.topbar h1,
.hero h2,
.hero p,
.screen h2,
.screen p {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.topbar h1 {
  margin-top: 2px;
  font-size: 22px;
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fffdfb;
  color: var(--ink);
  font-size: 24px;
}

.notification-button {
  visibility: hidden;
  overflow: visible;
}

.phone.home-mode .notification-button {
  visibility: visible;
}

.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: 74px;
  right: 14px;
  z-index: 12;
  width: min(330px, calc(100% - 28px));
  display: none;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(234, 217, 212, 0.9);
  border-radius: 8px;
  background: rgba(255, 248, 246, 0.96);
  box-shadow: 0 18px 42px rgba(47, 38, 53, 0.18);
  backdrop-filter: blur(16px);
}

.notification-panel.open {
  display: grid;
}

.phone:not(.home-mode) .notification-panel {
  display: none;
}

.notification-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 2px 2px 6px;
}

.notification-header strong {
  font-size: 15px;
}

.notification-header span {
  color: #9a6d81;
  font-size: 11px;
  font-weight: 900;
}

.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: start;
  border: 1px solid rgba(234, 217, 212, 0.72);
  border-radius: 8px;
  background: #fffdfb;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.notification-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.notification-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.notification-empty {
  margin: 4px 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.notification-dot {
  --mood-color: var(--active-mood-color);
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--mood-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mood-color) 18%, transparent);
}

.notification-dot.bracelet {
  position: relative;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--mood-color);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--mood-color) 34%, transparent);
  transform: rotate(-45deg);
}

.notification-dot.bracelet::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}

.screen {
  display: none;
  height: calc(100% - 158px);
  overflow: auto;
  padding: 18px;
}

.screen.active {
  display: block;
}

.phone.alert-mode .tabbar {
  display: none;
}

.phone.alert-mode .screen.active {
  height: calc(100% - 86px);
}

.bracelet-alert {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  text-align: center;
  padding: 24px 8px;
}

.bracelet-alert-stage {
  position: relative;
  width: min(280px, 82vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.bracelet-alert-stage::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(245, 200, 110, 0.46), transparent 58%),
    radial-gradient(circle, rgba(240, 111, 159, 0.26), transparent 68%);
  animation: alertPulse 1.45s ease-in-out infinite;
}

.bracelet-alert-stage img {
  position: relative;
  z-index: 1;
  width: 88%;
  max-height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 22px 26px rgba(47, 38, 53, 0.18));
  animation: alertBraceletShake 0.72s ease-in-out infinite;
}

.bracelet-alert-copy {
  display: grid;
  gap: 8px;
}

.bracelet-alert-copy h2 {
  max-width: 310px;
  font-size: 24px;
  line-height: 1.32;
}

.bracelet-alert-copy p {
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
}

.bracelet-alert .primary-action {
  width: min(310px, 100%);
}

.hero {
  min-height: 210px;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(47, 38, 53, 0.2), rgba(240, 109, 79, 0.18)),
    url("assets/home-withee-hero.png") center/cover;
  color: white;
}

.hero-copy {
  display: none;
}

.hero p {
  font-size: 13px;
  margin-bottom: 8px;
}

.hero h2 {
  font-size: 25px;
  line-height: 1.28;
}

.hero-pin,
.memory-pin {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50% 50% 50% 8px;
  background: linear-gradient(145deg, var(--rose), var(--coral));
  transform: rotate(-45deg);
  box-shadow:
    0 0 0 10px rgba(240, 111, 159, 0.18),
    0 0 30px rgba(240, 109, 79, 0.56);
}

.memory-pin::after,
.hero-pin::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  inset: 13px;
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 0 0 4px #ffd7df;
}

.hero-pin {
  position: relative;
  flex: 0 0 auto;
  margin: 0 6px 24px 16px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.quick-card {
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
  color: var(--ink);
  font-weight: 700;
}

.quick-card span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f2f0dc;
  color: var(--green);
}

.quick-card.highlight {
  background: #fff0f1;
  border-color: #f5c4cf;
}

.quick-card[data-go="pin"] {
  display: none;
}

.memory-strip,
.friend-header,
.my-album-section,
.pin-panel,
.band-card,
.upload-box,
.form-stack {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
  padding: 14px;
}

.memory-strip {
  display: flex;
  gap: 14px;
  align-items: center;
}

.memory-strip img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 8px;
}

.memory-empty {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px dashed #d8cfc8;
  border-radius: 8px;
  background: #fffdfb;
}

.memory-empty::before {
  content: "사진 없음";
  color: #8f8490;
  font-size: 12px;
  font-weight: 800;
}

.memory-strip p,
.pin-panel p,
.friend-header p,
.band-card p,
.ar-ready p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.upload-box {
  display: grid;
  gap: 14px;
}

.upload-preview {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: #f3eee8;
}

.upload-preview img,
.pin-editor img,
.memo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-photo,
.memo-photo-placeholder,
.album-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px dashed #dcc8bf;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(217, 221, 178, 0.28), rgba(240, 111, 159, 0.1)),
    #fffdfb;
  color: #8f8490;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  padding: 16px;
}

#uploadedImage,
#pinPhoto,
#memoPhoto {
  width: 100%;
  height: 100%;
}

#pinPhoto {
  position: absolute;
  inset: 0;
}

#uploadedImage img,
#pinPhoto img,
#memoPhoto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.primary-action,
.small-button {
  border: 0;
  border-radius: 8px;
  background: var(--brand-gradient);
  color: white;
  padding: 14px 16px;
  text-align: center;
  font-weight: 800;
  box-shadow: var(--brand-shadow);
}

.primary-action input {
  display: none;
}

.primary-action.large {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
}

.form-stack {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
  color: var(--ink);
  padding: 13px 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.mood-picker {
  display: grid;
  gap: 8px;
}

.mood-picker > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mood-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mood-button {
  --mood-color: #f5c86e;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(234, 217, 212, 0.9);
  border-radius: 999px;
  background: #fffdfb;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
}

.mood-button span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--mood-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mood-color) 18%, transparent);
}

.mood-button.active {
  border-color: color-mix(in srgb, var(--mood-color) 62%, white);
  background: color-mix(in srgb, var(--mood-color) 12%, white);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--mood-color) 16%, transparent);
}

[data-mood="excited"] {
  --mood-color: #8b45bb;
}

[data-mood="happy"] {
  --mood-color: #f5c84b;
}

[data-mood="soso"] {
  --mood-color: #5fbf7a;
}

[data-mood="sad"] {
  --mood-color: #4f8fe8;
}

[data-mood="angry"] {
  --mood-color: #f05a5a;
}

.pin-editor {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
  background: #f2e6e1;
  cursor: crosshair;
  touch-action: none;
}

.placed {
  position: absolute;
  left: 58%;
  top: 43%;
  width: 84px;
  height: 102px;
  border-radius: 0;
  background: url("assets/ar-red-pin.png") center/contain no-repeat;
  box-shadow: none;
  cursor: grab;
  touch-action: none;
  transform: translate(-50%, -88%);
  transition:
    left 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    top 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 160ms ease;
  will-change: left, top, transform;
  z-index: 2;
}

.placed.dragging {
  cursor: grabbing;
  transform: translate(-50%, -88%) scale(1.04);
  transition: transform 120ms ease;
}

.placed::after {
  display: none;
}

.pin-bubble {
  position: absolute;
  left: 58%;
  top: 43%;
  z-index: 4;
  max-width: min(250px, 76%);
  padding: 12px 14px;
  border: 1px solid rgba(234, 217, 212, 0.92);
  border-radius: 14px;
  background: rgba(255, 248, 246, 0.94);
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(47, 38, 53, 0.18);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-16%, -128%) scale(0.96);
  transition: opacity 160ms ease, transform 160ms ease;
}

.pin-bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: inherit;
  border-right: 1px solid rgba(234, 217, 212, 0.92);
  border-bottom: 1px solid rgba(234, 217, 212, 0.92);
  transform: rotate(45deg);
}

.pin-bubble.open {
  opacity: 1;
  transform: translate(-16%, -138%) scale(1);
}

.pin-panel {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.ar-ready {
  height: 100%;
  display: grid;
  align-content: center;
  text-align: center;
}

.radar {
  width: 230px;
  height: 230px;
  margin: 0 auto 24px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdfb 0 20%, #f2f0dc 21% 100%);
  overflow: hidden;
}

.radar span {
  position: absolute;
  border: 1px solid rgba(36, 75, 53, 0.26);
  border-radius: 50%;
  inset: calc(var(--i, 0) * 36px);
}

.radar span:nth-child(1) {
  --i: 1;
}

.radar span:nth-child(2) {
  --i: 2;
}

.radar span:nth-child(3) {
  --i: 3;
}

.radar-pin {
  position: relative;
  width: 92px;
  height: 112px;
  border-radius: 0;
  background: url("assets/ar-red-pin.png") center/contain no-repeat;
  box-shadow: none;
  transform: none;
  animation: floatPin 1.8s ease-in-out infinite;
}

.radar-pin::after {
  display: none;
}

.ar-screen {
  position: relative;
  height: calc(100% - 86px);
  padding: 0;
  background: #15151a;
}

.ar-screen video,
.camera-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ar-screen video.front-camera {
  transform: scaleX(-1);
}

.ar-screen video.back-camera {
  transform: scaleX(1);
}

.camera-fallback {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.74);
  background:
    linear-gradient(rgba(22, 25, 29, 0.12), rgba(22, 25, 29, 0.2)),
    linear-gradient(155deg, #7fa9b7 0 30%, #d9c5a5 31% 45%, #7e8e74 46% 100%);
}

.camera-fallback.hidden {
  display: none;
}

.street-lines {
  position: absolute;
  width: 72%;
  height: 120%;
  bottom: -58%;
  transform: perspective(240px) rotateX(56deg);
  background:
    linear-gradient(90deg, transparent 47%, rgba(255, 255, 255, 0.72) 48% 52%, transparent 53%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.16) 0 8px, transparent 8px 48px);
}

.ar-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.permission-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  border-radius: 999px;
  background: rgba(255, 248, 246, 0.72);
  color: var(--ink);
  padding: 7px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.location-chip {
  position: absolute;
  top: 46px;
  left: 18px;
  right: 18px;
  border-radius: 999px;
  background: rgba(232, 248, 242, 0.78);
  color: var(--green);
  padding: 6px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.ar-minimap-card {
  pointer-events: auto;
  position: absolute;
  top: 82px;
  right: 12px;
  z-index: 3;
  width: 132px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 246, 0.72);
  border-radius: 8px;
  background: rgba(255, 248, 246, 0.84);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

.ar-minimap {
  width: 100%;
  height: 106px;
  background: #edf0dc;
}

.ar-minimap-status {
  padding: 6px 7px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
}

.ar-minimap .leaflet-control-container {
  display: none;
}

.camera-controls {
  pointer-events: auto;
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 4;
  translate: 0;
  width: auto;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 248, 246, 0.76);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(47, 38, 53, 0.18);
  display: none;
  grid-template-columns: 1fr 112px;
  gap: 6px;
}

.phone.ar-mode .tabbar {
  display: none;
}

.camera-controls.show {
  display: grid;
}

.camera-facing {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.camera-facing-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--green);
}

.camera-facing-button.active {
  background: var(--brand-gradient);
  color: #fff;
}

.camera-controls select,
.camera-controls button {
  min-height: 34px;
  border-radius: 999px;
  border: 0;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
}

.camera-controls select {
  min-width: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.camera-controls button {
  background: var(--brand-gradient);
  color: #fff;
}

@media (max-width: 420px) {
  .camera-controls {
    grid-template-columns: 1fr;
  }

  .ar-minimap-card {
    top: 84px;
    right: 10px;
    width: 116px;
  }

  .ar-minimap {
    height: 92px;
  }

  .camera-controls select,
  .camera-controls #retryCamera {
    width: 100%;
  }
}

.ar-pin {
  pointer-events: auto;
  position: absolute;
  left: 58%;
  top: 35%;
  width: 118px;
  height: 142px;
  border-radius: 0;
  background: url("assets/ar-red-pin.png") center/contain no-repeat;
  box-shadow: none;
  opacity: 0;
  transform: scale(0.72) translateY(12px);
  animation: none;
  visibility: hidden;
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
}

.ar-pin.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  animation: arPinBob 1.55s ease-in-out infinite;
  visibility: visible;
}

.ar-pin::after {
  display: none;
}

.memo-card {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(126px + env(safe-area-inset-bottom));
  max-height: calc(100% - 218px);
  overflow: auto;
  display: none;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  border-radius: 8px;
  background: rgba(255, 248, 246, 0.94);
  padding: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

.memo-card.open {
  display: grid;
}

.memo-card img,
.memo-photo-placeholder {
  width: 100%;
  height: min(34vh, 220px);
  border-radius: 8px;
  object-fit: cover;
}

.memo-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.25;
}

.memo-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
}

@media (max-width: 420px) {
  .memo-card {
    bottom: calc(166px + env(safe-area-inset-bottom));
    max-height: calc(100% - 258px);
    grid-template-columns: minmax(96px, 32%) 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px;
  }

  .memo-card img,
  .memo-photo-placeholder {
    height: clamp(96px, 24vw, 122px);
  }

  .memo-card strong {
    font-size: 17px;
  }

  .memo-card p {
    max-height: 74px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.42;
  }

  .memo-card .field-label {
    margin: 0 0 3px;
    font-size: 10px;
  }
}

.field-label {
  display: block;
  margin: 2px 0 4px;
  color: #9a6d81;
  font-size: 11px;
  font-weight: 800;
}

.field-label + p {
  margin-top: 2px;
}

.friend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.my-album-section {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.my-album-section h2,
.my-album-section p {
  margin: 0;
}

.my-album-section p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.invite-form {
  display: none;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.invite-form.open {
  display: grid;
}

.small-button {
  padding: 10px 14px;
  background: var(--brand-gradient);
}

.small-button.active {
  background: var(--rose);
  color: #fff;
}

.save-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
}

.save-place-button {
  padding: 10px 12px;
  flex: 0 0 auto;
}

.save-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.album-grid article {
  --mood-color: var(--active-mood-color);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
}

.album-grid article[data-mood] {
  border-color: color-mix(in srgb, var(--mood-color) 34%, var(--line));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--mood-color) 10%, transparent);
}

.album-grid article[data-mood]::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1;
  height: 4px;
  background: var(--mood-color);
}

.album-grid article img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
}

.album-grid article p {
  margin: -4px 10px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.album-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-height: 30px;
  border-radius: 999px;
  background: rgba(255, 248, 246, 0.92);
  color: #9a4961;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(47, 38, 53, 0.14);
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 12px;
}

.reaction-button {
  min-width: 0;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #e9d7da;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 4px 9px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(47, 38, 53, 0.06);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.reaction-button:hover {
  transform: translateY(-1px);
}

.reaction-button.active {
  border-color: #f4b8c4;
  background: #fff2f5;
  color: var(--ink);
}

.reaction-button.active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
}

.reaction-count {
  min-width: auto;
  height: auto;
  border-radius: 999px;
  background: transparent;
  color: #6f626c;
  font-size: 12px;
  line-height: 1;
}

.reaction-button.active .reaction-count {
  background: transparent;
  color: var(--plum);
}

.album-detail {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: end;
  padding: 18px;
  background: rgba(47, 38, 53, 0.42);
  backdrop-filter: blur(8px);
}

.album-detail.open {
  display: flex;
}

.album-detail-panel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 20px 50px rgba(47, 38, 53, 0.24);
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
}

.map-header h2,
.map-header p {
  margin: 0;
}

.map-header p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.map-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#shareMapPins,
#copyDefaultPins {
  display: none;
}

.phone.admin-mode #shareMapPins,
.phone.admin-mode #copyDefaultPins {
  display: inline-block;
}

.map-edit-status {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.memory-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2e6e1;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.map-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.map-list article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.map-list article.active {
  border-color: rgba(240, 111, 159, 0.55);
  box-shadow: 0 8px 20px rgba(240, 111, 159, 0.14);
  transform: translateY(-1px);
}

.map-list p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.map-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 4px rgba(240, 111, 159, 0.14);
}

.map-dot.mine {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(36, 75, 53, 0.14);
}

.map-pin-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--rose);
  box-shadow: 0 4px 14px rgba(240, 111, 159, 0.34);
  transform: rotate(-45deg);
}

.map-pin-icon::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}

.map-pin-icon.mine {
  background: var(--green);
  box-shadow: 0 4px 14px rgba(36, 75, 53, 0.28);
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.leaflet-popup-content {
  margin: 10px;
}

.map-popup {
  width: 178px;
}

.map-popup img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  margin-bottom: 8px;
  border-radius: 8px;
  object-fit: cover;
}

.map-popup strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.map-popup span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.map-ar-button {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border-radius: 8px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--brand-shadow);
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgba(255, 248, 246, 0.9);
}

.detail-photo-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f2e6e1;
}

.detail-photo-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.detail-pin {
  display: none;
}

.detail-bubble {
  display: none;
}

.detail-copy {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.detail-copy strong {
  font-size: 20px;
}

.detail-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.detail-ar-button,
.detail-close-button {
  margin-top: 8px;
}

.detail-close-button {
  background: #fffdfb;
  color: var(--green);
  box-shadow: inset 0 0 0 1px var(--line);
}

.album-empty {
  aspect-ratio: 1;
  height: auto;
}

.album-empty::before {
  content: "사진 없음";
}

.album-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 10px 8px;
}

.album-title span {
  display: block;
  font-weight: 800;
}

.album-title small,
.detail-place {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: #fff2f5;
  color: var(--plum);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.album-title small {
  padding: 5px 7px;
}

.album-title .album-date {
  background: #f1f3f6;
  color: #5f6673;
  font-weight: 700;
}

.album-title .album-mood {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-block;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--mood-color);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--mood-color) 20%, transparent),
    0 4px 10px color-mix(in srgb, var(--mood-color) 28%, transparent);
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -2px;
}

.detail-mood {
  --mood-color: var(--active-mood-color);
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--mood-color);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--mood-color) 20%, transparent),
    0 4px 12px color-mix(in srgb, var(--mood-color) 30%, transparent);
}

.detail-place {
  margin-top: -2px;
  padding: 6px 8px;
}

.band-card {
  margin-top: 24px;
  display: grid;
  gap: 16px;
  text-align: center;
}

.bracelet {
  width: 190px;
  height: 190px;
  margin: 0 auto 6px;
  position: relative;
  border: 24px solid #2a2d33;
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px #565d65, 0 20px 40px rgba(36, 33, 38, 0.16);
}

.bracelet span {
  position: absolute;
  width: 52px;
  height: 34px;
  left: 45px;
  top: -28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--mint), var(--sky));
}

.bracelet strong {
  position: absolute;
  inset: 48px;
  border-radius: 50%;
  background: var(--paper);
}

.bracelet-image {
  position: relative;
  z-index: 2;
  width: min(250px, 82%);
  max-height: 260px;
  object-fit: contain;
  justify-self: center;
  filter: drop-shadow(0 18px 24px rgba(36, 33, 38, 0.14));
}

.bracelet-stage {
  position: relative;
  min-height: 286px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #fffdfb;
  transition: background 240ms ease, box-shadow 240ms ease;
}

.bracelet-stage.connected {
  background:
    radial-gradient(circle at 68% 30%, color-mix(in srgb, var(--active-mood-color) 24%, transparent), transparent 34%),
    radial-gradient(circle at 28% 72%, rgba(36, 75, 53, 0.2), transparent 38%),
    linear-gradient(135deg, #fff1ef, #f3e3ee 48%, #edf0dc);
  box-shadow: inset 0 0 0 1px rgba(240, 111, 159, 0.24);
}

.bracelet-stage.vibration-on .bracelet-image {
  animation: braceletVibe 0.34s ease-in-out infinite;
}

.led-glow {
  position: absolute;
  z-index: 1;
  width: 94px;
  height: 94px;
  left: 50%;
  top: 43%;
  border-radius: 50%;
  translate: -50% -50%;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle, var(--active-mood-color) 0 18%, color-mix(in srgb, var(--active-mood-color) 58%, white) 32%, color-mix(in srgb, var(--active-mood-color) 26%, transparent) 56%, transparent 72%);
  filter: blur(4px);
  transition: opacity 200ms ease;
}

.bracelet-stage.led-on .led-glow {
  opacity: 1;
  animation: ledPulse 1.4s ease-in-out infinite;
}

.bracelet-stage.syncing {
  animation: syncAura 0.8s ease-in-out infinite;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.status-row span {
  color: var(--muted);
}

.toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
}

.toggle-option {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toggle-option.active {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(140, 69, 187, 0.42);
}

.bracelet-sync {
  background: var(--brand-gradient);
  color: #fff;
}

.bracelet-sync:disabled {
  cursor: wait;
  opacity: 0.72;
}

.sync-status {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(255, 248, 246, 0.94);
  backdrop-filter: blur(16px);
}

.tabbar button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tabbar button.active {
  color: var(--coral);
}

@keyframes floatPin {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -10px;
  }
}

@keyframes arPinBob {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }

  50% {
    transform: scale(1) translateY(-12px);
  }
}

@keyframes alertPulse {
  0%,
  100% {
    transform: scale(0.86);
    opacity: 0.62;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes alertBraceletShake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  20% {
    transform: translateX(-3px) rotate(-1.4deg);
  }

  40% {
    transform: translateX(3px) rotate(1.4deg);
  }

  60% {
    transform: translateX(-2px) rotate(-0.8deg);
  }

  80% {
    transform: translateX(2px) rotate(0.8deg);
  }
}

@keyframes braceletVibe {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  25% {
    transform: translateX(-1.5px) rotate(-0.5deg);
  }

  50% {
    transform: translateX(1.5px) rotate(0.5deg);
  }

  75% {
    transform: translateX(-1px) rotate(-0.25deg);
  }
}

@keyframes ledPulse {
  0%,
  100% {
    transform: scale(0.88);
    opacity: 0.62;
  }

  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

@keyframes syncAura {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(240, 111, 159, 0.24), 0 0 0 rgba(36, 75, 53, 0);
  }

  50% {
    box-shadow: inset 0 0 0 1px rgba(240, 111, 159, 0.5), 0 0 28px rgba(36, 75, 53, 0.2);
  }
}

@media (max-width: 460px) {
  body {
    display: block;
  }

  .phone {
    width: 100vw;
    height: 100vh;
    border: 0;
  }
}
