/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f9e6ef;
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    background-color: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(255, 105, 180, 0.2);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

/* 标题样式 */
h1 {
    color: #ff69b4;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.3);
}

h2 {
    color: #ff69b4;
    font-size: 22px;
    margin-bottom: 15px;
}

h3 {
    color: #ff69b4;
    font-size: 18px;
    margin-bottom: 10px;
}

/* 游戏规则 */
.rules-section {
    background-color: #fff0f5;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: left;
}

.rules-section ul {
    list-style-position: inside;
    margin-left: 10px;
}

.rules-section li {
    margin-bottom: 5px;
    color: #333;
}

/* 奖励设置弹窗 */
.rewards-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.reward-setting-item {
    background-color: #fff0f5;
    border-radius: 15px;
    padding: 15px;
    border: 2px solid #ffb6c1;
}

.reward-setting-item h4 {
    color: #ff69b4;
    margin-bottom: 10px;
    font-size: 16px;
}

.reward-setting-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.reward-setting-fields input {
    padding: 8px;
    border: 2px solid #ffb6c1;
    border-radius: 20px;
    font-size: 14px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.reward-setting-fields input:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

.save-rewards-btn {
    padding: 12px;
    background-color: #ff69b4;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.save-rewards-btn:hover {
    background-color: #ff1493;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* 玩家管理部分 */
.player-section {
    margin: 20px 0;
}

#player-select {
    width: 80%;
    padding: 12px;
    border: 2px solid #ffb6c1;
    border-radius: 25px;
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    outline: none;
    background-color: #fff;
    transition: all 0.3s ease;
}

#player-select:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

.new-player {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.new-player #nickname-input {
    width: 60%;
    margin-bottom: 0;
    margin-right: 10px;
}

#add-player-btn {
    padding: 12px 16px;
    font-size: 14px;
}

/* 输入框样式 */
#nickname-input {
    padding: 12px;
    border: 2px solid #ffb6c1;
    border-radius: 25px;
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

#nickname-input:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

/* 玩家信息 */
.player-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fff0f5;
    border-radius: 10px;
}

/* 老虎机样式 */
.slot-machine {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    background-color: #fff0f5;
    padding: 20px;
    border-radius: 15px;
    box-shadow: inset 0 0 10px rgba(255, 105, 180, 0.2);
}

.reel {
    width: 100px;
    height: 100px;
    background-color: #fff;
    border: 3px solid #ffb6c1;
    border-radius: 10px;
    margin: 0 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.reel img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#start-btn, #spin-btn {
    background-color: #ff69b4;
    color: white;
}

#reset-btn, #back-btn {
    background-color: #ffb6c1;
    color: #333;
}

#rank-btn {
    background-color: #ffc0cb;
    color: #333;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

/* 结果显示 */
.result {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff0f5;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #ff69b4;
    min-height: 50px;
}

/* 底部导航 */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding: 15px;
    background-color: #fff0f5;
    border-radius: 15px;
    box-shadow: 0 -2px 10px rgba(255, 105, 180, 0.1);
}

.nav-btn {
    flex: 1;
    margin: 0 5px;
    padding: 12px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #ffb6c1;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
    background-color: #ff69b4;
    color: white;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #fff0f5;
    padding-bottom: 15px;
}

.modal-header h2 {
    margin: 0;
    color: #ff69b4;
}

.close-btn {
    font-size: 28px;
    font-weight: bold;
    color: #ff69b4;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #ff1493;
    transform: scale(1.1);
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* 玩家表单 */
.player-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.player-form input {
    padding: 12px;
    border: 2px solid #ffb6c1;
    border-radius: 25px;
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.player-form input:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

#save-player-btn {
    padding: 12px;
    background-color: #ff69b4;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#save-player-btn:hover {
    background-color: #ff1493;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* 玩家列表 */
.player-list {
    margin-top: 20px;
}

.player-list h3 {
    color: #ff69b4;
    margin-bottom: 15px;
    text-align: center;
}

.players-list-container {
    background-color: #fff0f5;
    border-radius: 15px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ffb6c1;
}

.player-item:last-child {
    border-bottom: none;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: bold;
    color: #333;
}

.player-details {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.player-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.edit-votes {
    display: flex;
    gap: 5px;
    align-items: center;
}

.votes-input {
    padding: 4px 8px;
    border: 2px solid #ffb6c1;
    border-radius: 15px;
    font-size: 12px;
    text-align: center;
    width: 80px;
    outline: none;
    transition: all 0.3s ease;
}

.votes-input:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 5px rgba(255, 105, 180, 0.3);
}

.player-actions button {
    padding: 5px 10px;
    font-size: 12px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-votes-btn {
    background-color: #ffb6c1;
    color: #333;
}

.save-votes-btn:hover {
    background-color: #ff69b4;
    color: white;
}

.select-player-btn {
    background-color: #ffb6c1;
    color: #333;
}

.select-player-btn:hover {
    background-color: #ff69b4;
    color: white;
}

.delete-player-btn {
    background-color: #ffcccc;
    color: #cc0000;
}

.delete-player-btn:hover {
    background-color: #ff9999;
}

/* 排名列表 */
.rank-list {
    background-color: #fff0f5;
    border-radius: 15px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #ffb6c1;
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-number {
    font-weight: bold;
    color: #ff69b4;
    margin-right: 10px;
    min-width: 30px;
}

/* 响应式设计 */
@media (max-width: 400px) {
    .game-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .reel {
        width: 70px;
        height: 70px;
    }
    
    .reel img {
        width: 50px;
        height: 50px;
    }
    
    .nav-btn {
        padding: 10px;
        font-size: 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}