body {
    text-align: center;
    background: linear-gradient(rgb(213, 229, 235), rgb(171, 205, 218));
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: Arial, sans-serif;
}
canvas {
    background: #222;
    display: block;
    margin: 20px auto;
    border: 2px solid black;
}
h1{
    color: rgb(9, 35, 77);
    margin: 10px 10px; 
    padding: 6px 10px;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    background: rgba(210, 225, 229, 0.75);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    width: 480px;
    margin: 20px auto;
}
#hud {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    max-width: 500px; /* optional: align with canvas width */
    margin: 0 auto;
    padding: 0px 0;
}
#score, #bullet, #live, #kill { 
    display: inline-block;
    font-size: 20px; 
    font-weight: bold;
    margin: 5px 10px; 
    padding: 6px 10px;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.content-box {
    max-width: 480px;
    margin: 30px auto;
    margin-bottom: 50px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 15px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.content-text{
    font-size: 16px;
    color: #333;
    margin: 5px 30px;
    text-align: left;
    padding: 0px 0px;
}
.btn {
    font-size: 20px; 
    font-weight: bold;
    margin: 5px 10px -10px 10px; 
    padding: 6px 10px;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    background: rgba(200, 214, 221, 0.75);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.ene-types{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px 10px; /* 12px row gap (vertical), 10px column gap (horizontal) */
    margin: 12px 20px;
    border: 5px solid rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.75);
    padding: 18px 15px;
}
.types{
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin: -10px 0px;
}
#longer {
    grid-column: span 2;
    padding:2px 0px;
}
.description{
    font-size: 14px;
    color: #333;
    text-align: left;
}
.imgs{
    width: 40px;
    height: 40px;
}
.btn:active{
    background-color: rgba(171, 189, 199, 0.75);
}
.game-container{
    position: relative;
    margin: 20px auto; /* center horizontally and give vertical spacing */
    width: 500px;
    height: 400px;
}
.game-container canvas {
    display: block;
    margin: 0; /* ensure canvas itself stays centered inside container */
    background: #222;
    border: 2px solid black;
    border-radius: 8px;
    box-sizing: border-box;
}
#highest-scores {
    position: absolute;  /* 绝对定位 */
    left: 520px;        /* 定位在 Canvas 右侧 (500px 宽度 + 10px 间距) */
    top: 0;
    width: 180px;
    height: 100%;        /* 自动与容器（Canvas）等高 */
    background: #444;
    color: #fff;
    border-radius: 8px;
    border: 2px solid black;
    padding: 10px;
    box-sizing: border-box;
    text-align: left;
}
#highest-scores h2 {
    margin-top: 0;
    font-size: 18px;
}
#highest-scores ol {
    padding-left: 20px;
    margin: 8px 0 0;
}