/* 한도사의 마당: 화면 전체를 쓰는 밤 장면 위에 얹는 단추·말풍선·안내 (DESIGN.md의 어두운 면 + 코랄 포인트) */
.md-page { margin: 0; height: 100dvh; overflow: hidden; -webkit-user-select: none; user-select: none; background: #0d1426; color: #faf9f5; font-family: var(--sans); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#md-canvas { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; touch-action: none; cursor: grab; }
#md-canvas:active { cursor: grabbing; }

.md-top { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; z-index: 5; pointer-events: none; }
.md-top > * { pointer-events: auto; }
.md-spacer { flex: 1; pointer-events: none; }
.md-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(250, 249, 245, .18); background: rgba(24, 23, 21, .55); color: #faf9f5; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; padding: 0; }
.md-icon svg, .md-act svg, .md-acts svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#md-sound.off .wave { opacity: 0; }
#md-sound.off { color: rgba(250, 249, 245, .55); }
.md-pill { padding: 10px 14px; border-radius: 999px; background: rgba(24, 23, 21, .55); border: 1px solid rgba(250, 249, 245, .18); font: 600 14px var(--serif); letter-spacing: -.01em; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.md-hint { position: fixed; top: calc(66px + env(safe-area-inset-top)); left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; color: rgba(250, 249, 245, .7); text-shadow: 0 1px 4px rgba(0, 0, 0, .6); pointer-events: none; z-index: 4; padding: 0 16px; }

.md-tag, .md-bubble { position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; white-space: nowrap; }
#md-name-tag { pointer-events: auto; cursor: pointer; }
#md-name-tag::after { content: '›'; margin-left: 2px; color: #ad5b40; font-size: 14px; }
.md-tag { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(250, 249, 245, .9); color: #141413; font-size: 12px; font-weight: 600; }
.md-tag b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #6c6a64; color: #fff; font-size: 10px; }
#md-dosa-tag { padding: 4px 10px; background: rgba(173, 91, 64, .92); color: #fff; }
.md-bubble { max-width: min(280px, 80vw); white-space: normal; padding: 10px 14px; border-radius: 14px; background: #faf9f5; color: #141413; font: 500 14px/1.5 var(--serif); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); margin-top: -8px; }
.md-bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #faf9f5; }
body:not(.md-in) .md-tag, body:not(.md-in) .md-bar, body:not(.md-in) .md-hint { visibility: hidden !important; }

.md-bar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; border-radius: 22px; background: rgba(24, 23, 21, .62); border: 1px solid rgba(250, 249, 245, .16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 5; }
.md-act { min-width: 76px; min-height: 56px; display: grid; justify-items: center; gap: 3px; padding: 8px 10px; border: 0; border-radius: 16px; background: transparent; color: #faf9f5; font: 600 12px var(--sans); cursor: pointer; }
.md-act:active { background: rgba(250, 249, 245, .1); }
.md-act:disabled { opacity: .4; }
.md-act[data-act="fortune"] svg { color: #e8a55a; }
.md-act[data-act="wish"] svg { color: #ff8f7a; }
.md-act[data-act="water"] svg { color: #9fc0ff; }

.md-busy { position: fixed; top: calc(92px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; background: rgba(24, 23, 21, .75); border: 1px solid rgba(250, 249, 245, .16); font-size: 13px; z-index: 5; }
.md-busy button { border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(250, 249, 245, .14); color: #faf9f5; font: 600 13px var(--sans); cursor: pointer; }

.md-sheet { position: fixed; inset: 0; z-index: 10; display: grid; place-items: end center; background: rgba(5, 7, 15, .45); padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.md-sheet-card { position: relative; width: min(440px, 100%); max-height: 80dvh; overflow: auto; background: #faf9f5; color: #3d3d3a; border-radius: 16px; padding: 24px; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); animation: md-up .3s ease-out both; }
@media (min-width: 720px) { .md-sheet { place-items: center; } }
@keyframes md-up { from { transform: translateY(16px); opacity: 0; } }
.md-sheet-card h2 { margin: 0 0 10px; font: 600 22px/1.3 var(--serif); letter-spacing: -.02em; color: #141413; }
.md-sheet-card h3 { margin: 4px 0 6px; font: 600 18px/1.4 var(--serif); color: #141413; }
.md-sheet-card p { margin: 0 0 10px; line-height: 1.65; }
.md-sheet-card .btn { display: inline-flex; width: auto; text-decoration: none; }
.md-sheet-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; color: #6c6a64; cursor: pointer; }
.md-gz { font: 600 44px/1.1 var(--serif); color: #ad5b40; margin: 8px 0 12px !important; }
.md-gz small { display: block; margin-top: 6px; font: 500 14px var(--sans); color: #6c6a64; }
.md-muted { color: #6c6a64; font-size: 14px; }
.md-streak { font: 600 18px/1.5 var(--serif); color: #141413; }
.md-wishes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.md-wishes button { min-height: 56px; border: 1px solid #e6dfd8; border-radius: 12px; background: #fff; font: 600 15px var(--sans); color: #141413; cursor: pointer; display: grid; place-items: center; gap: 4px; }
.md-wishes button::before { content: ''; width: 14px; height: 18px; border-radius: 5px; background: var(--c); box-shadow: 0 0 12px var(--c); }

.md-intro { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 30%, rgba(13, 20, 38, .55), rgba(5, 7, 15, .92)); overflow: auto; }
.md-intro[hidden] { display: none; }
.md-intro-card { width: min(520px, 100%); padding: 32px 24px; border-radius: 16px; background: rgba(24, 23, 21, .82); border: 1px solid rgba(250, 249, 245, .14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #e9e5dc; line-height: 1.7; font-size: 15px; }
.md-kicker { margin: 0; font-size: 13px; color: #e8a55a; letter-spacing: .02em; }
.md-intro h1 { margin: 6px 0 12px; font: 600 34px/1.15 var(--serif); letter-spacing: -.03em; color: #faf9f5; }
.md-intro-card > p { margin: 0 0 14px; }
.md-acts { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }
.md-acts li { display: flex; gap: 12px; align-items: flex-start; }
.md-acts svg { flex: none; margin-top: 2px; color: #e8a55a; }
.md-acts b { display: block; color: #faf9f5; }
.md-acts span { font-size: 14px; color: #a09d96; }
.md-note { font-size: 13px; color: #a09d96; }
.md-enter { width: 100%; margin-top: 4px; min-height: 48px; font-size: 16px; }
.md-back { display: block; margin-top: 14px; text-align: center; color: #e8a55a; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .md-sheet-card { animation: none; } }

/* 함께 있기: 사람 수 · 다른 사람 이름표 · 알림 · 마당 고르기 */
.md-people { display: inline-flex; align-items: center; gap: 8px; color: #faf9f5; cursor: pointer; font-family: var(--sans); font-weight: 600; font-size: 13px; }
.md-dot { width: 8px; height: 8px; border-radius: 50%; background: #5db872; box-shadow: 0 0 8px #5db872; }
.md-people.off .md-dot { background: #8e8b82; box-shadow: none; }
.md-tag-peer { padding: 4px 10px; background: rgba(24, 23, 21, .7); color: #faf9f5; font-weight: 500; }
.md-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(24, 23, 21, .78); color: #faf9f5; font-size: 13px; z-index: 6; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.md-rooms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.md-rooms button { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px; border: 1px solid #e6dfd8; border-radius: 12px; background: #fff; font: 500 14px var(--sans); color: #141413; cursor: pointer; }
.md-rooms button[aria-current] { border-color: #ad5b40; box-shadow: inset 0 0 0 1px #ad5b40; }
.md-rooms button span { color: #6c6a64; font-size: 13px; }
.md-rooms button:disabled { opacity: .45; }

/* 복채 */
.md-tip { width: auto; padding: 0 14px 0 10px; border-radius: 999px; display: inline-flex; gap: 6px; color: #e8c46a; font: 600 13px var(--sans); }
.md-tip span { color: #faf9f5; }
.md-pay { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 14px; background: #fee500; color: #191919; font: 700 16px var(--sans); text-decoration: none; }
.md-pay:active { filter: brightness(.95); }
.md-linkbtn { border: 0; padding: 0; background: none; color: #ad5b40; font: 600 14px var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* 운세 보기: 리포트 고르기 · 카드 */
.md-act[data-act="report"] svg { color: #e8c46a; }
.md-reports { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.md-reports button { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; border: 1px solid #e6dfd8; border-radius: 12px; background: #fff; font: 600 15px var(--sans); color: #141413; cursor: pointer; text-align: left; }
.md-reports b { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #ad5b40; color: #fff; font: 700 15px var(--serif); }
.md-card-wait { min-height: 200px; display: grid; place-items: center; color: #6c6a64; background: #efe9de; border-radius: 12px; }
.md-card-img { display: block; width: 100%; max-width: 320px; margin: 4px auto 12px; border-radius: 12px; box-shadow: 0 4px 18px rgba(20, 20, 19, .18); }
.md-card-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.md-card-btns .btn { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 14px; padding: 0 8px; }
.md-card-btns .btn:first-child:nth-last-child(3) { grid-column: 1 / -1; }
.md-detail { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; background: #181715; color: #faf9f5; font: 600 15px var(--sans); text-decoration: none; }
.md-report-me { grid-column: 1 / -1; background: #181715 !important; color: #faf9f5 !important; border-color: #181715 !important; }
.md-report-me b { background: #e8a55a !important; color: #181715 !important; }
.md-why { font-size: 14px; line-height: 1.6; color: #3d3d3a; background: #efe9de; border-radius: 12px; padding: 12px 14px; }
