* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.filter-box select {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.add-game-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    background: #4CAF50;
    color: white;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background 0.3s;
}

.add-game-btn:hover {
    background: #45a049;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.game-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.game-title {
    font-size: 1.4em;
    color: #333;
    font-weight: bold;
}

.game-genre {
    display: inline-block;
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border-radius: 15px;
    font-size: 0.85em;
    margin-top: 5px;
}

.game-info {
    margin: 15px 0;
    color: #666;
    font-size: 0.95em;
}

.rating-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.stars {
    display: flex;
    gap: 5px;
}

.star {
    font-size: 24px;
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s;
}

.star.filled {
    color: #ffd700;
}

.star:hover,
.star.hover {
    color: #ffed4e;
}

.rating-number {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

.game-review {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.game-review textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.game-card-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: flex-end;
}

.edit-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.edit-btn:hover {
    background: #0b7dda;
}

.delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: #da190b;
}

.title-genre-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-input {
    padding: 10px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 0.9em;
    font-family: inherit;
}

.edit-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
}

.game-card.edit-mode {
    background: #f9f9f9;
    border: 2px solid #667eea;
}

.game-card.edit-mode .edit-btn {
    background: #4CAF50;
}

.game-card.edit-mode .edit-btn:hover {
    background: #45a049;
}

.game-card.edit-mode .edit-btn::after {
    content: ' Save';
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit {
    background: #4CAF50;
    color: white;
}

.btn-submit:hover {
    background: #45a049;
}

.btn-cancel {
    background: #ddd;
    color: #333;
}

.btn-cancel:hover {
    background: #ccc;
}

.no-games {
    text-align: center;
    color: white;
    font-size: 1.2em;
    padding: 40px;
}