:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 2rem;
    margin-right: 0.5rem;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 3px 0;
    transition: 0.3s;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 99;
}

.mobile-nav a {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin: 2rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1rem;
}

.sort-buttons {
    display: flex;
    gap: 0.5rem;
}

.sort-buttons .btn {
    padding: 0.5rem 1rem;
}

.sort-buttons .btn.active {
    background: var(--primary-color);
    color: white;
}

.lineup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.lineup-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.lineup-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.lineup-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.lineup-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.username {
    color: #666;
    font-size: 0.9rem;
}

.lineup-comment {
    margin: 1rem 0;
    color: #555;
}

.lineup-stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    color: #666;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination a.active,
.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.ranking-section {
    margin: 3rem 0;
}

.ranking-box {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

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

.ranking-list li {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.ranking-list li:last-child {
    border-bottom: none;
}

.rank {
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 1rem;
    min-width: 30px;
}

.ranking-list a {
    flex: 1;
    text-decoration: none;
    color: var(--text-color);
}

.ranking-list a:hover {
    color: var(--primary-color);
}

.likes {
    color: #e74c3c;
}

.site-footer {
    background: var(--dark-color);
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    line-height: 2;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
    font-size: 1.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #34495e;
    color: #95a5a6;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control.error {
    border-color: var(--danger-color);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.success-message {
    background: var(--secondary-color);
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.lineup-items {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.lineup-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: move;
    transition: all 0.3s;
}

.lineup-item:hover {
    background: var(--light-color);
}

.lineup-item.dragging {
    opacity: 0.5;
}

.batting-order {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-right: 1rem;
    min-width: 30px;
}

.item-input {
    flex: 1;
    display: flex;
    gap: 0.5rem;
}

.item-input input {
    flex: 1;
}

.position-select {
    width: 120px;
}

.template-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.template-option {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.template-option:hover {
    border-color: var(--primary-color);
}

.template-option.selected {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

@media (max-width: 768px) {
    .main-nav,
    .header-actions {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-nav.active {
        display: block;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .lineup-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}