 :root {
    --black: #000000;
    --gray: #808080;
    --dark-gray: #404040;
    --white: #FFFFFF;
    --dark-orange: #FF4500;
    --dark-orange-hover: #FF6347;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--dark-gray);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    background-color: var(--black);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: auto;
}

.header-container {
    height: 70px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.logo img {
    height: 150px;
    width: auto;
    padding: 5px;
    object-fit: contain;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px;
}

.main-nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--dark-orange);
}

.main-nav a.active {
    color: var(--dark-orange);
    font-weight: bold;
}

.main-nav a i {
    font-size: 1.2rem;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 5px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--black);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    border-radius: 5px;
    padding: 10px 0;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    color: var(--white);
    padding: 10px 15px;
    display: block;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.dropdown-menu a:hover {
    background-color: var(--dark-orange);
    color: var(--white);
}

@media (max-width: 768px) {
    .main-header {
        padding: 10px 15px;
    }

    .header-container {
        height: 60px;
        flex-wrap: nowrap;
        align-items: center;
    }

    .logo img {
        height: 100px;
    }

    .main-nav {
        gap: 10px;
        padding: 5px;
    }

    .dropdown-toggle {
        font-size: 1rem;
        padding: 8px;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 5px;
    }

    .dropdown-menu {
        position: absolute;
        width: 200px;
        right: 0;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
        background-color: var(--black);
        padding: 10px;
        margin-top: 5px;
        z-index: 1001;
    }

    .dropdown-menu a {
        padding: 12px 15px;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dropdown-menu a:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 100px;
    }

    .main-nav {
        gap: 5px;
    }

    .main-nav a i {
        font-size: 1rem;
    }

    .dropdown-toggle {
        font-size: 0.9rem;
        padding: 6px;
    }

    .dropdown-menu {
        min-width: 180px;
    }
}

.hero-section {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/images/hero-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--white);
    padding: 60px 20px;
    text-align: center;
    position: relative;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.cta-button {
    background-color: var(--dark-orange);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.3rem;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: var(--dark-orange-hover);
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding: clamp(10px, 2vw, 15px);
    flex: 1;
}

.item-values-list {
    margin-bottom: 40px;
}

.item-values-list h2 {
    font-size: 2rem;
    color: var(--white);
    text-align: center;
    margin-bottom: 30px;
}

.category-filter {
    margin: 20px 0;
    text-align: center;
}

.category-filter label {
    font-size: 1.1rem;
    margin-right: 10px;
    color: var(--white);
}

#category-dropdown {
    padding: 10px 15px;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid var(--gray);
    background-color: var(--dark-gray);
    cursor: pointer;
    color: var(--white);
}

#category-dropdown:focus {
    outline: none;
    border-color: var(--dark-orange);
}

.calc-button-container {
    text-align: center;
    margin-bottom: 30px;
}

.calc-button {
    background-color: var(--dark-orange);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin: 0 10px;
}

.calc-button:hover {
    background-color: var(--dark-orange-hover);
}

.category-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.category-section {
    display: none;
}

.category-section.active {
    display: block;
}

.category-header {
    font-size: 1.8rem;
    color: var(--white);
    padding: px 15px;
    background-color: rgba(128, 128, 128, 0.2);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.items-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 2vw, 16px);
    background-color: rgba(128, 128, 128, 0.2);
    padding: clamp(16px, 3vw, 24px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@media (max-width: 767px) {
    .items-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .items-list {
        grid-template-columns: 1fr;
    }
}

.item-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(8px, 1.5vw, 12px);
    border-radius: 0;
    background-color: rgba(64, 64, 64, 0.3);
    min-width: 0;
    overflow-x: hidden;
}

.item-item img {
    width: clamp(80px, 14vw, 120px);
    height: clamp(80px, 14vw, 120px);
    object-fit: contain;
    border-radius: 8px;
}

.item-header {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.item-category {
    background-color: var(--dark-orange);
    color: var(--white);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.item-name {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 600;
    color: var(--white);
    text-align: center;
    margin-bottom: 8px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-info {
    width: 100%;
    margin-top: 8px;
}

.item-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-left: 10px;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
}

.item-value,
.item-demand,
.item-stability 
.item-cat
{
    color: var(--white);
}

.item-value {
    font-weight: bold;
}

.main-footer {
    width: 100%;
    background-color: var(--black);
    color: var(--white);
    padding: 30px 0;
    margin-top: auto;
}

.footer-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    padding: 0 15px;
}

.footer-section {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 10px;
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--white);
    opacity: 0.8;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
    padding: 5px 10px;
}

.footer-links a:hover {
    color: var(--dark-orange);
}

.footer-links a i {
    font-size: 1rem;
}

.copyright-grid p {
    font-size: 0.9rem;
    color: var(--white);
    opacity: 0.8;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-section {
        flex: none;
        width: 100%;
        min-width: unset;
        padding: 15px 0;
    }

    .footer-links {
        gap: 8px;
    }

    .footer-links a {
        font-size: 0.85rem;
        padding: 5px 8px;
    }
}

.calculator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.calculator-modal.show {
    opacity: 1;
    pointer-events: all;
}

.calculator-container {
    background-color: rgba(64, 64, 64, 0.9);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 15px;
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

.close-calculator {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--dark-orange);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--white);
    border-radius: 5px;
    padding: 5px 10px;
    transition: background-color 0.3s;
}

.close-calculator:hover {
    background-color: var(--dark-orange-hover);
}

.trade-sides {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: stretch;
    min-width: 0;
}

.trade-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

@media (max-width: 768px) {
    .trade-sides {
        flex-direction: column;
        gap: 20px;
    }

    .trade-side {
        width: 100%;
    }
}

.side-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
    padding: 10px;
    border-radius: 8px;
    background-color: rgba(128, 128, 128, 0.2);
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 100px;
    gap: 15px;
    align-items: stretch;
}

@media (max-width: 480px) {
    .units-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.unit-slot {
    width: 100%;
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    border: 2px dashed var(--gray);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background-color: rgba(128, 128, 128, 0.2);
    overflow: hidden;
}

.unit-slot:hover {
    border-color: var(--dark-orange);
    background-color: rgba(64, 64, 64, 0.3);
}

.unit-slot.empty::before {
    content: '+';
    font-size: 2rem;
    color: var(--white);
}

.unit-slot img {
    max-width: 70%;
    max-height: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.unit-slot .name-unit {
    margin-top: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
    line-height: 1.2;
}

.unit-slot .value-unit {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--dark-orange);
    color: var(--white);
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
    line-height: 1.2;
}

.remove-unit {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: var(--dark-orange);
    color: var(--white);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.unit-slot:hover .remove-unit {
    opacity: 1;
}

.result-container {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    background-color: rgba(128, 128, 128, 0.2);
    word-wrap: break-word;
}

.title-result {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #FF4500, #FFD700, #00FF00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
}

.message-result {
    font-size: 1.2rem;
    font-weight: 600;
}

.win .message-result {
    color: #00FF00; /* Green for win */
}

.fair .message-result {
    color: #00BFFF; /* Blue for fair */
}

.lose .message-result {
    color: #FF6347; /* Red for lose */
}

.win, .fair, .lose {
    background-color: rgba(128, 128, 128, 0.3);
}

.unit-selector {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.unit-selector.show {
    opacity: 1;
    pointer-events: all;
}

.selector-container {
    background-color: rgba(64, 64, 64, 0.9);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 15px;
    padding: 20px;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.selector-title {
    font-size: 1.5rem;
    color: var(--white);
}

.modal-close {
    background-color: var(--dark-orange);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--white);
    border-radius: 5px;
    padding: 5px 10px;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background-color: var(--dark-orange-hover);
}

.navbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(128, 128, 128, 0.2);
    border-radius: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--white);
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: var(--dark-orange);
}

.nav-link.active {
    background-color: var(--dark-orange);
    color: var(--white);
    font-weight: bold;
}

.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--dark-gray);
    color: var(--white);
}

.search-input:focus {
    outline: none;
    border-color: var(--dark-orange);
}

.modal-units-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: box-shadow 0.2s;
    background-color: rgba(64, 64, 64, 0.3);
}

.option-item:hover {
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.5);
}

.option-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.option-name {
    margin-top: 5px;
    font-size: 0.8rem;
    text-align: center;
    color: var(--white);
}

.clear-btn {
    background-color: var(--dark-orange);
    color: var(--white);
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.clear-btn:hover {
    background-color: var(--dark-orange-hover);
}