html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

#gameCanvas {
  position: fixed;
  background-color: black;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

#chat {
  position: fixed;
  left: 12px;
  bottom: 12px;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 350px;
  max-height: calc(100vh - 24px);

  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;

  padding: 10px;
  border-radius: 14px;

  background: rgba(0,0,0,0.38);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  color: rgba(255,255,255,0.92);
  user-select: none;
  pointer-events: auto;
}

#chat2 {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 450px;
  max-width: calc(100vw - 24px);
  height: 500px;
  max-height: calc(100vh - 24px);

  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;

  padding: 10px;
  border-radius: 14px;

  background: rgba(0,0,0,0.38);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  color: rgba(255,255,255,0.92);
  user-select: none;
  pointer-events: auto;
}

#chat.minimized {
  height: auto;
  grid-template-rows: auto;
}

#chat2.minimized {
  height: auto;
  grid-template-rows: auto;
}
#chat.minimized .chat-body,
#chat.minimized .chat-input {
  display: none;
}

#chat2.minimized .chat2-body,
#chat2.minimized .sendBtn,
#chat2.minimized .chat-input {
  display: none;
}


.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.chat-title {
  font: 700 13px/1.1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  opacity: .95;
}
.chat-actions { display: flex; gap: 6px; }

.chat-btn {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  border-radius: 10px;
  padding: 6px 10px;
  font: 700 12px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  cursor: pointer;
}

.chat-btn:hover { background: rgba(255,255,255,0.12); }
.chat-btn:active { transform: translateY(1px); }

.chat-body {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  padding: 8px;
  user-select: text;
}

.chat2-body {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  padding: 8px;
  user-select: text;
}

.msg { margin: 0 0 8px 0; display: grid; gap: 2px; }
.meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: rgba(255,255,255,0.65);
  font-size: 11px;
}
.name { color: rgba(255,255,255,0.92); font-weight: 800; }
.text { color: rgba(255,255,255,0.92); white-space: pre-wrap; word-break: break-word; }

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

#chatInput {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.22);
  color: rgba(255,255,255,0.92);
  padding: 10px;
  outline: none;
  font: 13px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
#chatInput::placeholder { color: rgba(255,255,255,0.45); }

.sendBtn {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  font: 900 12px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  cursor: pointer;
}

.sendBtn#menuG {
  background: rgba(224, 121, 43,0.10);
}

.sendBtn:hover { background: rgba(255,255,255,0.14); }
.sendBtn#menuG:hover {
  background: rgba(224, 121, 43,0.18);
}
.sendBtn:active { transform: translateY(1px); }

#sendBtn{
  padding: 10px 12px;
}

/*#menuD {
  padding: 15px 16px;
}
#menuI {
  padding: 15px 16px;
}*/

@media (max-width: 420px) {
  #chat { width: 92vw; height: 42vh; }
}

.tab{
  padding: 12px 13px;
}

.tab.active{
  background: rgba(120,180,255,0.18);
  border-color: rgba(120,180,255,0.35);
}

.tab.active#menuG{
  background: rgba(120,180,255,0.18);
  border-color: rgba(120,180,255,0.35);
}

.panel{ border-radius: 12px; }
.panel:not(.active){ display: none; } /* hidden도 같이 써도 됨 */


.container {
  display: flex;
  justify-content: space-between;
  align-items: center; /* 세로 정렬 */
  margin: 4px;
  padding: 6px;
  border-radius: 5px;
}

.factoryN{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(171, 170, 240,0.18);
}

.tabTitle{
  text-align: center;
  margin: 15px;
}

.prodClass{
  text-align: center;
  margin: 7px;
  padding: 7px;
}

.buy-btn {
  position: relative;
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.92);
  border-radius: 7px;
  padding: 6px 10px;
  font: 700 12px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  cursor: pointer;
  user-select: none;
  background: none;
  overflow: hidden;
  z-index: 0; 
}

.buy-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  transition: all 0.3s ease;
  z-index: -1;
}

.buy-btn:hover::before { filter: brightness(0.9); }
.buy-btn:active::before {  }
.buy-btn:active { transform: translateY(1px); }

.buyable::before {
  background: rgba(94, 255, 61,0.15); /*  0.08 -> 0.15  hover background: rgba(94, 255, 61,0.12); */
}

.not-buyable::before {
  background: rgba(245, 66, 66,0.15);
}

.buy-limit::before {
  background: rgba(245, 200, 66,0.25);
}


.guideBox {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 220, 150,0.15);
  background: rgba(255, 220, 150,0.25);
  padding: 8px;
  user-select: text;
}
