/* Bejeweled 等比例缩放自适应 */

body {
	margin: 0;
	padding: 0;
	font: 12pt Helvetica, Arial, "Trebuchet MS", sans-serif;
	color: black;
	background-color: black;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100vw;
	height: 100vh;
	overflow: hidden;
}

small {
	font-size: 85%;
}

a img	{
	border: 0;
}

a {
	color: #ddd;
}

#myiphone_to, #myiphone_from {
	overflow: hidden;
	height: 480px;
}

#myiphone_to div.myiphone_page {
	overflow: hidden;
	height: 480px;
}

.myiphone_page {
    height: 480px !important;
}

p {
    margin: 0;
    text-indent: 10px;
}

#myiphone_loading div.myiphone_wrapper {
    text-align: center;
    width: 100%;
    background-color: #4D78A4;
    height: 360px;
}

/* 核心：等比例缩放自适应 - PC端高度优先版本（放大版） */
#myiphone_screen {
    width: 320px;
    height: 480px;
    /* background: url(../images/myiphone_bg.jpg) no-repeat; */ /* 图片文件不存在，暂时注释 */
    background-size: 320px 480px;
    transform-origin: center center;
    position: relative;
    /* PC端：高度优先缩放 + 2倍放大系数（200%） */
    transform: scale(calc(100vh / 480 * 2));
}

/* 移动端或极小屏幕：使用min()确保完整显示，但保持200%放大 */
@media (max-width: 480px), (max-height: 600px) {
    #myiphone_screen {
        transform: scale(min(
            calc(100vw / 320 * 2),
            calc(100vh / 480 * 2)
        )) !important;
    }
}

/* 超窄屏幕：强制使用min()缩放，但保持200%放大 */
@media (max-aspect-ratio: 1/1) {
    #myiphone_screen {
        transform: scale(min(
            calc(100vw / 320 * 2),
            calc(100vh / 480 * 2)
        )) !important;
    }
}

/* 主菜单区域：PC端高度优先缩放（放大版） */
#startPage {
    /* PC端：高度优先缩放 + 2倍放大系数（200%），以420px为基准 */
    transform: scale(calc(100vh / 420 * 2)) !important;
    transform-origin: center center !important;
}

/* 移动端或极小屏幕：主菜单使用min()确保完整显示，但保持200%放大 */
@media (max-width: 480px), (max-height: 600px) {
    #startPage {
        transform: scale(min(
            calc(100vw / 320 * 2),
            calc(100vh / 420 * 2)
        )) !important;
    }
}

/* 超窄屏幕：主菜单强制使用min()缩放 */
@media (max-aspect-ratio: 1/1) {
    #startPage {
        transform: scale(min(
            calc(100vw / 320),
            calc(100vh / 420)
        )) !important;
    }
}

div.myiphone_page {
    margin-bottom: 0;
    height: 480px;
}

div.myiphone_wrapper {
    position: relative;
    height: 360px;
    width: 320px;
}

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    filter: alpha(opacity=40);
    -moz-opacity: 0.6;
    opacity: 0.6;
    z-index: 9999;
}

#ad_wrapper {
    display: none;
    position: absolute;
    top: 50px;
    left: 8px;
    width: 300px;
    border: solid 2px black;
    background-color: black;
    z-index: 999997;
}

#ad {
    display: none;
    color: #999999;
    font-weight: bold;
    font-size: 36px;
    text-align: center;
    width: 300px;
    height: 250px;
    background-color: black;
    z-index: 999997;
}

#ad_header {
    display: none;
    color: #FFFFFF;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    padding-top: 4px;
    width: 300px;
    height: 20px;
    background-color: #205b97;
    z-index: 999997;
}

#ad_footer {
    display: none;
    color: #FFFFFF;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    padding-top: 4px;
    width: 300px;
    height: 20px;
    background-color: #205b97;
    z-index: 999997;
}
