:root {
    --primary-color: #FF7F50;
    --secondary-color: #FFB5C5;
    --primary-text-color: #333;
    --secondary-text-color: #666;
    --footer-bg-color: #FFB5C5;
    --gradient-bg-color: linear-gradient(to bottom, #FFA68A, #FFF6EC);
    --border-radius: 0.75rem;
    --h2-font-size: 1.25rem;
    --shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: var(--h2-font-size);
}

body {
    font-family: Arial, sans-serif;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 62.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    /*background-color: var(--secondary-color);*/
    /*background: var(--gradient-bg-color);*/
}

header, footer {
    text-align: center;
    padding: 1em 0;
}

header {
    background-color: #333;
    color: white;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    max-width: 62.5rem;
    margin: 0 auto;
}

.ad-container {
    margin: 0 auto;
    text-align: center;
}

.top-ad {
    width: 50%;
    display: flex;
    align-items: center;
    margin: 0 auto;
    justify-content: center;
    color: #e6e6e6;
}

.games-grid {
    display: flex;
    flex-wrap: wrap;
    /*gap: 0.625rem;*/
    max-width: 62.5rem;
    margin: 0 auto;
    justify-content: center;
}

/* 添加容器以保持整体居中但内容左对齐 */
.games-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.game-item {
    flex: 0 0 4.375rem;
    height: 8rem;
    text-align: center;
    padding: 0.1rem;
    box-sizing: border-box;
}

.game-item:hover {
    transform: translateY(-0.3125rem);
    box-shadow: 0 0.3125rem 0.9375rem rgba(0, 0, 0, 0.1);
}

.game-item img {
    width: 5rem;
    height: 5rem;
    border-radius: 0.375rem;
    object-fit: contain;
    margin-bottom: 0.25rem;
}

.game-item h3 {
    margin: 0.1rem 0;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0;
    color: var(--primary-text-color);
    line-height: 1.2;
    height: 1.2em;
}

.game-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

.copyright {
    margin-bottom: 3.125rem;
}
footer {
    color: #333;
    padding: 0.9375rem 0;
    /*background-color: var(--footer-bg-color);*/
}

.footer-links {
    margin-bottom: 0.625rem;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
    /*gap: 0.5rem;*/
}

.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 0.3125rem;
    font-size: 0.875rem;
    padding: 0.3125rem 0.625rem;
    border-radius: 1.25rem;
    transition: all 0.3s ease;
}

/* 修改分隔符样式 */
.footer-links span {
    color: #666;
    margin: 0;
}

.footer-links a:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}


/* 游戏详情页样式 */
.game-detail {
    width: 100%;
    margin: 0 auto;
    padding-top: 1rem;
    box-sizing: border-box;
}

.game-detail-header {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-sizing: border-box;
}

.game-detail-icon {
    height: 6rem;
    width: 6rem;
    object-fit: fill;
    border-radius: 0.375rem;
}

.game-detail-info {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    position: relative;
}

.game-detail-info h1{
    margin: 0 0 0.625rem 0;
    font-size: 2rem;
    color: var(--primary-text-color);
    word-break: break-word;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 1.25rem;
    font-size: 4rem;
    margin-bottom: 0.625rem;
}

.game-description {
    color: var(--secondary-text-color);
    line-height: 1.2;
    margin-bottom: 1.25rem;
    margin-left: 0.65rem;
    margin-right: 0.65rem;
    font-size: 1rem;
    word-break: break-word;
}

.game-container {
    width: 100%;
    height: calc(100% - 3.125rem);
    border: none;
    background: #f0f0f0;
}

/* 分类按钮样式 */
.more-categories {
    margin-top: 1.25rem;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.category-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    color: white;
    border-radius: 1.25rem;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.3s ease;
}

.category-button:hover {
    background: darken(var(--primary-color), 80%);
}

/* 更多游戏样式 */
.more-games {
    margin-top: 2.5rem;
    h2 {
        margin-left: 0.6rem;
    }
}

.more-games .games-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-content: center;
    align-items: center;
}

.game-back {
    display: flex;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    width: 4rem;
    height: 2rem;
    position: absolute;
    left: 0;
    /*z-index: 9999;*/
    top: 50%;
    background-color: rgba(141, 205, 253, 0.8);
    border-radius: 0 0.625rem 0.625rem 0;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.3125rem;
}

.game-back .back {
    width: 1.8rem;
    height: 1.8rem;
}

.game-back .icon {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
}

.game-back-detail {
    display: flex;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    width: 4rem;
    height: 2rem;
    position: fixed;
    left: 0;
    top: 30%;
    background-color: rgba(141, 205, 253, 0.8);
    border-radius: 0 0.625rem 0.625rem 0;
    align-items: center;
    z-index: 99;
    justify-content: space-between;
    padding: 0 0.3125rem;
}

.game-back-detail .aback {
    width: 1.8rem;
    height: 1.8rem;
}
.game-back-detail .aicon {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
}

.float-game {
    position: fixed;
    display: none;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    width: 3.75rem;
    height: 3.75rem;
    right: 0;
    z-index: 99999;
    top: 70%;
    border-radius: 0 0.625rem 0.625rem 0;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.3125rem;
}

.float-game .icon {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
}

/* 添加返回首页链接的样式 */
.back-to-home {
    display: inline-block;
    margin-top: 0;
    padding: 0.3125rem 0.625rem;
    background: var(--primary-color);
    color: white;
    border: rgba(255, 136, 0, 0.76) 0.125rem solid;
    border-radius: 1.25rem;
    text-decoration: none;
    --shadow: 0 0.75rem 1.125rem rgba(0, 0, 0, 0.5);
    font-size: 0.875rem;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    margin-left: 1.25rem;
    margin-right: 1.25rem;
}

/* 初始隐藏游戏容器 */
.game-container-div {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #000;
    left: 0;
    top: 0;
    z-index: 999;
    visibility: hidden;
}

.play-button {
    display: block;
    position: relative;
    width: 12.5rem;
    height: 3.125rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    margin: 0 auto;
    overflow: hidden;
    transition: background-color 0.3s;
    border-radius: 0.625rem;
    border: white 0.125rem solid;
}

.progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    width: 0;
    border-radius: 0.625rem;
    transition: width 0.1s ease;
}

.play-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 全屏游戏容器样式 */
.fullscreen-game {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: white;
}

.home_banner_50{
    height: 3rem;
    margin: 0 auto;
    position: fixed;
    display: flex;
    bottom: 0;
}


/* 隐藏弹窗，默认状态下 */
#popup {
    visibility: hidden;
    position: fixed;
    display: flex;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    border-radius: 1rem;
}

#popup-60 {
    visibility: hidden;
    position: fixed;
    display: flex;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    border-radius: 1rem;
}

/* 弹窗内容样式 */
#popup-content {
    background-color: white;
    padding: 1rem;
    border-radius: 0.125rem;
    padding: 1rem;
    margin: 0 auto;
}
#popup-content-60 {
    background-color: white;
    padding: 1rem;
    border-radius: 0.125rem;
    padding: 1rem;
    margin: 0 auto;
}

/* 关闭按钮样式 */
#close-popup {
    float: right;
    font-size: 2rem;
}

#close-popup-60 {
    float: right;
    font-size: 2rem;
}