/* 游戏 App 基础样式 */
#app-game-container {
    height: 100%;
    width: 100%;
    background: #f4f5f7;
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

.game-header, .text-game-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-end; /* 使内容区域整体对齐到头部底部 */
    justify-content: center;
    padding: 0 15px 0 15px;
    padding-top: calc(18px + var(--top-safe-area, 0px) + env(safe-area-inset-top, 0px)) !important;
    height: calc(56px + var(--top-safe-area, 0px) + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(56px + var(--top-safe-area, 0px) + env(safe-area-inset-top, 0px)) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.game-progress-container {
    margin-top: 0;
    height: 10px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    flex: 1;
    border: 2px solid #fff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.game-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff9a9e 0%, #fecfef 100%);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.game-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255,255,255,0.3), transparent);
}

.game-header-progress-wrap {
    display: block;
    width: 100%;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    z-index: 9;
}

.header-mini-settings {
    position: absolute;
    right: 15px;
    bottom: 0;
    width: 30px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 12;
}

.text-game-header .back-btn,
.game-header .back-btn {
    position: absolute;
    left: 15px;
    bottom: 0;
    font-size: 18px;
    height: 38px;
    cursor: pointer;
    color: #333;
    padding: 0 10px;
    margin-left: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12;
}

.header-mini-settings:active {
    transform: rotate(45deg) scale(0.9);
}

.game-header .title, .text-game-header .title {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    width: 60%;
    height: 38px;
    line-height: 38px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-header .settings-btn, 
.text-game-header .settings-btn {
    position: absolute;
    right: 15px;
    top: calc(12px + var(--top-safe-area, 0px) + env(safe-area-inset-top, 0px));
    cursor: pointer;
    color: #333;
    padding: 10px;
    margin-right: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    z-index: 11;
}

.game-header .settings-btn:active {
    transform: scale(0.9);
}

.game-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.game-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 游戏列表项 */
.game-list-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.game-list-item:active {
    transform: scale(0.98);
}

.game-list-item-title {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    margin-bottom: 6px;
}

.game-list-item-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

/* 配置表单 */
.game-config-section {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.game-config-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-config-input {
    width: 100%;
    border: 1px solid #eee;
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.game-config-input:focus {
    border-color: #07c160;
    background: #fff;
}

textarea.game-config-input {
    resize: none;
    height: 80px;
    line-height: 1.5;
}

/* 参与者选择 */
.game-participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.game-participant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
}

.game-participant-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.game-participant.selected .game-participant-avatar {
    border-color: #07c160;
    transform: scale(1.05);
}

.game-participant-name {
    font-size: 11px;
    color: #666;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.game-participant-check {
    position: absolute;
    bottom: 20px;
    right: 0;
    width: 16px;
    height: 16px;
    background: #07c160;
    border-radius: 50%;
    border: 1.5px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s;
}

.game-participant.selected .game-participant-check {
    opacity: 1;
    transform: scale(1);
}

/* 按钮 */
.game-start-btn {
    background: linear-gradient(135deg, #07c160, #10ad5b);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 14px 0;
    font-size: 16px;
    font-weight: bold;
    width: calc(100% - 30px);
    margin: 10px 15px 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.game-start-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 6px rgba(7, 193, 96, 0.2);
}

.game-start-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.game-btn-group {
    display: flex;
    gap: 10px;
    padding: 10px 15px 20px;
    flex-shrink: 0;
}

.game-btn-group button {
    flex: 1;
    margin: 0;
    width: auto;
}

.game-save-btn {
    background: #fff;
    color: #07c160;
    border: 1px solid #07c160;
    border-radius: 20px;
    padding: 14px 0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.game-save-btn:active {
    background: #f0fdf4;
    transform: translateY(2px);
}

/* 文游界面 (Text UI) */
.text-game-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - var(--keyboard-height, 0px));
    max-height: calc(100% - var(--keyboard-height, 0px));
    margin-top: var(--viewport-offset-top, 0px);
    background: #ffffff;
    color: #1a1a1a;
    font-family: 'Songti SC', 'SimSun', serif;
    box-sizing: border-box;
    transition: height 0.12s ease-out, max-height 0.12s ease-out, margin-top 0.12s ease-out;
}

.text-game-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    padding-top: calc(24px + var(--top-safe-area, 0px) + env(safe-area-inset-top, 0px)) !important;
    height: calc(74px + var(--top-safe-area, 0px) + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(74px + var(--top-safe-area, 0px) + env(safe-area-inset-top, 0px)) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.text-game-header .title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    letter-spacing: 1px;
    margin-top: calc(24px + var(--top-safe-area, 0px) + env(safe-area-inset-top, 0px));
    transform: translateY(-50%);
}

.text-game-header .back-btn {
    color: #666;
    position: absolute;
    left: 15px;
    bottom: 10px;
}

.text-game-display {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    font-size: 17px;
    line-height: 2;
    letter-spacing: 0.5px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.text-game-display::-webkit-scrollbar {
    display: none;
}

.text-paragraph {
    margin-bottom: 16px;
    animation: fadeInRow 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

.text-paragraph.user {
    color: #4285f4;
    text-align: right;
    background: rgba(240, 247, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(66, 133, 244, 0.15);
    padding: 10px 14px;
    border-radius: 18px 4px 18px 18px;
    margin-left: auto;
    margin-right: 0;
    margin-bottom: 24px;
    align-self: flex-end;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
    font-size: 14px;
    line-height: 1.5;
    font-style: normal;
    opacity: 1;
    text-indent: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    width: fit-content;
    max-width: 85%;
    word-break: break-all;
}

.system-note-card {
    background: #fffef2;
    border: 1px solid #e5e2c5;
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    position: relative;
    border-left: 5px solid #f1c40f;
    transform: rotate(-0.5deg);
    white-space: pre-wrap;
    word-break: break-all;
    display: block;
    width: auto;
}

.system-note-card strong {
    color: #d35400;
    font-weight: 700;
}

.system-note-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 12px 12px;
    border-color: transparent transparent rgba(0,0,0,0.05) transparent;
}

.game-text-p {
    text-indent: 2em;
    margin-bottom: 0.8em;
}

.text-paragraph.system {
    color: #1a1a1a;
    margin-bottom: 30px;
    text-align: justify;
}

.text-paragraph.error {
    background: #fdf2f2;
    color: #d93025;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.text-game-input-area {
    padding: 12px 15px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

.text-game-auto-btn {
    background: #fff;
    border: 1.5px solid #000;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    color: #000;
}

.text-game-auto-btn:active {
    transform: scale(0.85) rotate(-15deg);
}

.text-game-input {
    flex: 1;
    background: #f5f5f5;
    border: none;
    color: #333;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
    transition: all 0.2s;
}

.text-game-input:focus {
    background: #f0f0f0;
}

.text-game-send {
    background: transparent;
    border: none;
    color: #07c160;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.text-game-send:active {
    background: rgba(138, 180, 248, 0.1);
}

.text-game-send:disabled {
    color: #555;
    cursor: not-allowed;
}

/* 文本加载动画 */
.text-typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px 0;
    opacity: 0.7;
}

.text-typing-dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: textTypingFade 1.4s infinite ease-in-out both;
}

.text-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.text-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes textTypingFade {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes fadeInRow {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 游戏二级菜单样式 */
.game-menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 10px 0;
}

.game-menu-item {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.game-menu-item::after {
    content: '';
    position: absolute;
    right: 20px;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ccc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s;
}

.game-menu-item:active {
    transform: scale(0.97);
    background: #fafafa;
}

.game-menu-item:hover::after {
    transform: translateX(5px);
}

.game-menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.game-menu-info {
    flex: 1;
}

.game-menu-title {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    margin-bottom: 4px;
}

.game-menu-desc {
    font-size: 12px;
    color: #888;
}

/* 不同选项的配色 */
.game-menu-item.save .game-menu-icon {
    background: rgba(7, 193, 96, 0.1);
    color: #07c160;
}

.game-menu-item.rooms .game-menu-icon {
    background: rgba(138, 180, 248, 0.1);
    color: #4285f4;
}

.game-menu-item.history .game-menu-icon {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.game-menu-item.new-game {
    margin-top: 20px;
    background: linear-gradient(135deg, #07c160, #10ad5b);
    border: none;
}

.game-menu-item.new-game .game-menu-title {
    color: #fff;
}

.game-menu-item.new-game .game-menu-desc {
    color: rgba(255, 255, 255, 0.8);
}

.game-menu-item.new-game .game-menu-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.game-menu-item.new-game::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
}

/* API 选择弹窗 UI 增强 (黑白极简风格) */
.api-select-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 5px 0 15px;
}

.api-select-item {
    border: 1.5px solid #eee;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.api-select-item:active {
    transform: scale(0.98);
}

.api-select-item.selected {
    border-color: #000;
    background-color: #fbfbfb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.api-select-item .api-info {
    flex: 1;
}

.api-select-item .api-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.api-select-item.selected .api-name {
    color: #000;
}

.api-select-item .api-desc {
    font-size: 12px;
    color: #999;
}

.api-select-item .api-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
    margin-left: 15px;
}

.api-select-item.selected .api-checkbox {
    border-color: #000;
    background: #000;
}

.api-select-item.selected .api-checkbox::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 对话框上下文菜单 */
.game-context-menu {
    position: fixed;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 6px;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-context-menu.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.game-context-menu-item {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.game-context-menu-item:active {
    background: rgba(0, 0, 0, 0.05);
}

.game-context-menu-item.danger {
    color: #ff4d4f;
}

.game-context-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
}

.game-context-menu-overlay.active {
    display: block;
}

/* 多版本内容切换器 */
.variant-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    padding: 4px 10px;
    width: fit-content;
    align-self: flex-start;
}

.text-paragraph.user + .variant-switcher {
    align-self: flex-end;
}

.variant-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    border-radius: 50%;
    transition: background 0.2s;
}

.variant-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.variant-btn.disabled {
    color: #ccc;
    pointer-events: none;
}

.variant-info {
    font-size: 12px;
    color: #888;
    font-family: -apple-system, system-ui;
}

/* 深色模式样式 */
.dark #app-game-container {
    background: #121212;
}

.dark .game-header, .dark .text-game-header {
    background: rgba(42, 42, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .game-progress-container {
    background: #333333;
    border: 2px solid #2A2A2A;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.dark .game-header-progress-wrap {
    background: #2A2A2A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .header-mini-settings {
    color: #B0B0B0;
}

.dark .text-game-header .back-btn,
.dark .game-header .back-btn {
    color: #B0B0B0;
}

.dark .game-header .title, .dark .text-game-header .title {
    color: #FFFFFF;
}

.dark .game-header .settings-btn, 
.dark .text-game-header .settings-btn {
    color: #B0B0B0;
}

.dark .game-list-item {
    background: #2A2A2A;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .game-list-item-title {
    color: #FFFFFF;
}

.dark .game-list-item-desc {
    color: #888888;
}

.dark .game-config-section {
    background: #2A2A2A;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.dark .game-config-title {
    color: #FFFFFF;
}

.dark .game-config-input {
    border: 1px solid #555555;
    background: #1E1E1E;
    color: #FFFFFF;
}

.dark .game-config-input:focus {
    border-color: #07c160;
    background: #2A2A2A;
}

.dark .game-participant-name {
    color: #B0B0B0;
}

.dark .game-participant.selected .game-participant-avatar {
    border-color: #07c160;
}

.dark .game-participant-check {
    background: #07c160;
    border: 1.5px solid #2A2A2A;
}

.dark .game-start-btn {
    background: linear-gradient(135deg, #07c160, #10ad5b);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.dark .game-start-btn:active {
    box-shadow: 0 2px 6px rgba(7, 193, 96, 0.2);
}

.dark .game-start-btn:disabled {
    background: #555555;
}

.dark .game-save-btn {
    background: #2A2A2A;
    color: #07c160;
    border: 1px solid #07c160;
}

.dark .game-save-btn:active {
    background: rgba(7, 193, 96, 0.1);
}

.dark .text-game-container {
    background: #121212;
    color: #FFFFFF;
}

.dark .text-game-header {
    background: rgba(42, 42, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .text-game-header .title {
    color: #FFFFFF;
}

.dark .text-game-header .back-btn {
    color: #B0B0B0;
}

.dark .text-paragraph {
    color: #FFFFFF;
}

.dark .text-paragraph.user {
    color: #BBDEFB;
    background: rgba(30, 64, 175, 0.2);
    border: 1px solid rgba(187, 222, 251, 0.2);
}

.dark .system-note-card {
    background: #2A2A2A;
    border: 1px solid #555555;
    color: #B0B0B0;
    border-left: 5px solid #f1c40f;
}

.dark .system-note-card strong {
    color: #f39c12;
}

.dark .text-paragraph.system {
    color: #FFFFFF;
}

.dark .text-paragraph.error {
    background: #372222;
    color: #ff6b6b;
}

.dark .text-game-input-area {
    background: #2A2A2A;
    border-top: 1px solid #333333;
}

.dark .text-game-auto-btn {
    background: #333333;
    border: 1.5px solid #FFFFFF;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.dark .text-game-input {
    background: #333333;
    color: #FFFFFF;
}

.dark .text-game-input:focus {
    background: #3A3A3A;
}

.dark .text-game-send {
    color: #07c160;
}

.dark .text-game-send:active {
    background: rgba(7, 193, 96, 0.1);
}

.dark .text-game-send:disabled {
    color: #888888;
}

.dark .text-typing-dot {
    background: #888888;
}

.dark .game-menu-item {
    background: #2A2A2A;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .game-menu-item::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
}

.dark .game-menu-item:active {
    background: #333333;
}

.dark .game-menu-title {
    color: #FFFFFF;
}

.dark .game-menu-desc {
    color: #888888;
}

.dark .game-menu-item.save .game-menu-icon {
    background: rgba(7, 193, 96, 0.2);
    color: #07c160;
}

.dark .game-menu-item.rooms .game-menu-icon {
    background: rgba(138, 180, 248, 0.2);
    color: #4285f4;
}

.dark .game-menu-item.history .game-menu-icon {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.dark .game-menu-item.new-game {
    background: linear-gradient(135deg, #07c160, #10ad5b);
}

.dark .game-menu-item.new-game .game-menu-title {
    color: #fff;
}

.dark .game-menu-item.new-game .game-menu-desc {
    color: rgba(255, 255, 255, 0.8);
}

.dark .game-menu-item.new-game .game-menu-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.dark .api-select-item {
    border: 1.5px solid #555555;
    background: #2A2A2A;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dark .api-select-item.selected {
    border-color: #FFFFFF;
    background-color: #333333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.dark .api-select-item .api-name {
    color: #B0B0B0;
}

.dark .api-select-item.selected .api-name {
    color: #FFFFFF;
}

.dark .api-select-item .api-desc {
    color: #888888;
}

.dark .api-select-item .api-checkbox {
    border: 2px solid #888888;
}

.dark .api-select-item.selected .api-checkbox {
    border-color: #FFFFFF;
    background: #FFFFFF;
}

.dark .api-select-item.selected .api-checkbox::after {
    border: solid #000;
    border-width: 0 2px 2px 0;
}

.dark .game-context-menu {
    background: rgba(42, 42, 42, 0.85);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dark .game-context-menu-item {
    color: #B0B0B0;
}

.dark .game-context-menu-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.dark .game-context-menu-item.danger {
    color: #ff6b6b;
}

.dark .variant-switcher {
    background: rgba(255, 255, 255, 0.03);
}

.dark .variant-btn {
    color: #888888;
}

.dark .variant-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.dark .variant-btn.disabled {
    color: #555555;
}

.dark .variant-info {
    color: #888888;
}