/* ─── My Games Dashboard ─── */

.mg-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.mg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.mg-heading {
  font-size: 22px;
  font-weight: 700;
  color: #e0e0f0;
  margin: 0;
}

.mg-btn-new {
  background: #4a4aaa;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.mg-btn-new:hover { background: #5a5abb; }

.topbar-page-title {
  font-size: 14px;
  color: #888;
  margin-left: 8px;
}

.mg-auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mg-username {
  font-size: 12px;
  color: #666;
}

.mg-topbar-link {
  font-size: 12px;
  color: #777;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
  text-decoration: none;
}
.mg-topbar-link:hover { color: #ccc; }

.mg-topbar-btn {
  background: none;
  border: 1px solid #2a2a36;
  color: #777;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.mg-topbar-btn:hover { color: #ccc; border-color: #44445a; }

/* ─── Game Grid ─── */

.mg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.mg-card {
  background: #13131a;
  border: 1px solid #1e1e2e;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.mg-card:hover {
  border-color: #3a3a6a;
  transform: translateY(-2px);
}

.mg-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0e0e18;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mg-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mg-card-placeholder {
  color: #2a2a4a;
  width: 48px;
  height: 48px;
  display: flex;
}
.mg-card-placeholder svg { width: 100%; height: 100%; }

.mg-card-body {
  padding: 12px 14px 10px;
  flex: 1;
}

.mg-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #ddd;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mg-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mg-badge-published { background: #1a3a1a; color: #5aaa5a; border: 1px solid #2a5a2a; }
.mg-badge-draft     { background: #2a2a1a; color: #aaa050; border: 1px solid #4a4a20; }

.mg-card-date {
  font-size: 11px;
  color: #555;
  margin-left: auto;
}

.mg-card-open-btn {
  display: none;
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #4a4aaa;
  color: #fff;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.mg-card:hover .mg-card-open-btn { display: block; }
.mg-card-open-btn:hover { background: #5a5abb; }

/* ─── Empty State ─── */

.mg-empty {
  text-align: center;
  padding: 80px 24px;
  color: #555;
  font-size: 15px;
}
.mg-empty p { margin-bottom: 20px; }

.mg-error {
  color: #aa5a5a;
  padding: 24px;
  font-size: 14px;
}

/* ─── New Game Modal ─── */

.mg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.mg-modal-box {
  background: #16161f;
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  padding: 28px 32px;
  width: 420px;
  max-width: 90vw;
}

.mg-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #e0e0f0;
  margin: 0 0 20px;
}

.mg-field {
  margin-bottom: 20px;
}
.mg-field label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mg-input {
  width: 100%;
  background: #0e0e18;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  color: #ddd;
  padding: 9px 12px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.mg-input:focus { border-color: #4a4aaa; }

.mg-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.mg-btn-primary {
  background: #4a4aaa;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.mg-btn-primary:hover { background: #5a5abb; }
.mg-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.mg-btn-ghost {
  background: transparent;
  color: #888;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.mg-btn-ghost:hover { border-color: #444; color: #bbb; }
