/**
 * BrainRot Platform
 * Game-specific styles
 */

/* Game container layout */
.game-container {
  display: flex;
  flex: 1;
  grid-template-columns: 1fr var(--sidebar-width, 0);
  /* min-height: calc(100vh - 300px); */
  margin-bottom: 20px;
  align-content: center;
  flex-direction: column;
  flex-wrap: wrap;
}

.game-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
}

.game-title {
  font-size: 2rem;
  margin: 0;
}

.game-wrapper {
  background-color: var(--brand-background);
  border-radius: 0.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  FONT-VARIANT: JIS90;
}

#game-interface {
  flex: 1;
  display: flex;
  min-height: 0;
  flex-direction: column;
}

/* Loading indicator */
.loading-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--overlay-dark);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--border-strong);
  border-top-color: var(--team1-primary);
  border-radius: 50%;
  animation: spinner 1s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Game sidebar and chat */
.game-sidebar {
  background-color: var(--brand-surface-alt);
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem;
}

.chat-container h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background-color: var(--brand-surface);
  border-radius: 0.25rem;
}

.chat-message {
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.system-message {
  color: var(--text-secondary);
  font-style: italic;
}



.chat-input {
  display: flex;
  gap: 0.5rem;
}

.chat-input input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.25rem;
  background: var(--brand-surface);
  color: var(--text-primary);
}

/* Game details page styles */
.game-details {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 0;
}

.game-details .game-header {
  text-align: center;
  /* margin-bottom: 2rem; */
}

.game-details .game-title {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.game-meta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  color: var(--text-secondary);
}

.game-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

.game-image img {
  width: 100%;
  margin-top: 3em;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px var(--overlay-light);
}

.game-info > div {
  margin-bottom: 2rem;
}

.game-info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.join-by-code {
  margin-top: 1.5rem;
}

.join-by-code h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.join-form {
  display: flex;
  gap: 0.5rem;
}

.join-form input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.25rem;
  background: var(--brand-surface);
  color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .game-container {
    grid-template-columns: 1fr;
  }
  
  .game-wrapper {
    /* height: calc(100vh - 300px); Removed to allow content height */
  }
  
  .game-sidebar {
    height: 200px;
  }
  
  .game-content {
    grid-template-columns: 1fr;
  }
}
