* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
    max-width: 100vw;
    overflow: hidden;
    height: 100vh;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

#battle_frame {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 7fr;
}
#battle_control {
    display: grid;
    background-color: rgb(22, 21, 32);
    grid-template-rows: 1fr 5fr;
    height: 100%;
    overflow: hidden;
}
#basic_control {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    grid-template-columns: repeat(3, 1fr);
}
/* 按钮 */
.control_btn {
    margin: 3px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background-color: rgba(78, 205, 196, 0.7);
    user-select: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.control_btn:hover {
    background: rgba(78, 205, 196, 1);
    transform: scale(0.98);
}
/* 阵营 */
#camp{
    margin: 3px;
    border-radius: 3px;
    display: grid;
    color: aliceblue;
    align-items: center;
    justify-content: center;
    grid-row: inherit;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}
#camp:hover {
    transform: scale(0.98);
}
/* 角色卡片 */
#units_list{
    display: flex;
    flex-direction: column;
    overflow: scroll;
    scrollbar-width: none;
    padding-top: 5px;
}
.unit_card {
    padding: 12px;
    border: none;
    margin: 0px 6px 6px 6px;
    border-radius: 8px;
    background: rgba(30, 30, 60, 0.8);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    font-size: 1rem;
}
.unit_card.selected {
    background: rgba(78, 205, 196, 0.3);
    border: 1px solid #4ecdc4;
}
.unit_card.selected:hover {
    background: rgba(78, 205, 196, 0.3);
    border: 1px solid #4ecdc4;
}
.unit_card:hover {
    background: rgba(40, 40, 80, 0.9);
    transform: scale(0.98);
}
/* 信息显示 */
#detail {
    position: absolute;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(4, auto);
    grid-auto-rows: auto;
    gap: 2px 12px;
    width: auto;
    height: auto;
}
#detail > div{
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.4;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

/* 统计面板 */
#stats_panel {
    position: absolute;
    right: 0;
    bottom: 0;
    margin: 8px;
    border-radius: 8px;
    padding: 8px;
    width: 15%;
    background: rgba(20, 20, 30, 0.6);
    color: #d0d0d0;
    font-size: 12px;
    user-select: none;
    pointer-events: none;
    backdrop-filter: blur(4px);
    z-index: 10;
}
#stats_panel.hidden {
    display: none;
}
.stats_row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
    gap: 4px;
}
.stats_label {
    color: #888;
    flex: 1;
}
.stats_val {
    color: #d0d0d0;
    font-weight: bold;
    text-align: right;
    flex: 1;
}
#stats_chart_wrap {
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 6px;
}
#stats_chart {
    width: 100%;
    height: 100px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
}

/* 单位分类 */
#unit_categories{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    gap: 8px;
}

#unit_categories > div{
    display: flex;
    background-color: rgba(20, 20, 30, 0.6);
    color: #ffffff;
    margin: 3px;
    border-radius: 3px;
    font-size: 20px;
    padding: 5px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

#unit_categories > div:hover {
    background: rgba(78, 205, 196, 0.7);
}

#unit_categories > div.active {
    background: rgba(78, 205, 196, 0.9);
    border: 1px solid #4ecdc4;
}
