/* Shared game surfaces over the nebula, with restrained light around controls. */
:root {
  --plasma: #91eafa;
}
.game {
  background:
    linear-gradient(115deg, #040816cf 3%, #090e245e 54%, #0c081cd8 100%),
    url('nebula-deep.webp') center / cover no-repeat, #050817;
}
.game .main {
  background:
    radial-gradient(ellipse at 10% 4%, #29366140, transparent 54%),
    linear-gradient(180deg, #080f2450, #060a18d9);
  scrollbar-color: #5b7097 #0b1022;
}
.game .topbar, .game .resource-strip, .game .mobile-nav {
  background:
    linear-gradient(103deg, #182846, #101a32 42%, #17132e 78%, #131d37);
  border-bottom-color: #657bb680;
}
.game .topbar { box-shadow: inset 0 1px #a7eaff42, 0 8px 28px #03051170; }
.game .resource-strip {
  box-shadow: inset 0 1px #789be926, 0 6px 18px #020511a0;
}
.game .top-logo .emblem, .auth-screen .logo-large .emblem {
  border-color: #9bcaff;
  background: radial-gradient(circle at 48% 42%, #456799, #1b2b50 63%, #141932);
  box-shadow: inset 0 0 16px #80d6ff44, 0 0 21px #578cf740;
  color: #dcf7ff;
}
.game .top-chip {
  border-color: #758fc269;
  background: linear-gradient(125deg, #243954a8, #11182fae);
}
.game .sidebar, .game .activity-bar {
  background: linear-gradient(150deg, #13223be8, #0a1025f5 54%, #12132afa);
  border-color: #5e7cab6e;
}
.game .sidebar { overflow-y: auto; overflow-x: hidden; }
.game .nav-main { gap: 4px; grid-template-columns: minmax(0,1fr); }
.game .nav-btn span:last-child { min-width: 0; overflow-wrap: anywhere; }
.game .nav-btn { padding-block: 9px; }
.game .nav-btn:is(:hover,.selected), .game .mobile-nav button.selected {
  background: linear-gradient(100deg, #284c72, #2e2655b0);
  border-color: #748bc8;
  color: #eff9ff;
  box-shadow: inset 2px 0 #a5edff, inset 0 1px #b1cefc29;
}
.game .mobile-nav button.selected { box-shadow: inset 0 2px #a5edff; }
.game .mobile-nav { grid-template-columns: repeat(6,minmax(0,1fr)); }
.game .mobile-nav button { min-width: 0; }

.screen .section-head h1 {
  color: #f3f5ff;
  text-shadow: 0 0 24px #7f9afa5c;
  overflow-wrap: anywhere;
}
.screen .section-head .eyebrow { color: #a4dafa; letter-spacing: .16em; }
.screen .section-head .section-sub { color: #bacbe6; }
.screen .section-head > div { min-width: 0; }
.game .panel, .game .stat, .game .overview-resource-card, .game .planet-production-card,
.game .building-card, .game .sector, .game .planet-pill, .game .activity-item, .dialog {
  border-color: #536b9a9c;
  background: linear-gradient(146deg, #203456dd 0%, #161f3ae8 48%, #15172eee 100%);
  box-shadow: inset 0 1px #b7d6ff21, 0 9px 24px #02050f36;
}
.game .panel-title, .dialog .dialog-header {
  background: linear-gradient(110deg, #273d62a0, #332b53a0 68%, #232c4ea0);
  border-color: #607ca46f;
}
.game .panel-title h3, .dialog h2 { color: #eaf2ff; }
.game :is(.planet-pill,.building-card,.sector,.overview-resource-card,.activity-item):hover,
.game :is(.planet-pill,.sector).active {
  border-color: #a0d4ff;
  box-shadow: inset 0 0 18px #809bda3b, 0 0 14px #639dfa38;
}
.game .colony-scene, .game .galaxy-wrap {
  border: 1px solid #7697c7;
  border-radius: 17px;
  box-shadow: 0 0 0 3px #789cdd18, 0 20px 45px #01040db3;
}
.game .scene-overlay, .game .galaxy-overlay { text-shadow: 0 2px 8px #010514; }
.game .scene-bottom span, .game .galaxy-tip {
  border-color: #92b9e592;
  background: #101a30dc;
}
.game .resource-tile { box-shadow: inset 0 1px #d3e5ff27, 0 3px 12px #0206166e; }
.game .resource-tile:hover { transform: none; }
.game .strip-heading { overflow: hidden; }
.game .strip-heading strong { font-family: system-ui,sans-serif; }
:is(.game,.dialog,.auth-screen) .primary {
  border: 1px solid #a1e5fd;
  background: linear-gradient(110deg, #a4e9ff, #aecbff 55%, #c6b5fb);
  color: #0d1832;
  box-shadow: inset 0 1px #f5f8ffb0, 0 0 15px #8fbef747;
}
:is(.game,.dialog,.auth-screen) :focus-visible {
  outline: 2px solid #b0eaff;
  outline-offset: 2px;
}
.game .soft-btn, .dialog .soft-btn {
  border-color: #738dbe;
  background: linear-gradient(125deg, #28456b, #2a244b);
  color: #edf1ff;
}
.game .soft-btn:hover, .dialog .soft-btn:hover { border-color: #b2ddff; }
.overlay { background: #040817be; backdrop-filter: blur(5px); }
.auth-screen {
  background-image: linear-gradient(90deg, #040919f5 0%, #070c1d94 50%, #04091919 100%), url('stellar-welcome.webp');
}
.auth-screen .auth-panel { border-color: #89aee37d; box-shadow: 0 18px 48px #0206149c; }

.mobile-menu-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.mobile-menu-grid button { text-align: left; overflow-wrap: anywhere; }

/* Galaktischer Funk */
.chat-terminal {
  display: grid;
  grid-template-columns: minmax(155px,220px) minmax(0,1fr);
  border: 1px solid #6f8fc6;
  border-radius: 17px;
  overflow: hidden;
  background: #0a1024;
  box-shadow: 0 17px 48px #0205129c, 0 0 0 3px #779deb1c;
}
.chat-terminal :is(h2,h3,p) { margin: 0; }
.chat-terminal h2 { font-size: 17px; color: #edf5ff; }
.chat-rooms {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 11px;
  background: linear-gradient(158deg, #233455, #171b37 64%, #1c1a37);
  border-right: 1px solid #5e74a4;
}
.chat-rooms-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.chat-rooms-head button { font-size: 11px; padding: 7px 9px; }
.chat-rooms h3 { color: #baccec; font-size: 12px; margin-top: 6px; }
.chat-room-list, .chat-private-list { display: grid; gap: 5px; }
.chat-private-list { max-height: 250px; overflow: auto; }
.chat-private-list p { font-size: 12px; line-height: 1.5; color: #aebfda; }
.chat-room {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 8px;
  min-width: 0;
  min-height: 39px;
  padding: 7px 9px;
  border: 1px solid #6079a260;
  border-radius: 8px;
  background: #0c172dba;
  color: #d4e6ff;
  font-weight: 700;
}
.chat-room span:first-child { color: var(--plasma); flex: none; }
.chat-room span:last-child { overflow-wrap: anywhere; }
.chat-room[aria-pressed="true"], .chat-room:hover {
  border-color: #91c6ef;
  background: linear-gradient(110deg, #274a6e, #30274d);
}
.chat-conversation {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0,1fr) auto auto;
  height: clamp(330px,62dvh,650px);
  background:
    linear-gradient(#090e23a8,#080c1bec),
    url('nebula-deep.webp') center / cover no-repeat;
}
.chat-conversation > header {
  padding: 13px 15px;
  border-bottom: 1px solid #647aab8c;
  background: #182544ce;
  overflow-wrap: anywhere;
}
.chat-conversation > header p { font-size: 12px; color: #c0d0e8; margin-top: 4px; max-height: 48px; overflow: auto; }
.chat-history { overflow: auto; overscroll-behavior: contain; padding: 12px; scrollbar-color: #647aa8 #0d152b; }
.chat-messages { display: grid; gap: 9px; }
.chat-message {
  justify-self: start;
  min-width: min(165px,100%);
  max-width: min(90%,720px);
  padding: 8px 11px;
  border: 1px solid #667aa38c;
  border-radius: 4px 13px 13px 13px;
  background: #1b2a47ed;
  overflow-wrap: anywhere;
}
.chat-message.own { justify-self: end; background: #2b2950ed; border-color: #998ad0a3; border-radius: 13px 4px 13px 13px; }
.chat-message > div { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
.chat-message strong { font-size: 12px; color: #c5e9ff; }
.chat-message time { font-size: 10px; color: #b8c7e2; }
.chat-message p { color: #f1f4ff; white-space: pre-wrap; font-size: 14px; line-height: 1.45; margin-top: 3px; }
.chat-empty { color: #c5d1e9; text-align: center; padding: 16px; }
.chat-older { display: block; margin: 0 auto 12px; }
.chat-older[hidden], .chat-empty[hidden] { display: none; }
.chat-status { color: #ffd0d9; padding: 4px 12px; font-size: 12px; }
.chat-status:empty { display: none; }
.chat-composer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; padding: 9px; background: #111b33f0; border-top: 1px solid #536b9a9c; }
.chat-composer textarea { min-width: 0; width: 100%; margin: 0; resize: none; font: inherit; padding: 9px; color: #f3f6ff; border: 1px solid #7086b0; border-radius: 8px; background: #0d162d; }
.chat-composer .primary { align-self: stretch; padding-inline: 11px; }
.chat-composer button:disabled { opacity: .6; }
.chat-create-form fieldset { border: 1px solid #6078a1; border-radius: 9px; padding: 8px; margin: 10px 0; }
.chat-player-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(145px,100%),1fr)); max-height: 220px; overflow: auto; gap: 6px; }
.chat-player-list label { display: flex; align-items: center; gap: 7px; margin: 0; padding: 6px; background: #15213a; border-radius: 5px; overflow-wrap: anywhere; }
.chat-player-list input[type="checkbox"] { width: auto; flex: none; margin: 0; accent-color: #90d4ff; }

@media (min-width: 761px) and (max-width: 1360px) {
  .resource-rail .resource-tile { padding-block: 2px; }
  .resource-rail .resource-tile .res-data { gap: 1px; }
  .resource-rail .res-data :is(.res-name,.res-amount,.res-rate) { line-height: 1.12; }
}
@media (max-width: 760px) {
  .game .main { background-attachment: scroll; }
  .game .screen:has(.chat-terminal) {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-height: 0;
    padding-block: 9px;
  }
  .chat-heading { flex: none; min-height: 0; margin: 0; padding-bottom: 6px; }
  .chat-heading .eyebrow { display: none; }
  .chat-terminal {
    flex: 1 1 0;
    min-height: 345px;
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto minmax(185px,1fr);
    border-radius: 11px;
  }
  .chat-rooms { padding: 8px; gap: 6px; border-right: 0; border-bottom: 1px solid #5e74a4; }
  .chat-room-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .chat-private-list { grid-template-columns: repeat(2,minmax(0,1fr)); max-height: 92px; }
  .chat-private-list p { grid-column: 1/-1; }
  .chat-room { font-size: 11px; min-height: 35px; padding: 4px 5px; gap: 3px; }
  .chat-room-list .chat-room { justify-content: center; text-align: center; }
  .chat-room-list .chat-room span:first-child { display: none; }
  .chat-conversation { height: auto; min-height: 185px; }
  .chat-composer textarea { font-size: 16px; }
}
@media (max-width: 380px) {
  .game .strip-heading .resource-orbit { display: none; }
  .game .strip-heading strong { font-size: 9px; letter-spacing: .02em; }
  .chat-room span:first-child { display: none; }
  .chat-room { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .game *, .auth-screen *, .dialog * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
