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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #d4af37;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    padding-bottom: 280px;
}

header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

h1 {
    font-size: 2rem;
    color: #d4af37;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.3rem;
    font-weight: bold;
    letter-spacing: 1.5px;
}

.subtitle {
    color: #c9b88c;
    font-size: 0.9rem;
    font-style: italic;
}

/* Type Toggle (Cards/Nobles) */
.type-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.type-toggle-btn {
    padding: 0.6rem 1.5rem;
    background: rgba(26, 26, 46, 0.6);
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 10px;
    color: rgba(212, 175, 55, 0.7);
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-toggle-btn:hover {
    background: rgba(26, 26, 46, 0.9);
    border-color: #d4af37;
    color: #d4af37;
}

.type-toggle-btn.active {
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #1a1a2e;
    border-color: #fff;
}

/* Main Card Display Area */
#cardDisplay {
    min-height: 400px;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
}

.empty-state {
    text-align: center;
    color: #c9b88c;
    font-size: 1.2rem;
    font-style: italic;
    margin-top: 4rem;
}

/* Splendor Card Styling */
.card {
    width: 280px;
    height: 380px;
    background: linear-gradient(145deg, #2d2d44 0%, #1a1a2e 100%);
    border: 3px solid #000000;
    border-radius: 20px;
    position: relative;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
                0 0 20px rgba(212, 175, 55, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

/* Card color variants */
.card.card-white {
    background: linear-gradient(145deg, #e8e8e8 0%, #d0d0d0 100%);
}

.card.card-blue {
    background: linear-gradient(145deg, #a8d4ff 0%, #7ab8f5 100%);
}

.card.card-green {
    background: linear-gradient(145deg, #b8f0d0 0%, #8ee6b8 100%);
}

.card.card-red {
    background: linear-gradient(145deg, #ffb8b8 0%, #ff9999 100%);
}

.card.card-black {
    background: linear-gradient(145deg, #9a9a9a 0%, #7a7a7a 100%);
}

/* Noble Card Styling */
.card.card-noble {
    background: linear-gradient(145deg, #e8e8e8 0%, #d0d0d0 100%);
    border-color: #000000;
}

.card.card-noble .card-header {
    border-bottom-color: rgba(0, 0, 0, 0.5);
}

.card.card-noble .card-points {
    color: #000000;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.card.card-noble .card-id {
    color: #000000;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7),
                0 0 30px rgba(212, 175, 55, 0.4);
}

/* Top Section - Points and Bonus */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.5);
}

.card-points {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.card-bonus {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Card ID - Center */
.card-id {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: #1a1a2e;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
    margin: 1rem 0;
}

/* Bottom Section */
.card-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Level Badge */
.card-level {
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid #000000;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: #000000;
    font-weight: bold;
}

/* Cost Display */
.card-cost {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.card-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.requirement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.requirement-gem {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.requirement-label {
    font-size: 0.7rem;
    color: #d4af37;
    font-weight: bold;
    text-transform: uppercase;
}

.cost-gem {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Gem Colors */
.white, .cost-gem.white {
    background: radial-gradient(circle, #f5f5f5, #d0d0d0);
    color: #333;
}

.blue, .cost-gem.blue {
    background: radial-gradient(circle, #4a90e2, #2e5c8a);
}

.green, .cost-gem.green {
    background: radial-gradient(circle, #50c878, #2d8659);
}

.red, .cost-gem.red {
    background: radial-gradient(circle, #e74c3c, #c0392b);
}

.black, .cost-gem.black {
    background: radial-gradient(circle, #4a4a4a, #2c2c2c);
}

/* Sticky Input Bar */
.input-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(22, 33, 62, 0.95) 0%, rgba(26, 26, 46, 0.98) 100%);
    backdrop-filter: blur(10px);
    border-top: 3px solid #d4af37;
    padding: 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    max-height: 35vh;
    overflow-y: auto;
}

/* Toggle Bar */
.toggle-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0;
    background: rgba(15, 20, 35, 0.9);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    padding: 0;
}

.toggle-btn {
    flex: 1;
    max-width: 200px;
    padding: 0.6rem 1.5rem;
    background: transparent;
    border: none;
    color: rgba(212, 175, 55, 0.6);
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.toggle-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
}

.toggle-btn.active {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    border-bottom-color: #d4af37;
}

.input-section {
    display: none;
    width: 100%;
    padding: 0.8rem 1rem;
    align-items: center;
    justify-content: center;
}

.input-section.active {
    display: flex;
}

/* ID Search Interface */
.id-search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.id-search-container label {
    color: #d4af37;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.id-input-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#idInput {
    width: 200px;
    height: 45px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 3px solid #d4af37;
    background: #1a1a2e;
    color: #d4af37;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

/* Hide default number input spinner arrows */
#idInput::-webkit-outer-spin-button,
#idInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#idInput[type=number] {
    -moz-appearance: textfield;
}

#idInput:focus {
    border-color: #e6c158;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

#idInput::placeholder {
    color: rgba(212, 175, 55, 0.4);
    font-size: 1.2rem;
}

.id-arrow-btn {
    width: 45px;
    height: 45px;
    border: 3px solid #d4af37;
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #1a1a2e;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.id-arrow-btn:hover {
    background: linear-gradient(145deg, #e6c158, #d4af37);
    transform: scale(1.1);
}

.id-arrow-btn:active {
    transform: scale(0.95);
}

.section-title {
    color: #d4af37;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.gem-input-group {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.gem-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.gem-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gem-input label {
    font-size: 0.75rem;
    color: #d4af37;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 0.3rem;
}

.input-controls input {
    width: 45px;
    height: 35px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    background: #1a1a2e;
    color: #d4af37;
    border-radius: 8px;
    outline: none;
}

.arrow-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #1a1a2e;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arrow-btn:hover {
    background: linear-gradient(145deg, #e6c158, #d4af37);
    transform: scale(1.1);
}

.arrow-btn:active {
    transform: scale(0.95);
}

.reset-btn {
    padding: 0.5rem 1.5rem;
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    border: 2px solid #fff;
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin: 0.5rem auto 0.8rem;
}

.reset-btn:hover {
    background: linear-gradient(145deg, #ff6b5b, #e74c3c);
    transform: scale(1.05);
}

.reset-btn:active {
    transform: scale(0.95);
}

.reset-btn:active {
    transform: scale(0.95);
}

/* Quick Select Interface */
.quick-select-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.color-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.8rem;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 65px;
}

.color-btn:hover {
    background: rgba(26, 26, 46, 1);
    border-color: #d4af37;
    transform: scale(1.05);
}

.color-btn.selected {
    background: rgba(212, 175, 55, 0.3);
    border-color: #d4af37;
    border-width: 3px;
}

.color-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.color-btn span {
    font-size: 0.7rem;
    color: #d4af37;
    font-weight: bold;
    text-transform: uppercase;
}

.pattern-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.pattern-btn {
    padding: 0.4rem 0.8rem;
    background: linear-gradient(145deg, #2d2d44, #1a1a2e);
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 6px;
    color: #d4af37;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
}

.pattern-btn:hover {
    background: linear-gradient(145deg, #3d3d54, #2a2a3e);
    border-color: #d4af37;
    transform: scale(1.05);
}

.pattern-btn.selected {
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #1a1a2e;
    border-color: #fff;
}

.pattern-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .card {
        width: 240px;
        height: 320px;
        padding: 1rem;
    }

    .card-id {
        font-size: 3rem;
    }

    .gem-input-group {
        gap: 1rem;
    }

    .input-bar {
        padding: 1rem;
    }

    .container {
        padding-bottom: 250px;
    }
    
    .input-section {
        width: 100%;
    }
    
    .section-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .gem-input-group {
        gap: 0.8rem;
    }

    .gem-icon {
        width: 30px;
        height: 30px;
    }

    .input-controls input {
        width: 40px;
        height: 35px;
    }

    .arrow-btn {
        width: 25px;
        height: 25px;
    }
}
