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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    background-image: url('../pubg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: transparent;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: #f77f00;
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 4px solid #fcbf49;
}

header h1 {
    font-size: 2.1em;
    margin-bottom: 6px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.header-nav {
    width: 100%;
    padding: 6px 10px;
    margin-top: 8px;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.header-nav .nav-item {
    background: transparent;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
}

.header-nav .nav-item:hover {
    background: rgba(255,255,255,0.08);
}

.config-section {
    padding: 40px;
    background: #2b2b2b;
    border-bottom: 2px solid #f77f00;
}

.player-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fcbf49;
    font-size: 1.1em;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #444;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
    background: #1a1a1a;
    color: #fff;
}

.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f77f00;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.btn-primary {
    background: #04668D;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(4, 102, 141, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.loading {
    padding: 20px;
    text-align: center;
    font-size: 1.2em;
    color: #fcbf49;
    font-weight: 600;
}

.no-wrap {
    white-space: nowrap;
}

.error,
.error-list .error {
    background: #fee;
    color: #c33;
    padding: 15px;
    margin: 20px 40px;
    border-radius: 8px;
    border-left: 4px solid #c33;
}

.error-list {
    margin: 20px 0;
}

.stats-container {
    padding: 40px;
    background: #1a1a1a;
}

.stats-container h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 40px;
    color: #fcbf49;
    letter-spacing: 1px;
}

/* Stats description under the leaderboard title */
.stats-description {
    text-align: center;
    color: #ffffff;
    font-size: 0.95em;
    margin-top: -10px;
    margin-bottom: 12px;
    opacity: 0.95;
}

.stats-table-wrapper + .stats-description {
    margin-top: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

/* Stats Table */
.stats-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(43, 43, 43, 0.95);
    box-shadow: 0 4px 20px rgba(247, 127, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.85em;
}

.stats-table thead {
    background: #f77f00;
}

.stats-table thead tr.group-header {
    background: #0b3553;
}

.stats-table thead tr.group-header th {
    color: #d7d7d7;
    font-size: 0.88em;
    letter-spacing: 0.4px;
}

.stats-table th {
    padding: 12px 8px;
    text-align: center;
    color: #1a1a1a;
    font-weight: bold;
    font-size: 0.9em;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-table thead tr.group-header th {
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.stats-table thead tr.group-header th:last-child {
    border-right: none;
}

/* Composite header style: use white font for composite component headers */
.stats-table th.composite-header {
    color: #ffffff !important;
}

.stats-table th:last-child {
    border-right: none;
}

.stats-table th.rank-col {
    width: 70px;
}

.stats-table th.player-col {
    width: 140px;
    text-align: left;
    padding-left: 15px;
}

.stats-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.stats-table tbody tr:hover {
    background: rgba(247, 127, 0, 0.15);
}

.stats-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.stats-table tbody tr:nth-child(even):hover {
    background: rgba(247, 127, 0, 0.15);
}

.stats-table td {
    padding: 10px 8px;
    text-align: center;
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-table thead tr:not(.group-header) th:nth-child(2),
.stats-table thead tr:not(.group-header) th:nth-child(4),
.stats-table thead tr:not(.group-header) th:nth-child(8),
.stats-table thead tr:not(.group-header) th:nth-child(13),
.stats-table thead tr:not(.group-header) th:nth-child(17),
.stats-table thead tr:not(.group-header) th:nth-child(20),
.stats-table thead tr:not(.group-header) th:nth-child(23),
.stats-table tbody td:nth-child(2),
.stats-table tbody td:nth-child(4),
.stats-table tbody td:nth-child(8),
.stats-table tbody td:nth-child(13),
.stats-table tbody td:nth-child(17),
.stats-table tbody td:nth-child(20),
.stats-table tbody td:nth-child(23) {
    border-right: 2px solid rgba(255, 255, 255, 0.18);
}

.stats-table td:last-child {
    border-right: none;
}

.stats-table td.rank-col {
    font-weight: bold;
    font-size: 1em;
}

.stats-table td.player-col {
    text-align: left;
    padding-left: 15px;
    font-weight: bold;
    color: #fcbf49;
}

.player-link {
    color: #fcbf49;
    text-decoration: none;
    transition: color 0.2s, text-shadow 0.2s;
}

.player-link:hover {
    color: #06b6d4;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.45);
}


.stats-table tr.rank-gold {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15) 0%, rgba(43, 43, 43, 0.95) 100%);
}

.stats-table tr.rank-silver {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.15) 0%, rgba(43, 43, 43, 0.95) 100%);
}

.stats-table tr.rank-bronze {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.15) 0%, rgba(43, 43, 43, 0.95) 100%);
}

.stats-table tr.rank-gold:hover,
.stats-table tr.rank-silver:hover,
.stats-table tr.rank-bronze:hover {
    background: rgba(247, 127, 0, 0.2);
}

.stats-table td.best-stat {
    background: rgba(0, 255, 100, 0.2);
    font-weight: bold;
    color: #00ff64;
    box-shadow: inset 0 0 10px rgba(0, 255, 100, 0.3);
}

.stats-table .stat-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    filter: drop-shadow(0 0 2px rgba(0, 255, 100, 0.5));
}

.wm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 12px;
    justify-content: center;
}

.wm-tab-button {
    background: rgba(4, 102, 141, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
}

.wm-tab-button.active {
    background: #04668D;
    border-color: #04668D;
}

.wm-panel {
    display: none;
}

.wm-panel.active {
    display: block;
}

.wm-weapon-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.wm-weapon-header span {
    white-space: nowrap;
}

.wm-weapon-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

.wm-award-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 4px;
}

.wm-best {
    background: rgba(247, 127, 0, 0.16);
    color: #ffd166;
    font-weight: 700;
}

.wm-panel .stats-table th.award-desc-col,
.wm-panel .stats-table td.award-desc-cell {
    width: 90px;
    min-width: 90px;
}




.player-card {
    background: #2b2b2b;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 3px solid #444;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(247, 127, 0, 0.3);
}

.player-card.gold {
    border-color: #FFD700;
    background: linear-gradient(135deg, #3d3d00 0%, #4a4a00 100%);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.player-card.silver {
    border-color: #C0C0C0;
    background: linear-gradient(135deg, #2b2b2b 0%, #3a3a3a 100%);
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.3);
}

.player-card.bronze {
    border-color: #CD7F32;
    background: linear-gradient(135deg, #3d2200 0%, #4a2a00 100%);
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.3);
}

.player-rank {
    font-size: 1.1em;
    font-weight: bold;
    color: #fcbf49;
    margin-bottom: 10px;
}

.player-name {
    font-size: 1.4em;
    color: #fcbf49;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 3px solid #f77f00;
}

.game-summary {
    background: #1a1a1a;
    padding: 10px;
    border-radius: 5px;
    margin: 8px 0 15px 0;
    color: #fcbf49;
    font-size: 0.9em;
    text-align: center;
    border: 1px solid #444;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-item {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.2s;
    border: 1px solid #444;
}

.stat-item:hover {
    background: #333;
    border-color: #f77f00;
}

.stat-label {
    font-size: 0.9em;
    color: #999;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #fcbf49;
}

footer {
    background: #0a0a0a;
    color: #999;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    border-top: 2px solid #f77f00;
}

/* Progress Container - index.php */
.progress-container {
    background: #2b2b2b;
    padding: 30px;
    text-align: center;
    border-bottom: 2px solid #f77f00;
}

.progress-bar {
    width: 80%;
    height: 30px;
    background: #1a1a1a;
    border-radius: 15px;
    margin: 20px auto;
    overflow: hidden;
    border: 2px solid #444;
}

.progress-fill {
    height: 100%;
    background: #04668D;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.progress-text {
    color: #fcbf49;
    font-size: 1.2em;
    margin-top: 10px;
}


.refresh-button {
    background: #04668D;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.refresh-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(4, 102, 141, 0.35);
}

.refresh-button:active {
    transform: translateY(0);
}

.refresh-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Player Details - player_details.php */
.back-link {
    display: inline-block;
    margin: 20px 0;
    padding: 10px 20px;
    background: #04668D;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: transform 0.2s;
}

.back-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(4, 102, 141, 0.35);
}

.container.player-details {
    background: #1a1a1a !important;
}

.mode-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(43, 43, 43, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(247, 127, 0, 0.3);
}

.mode-title {
    color: #fcbf49;
    font-size: 1.5em;
    margin-bottom: 15px;
    text-transform: uppercase;
    border-bottom: 2px solid #f77f00;
    padding-bottom: 10px;
}

.stats-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-detail-item {
    background: rgba(26, 26, 26, 0.8);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #f77f00;
}

.stat-detail-label {
    color: #aaa;
    font-size: 0.85em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-detail-value {
    color: #fcbf49;
    font-size: 1.3em;
    font-weight: bold;
}

/* Cache Notice */
.cache-notice {
    background: #2b2b2b;
    color: #fcbf49;
    padding: 10px;
    text-align: center;
    border-bottom: 2px solid #f77f00;
}

/* Player Details Specific */
.player-details-header-timestamp {
    color: #1a1a1a;
    font-size: 0.9em;
    margin-top: 10px;
    font-weight: 600;
}

.back-link-container {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

.stats-container-narrow {
    max-width: 1200px;
    margin: 0 auto;
}

.progress-h2 {
    color: #fcbf49;
}

/* Stats Detail Table */
.stats-detail-table {
    font-size: 0.9em;
}

.stats-detail-table th.stat-name {
    text-align: left;
    width: 50%;
}

.stats-detail-table th.stat-value {
    text-align: right;
    width: 50%;
}

.stats-detail-table td.stat-name-cell {
    text-align: left;
    padding-left: 15px;
}

.stats-detail-table td.stat-value-cell {
    text-align: right;
    padding-right: 15px;
    font-weight: bold;
    color: #fcbf49;
}

.stat-icon-inline {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 8px;
}

.stat-label-note {
    font-size: 0.75em;
    color: #aaa;
}

.centered-content {
    text-align: center;
    margin-top: 20px;
}

/* Awards Section */
.awards-heading {
    margin-top: 40px;
}

.awards-table {
    max-width: 800px;
    margin: 0 auto;
}

.awards-table th.award-title-col {
    width: 40%;
    text-align: left;
}

.awards-table th.award-desc-col {
    width: 30%;
    text-align: left;
}

.awards-table th.award-winner-col {
    width: 30%;
    text-align: left;
}

.awards-table td.award-title-cell {
    font-weight: bold;
    color: #fcbf49;
    text-align: left;
}

.awards-table td.award-desc-cell {
    text-align: left;
}

.awards-table td.award-winner-cell {
    font-weight: bold;
    text-align: left;
}

.tip-box {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: rgba(43, 43, 43, 0.5);
    border-radius: 8px;
}

.tip-text {
    color: #fcbf49;
    font-size: 0.95em;
    margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .config-section,
    .stats-container {
        padding: 20px;
    }

    .player-name {
        font-size: 1.4em;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }
}
