:root {
    --color-text: #222;
    --color-text-secondary: #929292;
    --background: #ddd;
    --border: 2px solid #b9b9b9;
    --border-color: #b9b9b9;
    --card: #fff;
    --orange: #ffaa22;
    --orange-hover: #ff8c00;
    --background-li: rgba(34, 34, 34, 0.06);
    --grid-color: #ccc;
    --border-grid-color: #999;
}

[data-theme="dark"] {
    --color-text: #ececec;
    --color-text-secondary: #929292;
    --background: #222;
    --border: 2px solid #434343;
    --border-color: #434343;
    --card: #333;
    --orange: #ff8c00;
    --orange-hover: #ffaa22;
    --background-li: rgba(255, 255, 255, 0.06);
    --grid-color: #4e4e4e;
    --border-grid-color: #444444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Oswald', sans-serif;
    background: var(--background);
    color: var(--color-text);
    padding: 20px;
    transition: all 0.3s ease;
}

/* header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3rem;
    color: var(--orange);
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.5);
    letter-spacing: 4px;
}

/* cards */
.card {
    background: var(--card);
    padding: 25px;
    margin: 25px auto;
    max-width: 1100px;
    border-radius: 14px;
    border: var(--border);
    box-shadow: 0 0 15px rgba(255, 159, 0, 0.25);
    transition: all 0.3s;
    overflow: hidden;
    scroll-margin-top: 90px;
}

.card:hover {
    box-shadow: 0 0 25px rgba(255, 159, 0, 0.45);
    transform: translateY(-4px);
}

.card h2 {
    font-size: 1.9rem;
    margin-bottom: 25px;
    color: var(--color-text);
    border-left: 6px solid var(--orange);
    padding-left: 10px;
}


.card.minimized {
    max-height: 95px;
}

/* form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

input {
    padding: 12px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: var(--border);
    outline: none;
    width: 100%;
    background: #fff;
    color: #222;
}

input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 6px rgba(255, 159, 0, 0.4);
}

button {
    margin-top: 10px;
    padding: 10px 15px;
    background: var(--orange);
    border: none;
    cursor: pointer;
    border-radius: 6px;
    font-weight: bold;
    transition: 0.2s;
}

button:hover {
    background: var(--orange-hover);
}

.buttons-float-container {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 70;
}

.fa-file-export,
.fa-file-import {
    font-size: 1.5rem;
}

.btn {
    margin-top: 10px;
    padding: 12px 20px;
    font-size: 1.1rem;
    background: var(--orange);
    border: none;
    color: #222;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
}

.btn:hover {
    background: var(--orange-hover);
    box-shadow: 0 0 12px rgba(255, 159, 0, 0.7);
}

.btn-secondary {
    background: none;
    color: var(--color-text);
}

.btn-secondary:hover {
    background: none;
    color: var(--orange-hover);
}

.btn-primary {
    background: #6fdf6f;
    color: var(--background);
}

.btn-primary:hover {
    background-color: #a6f3a6;
    color: var(--background);
}

.btn-blue {
    background: #0052CC;
    color: var(--background);
}

.btn-blue:hover {
    background-color: #329cda;
    color: var(--background);
}

.btn-orange {
    background: #eca239;
    color: var(--background);
}

.btn-orange:hover {
    background-color: #e79521;
    color: var(--background);
}

.time-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.unit-buttons {
    width: calc(35px * 3);
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.unit-buttons button {
    margin-top: 0;
    padding: 4px 8px;
    color: #222;
    cursor: pointer;
    border-radius: 4px;
}

.unit-buttons button:hover {
    background: var(--orange-hover);
}

.unit-buttons button.active {
    background: var(--orange-hover);
}

.section {
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    border: var(--border);
}

.section-header {
    padding: 12px;
    cursor: pointer;
    background: var(--background);
    font-weight: bold;
    transition: background .2s;
}

.section-header:hover {
    background: var(--card);
}

.section-content {
    display: none;
    padding: 12px;
    animation: fadeIn 0.3s;
    gap: 10px;
}

.open {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

select {
    width: 100%;
    border-radius: 8px;
    background: var(--card);
    color: var(--color-text);
    font-size: 1.1rem;
    border: var(--border);
    padding: 12px;
    outline: none;
    background: #fff;
    color: #222;
}

.time-row {
    display: flex;
    gap: 10px;
}

/* table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
}

thead {
    background: linear-gradient(to right, var(--orange), var(--orange-hover));
    color: #222;
}

th,
td {
    text-align: center;
    padding: 12px;
}

tbody tr:nth-child(even) {
    background: var(--background);
}

tbody tr:hover {
    background: var(--background);
    transition: .2s;
}

.highlight {
    background: #caffca !important;
    font-weight: bold;
}

.lowlight {
    background: #ffd1d1 !important;
    font-weight: bold;
}

/* resume */
#summary p {
    font-size: 1.3rem;
    margin: 6px 0;
}

/* footer */
footer {
    text-align: center;
    margin-top: 40px;
    color: var(--color-text-secondary);
}

/* popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popupBox {
    background: #222;
    padding: 25px;
    border-radius: 10px;
    width: 350px;
    text-align: center;
    border: 2px solid var(--orange);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popupBox h3 {
    color: #caffca;
}

.popupBox p {
    color: #eee;
}

.text-grey {
    color: #929292;
}

.text-black {
    color: #222;
}

.text-black:hover {
    color: #222;
}

.small {
    font-size: .9rem;
    color: var(--color-text-secondary) !important;
}

.explain-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

ul li {
    margin: 6px 0;
    padding: 8px 12px;
    background: var(--background-li);
    border-left: 4px solid var(--orange-hover);
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 4px;
    list-style-type: none;
}

/* General colors of emphasis */
.green {
    color: #51cf51;
    font-weight: 600;
}

.orange {
    color: #eca239;
    font-weight: 600;
}

.red {
    color: #eb4d4d;
    font-weight: 600;
}

.blue {
    color: #0052CC;
    font-weight: 600;
}

.simple-note {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 10px;
}

table tbody .best-kda {
    background: rgba(0, 255, 0, 0.15);
}

table tbody .worst-kda {
    background: rgba(255, 0, 0, 0.15);
}

table tbody .best-wr {
    border: 2px solid #01cc7e;
}

table tbody .worst-wr {
    border: 2px solid #ff4d4d;
}

#comparisonText ul ul li {
    margin-left: 12px;
    margin-bottom: 6px;
}

.tip {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* tooltips */
.t {
    position: relative;
    cursor: help;
    color: #38a8e9;
    font-weight: 600;
}

.t::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--background);
    color: var(--color-text);
    padding: 6px 9px;
    font-size: 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 20;
}

/* arrow */
.t::before {
    content: "";
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--background) transparent transparent transparent;
    opacity: 0;
    transition: opacity .2s ease;
}

/* show tooltip */
.t:hover::after,
.t:hover::before {
    opacity: 1;
}

.btn-delete {
    background: #eb5e59;
}

.btn-delete:hover {
    background: #e6504b;
}

.form-buttons {
    display: flex;
    gap: 10px;
}

.btn-float {
    padding: 8px 12px;
    background-color: var(--card);
    border: var(--border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--color-text);
    font-size: 1.5rem;
    transition: background-color 0.3s;
}

.btn-float:hover {
    background-color: var(--orange);
    color: var(--color-text);
}

.export-buttons {
    display: flex;
    flex-direction: column;
}

.export-buttons button {
    width: 100%;
}

.chart-box {
    margin: 20px 0;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 10px;
}

#chartsContainer {
    margin-top: 15px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
}

.table-mode-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.table-mode-switch button {
    padding: 8px 14px;
    background: var(--background);
    color: var(--color-text);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: .2s;
}

.table-mode-switch button.active {
    background: #0052CC;
    border-color: #0052CC;
    color: #fff;
}

.table-mode-switch button:hover {
    background: var(--background);
    border: 1px solid #0052CC;
    color: var(--color-text);
}

.hide {
    display: none !important;
}

.top-menu {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    z-index: 70;
    justify-content: center;
}

.menu-btn {
    padding: 10px 18px;
    border-radius: 8px;
    background: var(--background);
    color: var(--color-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.25s, transform 0.15s;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.menu-btn:hover {
    background: var(--card);
    border: 1px solid #0052CC;
}

.menu-btn.active {
    background: #0052CC;
    color: #fff;
    font-weight: 600;
    border-color: #0052CC;
    transform: none;
}
