/* === BACK BUTTON (Fixed Position) === */

.back-button {
    position: fixed;
    top: calc(var(--safe-top) + 12px);
    left: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-base);
}

.back-button:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.7);
}

.back-button img {
    width: 18px;
    height: 18px;
}

/* Extra padding for game page content so it's below the back button */
body:has(.back-button) .content {
    padding-top: calc(80px + var(--safe-top));
}

/* === Game Info Overlay (затемнение + blur) === */
.game-info-overlay, .game-description {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    margin-top: 16px;
}

/* === Ф О Н   С Т Р А Н И Ц Ы === */

.back-img-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: top center;
    z-index: -1;
    filter: brightness(0.3);
}

body {
    padding-top: 0;
}

/* === Г Е Й М   Х Е Д Е Р === */

.game-header {
    display: flex;
    flex-direction: row;
    gap: 14px;
    width: 100%;
    align-items: flex-end;
}

.game-header .game-image {
    width: 100px;
    height: 150px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.game-header .game-main-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
}

.game-main-info .game-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.game-main-info .game-rat-tag {
    display: flex;
    flex-direction: row;
    gap: 6px;
    font-size: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.game-main-info .game-tags-box {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
}

.game-tags-box .tag {
    padding: 4px 8px;
    border-radius: 6px;
    background-color: var(--bg-secondary);
    color: var(--accent);
    font-size: 10px;
    font-weight: 500;
}

.game-rat-tag .game-rating {
    display: flex;
    gap: 4px;
    background-color: var(--bg-elevated, #3A3A3C);
    padding: 4px 8px;
    align-items: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--warning);
}

.game-rat-tag img {
    width: 10px;
    height: 10px;
}

/* === И Н Ф О === */

.second-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    background-color: color-mix(in srgb, var(--bg-secondary), transparent 20%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.second-info .info-row {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 16px;
}

.info-row .rows-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: flex-start;
    gap: 2px;
}

.rows-column .hint {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.rows-column .value {
    display: flex;
    flex-direction: row;
    gap: 6px;
    font-size: 13px;
    align-items: center;
}

.rows-column .value img {
    width: 14px;
    height: 14px;
}

/* === О П И С А Н И Е === */

.game-description {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.description-container {
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease-in-out;
}

.description-container.collapsed {
    max-height: 120px;
}

.description-container.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
}

.description-container.expanded {
    max-height: 10000px;
}

.description-container.expanded::after {
    opacity: 0;
}

.description-wrapper {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.description-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
    pointer-events: auto;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 0;
    cursor: pointer;
    width: 100%;
    text-align: left;
    outline: none;
    position: relative;
    z-index: 2;
    transition: opacity 0.2s ease;
}

.toggle-btn:active {
    opacity: 0.7;
}

/* Steam BB-теги стилизация */
.game-description .bb_img {
    width: 100%;
    height: auto;
    margin-top: 10px;
    border-radius: 8px;
}

.game-description .bb_tag {
    color: var(--accent);
    font-size: 13px;
}

.game-description .bb_ul {
    display: flex;
    flex-direction: column;
    padding-left: 20px;
    margin: 10px 0;
    gap: 6px;
}

.game-description .bb_paragraph {
    margin-bottom: 10px;
}

.game-description .bb_img_ctn {
    margin-bottom: 10px;
}

/* === Б Л О К   А К К А У Н Т О В === */

div#account-display-container {
    width: 100%;
}

.account-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    background-color: var(--bg-secondary);
    padding: 16px;
    border-radius: 12px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 184px;
}

.account-box .login-data {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-box .data {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-box .data .hint {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-box .data .value {
    font-size: 14px;
    font-weight: 500;
    font-family: 'SF Mono', 'Fira Code', monospace;
    word-break: break-all;
}

.account-box .favorite {
    position: absolute;
    width: 36px;
    height: 36px;
    top: 16px;
    right: 16px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
}

.account-box .heart-icon {
    fill: var(--button-color, #2481CC);
    transition: transform 0.2s ease;
}

.account-box .favorite:active .heart-icon {
    transform: scale(1.2);
}

.account-box .last-check {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.account-box .last-check .hint {
    font-size: 12px;
}

.account-box button:not(.favorite) {
    background-color: var(--accent-dimmed);
    color: var(--accent);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.account-box button:not(.favorite):active {
    background-color: color-mix(in srgb, var(--accent), transparent 50%);
}

/* === Б А Н Ы === */

.bans-box {
    display: flex;
    gap: 6px;
    margin: 4px 0;
    min-height: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.ban {
    padding: 4px 8px;
    background: var(--danger);
    color: #fff;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ban.community {
    background: var(--warning);
    color: #000;
}

/* === К О П И Р О В А Н И Е === */

.copyable {
    cursor: pointer;
    transition: color 0.2s;
}

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

/* === С И С Т Е М Н Ы Е   Т Р Е Б О В А Н И Я === */

.requirements-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    background-color: var(--bg-secondary);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.requirements-box .requirement {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.requirements-box .requirement b {
    color: var(--text-primary);
    font-weight: 600;
}

/* === T O A S T   Н О Т И Ф И К А Ц И И === */

.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification.toast-success {
    border-left: 3px solid var(--success);
}

.toast-notification.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-message {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === У Л У Ч Ш Е Н Н А Я   П А Г И Н А Ц И Я === */

.pagination-controls {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 8px 0;
}

.pagination-controls span {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.nav-btn {
    padding: 12px;
    background-color: var(--accent-dimmed);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.nav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none !important;
}

.nav-btn:not(:disabled):active {
    transform: scale(0.92);
    background-color: color-mix(in srgb, var(--accent), transparent 50%);
}

.nav-btn:not(:disabled):hover {
    background-color: color-mix(in srgb, var(--accent), transparent 60%);
}

.nav-icon {
    width: 24px;
    height: 24px;
    fill: var(--accent);
}

/* Swipe индикатор */
.swipe-hint {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    opacity: 0.5;
}

.swipe-hint span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    transition: all 0.2s ease;
}

.swipe-hint span.active {
    background-color: var(--accent);
    transform: scale(1.2);
}

/* === S K E L E T O N === */

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        color-mix(in srgb, var(--bg-secondary), white 10%) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200px 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    border-radius: 6px;
    color: transparent !important;
    user-select: none;
    min-height: 20px;
    min-width: 60%;
    width: 60%;
    line-height: 20px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    display: inline-block;
}

.account-box .data .value.skeleton,
.account-box .last-check .hint.skeleton {
    min-height: 20px;
    line-height: 20px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    display: inline-block;
}
