* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(180deg, #1a1033 0%, #0d0a1f 100%);
  color: #f1edff;
  min-height: 100vh;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: radial-gradient(circle at top left, #6d28d9, #1a1033 70%);
  padding: 40px 0 30px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.site-header h1 {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: 1px;
}

.tagline {
  margin: 8px 0 0;
  color: #c9bdf0;
}

.post-form-card {
  background: #241a45;
  border-radius: 14px;
  padding: 24px;
  margin: 30px 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.post-form-card h2 {
  margin-top: 0;
}

#game-form .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#game-form input,
#game-form textarea {
  width: 100%;
  padding: 10px 12px;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid #3f2e77;
  background: #150f2e;
  color: #f1edff;
  font-size: 0.95rem;
}

#game-form .row input {
  flex: 1;
  min-width: 200px;
  margin-top: 0;
}

#game-form textarea {
  min-height: 70px;
  resize: vertical;
}

#game-form button {
  margin-top: 14px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #8b5cf6;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#game-form button:hover {
  background: #7c3aed;
}

.error {
  color: #ff8080;
  min-height: 1.2em;
  margin: 8px 0 0;
}

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.controls input,
.controls select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #3f2e77;
  background: #150f2e;
  color: #f1edff;
}

.controls input {
  flex: 1;
  min-width: 200px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  padding-bottom: 50px;
}

.game-card {
  background: #241a45;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  transition: transform 0.15s;
}

.game-card:hover {
  transform: translateY(-4px);
}

.game-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.badge {
  align-self: flex-start;
  background: #6d28d9;
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
}

.game-card p {
  margin: 0;
  color: #c9bdf0;
  font-size: 0.9rem;
  flex: 1;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-actions button {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.play-btn {
  background: #8b5cf6;
  color: white;
}

.play-btn:hover {
  background: #7c3aed;
}

.remove-btn {
  background: transparent;
  border: 1px solid #533d94 !important;
  color: #c9bdf0;
}

.remove-btn:hover {
  background: #352662;
}

.empty-state {
  text-align: center;
  color: #a594d8;
  padding: 40px 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-inner {
  background: #150f2e;
  border-radius: 12px;
  width: 100%;
  max-width: 1000px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #241a45;
  font-weight: 600;
}

.modal-bar button {
  background: transparent;
  border: none;
  color: #f1edff;
  font-size: 1.2rem;
  cursor: pointer;
}

#player-frame {
  flex: 1;
  border: none;
  width: 100%;
}

.site-footer {
  text-align: center;
  padding: 20px;
  color: #8a7cb8;
  font-size: 0.85rem;
}
