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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.daily-info {
    text-align: center;
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 0.9rem;
    padding: 8px 16px;
    background: #f7fafc;
    border-radius: 20px;
    display: inline-block;
    margin-left: 50%;
    transform: translateX(-50%);
}

.search-container {
    position: relative;
    margin-bottom: 30px;
}

#cardSearch {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#cardSearch:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.suggestion {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f7fafc;
    transition: background-color 0.2s ease;
}

.suggestion:hover {
    background-color: #f7fafc;
}

.suggestion:last-child {
    border-bottom: none;
}

.guesses-container {
    margin-bottom: 30px;
}

/* Ensure consistent column widths */
.guess-header > div,
.guess-row > div {
    min-width: 0;
    overflow: hidden;
}

/* Remove fixed width constraints for better grid flexibility */

.guess-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: slideIn 0.3s ease-out;
    align-items: center;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guess-header {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px;
    background: #4a5568;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    align-items: center;
    overflow: hidden;
}

.attribute {
    padding: 8px 6px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.correct {
    background: #48bb78;
    color: white;
}

.partial {
    background: #ed8936;
    color: white;
}

.overlap {
    background: #f6e05e;
    color: #2d3748;
}

.wrong {
    background: #f56565;
    color: white;
}

.game-status {
    text-align: center;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.win {
    color: #48bb78;
}

.lose {
    color: #f56565;
}

.reset-btn {
    display: block;
    margin: 20px auto;
    padding: 12px 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.give-up-btn {
    display: block;
    margin: 10px auto 20px;
    padding: 12px 30px;
    background: linear-gradient(45deg, #f56565, #ed8936);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.give-up-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 101, 101, 0.4);
}

.target-card {
    background: #e6fffa;
    border: 2px solid #38b2ac;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.target-card h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.card-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.card-detail {
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #bee3f8;
}

.card-detail strong {
    color: #2b6cb0;
}

/* Responsive Design - Mobile First Approach */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        margin: 0;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .daily-info {
        font-size: 0.8rem;
        padding: 6px 12px;
        margin-bottom: 15px;
    }
    
    #cardSearch {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .suggestions {
        max-height: 150px;
    }
    
    .suggestion {
        padding: 10px 15px;
    }
    
    /* Mobile grid layout - stack vertically */
    .guess-header {
        display: none; /* Hide header on mobile, we'll show labels inline */
    }
    
    .guess-row {
        display: block;
        padding: 15px;
        margin-bottom: 15px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .guess-row > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px 10px 0;
        border-bottom: 1px solid #f0f0f0;
        min-width: auto;
        max-width: none;
    }
    
    .guess-row > div:last-child {
        border-bottom: none;
    }
    
    .guess-row > div:before {
        content: attr(data-label);
        font-weight: 600;
        color: #4a5568;
        flex-shrink: 0;
        min-width: 90px;
        font-size: 0.9rem;
    }
    
    .guess-row > div:nth-child(1):before { content: "Name: "; }
    .guess-row > div:nth-child(2):before { content: "Pitch: "; }
    .guess-row > div:nth-child(3):before { content: "Cost: "; }
    .guess-row > div:nth-child(4):before { content: "Power: "; }
    .guess-row > div:nth-child(5):before { content: "Defense: "; }
    .guess-row > div:nth-child(6):before { content: "Types: "; }
    .guess-row > div:nth-child(7):before { content: "Classes: "; }
    .guess-row > div:nth-child(8):before { content: "Talents: "; }
    .guess-row > div:nth-child(9):before { content: "Keywords: "; }
    
    .attribute {
        padding: 6px 10px;
        margin: 0;
        border-radius: 6px;
        min-height: 32px;
        text-align: center;
        flex-shrink: 0;
        max-width: 50%;
        word-break: break-word;
        font-size: 0.85rem;
        font-weight: 500;
        min-width: 60px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .reset-btn,
    .give-up-btn {
        padding: 12px 25px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .target-card {
        padding: 15px;
    }
    
    .card-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    /* Tablet layout - condensed grid */
    .guess-header,
    .guess-row {
        grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.8fr 1fr 1fr 1fr 1fr;
        gap: 8px;
        font-size: 0.9rem;
    }
    
    .guess-header > div:nth-child(1),
    .guess-row > div:nth-child(1) {
        min-width: 150px;
    }
    
    .guess-header > div:nth-child(n+2),
    .guess-row > div:nth-child(n+2) {
        min-width: 80px;
        max-width: 100px;
    }
    
    .attribute {
        padding: 8px 6px;
        font-size: 0.85rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 25px;
    }
    
    /* Desktop-tablet hybrid */
    .guess-header,
    .guess-row {
        gap: 8px;
    }
    
    .guess-header > div:nth-child(1),
    .guess-row > div:nth-child(1) {
        min-width: 180px;
    }
    
    .guess-header > div:nth-child(n+2),
    .guess-row > div:nth-child(n+2) {
        min-width: 100px;
        max-width: 120px;
    }
}