:root{
  color-scheme:light;--ink:#275578;--ink-deep:#20455e;--blue:#76b7e6;--blue-d:#4d93c6;
  --blue-light:#eaf7ff;--yellow:#ffe9a3;--yellow-soft:#fff4ce;--white:#fffefa;
  --border:#a7d2ee;--muted:#7996ac;
  font-family:'Pretendard','Apple SD Gothic Neo','Noto Sans KR','Malgun Gothic',system-ui,sans-serif;
}
*{box-sizing:border-box}html,body{min-height:100%;margin:0}button,input{font:inherit}button{cursor:pointer}
button:focus-visible,input:focus-visible{outline:3px solid #eeb940;outline-offset:3px}button:disabled,input:disabled{opacity:.5;cursor:not-allowed}
body{
  min-height:100dvh;display:flex;justify-content:center;align-items:center;padding:25px 15px;
  color:var(--ink);background-color:#fff8e7;
  background-image:linear-gradient(90deg,rgba(159,204,235,.58) 50%,transparent 50%),linear-gradient(rgba(159,204,235,.4) 50%,transparent 50%);
  background-size:220px 220px,220px 220px;
}
.chat-shell{
  width:min(100%,530px);height:min(870px,calc(100dvh - 50px));min-height:480px;
  position:relative;display:flex;flex-direction:column;overflow:hidden;background:var(--white);
  border:5px solid rgba(255,255,255,.95);outline:2px solid rgba(85,151,199,.42);border-radius:34px;
  box-shadow:0 17px 0 rgba(94,151,196,.12),0 28px 65px rgba(70,131,178,.22);
}
.chat-header{position:relative;z-index:2;flex:none;background:linear-gradient(120deg,#f1faff,#d9efff 74%,#e3f4ff);border-bottom:2px dashed #a9d2ea;}
.header-topline{height:34px;display:flex;align-items:center;justify-content:center;gap:15px;background:#fff0bb;color:#5a9aca;font-size:10px;letter-spacing:2.2px;font-weight:900;}
.topline-star{color:#e8b748;font-size:16px}
.header-main{min-height:81px;display:flex;align-items:center;gap:12px;padding:15px 18px}
.profile{width:52px;height:52px;display:grid;place-items:center;flex:none;border:3px solid white;background:#fff1bf;box-shadow:0 3px 0 #b6d5eb;border-radius:20px;font-size:28px;transform:rotate(-4deg)}
.profile-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.profile-text strong{font-size:19px;letter-spacing:-.4px}.profile-text span{font-size:11px;color:#6e9aba}
.menu-button{border:0;background:white;border-radius:50%;width:36px;height:36px;line-height:1;color:#6a9fc3;font-size:26px}
.settings-menu{position:absolute;right:14px;top:101px;background:white;border:1px solid #bad9ef;border-radius:16px;padding:7px;min-width:195px;box-shadow:0 12px 25px #6b97b744;z-index:5}.settings-menu[hidden]{display:none}
.settings-menu button{background:transparent;border:0;border-radius:10px;width:100%;text-align:left;color:var(--ink);font-size:12px;padding:11px}.settings-menu button:hover{background:#edf8ff}.settings-menu .danger{color:#b75d63}
.conversation{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;background:#fffefa;background-image:radial-gradient(#a3d5f22f .9px,transparent .9px);background-size:20px 20px;padding:18px 17px 26px;scrollbar-color:#c3e0ef transparent}
.conversation-intro{text-align:center;margin:6px 0 27px}.conversation-intro span{display:inline-block;background:#fff4cf;border:1px solid #f2dc9d;border-radius:60px;padding:8px 15px;font-size:10px;color:#a18a58;font-weight:750}
.message{display:flex;align-items:flex-end;gap:8px;margin:0 0 16px}.message.player{justify-content:flex-end}.message.system{justify-content:center;margin:23px 0}
.message-avatar{flex:none;width:31px;height:31px;display:grid;place-items:center;border-radius:50%;font-size:18px;background:#fff0bd;border:2px solid white;box-shadow:0 1px 4px #9ac6df5c}
.bubble{max-width:83%;white-space:pre-wrap;overflow-wrap:anywhere;background:#eaf6ff;color:#284d6e;border:1px solid #badcf0;box-shadow:0 3px 0 #8cc2e616;border-radius:17px 17px 17px 5px;padding:11px 14px;font-size:13px;line-height:1.75}
.player .bubble{background:#fff0b6;border-color:#eed383;border-radius:17px 17px 5px 17px;color:#67512e}
.system .bubble{max-width:90%;padding:7px 13px;background:#f3faff;border:1px dashed #c4dded;box-shadow:none;color:#7697b1;border-radius:50px;text-align:center;font-size:11px;line-height:1.6;font-weight:700}
.story-inline{margin:19px 8px 17px 42px;display:flex;flex-direction:column;gap:8px;align-items:stretch;}
.story-inline button{border:1px solid #e8cc77;background:#fff1bb;color:#745b2d;border-radius:14px;min-height:43px;padding:11px 13px;font-size:12px;font-weight:850;box-shadow:0 3px 0 #eedda75c;transition:transform .12s}
.story-inline button:hover{transform:translateY(-1px);background:#ffe9a5}
.story-inline .story-mini-note{color:#829caf;font-size:11px;text-align:center}
.story-inline .ticket-trigger{background:#e0f3ff;border-color:#8fc7ea;color:#2f74a9;font-weight:900;font-size:14px;box-shadow:0 4px 0 #bbdff2}
.chat-footer{flex:none;background:#fffefa;border-top:2px dashed #c2e0f0;padding:12px 15px 10px}
.chat-form{display:flex;gap:8px;align-items:center;background:white;border:2px solid #bcdcf0;border-radius:50px;padding:6px 7px 6px 15px;transition:border-color .15s}
.chat-form:focus-within{border-color:var(--blue)}.chat-form input{font-size:13px;outline:0;border:0;background:transparent;color:var(--ink-deep);flex:1;min-width:0;padding:6px 0}.chat-form input::placeholder{color:#a1b5c5}
.chat-form button{width:39px;height:39px;border:0;border-radius:50%;background:var(--blue);color:white;font-size:22px;display:grid;place-items:center;box-shadow:0 3px 0 #b5d4ec}.chat-form button span{transform:rotate(-25deg)}
.footer-caption{color:#9ab1c1;font-size:10px;letter-spacing:1.2px;text-align:center;margin:8px 0 0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.ticket-dialog{border:0;background:transparent;padding:15px;max-width:min(96vw,530px);max-height:92dvh;overflow-y:auto;color:var(--ink)}.ticket-dialog::backdrop{background:#183c60a1;backdrop-filter:blur(4px)}
.ticket-panel{position:relative;background:#fffdfa;padding:20px;border:4px solid white;outline:2px solid #a7cde4;border-radius:25px;box-shadow:0 18px 50px #173b5966}.ticket-close{position:absolute;right:12px;top:11px;width:35px;height:35px;border:0;border-radius:50%;background:#eef8ff;color:#5388b0;font-size:25px;z-index:4}
.ticket-paper{border:2px dashed #a7d5f0;border-radius:16px;background:linear-gradient(150deg,#fffdf6,#fff 55%,#f1f9ff);padding:28px 22px 24px;text-align:center;position:relative}.ticket-kicker{color:#76acd6;font-size:10px;font-weight:900;letter-spacing:2px;margin:0 0 10px}.ticket-ornament{font-size:23px;color:#e6c76c}.ticket-paper h2{color:#3779a8;font-size:27px;letter-spacing:-.5px;margin:8px 0 7px}.ticket-subtitle{font-size:12px;color:#638ca5;margin:0 auto 18px;max-width:270px;line-height:1.7}.ticket-stamp{margin:0 auto 20px;padding:12px 20px;max-width:155px;color:#4b93c2;border:3px double #83c0e7;border-radius:12px;font-size:13px;font-weight:1000;line-height:1.4;transform:rotate(-5deg)}.ticket-stamp span{color:#5da979}
.ticket-row{display:flex;gap:13px;justify-content:space-between;align-items:flex-start;text-align:left;font-size:11px;margin:13px 0;padding-bottom:13px;border-bottom:1px dashed #c8dfea}.ticket-row span{white-space:nowrap;color:#7296ae}.ticket-row strong{font-size:12px;color:#2f5c7a;text-align:right;overflow-wrap:anywhere}.ticket-divider{letter-spacing:9px;color:#e6bf56;margin:18px 0}.ticket-message{font-size:12px;line-height:1.7;color:#608aa6}.ticket-warning{margin-top:18px;padding:10px;border-radius:8px;background:#fff0cf;color:#8e6839;font-size:10px;line-height:1.6}
.ticket-paper .ticket-lucky-badge[hidden]{display:none!important}
.ticket-lucky-badge{display:inline-block;margin:4px auto 10px;padding:8px 12px;background:#fff0ae;border:1px solid #e5bd5a;border-radius:999px;color:#806025;font-weight:900;font-size:12px;letter-spacing:.4px}
.ticket-paper.is-lucky{border-color:#e6b942;background:linear-gradient(150deg,#fff6d4,#ffffff 52%,#e7f5ff)}
.ticket-paper.is-lucky .ticket-stamp{color:#ad7d24;border-color:#dfbd59;transform:rotate(-5deg)}
.ticket-paper.is-lucky .ticket-kicker{color:#ad8c39}
.ticket-actions{display:flex;gap:8px;margin-top:16px}.ticket-actions button{flex:1;border-radius:12px;border:1px solid #9dc9e7;background:#e3f3ff;color:#3276a3;padding:11px 9px;font-weight:800;font-size:12px}.ticket-actions button:first-child{background:#fff0b4;border-color:#ebd58b;color:#806028}.dialog-hint{font-size:10px;line-height:1.5;color:#7e9bb0;text-align:center}
@media(max-width:620px){body{padding:0;background:#fffdf5}.chat-shell{height:100dvh;width:100%;min-height:390px;border:0;outline:0;border-radius:0;box-shadow:none}.header-topline{height:28px;font-size:9px}.header-main{min-height:72px;padding:11px 14px}.conversation{padding:17px 12px 21px}.chat-footer{padding:10px 10px max(12px,env(safe-area-inset-bottom))}.ticket-dialog{padding:8px;max-width:98vw}.ticket-panel{padding:13px}}
@media print{body{background:white!important;padding:0}.chat-shell{display:none!important}.ticket-dialog{display:block!important;position:static!important;max-width:none!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;border:none!important}.ticket-dialog::backdrop{display:none!important}.ticket-panel{border:none!important;outline:none!important;box-shadow:none!important;padding:0!important}.ticket-close,.ticket-actions,.dialog-hint{display:none!important}.ticket-paper{margin:20mm auto!important;max-width:120mm!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}}

/* v3.0: 처음에만 보이는 카페 메뉴판 스타일의 닉네임 + 멤버 선택 화면 */
.chat-shell.is-starting .chat-header,.chat-shell.is-starting .conversation,.chat-shell.is-starting .chat-footer{display:none}
.start-screen{display:none;min-height:0;height:100%;flex:1;overflow-y:auto;background:#fffefa;background-image:radial-gradient(#a4d4ef33 .8px,transparent .8px);background-size:18px 18px}
.chat-shell.is-starting .start-screen{display:flex;flex-direction:column}
.start-topline{flex:none;min-height:36px;display:grid;place-items:center;background:#ffedaf;color:#6099c3;letter-spacing:2px;font-size:10px;font-weight:900;border-bottom:2px dashed #d1e9f7}
.start-form{display:flex;flex-direction:column;gap:16px;padding:22px 27px 17px;flex:1}
.start-heading{text-align:center}
.start-kicker{color:#79a9c7;letter-spacing:1.5px;font-size:10px;font-weight:900;margin:0 0 10px}
.start-illustration{display:flex;justify-content:center;align-items:center;gap:23px;margin-bottom:4px;font-size:26px}
.start-illustration span:nth-child(2){color:#f0c960;font-size:19px}
.start-heading h1{font-size:27px;line-height:1.28;color:#3f83b4;letter-spacing:-1px;margin:2px 0 8px}
.start-heading > p:last-child{margin:0;color:#7f9bb1;font-size:12px;line-height:1.65}
.start-nickname label,.start-label{display:flex;align-items:center;gap:8px;font-weight:850;color:#42779f;font-size:13px;margin:0 0 9px}
.start-nickname label span,.start-label span{border-radius:50%;background:#dfedfb;color:#609ec8;display:inline-grid;place-items:center;width:24px;height:24px;font-size:10px}
.start-nickname input{width:100%;height:48px;border:2px solid #b5d8ed;border-radius:14px;background:#fff;color:#2c5e7c;padding:0 15px;font-size:14px;box-shadow:0 3px 0 #e4f2fb}
.start-nickname input::placeholder{color:#abc2d0}
.start-members{display:flex;flex-direction:column;gap:1px}
.member-menu{display:flex;flex-direction:column;gap:9px}
.member-menu-item{width:100%;display:flex;align-items:center;gap:13px;text-align:left;min-height:77px;border:2px solid #bcdcee;background:#f2faff;border-radius:17px;padding:10px 13px;box-shadow:0 3px 0 #d6e8f4;transition:transform .12s,border-color .12s,background .12s}
.member-menu-item:nth-child(2){background:#fff9e4;border-color:#eddeb3;box-shadow:0 3px 0 #f8edcb}
.member-menu-item:nth-child(3){background:#f7fbff}
.member-menu-item:hover{transform:translateY(-2px)}
.member-menu-item.selected{border-color:#5aa6d6;background:#e2f3ff;box-shadow:0 0 0 3px #d6ebfb,0 3px 0 #b2d8ee}
.member-menu-item:nth-child(2).selected{border-color:#e4bc57;background:#fff0b9;box-shadow:0 0 0 3px #fff4d6,0 3px 0 #e9d49a}
.menu-avatar{display:grid;place-items:center;width:52px;height:52px;flex:none;font-size:28px;border-radius:17px;background:#fff;border:1px dashed #bdd9e8}
.menu-member-details{display:flex;flex:1;min-width:0;flex-direction:column;gap:2px}
.menu-member-code{color:#84b0ce;font-size:9px;font-weight:800;letter-spacing:1.2px}
.menu-member-name{color:#335c79;font-size:16px;font-weight:900}
.menu-member-subtitle{color:#88a3b7;font-size:11px}
.menu-member-check{display:grid;place-items:center;width:29px;height:29px;flex:none;border-radius:50%;border:1px solid #bedcec;background:#fff;color:#82b8d7;font-size:18px;font-weight:800}
.member-menu-item.selected .menu-member-check{background:#70b5e1;border-color:#70b5e1;color:#fff}
.member-menu-item:nth-child(2).selected .menu-member-check{background:#e8c15c;border-color:#e8c15c}
.start-button{min-height:52px;border:2px solid #e8ca6d;border-radius:18px;background:#ffe9a3;color:#73592d;font-size:15px;font-weight:900;box-shadow:0 4px 0 #efdeaa;margin-top:auto}
.start-button span{font-size:19px;vertical-align:-1px;margin-left:6px}
.start-button:not(:disabled):hover{background:#ffdf7d}
.start-button:disabled{opacity:.55}
.start-fineprint{text-align:center;color:#99afc0;font-size:10px;line-height:1.45;margin:0}
@media(max-width:620px){.start-form{padding:18px 22px 15px;gap:13px}.start-heading h1{font-size:25px}.start-illustration{font-size:23px}.member-menu-item{min-height:70px;padding:9px 12px}.menu-avatar{width:48px;height:48px;font-size:26px}}
@media(max-height:730px){.start-form{gap:11px;padding-top:12px}.start-heading h1{font-size:23px;margin:0 0 5px}.start-heading > p:last-child{font-size:11px}.start-illustration{margin-bottom:0}.start-nickname input{height:42px}.member-menu-item{min-height:64px}.menu-avatar{width:43px;height:43px}.start-button{min-height:45px}}
@media print{.start-screen{display:none!important}}
