* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #0d1117; color: #e6edf3;
  font-family: 'Segoe UI', 'Malgun Gothic', sans-serif; }
.hidden { display: none !important; }

#canvas { display: block; width: 100vw; height: 100vh; image-rendering: pixelated; }

.overlay { position: fixed; inset: 0; background: rgba(5, 8, 15, .75);
  display: flex; align-items: center; justify-content: center; z-index: 50; }
.panel { background: #161b26; border: 1px solid #2d3548; border-radius: 12px;
  padding: 24px; width: min(420px, 92vw); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.panel.wide { width: min(560px, 94vw); max-height: 80vh; display: flex; flex-direction: column; }
.panel h1 { font-size: 28px; margin-bottom: 6px; }
.panel h3 { margin-bottom: 10px; }
.tagline { color: #8b96a8; font-size: 13px; margin-bottom: 18px; }
.login-panel { text-align: center; }
input, textarea { width: 100%; background: #0d1117; color: #e6edf3;
  border: 1px solid #2d3548; border-radius: 8px; padding: 10px 12px; font-size: 15px;
  margin-bottom: 10px; outline: none; resize: none; }
input:focus, textarea:focus { border-color: #58a6ff; }
button { background: #2ea043; color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font-size: 15px; cursor: pointer; }
button:hover { filter: brightness(1.1); }
button.ghost { background: #21283b; color: #c9d4e3; }
.error { color: #ff7b72; font-size: 13px; min-height: 18px; margin-top: 8px; }
.row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.hint { color: #8b96a8; font-size: 12px; margin-top: 8px; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#statusBar { position: absolute; top: 12px; left: 12px; background: rgba(13,17,23,.8);
  border: 1px solid #2d3548; border-radius: 10px; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px; pointer-events: auto; }
#hudName { font-weight: 700; }
.bar { position: relative; width: 140px; height: 16px; background: #21283b;
  border-radius: 8px; overflow: hidden; }
.bar > div { height: 100%; transition: width .2s; }
.bar.hp > div { background: linear-gradient(90deg, #f85149, #ff9b4e); }
.bar.xp > div { background: linear-gradient(90deg, #58a6ff, #9d7bff); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 11px;
  line-height: 16px; text-shadow: 0 1px 2px #000; }
#hudGold { color: #f0c649; font-weight: 600; }
#topRight { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px;
  pointer-events: auto; }
#topRight button { background: #21283b; border: 1px solid #2d3548; font-size: 14px; }
#wishBtn.open { background: #6e40c9; border-color: #8957e5; animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 14px #8957e5; } }

#announceBanner { position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, #6e40c9, #388bfd); border-radius: 10px;
  padding: 10px 22px; font-weight: 700; box-shadow: 0 6px 24px rgba(110,64,201,.5);
  max-width: 80vw; text-align: center; animation: dropIn .45s ease; }
@keyframes dropIn {
  from { transform: translateX(-50%) translateY(-24px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
#reloadBanner { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: #b62324; border-radius: 12px; padding: 18px 30px; font-size: 20px;
  font-weight: 800; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
#controls { position: absolute; bottom: 12px; right: 12px; background: rgba(13,17,23,.7);
  border: 1px solid #2d3548; border-radius: 8px; padding: 6px 12px; font-size: 12px;
  color: #8b96a8; }
#controls b { color: #c9d4e3; }

/* 채팅 */
#chatBox { position: fixed; left: 12px; bottom: 12px; width: min(380px, 60vw); z-index: 20; }
#chatLog { max-height: 180px; overflow-y: auto; background: rgba(13,17,23,.7);
  border-radius: 10px 10px 0 0; padding: 8px 10px; font-size: 13px; }
#chatLog .msg { margin: 2px 0; word-break: break-all; }
#chatLog .sys { color: #d2a8ff; font-weight: 600; }
#chatLog .from { color: #7ee787; font-weight: 600; }
#chatInput { border-radius: 0 0 10px 10px; margin: 0; background: rgba(13,17,23,.85);
  font-size: 13px; padding: 8px 10px; }

/* 인벤토리 */
#inventory { position: fixed; right: 12px; top: 64px; width: 292px; z-index: 30;
  max-height: calc(100vh - 84px); overflow-y: auto; }
#invGold { color: #f0c649; font-size: 13px; float: right; }
#equipRow { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
#equipRow .slot { background: #0d1117; border: 1px solid #3d4661;
  border-radius: 8px; padding: 6px 8px; font-size: 12px; color: #c9d4e3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enhanceBtn { display: block; margin-top: 5px; width: 100%; padding: 4px 6px;
  font-size: 11px; background: #6e40c9; border-radius: 6px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.enhanceBtn:hover { background: #8957e5; }
.enhanceMax { color: #ffdf6b; font-weight: 700; font-size: 11px; }
#invGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#invGrid .cell { aspect-ratio: 1; background: #0d1117; border: 1px solid #2d3548;
  border-radius: 8px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; font-size: 10px; cursor: pointer; text-align: center;
  overflow: hidden; padding: 2px; }
#invGrid .cell:hover { border-color: #58a6ff; }
#invGrid .cell .icon { font-size: 17px; }
#invGrid .cell .name { max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; line-height: 1.2; }
#invGrid .cell .qty { color: #8b96a8; }

/* 패치 노트 */
#patchList { overflow-y: auto; flex: 1; }
.patch { border-bottom: 1px solid #2d3548; padding: 10px 4px; }
.patch .ver { font-weight: 700; color: #58a6ff; }
.patch .status-deployed { color: #7ee787; }
.patch .status-failed { color: #ff7b72; }
.patch .status-skipped { color: #8b96a8; }
.patch .status-scheduled { color: #d2a8ff; }
.patch .grade-great { color: #ffdf6b; font-weight: 700; }
.patch .grade-normal { color: #9ecbff; }
.patch .wish { color: #d2a8ff; font-size: 13px; margin: 4px 0; }
.patch .summary { font-size: 13px; color: #c9d4e3; white-space: pre-wrap; }
.patch .when { font-size: 11px; color: #8b96a8; }
#wishStatus { font-size: 13px; color: #8b96a8; margin-bottom: 8px; }
#wishResult { font-size: 13px; min-height: 18px; margin-top: 6px; }
.wishListTitle { margin-top: 12px; padding-top: 10px; border-top: 1px solid #2d3548;
  font-size: 14px; }
#wishList { max-height: 180px; overflow-y: auto; margin-top: 6px; }
.wishItem { font-size: 13px; padding: 6px 8px; border-radius: 8px; margin-bottom: 4px;
  background: #0d1117; border: 1px solid #232b3d; color: #c9d4e3; word-break: break-all; }
.wishItem .wisher { color: #d2a8ff; font-weight: 600; margin-right: 6px; }
.sponsorRow { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.sponsorRow .tickets { color: #ffdf6b; font-size: 12px; }
.sponsorBtn { padding: 3px 8px; font-size: 11px; background: #b8860b; }
.wishItem.upcoming { border-color: #6e40c9; background: #161226; }
.jobCard { border: 1px solid #2d3548; border-radius: 10px; padding: 10px; margin-bottom: 8px;
  background: #0d1117; }
.jobCard.current { border-color: #58a6ff; }
.jobCard .jobHead { font-size: 15px; margin-bottom: 4px; }
.jobCard .jobSkills { font-size: 12px; color: #8b96a8; margin-bottom: 8px; line-height: 1.5; }
.skillRow { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-bottom: 1px solid #232b3d; padding: 8px 4px; }
.skillRow small { color: #8b96a8; }
.skillRow .slv { color: #ffdf6b; font-weight: 700; margin-left: 6px; }
.skillRow button { padding: 4px 10px; font-size: 12px; }
.skillRow button:disabled { background: #21283b; color: #5a6478; cursor: not-allowed; }
#shopList { max-height: 320px; overflow-y: auto; margin: 8px 0; }
.shopRow { display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-bottom: 1px solid #232b3d; }
.shopRow .icon { font-size: 18px; }
.shopRow .sname { flex: 1; font-size: 13px; }
.shopRow .sname small { color: #8b96a8; margin-left: 4px; }
.shopRow button { padding: 4px 12px; font-size: 12px; background: #b8860b; }
.shopRow button:disabled { background: #21283b; color: #5a6478; cursor: not-allowed; }
#shopGold { float: right; color: #f0c649; font-size: 13px; }
#floorButtons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; }
#floorButtons button { padding: 10px 4px; font-size: 14px; }
#floorButtons button.locked { background: #21283b; color: #5a6478; cursor: not-allowed; }
.wishItem.upcoming .when { color: #ffdf6b; font-size: 12px; }
