/* Hub main column: topbar, welcome, iframe host */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  background: #003f7f;
  border-bottom: 3px solid #ffc72c;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  flex-shrink: 0;
  gap: 12px;
}
.tb-logo {
  font-family: "DM Serif Display", serif;
  font-size: 17px;
  display: flex;
  align-items: baseline;
  flex-shrink: 0;
}
.tb-logo .t {
  color: #fff;
}
.tb-logo .g {
  color: #ffc72c;
}
.tb-logo .a {
  color: #fff;
}
.tb-sep {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.tb-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tb-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}
.tb-spacer {
  flex: 1;
}
.tb-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 199, 44, 0.15);
  color: #ffc72c;
  border: 1px solid rgba(255, 199, 44, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.content-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #0a1628;
}

.welcome-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  text-align: center;
  padding: 40px;
  background: linear-gradient(135deg, #0a1628 0%, #0d2045 100%);
}
.welcome-screen.hidden {
  display: none;
}
.welcome-screen h1 {
  font-family: "DM Serif Display", serif;
  font-size: 36px;
  color: #fff;
  line-height: 1.2;
}
.welcome-screen h1 span {
  color: #ffc72c;
}
.welcome-screen p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  max-width: 480px;
  line-height: 1.7;
}
.welcome-screen .welcome-emoji {
  font-size: 44px;
  margin-bottom: 10px;
  line-height: 1;
}
.wc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 640px;
  width: 100%;
}
.wc-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: left;
}
a.wc-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.wc-card:hover {
  background: rgba(255, 199, 44, 0.07);
  border-color: rgba(255, 199, 44, 0.25);
  transform: translateY(-2px);
}
.wc-icon {
  font-size: 20px;
  margin-bottom: 6px;
}
.wc-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}
.wc-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
}

.loading-screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  z-index: 500;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(4px);
}
.loading-screen.show {
  display: flex;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 199, 44, 0.2);
  border-top-color: #ffc72c;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-screen p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

#mainFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
#mainFrame.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .wc-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }
  .main {
    flex: 1;
    min-height: min(70vh, 900px);
    overflow: hidden;
  }
  .content-area {
    min-height: 360px;
  }
  .welcome-screen {
    padding: 24px 16px;
  }
  .welcome-screen h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
}
