/* dotascore/static/css/home_styles.css */

.leaderboard:has(.news-tabs) {
    max-width: 1200px;
}

/* ДВОЙНАЯ РАМКА: внешняя оправа + внутреннее ядро */
.bezel {
    --r: 28px;
    --pad: 6px;
    padding: var(--pad);
    border-radius: var(--r);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--hair);
}

.bezel-core {
    border-radius: calc(var(--r) - var(--pad));
    background: var(--core);
    box-shadow: var(--inner-light);
    overflow: hidden;
}

/* ПРИВЕТСТВИЕ */
.home-greeting {
    margin-bottom: 20px;
}

.home-greeting .bezel-core {
    padding: 22px 28px 24px;
    text-align: center;
}

.home-greeting-title {
    margin: 0 0 10px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.05em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 0 24px rgba(0, 210, 255, 0.45);
}

.home-greeting-text {
    color: #aeb7c6;
    font-size: 0.92em;
    line-height: 1.6;
}

.home-greeting-text > :first-child { margin-top: 0; }
.home-greeting-text > :last-child { margin-bottom: 0; }
.home-greeting-text p { margin: 6px 0; }

.home-greeting .text-highlight { color: rgba(0, 210, 255, 0.7); }

.player-link,
.player-link:link,
.player-link:visited {
    color: #6cb8ff;
    text-decoration: none;
    border-bottom: 1px dashed rgba(108, 184, 255, 0.45);
    transition: color 0.5s var(--ease), border-color 0.5s var(--ease);
}

.player-link:hover,
.player-link:focus {
    color: #a6d4ff;
    border-bottom-color: #a6d4ff;
}

.player-left-guild {
    color: #7d8799;
    font-style: italic;
    font-weight: 400;
}

/* ПОБЕДИТЕЛИ */
.winners-strip {
    margin-bottom: 20px;
}

.winners-strip .bezel-core {
    padding: 20px 18px 18px;
}

.winners-title {
    display: table;
    margin: 0 auto 18px;
    padding: 5px 14px;
    border: 1px solid var(--hair);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.winners-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.winner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background:
        radial-gradient(120% 100% at 0% 0%, var(--medal-soft), transparent 65%),
        rgba(255, 255, 255, 0.025);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.winner-1 { --medal: #f5c542; --medal-soft: rgba(245, 197, 66, 0.16); }
.winner-2 { --medal: #c0c7d0; --medal-soft: rgba(192, 199, 208, 0.12); }
.winner-3 { --medal: #cd7f32; --medal-soft: rgba(205, 127, 50, 0.16); }

.winner-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: 1px solid var(--medal);
    border-radius: 50%;
    background: #141a24;
    box-shadow: 0 0 20px -4px var(--medal);
}

.winner-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.winner-avatar-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4em;
    font-weight: 700;
}

.winner-medal {
    position: absolute;
    right: -8px;
    bottom: -6px;
    font-size: 1.2em;
    line-height: 1;
}

.winner-name {
    min-width: 0;
    color: #fff;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* ВКЛАДКИ */
.news-tabs {
    --accent: #00d2ff;
    --accent-glow: rgba(0, 210, 255, 0.5);
    --accent-ring: rgba(0, 210, 255, 0.4);
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 6px;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--hair);
    border-radius: 999px;
}

.news-tabs[data-active="guild"] {
    --accent: #34d399;
    --accent-glow: rgba(52, 211, 153, 0.5);
    --accent-ring: rgba(52, 211, 153, 0.4);
}

.news-tab-indicator {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: calc((100% - 12px) / 2);
    border-radius: 999px;
    background: #0e131b;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        0 0 0 1px var(--accent-ring),
        0 0 28px -6px var(--accent-glow);
    transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
}

.news-tabs[data-active="guild"] .news-tab-indicator {
    transform: translateX(100%);
}

.news-tab {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    background: none;
    color: var(--muted);
    border: none;
    border-radius: 999px;
    font: inherit;
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.6s var(--ease), background 0.6s var(--ease), transform 0.6s var(--ease);
}

.news-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
}

.news-tab:active {
    transform: scale(0.98);
}

.news-tab.active {
    color: #fff;
}

.news-tab:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: -2px;
}

.news-tab-count {
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.85em;
    letter-spacing: 0;
    text-align: center;
    transition: background 0.7s var(--ease), color 0.7s var(--ease);
}

.news-tab.active .news-tab-count {
    background: var(--accent);
    color: #03121a;
}

/* ПАНЕЛИ */
.news-panel[hidden] { display: none; }

.news-panel { animation: panel-in 0.6s var(--ease); }

@keyframes panel-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dota-panel { --accent: #00d2ff; --accent-glow: rgba(0, 210, 255, 0.45); --accent-ring: rgba(0, 210, 255, 0.4); }
.guild-panel { --accent: #34d399; --accent-glow: rgba(52, 211, 153, 0.45); --accent-ring: rgba(52, 211, 153, 0.4); }

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

/* КАРТОЧКИ */
.news-card {
    position: relative;
    display: flex;
    transition: transform 0.7s var(--ease), border-color 0.7s var(--ease), box-shadow 0.7s var(--ease);
}

.news-card .bezel-core {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-ring);
    box-shadow: 0 30px 60px -30px var(--accent-glow);
}

.news-card-image-container {
    position: relative;
    flex: 1 0 auto;
    aspect-ratio: 16 / 10;
    background: #05070a;
    overflow: hidden;
}

.news-card-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s var(--ease);
}

.news-card:hover .news-card-image {
    transform: scale(1.05);
}

.news-card-overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to top, var(--core) 8%, transparent);
}

.news-card-tags {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.news-tag {
    padding: 4px 11px;
    border: 1px solid var(--accent-ring);
    border-radius: 999px;
    background: rgba(5, 7, 10, 0.72);
    color: var(--accent);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-transform: uppercase;
}

.news-card-content {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    padding: 6px 22px 20px;
}

.news-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    margin: 0 0 8px;
    color: #fff;
    font-size: 1.05em;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.6s var(--ease);
}

.news-card:hover .news-card-title {
    color: var(--accent);
}

.news-card-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.65em;
    margin: 0 0 16px;
    color: #9aa4b5;
    font-size: 0.88em;
    line-height: 1.55;
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--hair);
}

.news-card-date {
    color: var(--accent);
    font-size: 0.82em;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.news-card-link {
    padding: 7px 16px;
    border: 1px solid var(--hair);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.82em;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.6s var(--ease), color 0.6s var(--ease), border-color 0.6s var(--ease);
}

.news-card-link::after {
    content: '';
    position: absolute;
    inset: 0;
}

.news-card:hover .news-card-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #03121a;
}

.news-card-link:focus-visible {
    outline: none;
}

.news-card:has(.news-card-link:focus-visible) {
    border-color: var(--cyan);
}

.news-empty {
    grid-column: 1 / -1;
    padding: 48px 0;
    text-align: center;
    color: var(--muted);
}

/* АСИММЕТРИЧНЫЙ БЕНТО: первая новость крупнее */
@media (min-width: 601px) {
    .news-grid > .news-card:first-child {
        grid-column: span 2;
    }

    .news-grid > .news-card:first-child .news-card-image-container {
        aspect-ratio: 16 / 8;
    }

    .news-grid > .news-card:first-child .news-card-title {
        font-size: 1.35em;
    }
}

@media (min-width: 1000px) {
    .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .bezel { --r: 22px; --pad: 5px; }
    .home-greeting .bezel-core { padding: 18px 16px 20px; }
    .winners-strip .bezel-core { padding: 16px 12px 12px; }
    .winners-podium { grid-template-columns: 1fr; gap: 8px; }
    .news-tabs { margin-bottom: 20px; }
    .news-tab { padding: 14px 8px; font-size: 0.74em; letter-spacing: 0.06em; }
    .news-grid { grid-template-columns: 1fr; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .news-panel { animation: none; }
    .news-card, .news-card-image, .news-tab-indicator { transition: none; }
    .news-card:hover, .news-card:hover .news-card-image { transform: none; }
}