body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    max-width: 1400px;
    width: 100%;
    background-color: #fff;
    padding: clamp(15px, 3vw, 40px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #0056b3;
    margin-bottom: 20px;
    font-size: clamp(22px, 4vw, 32px);
}

hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.2), rgba(0,0,0,0));
    margin: 20px 0;
    width: 100%;
}

.search-area {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 1000px;
}

input[type="text"], select {
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

input[type="text"] {
    flex-grow: 1;
}

#saveQuizBtn {
    padding: 10px 20px;
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

#message {
    min-height: 24px;
    margin: 10px 0;
    font-weight: bold;
}

.error-message { color: #d9534f; }
.success-message { color: #5cb85c; }

#foundElementsList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.periodic-table-section {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 15px;
    display: flex;
    justify-content: center;
}

#periodic-table-grid {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 8px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    min-width: 1100px; 
    width: 100%;
}

.empty-element-card {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    position: relative;
}

.element-revealed {
    background-color: #fff !important;
    border: 2px solid #0056b3;
    box-shadow: 0 2px 8px rgba(0,86,179,0.15);
}

.symbol-display, .name-display {
    visibility: hidden;
    opacity: 0;
}

.element-revealed .symbol-display {
    visibility: visible;
    opacity: 1;
    font-size: clamp(16px, 1.8vw, 26px);
    font-weight: 800;
    color: #0056b3;
}

.element-revealed .name-display {
    visibility: visible;
    opacity: 1;
    font-size: clamp(9px, 0.7vw, 11px);
    color: #666;
    margin-top: 2px;
    text-align: center;
}

.lanthanide-placeholder, .actinide-placeholder {
    background-color: #e9ecef;
    border: 1px dashed #adb5bd;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    color: #6c757d;
    font-weight: bold;
}

.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.save-button {
    background: #0056b3;
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 20px;
}

@media (max-width: 1150px) {
    .periodic-table-section {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .search-area {
        flex-direction: column;
    }
    
    .container {
        padding: 15px;
    }

    .element-revealed .name-display {
        display: none;
    }
}

.logo-title {
    width: 40px;
    height: 40px;
    vertical-align: middle;
    margin-right: 10px;
}

.github-footer {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 14px;
}

.github-footer p {
    margin-bottom: 10px;
}

.github-footer a {
    color: #333;
    text-decoration: underline;
    font-weight: 500;
}

@media (max-width: 600px) {
    .github-footer {
        padding: 15px 0;
        margin-top: 20px;
    }
}