/* =========================================================
   GUN Stats - WordPress plugin layout
   Based on the supplied GuN Stats MOHAAS layout lab.
   Scoped to .gun-stats-page so it does not restyle the full WP theme.
   ========================================================= */

.gun-stats-page {
    --bg: #05080d;
    --bg-2: #07101a;
    --panel: rgba(13, 18, 25, 0.92);
    --panel-2: rgba(17, 23, 31, 0.88);
    --line: rgba(162, 176, 191, 0.15);
    --line-strong: rgba(216, 181, 78, 0.46);
    --accent: #d8b54e;
    --accent-2: #f2cf66;
    --accent-soft: rgba(216, 181, 78, 0.12);
    --text: #f5f0e6;
    --muted: #98a4b4;
    --muted-2: #687485;
    --green: #6bd36f;
    --red: #e56a67;
    --shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
    --radius: 16px;
    --table-font: 0.78rem;
    --head-font: 0.62rem;
    --name-font: 0.82rem;
    --cell-pad-y: 9px;
    --cell-pad-x: 13px;
    --table-weight: 400;
    --head-weight: 800;
    --name-weight: 600;
    --number-weight: 650;
    --page-max: 1580px;

    margin: 0;
    min-height: 100%;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(216, 181, 78, 0.13), transparent 31rem),
        radial-gradient(circle at 90% 8%, rgba(55, 118, 165, 0.14), transparent 34rem),
        linear-gradient(180deg, #05080d 0%, #030509 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.gun-stats-page,
.gun-stats-page * {
    box-sizing: border-box;
}

.gun-stats-page button,
.gun-stats-page input,
.gun-stats-page select {
    font: inherit;
}

.gun-stats-page.font-compact {
    --table-font: 0.78rem;
    --head-font: 0.62rem;
    --name-font: 0.82rem;
}

.gun-stats-page.font-normal {
    --table-font: 0.84rem;
    --head-font: 0.66rem;
    --name-font: 0.88rem;
}

.gun-stats-page.font-large {
    --table-font: 0.92rem;
    --head-font: 0.72rem;
    --name-font: 0.96rem;
}

.gun-stats-page.density-slim {
    --cell-pad-y: 9px;
    --cell-pad-x: 13px;
}

.gun-stats-page.density-comfort {
    --cell-pad-y: 13px;
    --cell-pad-x: 16px;
}

.gun-stats-page.density-spacious {
    --cell-pad-y: 17px;
    --cell-pad-x: 18px;
}

.gun-stats-page.accent-gold {
    --accent: #d8b54e;
    --accent-2: #f2cf66;
    --accent-soft: rgba(216, 181, 78, 0.12);
    --line-strong: rgba(216, 181, 78, 0.46);
}

.gun-stats-page.accent-military {
    --accent: #b7a05a;
    --accent-2: #d8c473;
    --accent-soft: rgba(126, 143, 81, 0.16);
    --line-strong: rgba(183, 160, 90, 0.46);
}

.gun-stats-page.accent-blue {
    --accent: #64b5f6;
    --accent-2: #a7d7ff;
    --accent-soft: rgba(100, 181, 246, 0.12);
    --line-strong: rgba(100, 181, 246, 0.44);
}

.gun-stats-page.width-contained {
    --page-max: 1580px;
}

.gun-stats-page.width-full .page-shell {
    max-width: none;
}

.gun-stats-page.width-full .preview-frame {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
}

.gun-stats-page.weight-normal {
    --name-weight: 400;
}

.gun-stats-page.weight-medium {
    --name-weight: 500;
}

.gun-stats-page.weight-semibold {
    --name-weight: 600;
}

.gun-stats-page.weight-bold {
    --name-weight: 700;
}

.gun-stats-page .page-shell {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: clamp(18px, 2.4vw, 38px);
}

.gun-stats-page .preview-frame {
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(10, 18, 27, 0.96), rgba(5, 8, 13, 0.985)),
        radial-gradient(circle at 18% 0%, var(--accent-soft), transparent 35rem);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.gun-stats-page .gun-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px clamp(20px, 2.5vw, 34px);
    border-bottom: 1px solid var(--line);
}

.gun-stats-page .gun-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 13px;
}

.gun-stats-page .gun-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #0b0c0e;
    background: linear-gradient(145deg, var(--accent-2), #9d701e);
    border-radius: 14px;
    font-weight: 1000;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.44),
        0 0 0 1px rgba(216, 181, 78, 0.28),
        0 16px 36px rgba(0, 0, 0, 0.24);
}

.gun-stats-page .gun-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.gun-stats-page .gun-brand-text strong {
    color: #fffaf0;
    font-size: 1.08rem;
    font-weight: 950;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.gun-stats-page .gun-brand-text em {
    margin-top: 5px;
    color: var(--accent);
    font-size: 0.70rem;
    font-style: normal;
    font-weight: 900;
    letter-spacing: 0.34em;
    text-transform: uppercase;
}

.gun-stats-page .gun-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    color: #fff;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(162, 176, 191, 0.14);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.gun-stats-page .gun-user span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.gun-stats-page .gun-hero {
    padding: clamp(24px, 3vw, 44px) clamp(20px, 2.5vw, 34px) 20px;
}

.gun-stats-page .gun-overline {
    color: var(--accent-2);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.gun-stats-page .gun-hero h1 {
    margin: 7px 0 0;
    color: #fff;
    font-size: clamp(2.25rem, 5vw, 4.6rem);
    line-height: 0.95;
    font-weight: 950;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    text-shadow:
        0 2px 0 rgba(216, 181, 78, 0.16),
        0 20px 44px rgba(0, 0, 0, 0.38);
}

.gun-stats-page .search-panel {
    padding: 0 clamp(20px, 2.5vw, 34px) 14px;
}

.gun-stats-page .search-wrap {
    position: relative;
}

.gun-stats-page .search-wrap svg {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 19px;
    height: 19px;
    color: var(--muted-2);
    transform: translateY(-50%);
}

.gun-stats-page .gun-player-search {
    width: 100%;
    height: 58px;
    padding: 0 18px 0 52px;
    color: var(--text);
    background: rgba(7, 11, 16, 0.76);
    border: 1px solid rgba(162, 176, 191, 0.18);
    border-radius: 12px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    font-size: 0.98rem;
}

.gun-stats-page .gun-player-search:focus {
    border-color: var(--line-strong);
    box-shadow:
        0 0 0 3px rgba(216, 181, 78, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.gun-stats-page .gun-player-search::placeholder {
    color: #657283;
}

.gun-stats-page .board-shell {
    margin: 0 clamp(20px, 2.5vw, 34px) clamp(22px, 2.4vw, 36px);
    overflow: hidden;
    background: rgba(10, 15, 22, 0.86);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.gun-stats-page .table-scroll {
    overflow: auto;
}

.gun-stats-page .gun-table {
    width: 100%;
    min-width: 980px;
    color: var(--text);
    border-collapse: collapse;
    border-spacing: 0;
    font-size: var(--table-font);
    margin: 0;
    background: transparent;
}

.gun-stats-page .gun-table th,
.gun-stats-page .gun-table td {
    padding: var(--cell-pad-y) var(--cell-pad-x);
    border: 0;
    border-bottom: 1px solid rgba(162, 176, 191, 0.115);
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
    background: transparent;
}

.gun-stats-page .gun-table td {
    font-weight: var(--table-weight);
}

.gun-stats-page .gun-table th {
    color: var(--accent-2);
    background: linear-gradient(180deg, rgba(8, 13, 19, 0.82), rgba(8, 13, 19, 0.42));
    border-bottom: 1px solid var(--line-strong);
    font-size: var(--head-font);
    font-weight: var(--head-weight);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.gun-stats-page .gun-table th:nth-child(1),
.gun-stats-page .gun-table td:nth-child(1) {
    width: 68px;
    text-align: center;
}

.gun-stats-page .gun-table th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.gun-stats-page .gun-table th[data-sort]:hover {
    color: #fff;
}

.gun-stats-page .gun-table tr {
    background: rgba(255, 255, 255, 0.005);
    transition: background 0.18s ease;
}

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

.gun-stats-page .gun-table tbody tr:hover {
    background: rgba(216, 181, 78, 0.072);
}

.gun-stats-page .rank-medal {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(162, 176, 191, 0.14);
    border-radius: 10px;
    font-weight: 900;
}

.gun-stats-page .rank-medal.gold {
    color: #0b0c0e;
    background: linear-gradient(145deg, var(--accent-2), #a87920);
    border-color: rgba(216, 181, 78, 0.36);
}

.gun-stats-page .rank-medal.silver {
    color: #101317;
    background: linear-gradient(145deg, #edf1f5, #858f9a);
}

.gun-stats-page .rank-medal.bronze {
    color: #100d08;
    background: linear-gradient(145deg, #d98b46, #7d4b24);
}

.gun-stats-page .player-cell {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.gun-stats-page .avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(216, 181, 78, 0.30);
    border-radius: 999px;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.13);
    font-size: 1rem;
}

.gun-stats-page .player-meta {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.gun-stats-page .player-meta a {
    color: #fff;
    text-decoration: none;
    font-size: var(--name-font);
    font-weight: var(--name-weight);
}

.gun-stats-page .player-meta a:hover {
    color: var(--accent-2);
}

.gun-stats-page .clan {
    color: var(--muted-2);
    font-size: 0.8em;
}

.gun-stats-page .num-accent {
    color: var(--accent-2);
    font-weight: var(--number-weight);
}

.gun-stats-page .kd-good,
.gun-stats-page .kd-mid,
.gun-stats-page .kd-low {
    font-weight: var(--number-weight);
}

.gun-stats-page .kd-good {
    color: var(--green);
}

.gun-stats-page .kd-mid {
    color: #bee56a;
}

.gun-stats-page .kd-low {
    color: #f1a75f;
}

.gun-stats-page .empty-state {
    display: none;
    padding: 32px;
    color: var(--muted);
    text-align: center;
    font-weight: 700;
}

.gun-stats-page .empty-state.is-visible {
    display: block;
}

.gun-stats-page .profile-preview {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) 1.6fr;
    gap: 18px;
    padding: 0 clamp(20px, 2.5vw, 34px) clamp(24px, 2.4vw, 38px);
}

.gun-stats-page .profile-card {
    padding: 18px;
    background: rgba(10, 15, 22, 0.82);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.gun-stats-page .profile-title {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 16px;
}

.gun-stats-page .profile-title .avatar {
    width: 46px;
    height: 46px;
}

.gun-stats-page .profile-title strong {
    display: block;
    color: #fff;
    font-size: 1.05rem;
    font-weight: var(--name-weight);
}

.gun-stats-page .profile-title span:not(.avatar) {
    color: var(--muted-2);
    font-size: 0.82rem;
}

.gun-stats-page .profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 12px;
}

.gun-stats-page .mini-stat {
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(162, 176, 191, 0.12);
    border-radius: 12px;
}

.gun-stats-page .mini-stat strong {
    display: block;
    color: #fff;
    font-size: 1.18rem;
    font-weight: var(--number-weight);
}

.gun-stats-page .mini-stat span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .gun-stats-page .profile-preview {
        grid-template-columns: 1fr;
    }

    .gun-stats-page .profile-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

@media (max-width: 640px) {
    .gun-stats-page .gun-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .gun-stats-page .gun-user {
        display: none;
    }

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


/* =========================================================
   WordPress full-page support
   ---------------------------------------------------------
   These rules only remove common theme containers/titles when
   the [gun_stats] shortcode is used. The original GUN layout
   styling above is intentionally preserved.
   ========================================================= */

body.gun-stats-fullscreen-active .entry-title,
body.gun-stats-fullscreen-active .page-title,
body.gun-stats-fullscreen-active .wp-block-post-title {
    display: none !important;
}

body.gun-stats-fullscreen-active .entry-content,
body.gun-stats-fullscreen-active .wp-block-post-content,
body.gun-stats-fullscreen-active .site-main,
body.gun-stats-fullscreen-active .content-area {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.gun-stats-fullscreen-active .entry-content > *,
body.gun-stats-fullscreen-active .wp-block-post-content > * {
    max-width: none !important;
}

body.gun-stats-fullscreen-active .gun-stats-page {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}
