:root {
    --bg-color: #0f1923;
    --card-bg: #1f2b35;
    --accent-color: #ff4655;
    --text-color: #ece8e1;
    --text-muted: #8b9bb4;
    --card-border: #36495d;
    --success: #4ade80;
    --danger: #ff4655;
    --font-main: 'Roboto', sans-serif;
    --font-header: 'Oswald', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 25, 35, 0.8);
    z-index: -1;
}

#dynamic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 1.5s ease-in-out;
    opacity: 0;
}

.main-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.grid-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hidden {
    display: none !important;
}

h1 {
    font-family: var(--font-header);
    font-size: 3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

h3 {
    font-family: var(--font-header);
    text-transform: uppercase;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
    color: var(--text-color);
}

.accent {
    color: var(--accent-color);
}

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

#subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.lang-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.lang-btn.active,
.lang-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-muted);
    text-transform: uppercase;
}

input,
select {
    border: 1px solid var(--card-border);
    padding: 12px;
    color: white;
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

input {
    background: rgba(0, 0, 0, 0.2);
}

select {
    background: var(--accent-color);
}

input:focus,
select:focus {
    border-color: white;
}

option {
    background-color: var(--card-bg);
    color: white;
}

/* Buttons */
.btn-primary {
    width: 100%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 15px;
    font-family: var(--font-header);
    font-size: 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.3s;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: #d93a46;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: var(--accent-color);
}


.recent-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.search-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-chip:hover {
    background: rgba(255, 70, 85, 0.1);
    border-color: var(--accent-color);
    color: white;
}

#error-msg {
    background: rgba(255, 70, 85, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 15px;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 15px;
}

.rank-card {
    position: relative;
    overflow: hidden;
    padding: 0;
    min-height: 200px;
}

.rank-card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 43, 53, 0.4);
    z-index: 1;
}

#player-card-bg {
    background-size: cover;
    background-position: center;
}

.card-content {
    position: relative;
    z-index: 2;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.player-card-small {
    display: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rank-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.info h2 {
    font-family: var(--font-header);
    font-size: 2rem;
    margin-bottom: 5px;
}

.rank-badge {
    background: var(--accent-color);
    color: white;
    padding: 2px 8px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    text-transform: uppercase;
}

.stats-container {
    width: 100%;
}

.stats {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.icon-elo {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
}

.mmr-change {
    font-weight: bold;
}

.mmr-change.positive {
    color: var(--success);
}

.mmr-change.negative {
    color: var(--danger);
}

.rank-progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.rank-progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 1s ease-out;
}

.match-card {
    position: relative;
    overflow: hidden;
    background-image: var(--match-bg, none);
    background-size: cover;
    background-position: center top;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 43, 53, 0.5);
    z-index: 1;
}

.match-card>* {
    position: relative;
    z-index: 2;
}

.match-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.map-name {
    border-radius: 2px;
    font-size: 0.9rem;
}

.match-date {
    font-size: 0.85rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.match-result {
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.9rem;
}

.match-result.win {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.match-result.loss {
    background: rgba(255, 70, 85, 0.2);
    color: var(--danger);
}

.match-result.draw {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.match-stats-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.agent-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
}

.stat-group {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-header);
    font-size: 1.8rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.chart-card {
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.chart-container {
    flex: 1;
    position: relative;
    width: 100%;
}

.config-toggle-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.command-item {
    margin-bottom: 20px;
}

.command-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-color);
}

.copy-box {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
}

.copy-box input {
    flex: 1;
    background: transparent;
    border: none;
    font-family: monospace;
    color: var(--text-muted);
    padding: 10px;
}

.example-box {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--success);
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    align-items: center;
}

.example-label {
    font-weight: bold;
    color: var(--success);
    text-transform: uppercase;
    font-size: 0.8rem;
}

.example-text {
    font-family: monospace;
    color: white;
    word-break: break-all;
}

.doc-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    margin-bottom: 15px;
    border-left: 3px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.method {
    color: var(--accent-color);
    font-weight: bold;
    font-family: monospace;
}

.url {
    font-family: monospace;
    color: white;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    display: inline-block;
}

.desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.doc-note {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 20px;
}

.doc-note code {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: white;
}

.disclaimer {
    font-size: 0.7rem;
    opacity: 0.5;
    max-width: 700px;
    margin: 20px auto 0;
    line-height: 1.4;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .card-content {
        padding: 15px;
    }

    .card-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .btn-icon {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .match-stats-row {
        flex-wrap: wrap;
        gap: 15px;
    }

    .stat-group {
        flex: 1 1 40%;
    }

    .example-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .copy-box {
        flex-direction: column;
    }

    .copy-box input {
        border-bottom: 1px solid var(--card-border);
        border-right: none;
    }

    .btn-copy {
        width: 100%;
        padding: 10px;
    }
}