body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* 改为flex-start，使内容从顶部开始 */
    max-width: 900px;
    max-height: 900px
}

.container {
    width: 100%;
    max-width: 1200px;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 25px 0 0 0;
}

h1 {
    text-align: center;
    color: #1a73e8;
    margin-bottom: 30px;
}

/* Admin Page Styles */
.admin-controls {
    margin-bottom: 30px;
}

.admin-controls label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.admin-controls input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.card-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 800px; /* 添加最大高度 */
    overflow-y: auto; /* 添加垂直滚动 */
    padding-right: 10px; /* 为滚动条留出空间 */
}

.card {
    width: 60px;
    height: 85px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card.selected {
    border-color: #1a73e8;
    background-color: #e8f0fe;
    box-shadow: 0 0 0 2px #1a73e8;
}

.card .rank {
    font-size: 18px;
    font-weight: bold;
}

.card .suit {
    font-size: 22px;
    text-align: right;
}

.hearts .suit, .diamonds .suit { color: red; }
.clubs .suit, .spades .suit { color: black; }

button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #0d47a1;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#status {
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
    color: green;
}

/* 新增的已选择扑克显示区域样式 */
#selected-cards-display {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

#selected-cards-display h3 {
    margin-top: 0;
    color: #1a73e8;
}

#selected-cards-container {
    min-height: 30px;
}

#selected-cards-container .card.small {
    width: 40px;
    height: 60px;
    font-size: 14px;
}

#selected-cards-container .card.small .rank {
    font-size: 14px;
}

#selected-cards-container .card.small .suit {
    font-size: 16px;
}

/* 清除按钮样式 */
#clear-btn {
    background-color: #ff6b6b;
}

#clear-btn:hover {
    background-color: #ff5252;
}

/* 按钮组横向排列样式 */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.button-group button {
    display: inline-block;
    width: auto;
    flex: 1;
}

/* Display Page Styles */
.display-area {
    text-align: center;
}

#display-name {
    font-size: 2em;
    margin-bottom: 20px;
    color: #1a73e8;
    min-height: 60px; /* 保持高度，防止页面跳动 */
    display: flex;
    align-items: center;
    justify-content: center;
}

#display-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    min-height: 120px; /* 保持高度 */
    align-items: center;
}

#display-cards .card {
    width: 80px;
    height: 110px;
    font-size: 1.2em;
    cursor: default;
}
#display-cards .card .rank { font-size: 24px; }
#display-cards .card .suit { font-size: 28px; }

#connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}

#connection-status.error {
    background-color: #f44336;
}