:root {
  --bg-primary: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-primary: #38bdf8;
  --accent-hover: #0284c7;
  --status-running: #22c55e;
  --status-stopped: #ef4444;
  --status-pending: #f59e0b;
  --border-color: #334155;
  --border-radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.container {
  width: 100%;
  max-width: 900px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-icon {
  font-size: 2.2rem;
  background: var(--bg-card);
  padding: 8px 12px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Alert Banner */
.alert-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0284c7;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}

.alert-banner.hidden {
  display: none;
}

.close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Badges */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-running {
  background: rgba(34, 197, 94, 0.2);
  color: var(--status-running);
  border: 1px solid var(--status-running);
}

.badge-stopped {
  background: rgba(239, 68, 68, 0.2);
  color: var(--status-stopped);
  border: 1px solid var(--status-stopped);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--status-pending);
  border: 1px solid var(--status-pending);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.metric {
  background: var(--bg-primary);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

/* Connection Details */
.connection-section {
  margin-bottom: 16px;
}

.connection-section label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.copy-input-group {
  display: flex;
  gap: 8px;
}

.copy-input-group input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.copy-input-group input:focus {
  border-color: var(--accent-primary);
}

/* Idle Notice */
.idle-notice {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 16px;
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background: var(--accent-primary);
  color: #0f172a;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #475569;
}

.btn-success {
  background: #16a34a;
  color: #fff;
}

.btn-success:hover {
  background: #15803d;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-large {
  padding: 14px 20px;
  font-size: 1rem;
  width: 100%;
}

.control-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.divider {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 20px 0;
}

/* Resize Controls */
.resize-section h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.resize-section .description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.resize-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.select-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  outline: none;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 36px;
}

/* Cognito Authentication UI */
.user-pill {
  font-size: 0.85rem;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  border-radius: var(--border-radius);
  padding: 32px;
  text-align: center;
  margin-bottom: 24px;
}

.auth-card h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--text-main);
}

.auth-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.auth-card button {
  max-width: 280px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}
