/* 별자리 오목 테마: 시크릿 워드의 밤하늘(남보라, 금색, 민트)을 잇는다. 카드 한쪽 색 띠 없음. */
:root {
  --bg: #15122e; --panel: #241f52; --panel-2: #302a6a; --line: #0d0b22;
  --text: #f6f3ff; --text-2: #cdc7f2; --text-3: #9d95d1;
  --gold: #f2c14e; --gold-d: #b9862a; --mint: #3ef0c1;
  --lift: 0 4px 0 var(--line);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Pretendard Variable", Pretendard, -apple-system, system-ui, sans-serif; color: var(--text); background: var(--bg) url("assets/bg.webp") center / cover fixed; word-break: keep-all; -webkit-font-smoothing: antialiased; line-height: 1.5; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
.btn { border: 2px solid var(--line); border-radius: 12px; background: var(--panel-2); box-shadow: var(--lift); padding: 10px 18px; font-weight: 800; font-size: 16px; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn.gold { background: linear-gradient(#ffd977, #e6a93a); color: #2a1a05; border-color: #6b4a12; }
.btn.big { width: 100%; padding: 14px; font-size: 19px; }
.btn.ghost { background: var(--panel); color: var(--text-2); }
.btn:disabled { opacity: .4; }
.link { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.icon { width: 40px; height: 40px; border: 2px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 3px 0 var(--line); font-weight: 900; color: var(--gold); }
.wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* 첫 화면 */
.title { max-width: 560px; margin: 0 auto; padding: 34px 18px; align-items: center; gap: 14px; text-align: center; }
.logo { width: min(460px, 88vw); height: auto; filter: drop-shadow(0 6px 18px rgba(242, 193, 78, .25)); }
.logo.sm { width: auto; height: 34px; }
.tag { color: var(--text-2); font-weight: 600; margin: 0; }
.panel { width: 100%; background: rgba(36, 31, 82, .92); border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 6px 0 var(--line), inset 0 0 0 1px rgba(242, 193, 78, .35); padding: 18px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.pick-me { display: flex; align-items: center; gap: 14px; }
.big-av { width: 92px; height: 92px; }
.me-name { font-size: 20px; color: var(--gold); }
.lbl { font-size: 12.5px; font-weight: 800; color: var(--text-3); }
.avs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.av { background: none; border: 2px solid transparent; border-radius: 50%; padding: 2px; }
.av img { width: 100%; aspect-ratio: 1; }
.av.on { border-color: var(--gold); background: rgba(242, 193, 78, .18); }
.segs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { border: 2px solid var(--line); border-radius: 12px; background: var(--panel-2); box-shadow: 0 3px 0 var(--line); padding: 10px; display: flex; flex-direction: column; align-items: center; }
.seg span { font-size: 12px; color: var(--text-3); }
.seg.on { background: var(--gold); color: #2a1a05; }
.seg.on span { color: #5a4214; }
.row-links { display: flex; justify-content: space-between; font-size: 14px; }
.soon { color: var(--text-3); font-size: 13px; }

/* 게임 */
.game { height: 100vh; height: 100dvh; }
.gtop { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.gtop .round { margin-left: auto; background: var(--panel); border: 2px solid var(--line); border-radius: 99px; padding: 3px 14px; font-weight: 700; color: var(--text-2); }
.gtop .round b { color: var(--gold); }
.gmain { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 1fr 200px; gap: 16px; align-items: center; padding: 0 16px; }
.boardwrap { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.board { position: relative; aspect-ratio: 1; height: min(100%, 92vw); max-height: 100%; background-size: 100% 100%; }
.grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.grid line { stroke: rgba(205, 199, 242, .22); stroke-width: .18; }
.grid circle { fill: rgba(242, 193, 78, .55); }
.constel { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.constel line { stroke-width: 1.1; stroke-linecap: round; opacity: .85; animation: draw 1.2s ease-out; }
.constel line.c0 { stroke: #fff2c4; filter: drop-shadow(0 0 1.5px #f2c14e) drop-shadow(0 0 3px #f2c14e); }
.constel line.c1 { stroke: #d6fff3; filter: drop-shadow(0 0 1.5px #3ef0c1) drop-shadow(0 0 3px #3ef0c1); }
.stone.five { width: 8.2%; z-index: 2; animation: glow 1.4s ease-in-out infinite alternate; }
@keyframes glow { to { filter: drop-shadow(0 0 10px #fff3c0); } }
.grid line.const { stroke-width: .9; stroke-linecap: round; filter: drop-shadow(0 0 1.2px currentColor); animation: draw 1s ease-out; }
.grid line.const.c0 { stroke: var(--gold); color: var(--gold); }
.grid line.const.c1 { stroke: var(--mint); color: var(--mint); }
@keyframes draw { from { opacity: 0; } }
.stone, .target, .hit, .endc, .bidpop { position: absolute; transform: translate(-50%, -50%); }
.stone { width: 7.0%; height: auto; filter: drop-shadow(0 0 4px rgba(255, 220, 120, .55)); }
.stone.s1 { filter: drop-shadow(0 0 4px rgba(62, 240, 193, .6)); }
.stone.drop { animation: twinkle .6s ease-out; }
@keyframes twinkle { from { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } }
.target { width: 5.8%; }
.target img { width: 100%; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal .target b { display: none; }
.target b { position: absolute; left: 50%; top: -38%; transform: translateX(-50%); font-size: clamp(10px, 1.5vw, 14px); background: var(--gold); color: #2a1a05; border-radius: 99px; padding: 0 6px; font-weight: 900; }
.hit { width: 6.2%; aspect-ratio: 1; border: 0; background: transparent; border-radius: 50%; padding: 0; }
.hit:hover { background: rgba(242, 193, 78, .25); }
.endc { width: 5%; aspect-ratio: 1; border: 2px dashed var(--mint); border-radius: 50%; background: rgba(62, 240, 193, .18); animation: pulse 1s ease-in-out infinite; z-index: 3; padding: 0; }
@keyframes pulse { 50% { transform: translate(-50%, -50%) scale(1.25); } }
.bidpop { z-index: 4; min-width: 1.9em; text-align: center; border-radius: 7px; font-weight: 900; font-size: clamp(12px, 1.6vw, 17px); line-height: 1.35; border: 2px solid var(--line); opacity: .5; animation: pop .25s ease-out; }
.bidpop.up { margin-top: -4.6%; }
.bidpop.down { margin-top: 4.6%; }
.bidpop.lft { margin-left: -4.4%; }
.bidpop.rgt { margin-left: 4.4%; }
.bidpop.b0 { background: var(--gold); color: #2a1a05; }
.bidpop.b1 { background: var(--mint); color: #062a22; }
.bidpop.win { opacity: 1; box-shadow: 0 0 10px currentColor; }
@keyframes pop { from { opacity: 0; } }
.pcard { position: relative; background: rgba(36, 31, 82, .92); border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 var(--line), inset 0 0 0 1px rgba(242, 193, 78, .3); padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.pcard.chooser { box-shadow: 0 5px 0 var(--line), inset 0 0 0 2px var(--gold), 0 0 22px rgba(242, 193, 78, .35); }
.pav { width: 110px; height: 110px; }
.pname { font-weight: 800; font-size: 16px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstar { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 13px; color: var(--text-2); font-weight: 700; }
.pstar img { width: 22px; }
.dust { display: flex; align-items: center; gap: 6px; }
.dust img { width: 34px; }
.dust b { font-size: 28px; color: var(--gold); font-variant-numeric: tabular-nums; }
.badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--gold); color: #2a1a05; font-weight: 900; font-size: 12px; border-radius: 99px; padding: 2px 10px; border: 2px solid var(--line); }

.ctrl { padding: 10px 14px 14px; }
.bar { max-width: 900px; margin: 0 auto; background: rgba(36, 31, 82, .95); border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 var(--line), inset 0 0 0 1px rgba(242, 193, 78, .3); padding: 14px 16px; text-align: center; }
.msg { margin: 0; font-weight: 700; color: var(--text-2); }
.bar .btns { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.bar .btns .btn { white-space: nowrap; }
.bar.bid { display: grid; grid-template-columns: auto 1fr 170px; gap: 14px; align-items: center; text-align: left; }
.bar.bid .left { display: flex; align-items: center; gap: 8px; }
.bar.bid .left img { width: 44px; }
.left-n { font-size: 30px; color: var(--gold); }
.of { color: var(--text-3); margin-left: 4px; font-weight: 700; }
.steppers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stepper { position: relative; display: flex; align-items: center; justify-content: space-between; background: var(--panel-2); border: 2px solid var(--line); border-radius: 12px; padding: 6px; }
.stepper b { font-size: 24px; font-variant-numeric: tabular-nums; }
.snum { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #2a1a05; border-radius: 99px; font-size: 11px; font-weight: 900; padding: 0 7px; }
.sb { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--line); background: var(--panel); font-size: 18px; font-weight: 900; }
.sb:disabled { opacity: .3; }
.hint { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--text-3); text-align: center; }
.big-msg { font-size: 24px; font-weight: 900; margin: 0; }
.gold-t { color: var(--gold); }
.sub { margin: 2px 0 0; color: var(--text-3); }

.modal { position: fixed; inset: 0; background: rgba(8, 6, 20, .7); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.sheet { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .4); max-width: 520px; width: 100%; max-height: 88vh; overflow: auto; padding: 22px; }
.sheet h2 { margin: 0 0 8px; color: var(--gold); }
.sheet ol { padding-left: 20px; }
.sheet li { margin: 6px 0; color: var(--text-2); }
.sheet b { color: var(--text); }


/* 친구 초대 화면 */
.start-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.form-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 16px; }
.panel.narrow { max-width: 460px; }
.logo.mid { width: min(240px, 70%); margin: 0 auto 2px; }
.form-title { margin: 4px 0 0; font-size: 22px; text-align: center; color: var(--gold); }
.form-sub { margin: 0; color: var(--text-2); font-weight: 600; text-align: center; }
.form-note { margin: 0; color: var(--text-3); font-size: 14px; font-weight: 600; text-align: center; }
.name-in { border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 17px; font-weight: 700; background: var(--panel-2); color: var(--text); width: 100%; box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .35); }
.name-in::placeholder { color: var(--text-3); }
.name-in:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.err { margin: 0; color: #ff9b8a; font-weight: 700; font-size: 14px; }
.invite-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.invite-row.one { grid-template-columns: 1fr; }
.seats { list-style: none; margin: 2px 0; padding: 0; display: grid; gap: 8px; }
.seat { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 2px solid var(--line); border-radius: 12px; padding: 6px 12px; min-height: 56px; }
.seat img { width: 44px; height: 44px; object-fit: contain; }
.seat.me { box-shadow: inset 0 0 0 2px var(--gold); }
.seat.empty { border-style: dashed; border-color: var(--text-3); color: var(--text-3); justify-content: center; }
.sname { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-s { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px; background: var(--gold); color: #2a1a05; white-space: nowrap; }
.tag-s.mine { background: var(--mint); color: #062a22; }
.timer { display: inline-block; min-width: 42px; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--line); color: var(--mint); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer:empty { display: none; }
.timer.low { background: #c8443a; color: #fff; }
.pcard.off { opacity: .6; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 99; max-width: calc(100vw - 32px); background: var(--gold); color: #2a1a05; border: 2px solid var(--line); border-radius: 12px; padding: 10px 16px; font-weight: 800; }
.toast[hidden] { display: none; }

.embedded .title .logo { width: min(300px, 66vw); }
.embedded .title .tag { display: none; }
@media (max-width: 860px) {
  .gmain { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 8px; padding: 0 10px; }
  .boardwrap { grid-column: 1 / -1; grid-row: 2; }
  .game { height: auto; min-height: 100dvh; }
  .gmain { grid-template-rows: auto auto; flex: none; }
  .boardwrap { height: auto; }
  .board { height: auto; width: 100%; max-width: 100%; max-height: none; }
  .pcard { flex-direction: row; padding: 8px 10px; gap: 8px; text-align: left; }
  .pav { width: 44px; height: 44px; }
  .pmeta { flex: 1; min-width: 0; }
  .pname { font-size: 12px; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
  .pcard { min-width: 0; }
  .badge { top: auto; bottom: -11px; font-size: 11px; padding: 1px 8px; }
  .pstar span { display: none; }
  .pstar { justify-content: flex-start; font-size: 11px; }
  .pstar img { width: 16px; }
  .dust img { width: 22px; }
  .dust b { font-size: 20px; }
  .bar.bid { grid-template-columns: 1fr; gap: 10px; }
  .bar.bid .left { justify-content: center; }
  .logo.sm { height: 26px; }
  .stone { width: 7.8%; }
  .bidpop { font-size: 12px; min-width: 1.7em; }
  .gmain { align-items: start; }
}
