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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 280px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 输入框样式 */
.input {
    width: 100%;
    max-width: 280px;
    padding: 14px 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.input:focus {
    outline: none;
    border-color: #667eea;
}

/* 选择框样式 */
.select {
    padding: 10px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
}

/* 首页样式 */
.home-container {
    text-align: center;
}

.title {
    font-size: 48px;
    color: white;
    margin-bottom: 60px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn-group {
    margin-bottom: 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nickname-input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.nickname-input-group .input {
    margin-bottom: 15px;
}

.divider {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    font-size: 14px;
}

.join-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.join-form .input {
    letter-spacing: 8px;
    font-size: 24px;
    text-align: center;
}

/* 房间大厅样式 */
.lobby-container {
    justify-content: flex-start;
    padding-top: 40px;
}

.room-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-code {
    font-size: 32px;
    font-weight: bold;
    color: white;
}

.btn-copy {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 12px;
    cursor: pointer;
}

.room-status {
    padding: 6px 12px;
    background: rgba(255, 193, 7, 0.9);
    border-radius: 20px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.player-count {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    margin-bottom: 30px;
}

.player-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.player-card {
    width: 80px;
    text-align: center;
}

.player-card.self-player .player-avatar {
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.85);
}

.player-card.self-player .player-name {
    color: #ffd54f;
    font-weight: 700;
}

.player-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 24px;
}

.player-name {
    color: white;
    font-size: 14px;
    word-break: break-all;
}

.owner-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #ffc107;
    border-radius: 10px;
    font-size: 10px;
    color: #333;
    margin-top: 4px;
}

.owner-controls {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    color: white;
    font-size: 16px;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.action-buttons .btn {
    flex: 1;
}

/* 游戏页面样式 */
.game-container {
    justify-content: flex-start;
    padding-top: 30px;
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.round-info, .game-phase {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    font-size: 14px;
}

.word-card {
    width: 100%;
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.word-label {
    color: #999;
    font-size: 14px;
    margin-bottom: 15px;
}

.word-content {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    word-break: break-all;
}

.phase-tip {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.game-section {
    width: 100%;
    margin-bottom: 20px;
}

.game-section h3 {
    color: white;
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
}

.alive-player-list, .eliminate-player-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.game-player-card {
    width: 70px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.game-player-card:active {
    transform: scale(0.95);
}

.game-player-card.eliminated {
    opacity: 0.4;
    cursor: not-allowed;
}

.game-player-card.pending-eliminate .player-avatar {
    outline: 3px solid #ffc107;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.35);
}

.game-player-card .player-avatar {
    width: 50px;
    height: 50px;
    font-size: 20px;
}

.game-player-card .player-name {
    font-size: 12px;
}

.game-player-card.self-player .player-avatar {
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.85);
}

.game-player-card.self-player .player-name {
    color: #ffd54f;
    font-weight: 700;
}

.player-status {
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    margin-top: 2px;
}

.eliminate-section {
    width: 100%;
    background: rgba(255, 193, 7, 0.2);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.eliminate-section h3 {
    color: #ffc107;
    margin-bottom: 15px;
}

.stats-bar {
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

/* 结果页面样式 */
.result-container {
    text-align: center;
}

.result-content {
    margin-bottom: 30px;
}

.result-title {
    font-size: 42px;
    color: #ffc107;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(255, 193, 7, 0.5);
}

.result-message {
    color: white;
    font-size: 18px;
}

.result-details {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.result-details h3 {
    color: white;
    margin-bottom: 20px;
}

.final-word, .final-role {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
}

.final-word .value, .final-role .value {
    font-weight: bold;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}
