* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
}

body {
    background-color: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 声音开关按钮 */
.sound-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sound-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.sound-toggle:active {
    transform: scale(0.95);
}

#app {
    max-width: 768px;
    margin: 0 auto;
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    background: linear-gradient(to bottom, #15181d 50%, #f1f8fe 50%);
}

/* 非首页页面使用统一浅色背景 */
.page {
    display: none;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.page:not(#home) {
    background: #f1f8fe;
}

.page.active {
    display: block;
}

/* 首页样式 */
.home-container {
    max-width: 768px;
    margin: 0 auto;
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
    position: relative;
    min-height: 100vh;
}

.avatar {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    border: 3px solid #4cc9f0;
    background-color: rgba(76, 201, 240, 0.1);
}

/* 标题、文本等需要居中的元素单独设置居中 */
.title h1, .title p, .or-text, .online-friends {
    text-align: center;
}

.title {
    margin-top: 60px;
    margin-bottom: 20px;
}

.title h1 {
    font-size: 42px;
    color: #fff;
    text-shadow: 0 0 15px #4cc9f0, 0 0 30px #4cc9f0;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    font-family: "Arial Rounded MT Bold", "PingFang SC", sans-serif;
}

.title p {
    font-size: 24px;
    color: #fff;
    text-shadow: 0 0 15px #4cc9f0, 0 0 30px #4cc9f0;
    margin-bottom: 20px;
    font-weight: 500;
    letter-spacing: 1px;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.nickname-input {
    width: 100%;
    padding: 18px 20px;
    border: 3px solid #4cc9f0;
    border-radius: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 20px;
    text-align: center;
    box-shadow: 0 0 15px #4cc9f0;
    margin-bottom: 20px;
    outline: none;
}

.nickname-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.create-btn {
    width: 100%;
    padding: 18px 20px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(90deg, #4cc9f0, #7209b7);
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: transform 0.2s;
}

.create-btn:hover {
    transform: scale(1.02);
}

.btn-icon {
    width: 32px;
    height: 32px;
}

.or-text {
    color: #4cc9f0;
    font-size: 20px;
    margin-bottom: 15px;
}

.join-room {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.room-code-input {
    flex: 1;
    padding: 18px 20px;
    border: 2px solid #4cc9f0;
    border-radius: 12px;
    font-size: 20px;
    outline: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: #4cc9f0;
}

.room-code-input::placeholder {
    color: rgba(76, 201, 240, 0.6);
}

.join-btn {
    padding: 0 30px;
    border: 3px solid #4cc9f0;
    border-radius: 12px;
    background-color: #4cc9f0;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.join-btn:hover {
    background-color: #3bb8db;
    transform: scale(1.05);
}

.games-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 15px;
}

.game-card {
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    aspect-ratio: 4/5;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.game-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.online-friends {
    color: #1a1a2e;
    font-size: 18px;
    margin-top: 10px;
}

/* 平板电脑适配 */
@media (min-width: 768px) {
    .home-container {
        padding: 30px 40px;
    }

    .avatar {
        width: 100px;
        height: 100px;
        margin: 0 auto 30px;
    }

    .title h1 {
        font-size: 56px;
    }

    .title p {
        font-size: 28px;
    }

    .nickname-input,
    .room-code-input {
        font-size: 22px;
        padding: 20px 24px;
    }

    .create-btn {
        font-size: 24px;
        padding: 20px 24px;
    }

    .games-container {
        gap: 20px;
    }

    .game-card {
        flex: 0 0 calc(25% - 15px);
        max-width: calc(25% - 15px);
    }

    .online-friends {
        font-size: 20px;
    }

    /* 房间页面 */
    .room-header h2 {
        font-size: 30px;
    }

    .player-card {
        min-width: 170px;
    }

    /* 游戏选择 */
    .game-types {
        gap: 22px;
    }

    .game-type-card img {
        width: 110px;
        height: 110px;
    }

    /* 答题游戏 */
    .timer {
        font-size: 52px;
    }

    .question-text {
        font-size: 26px;
    }

    .option-btn {
        font-size: 20px;
        padding: 22px 28px;
    }

    /* 绘画游戏 */
    .word-selection-area {
        padding: 45px 35px;
    }

    .word-item h4 {
        font-size: 22px;
    }

    #drawCanvas,
    #guessCanvas {
        width: 350px;
        height: 350px;
    }

    /* 类别选择 */
    .category-list {
        gap: 22px;
    }

    .category-btn {
        padding: 32px 22px;
        font-size: 21px;
    }

    /* 结果页面 */
    .result-icon {
        width: 200px;
        height: 200px;
    }

    #resultTitle {
        font-size: 40px;
    }
}

/* 桌面端适配 */
@media (min-width: 1024px) {
    #app {
        max-width: 1024px;
    }

    .home-container {
        padding: 40px 60px;
    }

    .game-card {
        flex: 0 0 calc(20% - 16px);
        max-width: calc(20% - 16px);
    }

    /* 房间页面 */
    .room-header {
        padding: 35px;
    }

    .room-header h2 {
        font-size: 32px;
    }

    .player-card {
        min-width: 180px;
        padding: 30px;
    }

    /* 游戏选择 */
    .game-types {
        gap: 25px;
    }

    .game-type-card {
        padding: 35px;
    }

    .game-type-card img {
        width: 120px;
        height: 120px;
    }

    /* 惩罚选择 */
    .punishment-options {
        gap: 15px;
    }

    /* 答题游戏 */
    .game-header {
        padding: 30px;
    }

    .timer {
        font-size: 56px;
    }

    .question-text {
        font-size: 28px;
    }

    /* 绘画游戏 */
    .word-item {
        padding: 25px;
    }

    #drawCanvas,
    #guessCanvas {
        width: 400px;
        height: 400px;
    }

    /* 类别选择 */
    .category-btn {
        padding: 35px 25px;
        font-size: 22px;
    }
}

/* 移动端优化 */
@media (max-width: 480px) {
    .home-container {
        padding: 15px;
    }

    .avatar {
        width: 70px;
        height: 70px;
    }

    .title h1 {
        font-size: 36px;
    }

    .title p {
        font-size: 20px;
    }

    .nickname-input,
    .room-code-input {
        font-size: 18px;
        padding: 14px 16px;
    }

    .create-btn {
        font-size: 20px;
        padding: 14px 16px;
    }

    .join-btn {
        padding: 0 20px;
        font-size: 18px;
    }

    .games-container {
        gap: 12px;
    }

    .game-card {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }

    .online-friends {
        font-size: 16px;
    }
}

.subtitle {
    color: #666;
    font-size: 18px;
}

.form-container {
    padding: 30px;
}

.input {
    width: 100%;
    padding: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 18px;
    color: #333;
    background: white;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.input:focus {
    outline: none;
    border-color: #667eea;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 18px 30px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.or {
    text-align: center;
    color: #999;
    margin: 20px 0;
}

.features {
    display: flex;
    justify-content: space-around;
    padding: 30px 20px;
    background: #f8f9fa;
    margin-top: 20px;
    border-radius: 15px;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
}

/* 房间页面样式 */
.room-header {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #4cc9f0 0%, #7209b7 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.3);
}

.room-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.room-header p {
    font-size: 18px;
    opacity: 0.95;
}

.players-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.player-card {
    background: white;
    border: 3px solid #4cc9f0;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.2);
    transition: all 0.3s;
}

.player-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 201, 240, 0.4);
}

.player-card.ready {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f0fff4 0%, #e8f5e8 100%);
}

.player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.player-name {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 16px;
}

.role-label {
    font-size: 14px;
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: normal;
}

.selector-badge {
    background: #f39c12;
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    margin-left: 5px;
    font-size: 14px;
    font-weight: normal;
}

.player-status {
    font-size: 12px;
    color: #666;
}

.game-selection,
.punishment-selection {
    margin-bottom: 30px;
}

.game-selection h3,
.punishment-selection h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #7209b7;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 10px;
}

.game-type-card {
    background: white;
    border: 3px solid #4cc9f0;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(76, 201, 240, 0.2);
}

.game-type-card:hover {
    border-color: #7209b7;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(114, 9, 183, 0.3);
}

.game-type-card img {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.game-type-card h4 {
    color: #1a1a2e;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: bold;
}

.game-type-card p {
    font-size: 14px;
    color: #666;
}

.game-type-card.selected {
    border-color: #7209b7;
    background: linear-gradient(135deg, #f0f4ff 0%, #f5e8ff 100%);
    box-shadow: 0 4px 15px rgba(114, 9, 183, 0.3);
}

.punishment-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 10px;
}

.punishment-option {
    background: white;
    border: 2px solid #ff6b6b;
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.punishment-option:hover {
    border-color: #ff8a8a;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.punishment-option h4 {
    color: #1a1a2e;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: bold;
}

.punishment-option p {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.hidden {
    display: none !important;
}

/* 计时答题游戏样式 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    background: linear-gradient(135deg, #4cc9f0 0%, #7209b7 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.3);
}

.timer {
    font-size: 48px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.timer.warning {
    color: #ff6b6b;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.progress {
    background: rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 20px;
    font-weight: bold;
}

.question-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 35px;
    line-height: 1.6;
    color: #1a1a2e;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    padding: 20px 25px;
    background: white;
    border: 2px solid #4cc9f0;
    border-radius: 12px;
    font-size: 18px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(76, 201, 240, 0.15);
    color: #1a1a2e;
}

.option-btn:hover {
    border-color: #7209b7;
    background: linear-gradient(135deg, #f0f4ff 0%, #f5e8ff 100%);
    transform: translateX(5px);
}

.option-btn.correct {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-color: #4CAF50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.option-btn.incorrect {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    border-color: #ff6b6b;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.score-board {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.player-score,
.opponent-score {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #1a1a2e;
}

.player-score {
    color: #4cc9f0;
}

/* 你画我猜游戏样式 */
.draw-header {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #4cc9f0 0%, #7209b7 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.3);
}

.draw-header h2 {
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 词条选择界面 */
.word-selection-area {
    text-align: center;
    padding: 40px 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.word-selection-area h3 {
    font-size: 24px;
    color: #7209b7;
    margin-bottom: 25px;
    font-weight: bold;
}

.timer-display {
    text-align: center;
    padding: 18px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.word-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.word-item {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #4cc9f0;
    box-shadow: 0 2px 8px rgba(76, 201, 240, 0.15);
}

.word-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 201, 240, 0.4);
    border-color: #7209b7;
}

.word-item h4 {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 8px;
    font-weight: bold;
}

.word-item p {
    font-size: 16px;
    color: #666;
}

/* 绘画工具 */
.drawing-tools {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
}

.tool-group {
    flex: 1;
}

.tool-group h4 {
    font-size: 18px;
    color: #7209b7;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.tool-btn {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #4cc9f0;
    border-radius: 8px;
    background: white;
    color: #4cc9f0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
    box-shadow: 0 2px 6px rgba(76, 201, 240, 0.2);
}

.tool-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.4);
    background: linear-gradient(135deg, #4cc9f0 0%, #3ab0d8 100%);
    color: white;
}

.tool-btn.active {
    background: linear-gradient(135deg, #4cc9f0 0%, #7209b7 100%);
    color: white;
    border-color: #7209b7;
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 提示显示 */
.hint-display {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fff4 100%);
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px solid #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.hint-display h3 {
    font-size: 22px;
    color: #4CAF50;
    margin-bottom: 15px;
    font-weight: bold;
}

.hint-display p {
    font-size: 18px;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.drawer-area,
.guesser-area {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.draw-info {
    text-align: center;
    padding: 18px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff4cc 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid #ff9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
    color: #1a1a2e;
}

#drawCanvas,
#guessCanvas {
    border: 3px solid #4cc9f0;
    border-radius: 12px;
    background: white;
    display: block;
    margin: 0 auto 25px;
    cursor: crosshair;
    max-width: 100%;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.2);
}

.color-picker {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.color-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #4cc9f0;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(76, 201, 240, 0.2);
}

.color-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.4);
}

.color-btn.active {
    border-color: #7209b7;
    box-shadow: 0 0 0 4px rgba(114, 9, 183, 0.4);
}

.brush-size {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.size-btn {
    padding: 10px 25px;
    background: white;
    border: 2px solid #4cc9f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(76, 201, 240, 0.2);
}

.size-btn:hover {
    border-color: #7209b7;
    background: linear-gradient(135deg, #f0f4ff 0%, #f5e8ff 100%);
}

.size-btn.active {
    background: linear-gradient(135deg, #4cc9f0 0%, #7209b7 100%);
    color: white;
    border-color: #7209b7;
}

.guess-input-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.guess-input-field {
    width: 100%;
    padding: 18px;
    border: 2px solid #4cc9f0;
    border-radius: 12px;
    font-size: 18px;
    color: #1a1a2e !important;
    background: white !important;
    transition: border-color 0.3s;
    box-shadow: 0 2px 8px rgba(76, 201, 240, 0.15);
}

.guess-input-field:focus {
    outline: none;
    border-color: #7209b7;
    box-shadow: 0 4px 12px rgba(114, 9, 183, 0.3);
}

.guess-input-field::placeholder {
    color: #999;
}

.guess-history {
    max-height: 150px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f4ff 100%);
    border-radius: 12px;
    padding: 12px;
    border: 2px solid #4cc9f0;
}

.guess-item {
    padding: 10px 14px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    color: #1a1a2e;
}

.guess-item.correct {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.guess-item.incorrect {
    color: #666;
}

/* 结果页面样式 */
.result-container {
    text-align: center;
    padding: 50px 30px;
}

.result-icon {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin-bottom: 30px;
    animation: bounce 1s ease-in-out;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#resultTitle {
    font-size: 36px;
    color: #7209b7;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#resultMessage {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 35px;
    line-height: 1.6;
}

.punishment-area {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 35px;
    border: 2px solid #ff6b6b;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
}

.punishment-area h3 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
}

.punishment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.punishment-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #ff6b6b;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.15);
}

.punishment-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    border-color: #ff8a8a;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
}

.punishment-item h4 {
    font-size: 18px;
    color: #1a1a2e;
    margin-bottom: 8px;
    font-weight: bold;
}

.punishment-item p {
    font-size: 16px;
    color: #666;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-direction: column;
}

.result-buttons .btn {
    margin-top: 10px;
}

/* 类别选择页面样式 */
.category-selection-container {
    text-align: center;
    padding: 40px 30px;
}

.category-selection-container h2 {
    font-size: 32px;
    color: #7209b7;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#selectorInfo {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 30px;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.category-btn {
    padding: 30px 20px;
    border: 3px solid #4cc9f0;
    border-radius: 15px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
    color: #4cc9f0;
    box-shadow: 0 2px 8px rgba(76, 201, 240, 0.2);
}

.category-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 201, 240, 0.4);
    background: linear-gradient(135deg, #4cc9f0 0%, #7209b7 100%);
    color: white;
    border-color: #7209b7;
}

.category-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.punishment-item {
    background: white;
    border: 2px solid #ff6b6b;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.punishment-item:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
}

.punishment-item h4 {
    margin-bottom: 5px;
}

.punishment-item p {
    font-size: 12px;
    opacity: 0.8;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast.show {
    display: block;
}

/* 响应式 */
@media (max-width: 768px) {
    #app {
        max-width: 100%;
        margin: 0;
        box-shadow: none;
    }

    .page {
        padding: 20px;
    }

    .title {
        font-size: 32px;
    }

    .logo {
        width: 120px;
        height: 120px;
    }

    .player-avatar {
        width: 60px;
        height: 60px;
    }

    .game-type-card img {
        width: 80px;
        height: 80px;
    }

    .timer {
        font-size: 36px;
    }

    .question-text {
        font-size: 20px;
    }

    .option-btn {
        font-size: 16px;
        padding: 15px 20px;
    }

    /* 房间页面移动端优化 */
    .room-header h2 {
        font-size: 24px;
    }

    .player-card {
        min-width: 140px;
        padding: 15px;
    }

    /* 游戏选择移动端 */
    .game-types {
        gap: 12px;
    }

    .game-type-card {
        padding: 18px;
    }

    /* 惩罚选择移动端 */
    .punishment-options {
        gap: 8px;
    }

    /* 答题游戏移动端 */
    .question-text {
        font-size: 18px;
    }

    /* 绘画游戏移动端 */
    #drawCanvas,
    #guessCanvas {
        width: 280px;
        height: 280px;
    }

    .word-list {
        gap: 10px;
    }

    /* 类别选择移动端 */
    .category-list {
        gap: 12px;
    }

    .category-btn {
        padding: 20px 15px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 28px;
    }

    .logo {
        width: 100px;
        height: 100px;
    }

    .header {
        padding: 40px 20px;
    }

    .game-types {
        grid-template-columns: 1fr;
    }

    .draw-header h2 {
        font-size: 24px;
    }

    /* 更多移动端优化 */
    .room-header {
        padding: 18px;
    }

    .players-container {
        gap: 12px;
    }

    .player-card {
        min-width: 120px;
        padding: 12px;
    }

    .game-header {
        padding: 18px;
    }

    .timer {
        font-size: 32px;
    }

    .question-container {
        padding: 25px;
    }

    #drawCanvas,
    #guessCanvas {
        width: 250px;
        height: 250px;
    }

    .drawing-tools {
        flex-direction: column;
        gap: 15px;
    }

    .color-picker {
        gap: 8px;
    }

    .color-btn {
        width: 40px;
        height: 40px;
    }

    .result-icon {
        width: 150px;
        height: 150px;
    }

    #resultTitle {
        font-size: 28px;
    }
}

/* 卡牌游戏样式 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #4cc9f0 0%, #7209b7 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.3);
    flex-wrap: wrap;
    gap: 15px;
}

.player1-score,
.player2-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 16px;
}

.player1-score span:first-child,
.player2-score span:first-child {
    font-weight: bold;
    margin-bottom: 4px;
}

.player1-score span:last-child,
.player2-score span:last-child {
    font-size: 24px;
    font-weight: bold;
}

.turn-indicator {
    text-align: center;
    flex: 1;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.card:hover:not(.flipped):not(.eliminated) {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.card.flipped {
    background: linear-gradient(135deg, #f0f4ff 0%, #f5e8ff 100%);
    border: 3px solid #7209b7;
    cursor: default;
}

.card.eliminated {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    cursor: default;
    opacity: 0.5;
    transform: scale(0.9);
}

.card-empty {
    background: transparent;
    box-shadow: none;
    cursor: default;
    width: 100%;
    height: 100%;
}

.card-back {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4cc9f0 0%, #3ab0d8 100%);
    color: white;
    font-size: 48px;
    border-radius: 10px;
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.3s;
}

.card-back::after {
    content: '?';
    font-size: 48px;
    font-weight: bold;
    opacity: 0.8;
}

.card-emoji {
    font-size: 48px;
    margin-bottom: 8px;
}

.card-name {
    font-size: 16px;
    font-weight: bold;
    color: #1a1a2e;
}

.card-footer {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-footer p {
    margin-bottom: 8px;
    font-size: 18px;
    color: #1a1a2e;
}

#cardInstruction {
    font-size: 16px;
    color: #666;
}

/* 五子棋样式 */
.gomoku-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 16px;
}

.player-info.black {
    color: #333;
}

.player-info.white {
    color: #666;
}

.turn-indicator {
    font-size: 16px;
    color: #4CAF50;
    font-weight: bold;
}

/* 棋盘容器 */
.gomoku-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: auto;
}

/* 棋盘 */
.gomoku-board {
    display: grid;
    grid-template-columns: repeat(13, 32px);
    grid-template-rows: repeat(13, 32px);
    gap: 0;
    background-color: #DEB887;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* 棋盘格子 - 无网格线 */
.gomoku-cell {
    width: 32px;
    height: 32px;
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
}

/* 点阵标记 */
.gomoku-cell::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: rgba(139, 69, 19, 0.4);
    border-radius: 50%;
    z-index: 1;
}

/* 黑棋 */
.gomoku-cell .stone.black {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 30% 30%, #666, #000);
    border-radius: 50%;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    z-index: 10;
    animation: placeStone 0.2s ease-out;
}

/* 白棋 */
.gomoku-cell .stone.white {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
    border-radius: 50%;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    animation: placeStone 0.2s ease-out;
}

/* 落子动画 */
@keyframes placeStone {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 最后一步标记 */
.last-move-marker {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: red;
    border-radius: 50%;
    z-index: 11;
    animation: pulse 1.5s ease-in-out infinite;
}

/* 获胜连线高亮 */
.gomoku-cell.winning {
    animation: winningPulse 1s ease-in-out infinite;
}

@keyframes winningPulse {
    0%, 100% {
        background-color: rgba(255, 215, 0, 0.3);
    }
    50% {
        background-color: rgba(255, 215, 0, 0.7);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
}

/* 五子棋信息 */
.gomoku-info {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    margin: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gomoku-info p {
    margin: 5px 0;
    font-size: 16px;
    color: #333;
}

/* 五子棋棋盘响应式适配 */

/* 手机端 (小于480px) */
@media (max-width: 480px) {
    .gomoku-board {
        grid-template-columns: repeat(13, 24px);
        grid-template-rows: repeat(13, 24px);
        max-width: 95vw;
    }

    .gomoku-cell {
        width: 24px;
        height: 24px;
    }

    .gomoku-cell::before {
        width: 4px;
        height: 4px;
    }

    .gomoku-cell .stone.black {
        width: 16px;
        height: 16px;
    }

    .gomoku-cell .stone.white {
        width: 16px;
        height: 16px;
    }

    .last-move-marker {
        width: 5px;
        height: 5px;
    }
}

/* 平板端 (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .gomoku-board {
        grid-template-columns: repeat(13, 28px);
        grid-template-rows: repeat(13, 28px);
    }

    .gomoku-cell {
        width: 28px;
        height: 28px;
    }

    .gomoku-cell .stone.black {
        width: 18px;
        height: 18px;
    }

    .gomoku-cell .stone.white {
        width: 18px;
        height: 18px;
    }
}

/* 电脑端 (大于768px) */
@media (min-width: 769px) {
    .gomoku-board {
        grid-template-columns: repeat(13, 34px);
        grid-template-rows: repeat(13, 34px);
    }

    .gomoku-cell {
        width: 34px;
        height: 34px;
    }

    .gomoku-cell::before {
        width: 7px;
        height: 7px;
    }

    .gomoku-cell .stone.black {
        width: 22px;
        height: 22px;
    }

    .gomoku-cell .stone.white {
        width: 22px;
        height: 22px;
    }

    .last-move-marker {
        width: 7px;
        height: 7px;
    }
}

/* 翻牌结果展示层 */
.flip-result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.flip-result-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.flip-result-content h3 {
    font-size: 28px;
    color: #7209b7;
    margin-bottom: 30px;
    font-weight: bold;
}

.flipped-cards-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.flipped-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #f5e8ff 100%);
    border: 3px solid #7209b7;
    border-radius: 15px;
    padding: 20px;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flipped-card .card-emoji {
    font-size: 56px;
    margin-bottom: 10px;
}

.flipped-card .card-name {
    font-size: 20px;
}

.vs-divider {
    font-size: 32px;
    font-weight: bold;
    color: #7209b7;
}

#flipResultScore {
    font-size: 18px;
    color: #1a1a2e;
    font-weight: bold;
    background: linear-gradient(135deg, #fff9e6 0%, #fff4cc 100%);
    padding: 15px 25px;
    border-radius: 12px;
    border: 2px solid #ff9800;
}

/* 卡牌游戏响应式 */
@media (max-width: 768px) {
    .card-header {
        padding: 15px;
        gap: 10px;
    }

    .player1-score,
    .player2-score {
        font-size: 14px;
    }

    .player1-score span:last-child,
    .player2-score span:last-child {
        font-size: 20px;
    }

    .turn-indicator {
        font-size: 16px;
    }

    .card-board {
        gap: 10px;
        padding: 15px;
    }

    .card-emoji {
        font-size: 36px;
    }

    .card-name {
        font-size: 14px;
    }

    .card-back::after {
        font-size: 36px;
    }

    .flip-result-content {
        padding: 30px 20px;
    }

    .flip-result-content h3 {
        font-size: 22px;
    }

    .flipped-cards-display {
        gap: 15px;
    }

    .flipped-card {
        width: 90px;
        height: 90px;
        padding: 15px;
    }

    .flipped-card .card-emoji {
        font-size: 40px;
    }

    .flipped-card .card-name {
        font-size: 16px;
    }

    .vs-divider {
        font-size: 24px;
    }

    #flipResultScore {
        font-size: 16px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .card-header {
        flex-direction: column;
        gap: 8px;
    }

    .card-board {
        gap: 8px;
        padding: 10px;
    }

    .card-emoji {
        font-size: 28px;
    }

    .card-name {
        font-size: 12px;
    }

    .card-back::after {
        font-size: 28px;
    }

    .flip-result-content {
        padding: 25px 15px;
        width: 95%;
    }

    .flip-result-content h3 {
        font-size: 18px;
    }

    .flipped-cards-display {
        gap: 10px;
    }

    .flipped-card {
        width: 70px;
        height: 70px;
        padding: 10px;
    }

    .flipped-card .card-emoji {
        font-size: 32px;
    }

    .flipped-card .card-name {
        font-size: 14px;
    }

    .vs-divider {
        font-size: 20px;
    }

    #flipResultScore {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* 卡牌内容容器 */
.card-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* Player1 红色背景（半透明） */
.card.flipped.owner-player1 .card-content {
    background-color: rgba(255, 0, 0, 0.15);
    border: 2px solid rgba(255, 0, 0, 0.4);
}

/* Player2 蓝色背景（半透明） */
.card.flipped.owner-player2 .card-content {
    background-color: rgba(0, 0, 255, 0.15);
    border: 2px solid rgba(0, 0, 255, 0.4);
}

/* 所有权标记 */
.owner-mark {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 16px;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.owner-mark.player1 {
    color: #ff4444;
}

.owner-mark.player2 {
    color: #4444ff;
}

/* 选中状态的卡牌 */
.card.selected {
    border: 4px solid #4CAF50 !important;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    transform: scale(1.05);
}

/* 卡牌已消除样式 */
.card-eliminated {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    color: #999;
    font-size: 36px;
}

/* 移动方向控制 */
.move-controls {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.move-controls p {
    font-size: 18px;
    font-weight: bold;
    color: #7209b7;
    margin-bottom: 15px;
}

.direction-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.direction-btn {
    padding: 15px 20px;
    border: 2px solid #4cc9f0;
    border-radius: 12px;
    background: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(76, 201, 240, 0.2);
    color: #1a1a2e;
}

.direction-btn:hover {
    background: linear-gradient(135deg, #4cc9f0 0%, #3ab0d8 100%);
    color: white;
    border-color: #7209b7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(114, 9, 183, 0.3);
}

.direction-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(76, 201, 240, 0.2);
}
