/* Compact companion screen. Gen V reference: white/black menu rails,
   inset white capsules, red selection brackets, monochrome dialogue. */
:root{--panel-width:360px;--ink:#25262a;--paper:#fafafa;--line:#83858b;--green:#30343a;font-family:'Dotum','Gulim',sans-serif;background:#191a1e}
body{background:repeating-linear-gradient(135deg,#222328 0 2px,#1e1f23 2px 8px)}
header{padding:14px 24px}h1{font-size:23px;letter-spacing:0}h1 span{font-size:11px}.eyebrow{letter-spacing:1.3px}
main{padding:0 22px}.toolbar{background:linear-gradient(#484a50 0 45%,#303238 45%);border:2px solid #101114;box-shadow:inset 0 0 0 1px #94969b;border-radius:8px 8px 0 0}.toolbar button{min-height:36px}
button{border:2px solid #33353b;border-radius:7px;background:linear-gradient(#fff 0 48%,#e7e8eb 49% 100%);box-shadow:inset 0 0 0 2px #fff,0 2px #111;color:#25262a;font-size:13px;min-height:40px}
button:hover{background:linear-gradient(#fff7ed 0 48%,#ffe2b9 49%);border-color:#c44c40;box-shadow:inset 0 0 0 2px #fff,0 2px #6a2625}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #d95743;outline-offset:3px}
.primary{background:linear-gradient(#586b81 0 48%,#35465e 49%);color:#fff;border-color:#202a3a}.primary:hover{background:#475e78;color:#fff}
body.panel-visible main,body.panel-visible>header{margin-right:calc(var(--panel-width) + 20px);max-width:none}
body.panel-visible .toolbar{align-items:flex-start;flex-direction:column;gap:7px}
body.panel-visible #stage{width:min(100%,calc((100dvh - 245px)*1.333333))}
#panel{position:fixed;inset:16px 16px 16px auto;margin:0;width:var(--panel-width);height:calc(100dvh - 32px);max-height:none;max-width:calc(100vw - 24px);padding:0;overflow:hidden;border:3px solid #202126;border-radius:12px;background:#f5f5f5;box-shadow:0 0 0 2px #d8d9dc,0 0 0 4px #56585d,5px 7px 0 #10111480;z-index:100}
#panel[open]{display:flex;flex-direction:column}#panel::backdrop{background:transparent}
.dialog-heading{position:relative;flex:none;display:flex;gap:8px;padding:13px 12px 12px;background:linear-gradient(#53555d 0 48%,#303239 49%);border-bottom:4px solid #9ea1a9;box-shadow:inset 0 2px #a9abb2}
.dialog-heading h2{font-size:18px;line-height:1.5;letter-spacing:0;margin-top:5px;text-shadow:1px 2px #14151a}.dialog-heading .eyebrow{color:#e0e1e4;font:9px Consolas,monospace;letter-spacing:1px}.panel-navigation{gap:5px;align-self:center}.dialog-heading button{border-radius:6px;height:36px;min-height:36px;box-shadow:inset 0 0 0 2px #fff}.dialog-heading #back-panel{font-size:12px;padding:0 8px}.dialog-heading #close-panel{width:30px}
#panel-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:15px 13px 22px;border:0;background:repeating-linear-gradient(0deg,#f6f6f6 0 2px,#eeeef0 2px 4px);font-size:13px;line-height:1.75;scrollbar-width:thin;scrollbar-color:#888a92 #e7e7e9}
#panel-content>p{margin:0 0 14px}#panel-content button{border-radius:6px;min-height:42px;font-size:13px;padding:9px 11px}#panel-content>button::before,#panel-content .actions button::before{content:none}#panel-content>button,#panel-content .actions button{padding-left:11px}
.panel-footer{position:relative;flex:none;background:linear-gradient(#53555b,#303238);border-top:3px solid #9ea1a9;padding:9px 12px}.panel-footer button{width:100%;font-size:12px;min-height:38px}
.game-menu{gap:12px;margin:7px 0 18px}.game-menu .game-option{position:relative;grid-template-columns:15px minmax(0,1fr) 23px;gap:3px 8px;border:2px solid #62656b;border-radius:10px;padding:15px 10px;background:linear-gradient(#fff 0 49%,#ececef 50%);box-shadow:inset 0 0 0 3px #fff,0 3px #a1a2a8;min-height:90px}
.menu-title{font-size:16px;letter-spacing:0;color:#28292d}.menu-description{font-size:12px;line-height:1.65;color:#595b63;margin-top:2px}.menu-key{width:22px;height:22px;border:2px solid #70727a;color:#fff;background:#50525a;box-shadow:inset 0 0 0 1px #fff;font:bold 11px Consolas}.menu-cursor{color:#9a9da4;font-size:11px}.game-option:hover,.game-option:focus-visible{border-color:#c9493c;background:linear-gradient(#fff7e8 0 49%,#ffe2b5 50%);box-shadow:inset 0 0 0 3px #fff,0 3px #a64b43}.game-option:hover .menu-cursor,.game-option:focus-visible .menu-cursor{color:#cf4435}
.notice{border:1px solid #9a9ca4;border-left:4px solid #64778e;background:#fff;padding:10px 11px;font-size:12px;line-height:1.8;box-shadow:none}.game-link{color:#3d5678;line-height:1.7;overflow-wrap:anywhere}
input:not([type=file]),textarea,select{width:100%;min-width:0;border:2px solid #82858f;background:#fff;border-radius:4px;color:#272a30;padding:9px;box-shadow:inset 1px 2px #dddfe4;font-size:14px}textarea{min-height:95px;resize:vertical}label{font-size:12px;color:#424650}form{min-width:0}label+input,label+textarea,label+select{margin:5px 0 12px}
.gallery-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.gallery-list img{height:110px;object-fit:contain;background:#202126;image-rendering:auto}.gallery-list button{min-width:0}.gallery-list strong{display:block;font-size:12px;margin-top:7px}.gallery-list button:hover:after{content:'▶';background:#cf4d3c}.photo-view{width:100%;height:auto;max-height:36dvh;object-fit:contain;background:#1b1c20;border:2px solid #686a73;box-shadow:0 0 0 2px white;image-rendering:auto;cursor:zoom-in}.actions{display:flex;flex-wrap:wrap;gap:4px}.actions button{flex:1;white-space:nowrap}
.chat-log{max-height:38dvh;gap:10px;padding:2px 1px 12px}.chat-line{font-size:13px;line-height:1.8;padding:11px 12px;border:2px solid #545760;border-radius:9px!important;background:#fff;box-shadow:inset 0 0 0 2px #e5e6ea}.chat-line.you{background:#e6ebf3;border-color:#7d8ca2}.chat-line:not(.you)::before{content:'지유';color:#385474;font-size:11px}.chat-line.you::before{content:'나';color:#555d6b}
.bubble{border:2px solid #2c2e34;border-radius:8px;background:#fff;color:#24262b;box-shadow:inset 0 0 0 2px #d6d7dc,0 0 0 2px #fff,2px 3px 0 #15161b70;padding:8px 11px;max-width:175px;font-size:12px;line-height:1.5}.bubble strong{margin:-4px 0 3px;padding:0;background:transparent!important;border:0!important;color:#3d516d;font-size:11px;letter-spacing:0}.bubble::after{background:#fff;border-color:#2c2e34;bottom:-7px;width:9px;height:9px}.bubble.yongyongi{border-color:#33343a;max-width:160px}.bubble.yongyongi strong{color:#8c4f20}.bubble.jiyu:hover{background:#fff4db}.bubble-text{line-height:1.5}
.catalog-filters{grid-template-columns:1fr 1fr;gap:7px}.catalog-filters input{grid-column:1/3}.catalog-row{padding:12px 0;overflow-wrap:anywhere}.catalog-row small{font-size:11px;color:#60636b}.catalog-row .catalog-photo{width:100%;max-height:190px;object-fit:contain;background:#22242b;image-rendering:auto}.publish-selection{max-height:35dvh;background:#fff;border:2px solid #9699a2;border-radius:6px}.photo-choice{font-size:12px;gap:5px 7px;padding:9px 4px}.photo-choice small{font-size:11px}.task-card{padding:11px;border-radius:6px}.task-card dl{grid-template-columns:65px minmax(0,1fr)}
#photo-lightbox{position:fixed;inset:20px;margin:auto;width:calc(100vw - 40px);height:calc(100dvh - 40px);max-width:none;max-height:none;border:3px solid #aeb0b8;border-radius:10px;padding:12px;background:#18191d;color:white;z-index:300;box-shadow:0 0 0 3px #222}
#photo-lightbox[open]{display:flex;flex-direction:column;gap:10px}#photo-lightbox::backdrop{background:#101116e8}#photo-lightbox .viewer-head{display:flex;align-items:center;justify-content:space-between;gap:12px}#photo-lightbox .viewer-head strong{font-size:14px;overflow-wrap:anywhere}#photo-lightbox .viewer-image{flex:1;min-height:0;overflow:auto;display:grid;place-items:center}#photo-lightbox img{max-width:100%;max-height:100%;object-fit:contain;image-rendering:auto}#photo-lightbox .viewer-image.original{display:block}#photo-lightbox .original img{max-width:none;max-height:none}#photo-lightbox p{font-size:12px;margin:0;color:#c4c6ce}
@media(min-width:1500px){:root{--panel-width:380px}}
@media(max-width:850px){body.panel-visible main,body.panel-visible>header{margin-right:0}#panel{inset:8px 8px 8px auto;width:min(360px,calc(100vw - 16px));height:calc(100dvh - 16px)}body.panel-visible::after{content:'';position:fixed;inset:0;background:#1118;z-index:90;pointer-events:none}#panel-content{padding:13px}.bubble{font-size:10px;max-width:120px}.bubble strong{font-size:9px}.bubble.yongyongi{max-width:115px}.dialog-heading h2{font-size:17px}#photo-lightbox{inset:7px;width:calc(100vw - 14px);height:calc(100dvh - 14px)}header{padding:12px}.toolbar{flex-wrap:wrap}main{padding:0 10px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* Fullscreen keeps the world and its companion panel in the same top layer. */
:root:fullscreen{overflow:auto;background:#191a1e}
:root:fullscreen #viewport{max-height:calc(100dvh - 170px)}
:root:fullscreen #stage{width:min(100%,calc((100dvh - 175px)*1.333333))}
.room-chat-log{min-height:150px;max-height:42dvh;overflow:auto}.room-chat-log .chat-line{display:flex;flex-direction:column;gap:3px}.room-chat-log .chat-line strong{font-size:11px;color:#3d516d}.room-chat-log .chat-line span{white-space:pre-wrap;overflow-wrap:anywhere}.room-chat-log .chat-line small{align-self:flex-end;color:#656b75;font-size:10px}

/* BW2 actual touch menu: dark grid, notched tabs, outlined category glyphs. */
#panel-content:has(>.game-menu){background:linear-gradient(#65676d55 1px,transparent 1px),linear-gradient(90deg,#65676d55 1px,transparent 1px),#37393f;background-size:12px 12px}
.game-menu{gap:17px;margin:4px 0}.game-menu .game-option{grid-template-columns:37px minmax(0,1fr) 23px;gap:3px 10px;min-height:105px;border-radius:0;border:2px solid #111217;padding:23px 12px 14px;background:linear-gradient(43deg,#24262b 0 43%,#404249 43%);box-shadow:inset 0 0 0 2px #a5a6ac,inset 0 0 0 4px #202126;clip-path:polygon(0 0,25% 0,30% 12px,100% 12px,100% 100%,0 100%)}
.game-menu .menu-title{color:#fff;text-shadow:1px 2px #101115;font-size:17px}.game-menu .menu-description{color:#c9cbd1;font-size:12px;line-height:1.65}.menu-icon{grid-column:1;grid-row:1/3;width:32px;height:32px;align-self:center;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:square;stroke-linejoin:miter;filter:drop-shadow(1px 2px #101115)}.game-menu .menu-key{background:#24262b;border-color:#8c8f98;box-shadow:none;color:#e8e9ed}
.game-menu .game-option:hover,.game-menu .game-option:focus-visible{background:linear-gradient(43deg,#1c384d 0 43%,#2c5874 43%);border-color:#87e3f6;box-shadow:inset 0 0 0 2px #bcefff,inset 0 0 0 4px #182b39}.game-menu .game-option:focus-visible{outline:0}
#photo-lightbox .viewer-image{display:block;position:relative}#photo-lightbox .viewer-image:not(.original) img{position:absolute;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}#photo-lightbox .viewer-image.original img{position:static;width:auto;height:auto;max-width:none;max-height:none}
