:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-dark); min-height: 100vh; display: flex; flex-direction: column; }

.navbar { background: #1e293b; color: white; padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 700; cursor: pointer; }

.container { max-width: 1280px; margin: 2rem auto; padding: 0 1.5rem; width: 100%; flex: 1; }

.hero-header { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); color: white; padding: 2.5rem; border-radius: var(--radius); margin-bottom: 2rem; box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2); }
.hero-header h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.hero-header p { font-size: 1.1rem; opacity: 0.95; max-width: 750px; }

.controls-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.search-box input { padding: 0.6rem 1.2rem; border: 1px solid var(--border); border-radius: 8px; width: 300px; font-size: 0.95rem; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.game-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; position: relative; }
.game-card:hover { transform: translateY(-4px); box-shadow: 0 12px 20px -5px rgba(0,0,0,0.1); border-color: var(--primary); }
.game-number { position: absolute; top: 1rem; right: 1rem; background: #f1f5f9; color: var(--text-muted); font-size: 0.8rem; font-weight: 700; padding: 2px 8px; border-radius: 12px; }

.game-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; }
.game-card-icon { font-size: 2.2rem; background: #eff6ff; padding: 10px; border-radius: 12px; }
.game-card-title { font-size: 1.15rem; font-weight: 700; color: var(--text-dark); }
.game-card-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 1.2rem; }
.game-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.2rem; }
.tag { background: #f1f5f9; color: #475569; font-size: 0.75rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; }

.btn-generate { background: var(--primary); color: white; border: none; padding: 0.7rem; border-radius: 8px; font-weight: 600; cursor: pointer; width: 100%; text-align: center; transition: background 0.2s; }
.btn-generate:hover { background: var(--primary-hover); }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); z-index: 100; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-overlay.active { display: flex; }
.modal-box { background: white; border-radius: 16px; width: 100%; max-width: 650px; max-height: 90vh; overflow-y: auto; padding: 2rem; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); position: relative; }
.modal-large { max-width: 1000px; height: 85vh; display: flex; flex-direction: column; }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-control { width: 100%; padding: 0.7rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

iframe#gamePreviewFrame { width: 100%; flex: 1; border: 1px solid var(--border); border-radius: 8px; background: white; min-height: 500px; }

footer { text-align: center; padding: 1.5rem; background: white; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--text-muted); }
