/* ─── Side panel ──────────────────────────────────────────────────────── */

.game-panel {
  width: 160px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 16px var(--shadow);
}

.game-panel-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-light);
}

.game-panel-tab {
  flex: 1;
  padding: 7px 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.1s;
  position: relative;
}

.game-panel-tab:hover { color: var(--accent); }

.game-panel[data-active-tab="chat"] .game-panel-tab[data-tab="chat"],
.game-panel[data-active-tab="inventory"] .game-panel-tab[data-tab="inventory"],
.game-panel[data-active-tab="profile"] .game-panel-tab[data-tab="profile"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.game-panel-tab.has-unread::after {
  content: '';
  position: absolute;
  top: 5px;
  right: calc(50% - 10px);
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.game-panel-pane { display: none; flex: 1; overflow: hidden; }

.game-panel[data-active-tab="chat"] .game-panel-pane[data-pane="chat"],
.game-panel[data-active-tab="inventory"] .game-panel-pane[data-pane="inventory"],
.game-panel[data-active-tab="profile"] .game-panel-pane[data-pane="profile"] {
  display: flex;
}

.game-profile {
  flex-direction: column;
  gap: 6px;
  padding: 10px;
}

.game-history {
  flex-direction: column-reverse;
  gap: 8px;
  padding: 10px;
}

.game-inventory {
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  overflow-y: auto;
}

/* ─── Inventory ───────────────────────────────────────────────────────── */

.inventory-section-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 8px 0 4px;
}

.inventory-section-header:first-child { margin-top: 0; }

.inventory-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inventory-empty {
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.7;
  margin: auto;
  opacity: 0.7;
}

.inventory-item {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--fg-2);
  flex-shrink: 0;
}

.inventory-item-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inventory-item.has-actions { cursor: pointer; }
.inventory-item.has-actions:hover .inventory-item-label { color: var(--fg); }
.inventory-item.has-actions:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ─── Chat history ────────────────────────────────────────────────────── */

.game-history-msg {
  font-family: monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--accent);
  flex-shrink: 0;
}

.game-history-msg--self {
  color: var(--fg-2);
  text-align: right;
  padding-left: 12px;
}

.game-history-placeholder {
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.7;
  margin: auto;
  flex-shrink: 0;
  opacity: 0.7;
}

@media (prefers-reduced-motion: no-preference) {
  .game-history-msg {
    animation: msg-fade 0.15s ease-out;
  }
}

@keyframes msg-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
