@font-face {
    font-family: 'Comic Neue';
    src: url('../fonts/ComicNeue-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Comic Neue';
    src: url('../fonts/ComicNeue-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Neue', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #fff;
    font-size: 2.5rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.subtitle {
    color: #fff;
    font-size: 1.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.8rem;
    }
}

section {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h2 {
    color: #764ba2;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: bold;
    font-size: 1rem;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

input[type="text"]::placeholder {
    color: #aaa;
}

small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.85rem;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.message:empty {
    display: none;
}

.ranking-list {
    min-height: 200px;
}

.ranking {
    list-style: none;
    counter-reset: ranking;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 12px;
    transition: transform 0.2s;
}

.ranking-item:hover {
    transform: translateX(5px);
}

.ranking-item.gold {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border: 2px solid #ffa500;
}

.ranking-item.silver {
    background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 100%);
    border: 2px solid #a8a8a8;
}

.ranking-item.bronze {
    background: linear-gradient(135deg, #fdd6bd 0%, #cd7f32 50%);
    border: 2px solid #cd7f32;
}

.rank {
    width: 35px;
    height: 35px;
    background: #764ba2;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.ranking-item.gold .rank {
    background: #ffa500;
}

.ranking-item.silver .rank {
    background: #a8a8a8;
}

.ranking-item.bronze .rank {
    background: #cd7f32;
}

.game-name {
    flex-grow: 1;
    font-weight: bold;
    color: #333;
    font-size: 1rem;
}

.vote-count {
    background: #667eea;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.no-votes,
.loading,
.error {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
}

.error {
    color: #dc3545;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

footer p {
    font-size: 1.1rem;
}
