/* Klondike Solitär - Klassisches Design nach Vorlage */

:root {
    /* Dynamic card sizing to maximize screen usage - 按比例缩�?*/
    --foundation-spacing: 0.6vw;
    --card-width: calc(((100vw - 4vw - 6 * var(--foundation-spacing)) / 7) * 0.85);
    --card-height: calc(var(--card-width) * 1.4);
    --card-border-radius: calc(var(--card-width) * 0.08);
    
    /* 真实牌桌配色 - 经典绿色（默认） */
    --table-felt-primary: #1a4d2e;   /* 经典绿色 - 主色�?*/
    --table-felt-dark: #0f3d24;      /* 更深的绿�?- 阴影和边�?*/
    --table-felt-light: #245c3a;     /* 浅绿�?- 高光 */
    --table-pattern: #163d27;        /* 纹理颜色 */
    
    /* 兼容旧变量名 */
    --green-felt: var(--table-felt-primary);
    --felt-texture: var(--table-felt-dark);
    --header-bg: #1a1d20;            /* 与导航栏统一 */
    
    --card-spacing: calc(var(--card-height) * 0.5);
    --stack-depth: calc(var(--card-width) * 0.03);
    --waste-card-offset: 20px; /* Waste pile 卡片间距 */
    
    /* Minimum and maximum sizes - 按比例缩�?*/
    --min-card-width: 77px;
    --min-card-height: 108px;
    --max-card-width: 204px;
    --max-card-height: 286px;
}

/* Reset und Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* 真实牌桌背景：深绿色毡布纹理 */
    background: var(--table-felt-primary);
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            var(--table-pattern) 2px,
            var(--table-pattern) 4px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 2px,
            var(--table-pattern) 2px,
            var(--table-pattern) 4px
        ),
        radial-gradient(
            ellipse at center,
            var(--table-felt-light) 0%,
            var(--table-felt-primary) 50%,
            var(--table-felt-dark) 100%
        );
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    /* 移动端触控优�?*/
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Header - 紧凑型设�?*/
.game-header {
    background: rgb(17 24 39 / var(--tw-bg-opacity, 1));
    border-bottom: 1px solid #0a3d1d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    min-height: 60px; /* 减少最小高�?*/
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    min-height: 60px;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 左侧：游戏标题和基本信息 */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.game-title {
    color: #fff;
    font-size: 1.4rem; /* 减小字体 */
    font-weight: bold;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.basic-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}

.basic-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.basic-stats .stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1;
}

.basic-stats .stat-value {
    font-size: 14px;
    color: #ffc107;
    font-weight: bold;
    line-height: 1;
}

/* 中间：游戏模式选择 */
.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 200px;
}

/* 右侧：操作按钮和设置 */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 50px;
    min-height: 40px;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.action-btn.primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.3);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.4);
}

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

.action-btn .icon {
    font-size: 14px;
    line-height: 1;
}

.action-btn .btn-text {
    font-size: 9px;
    line-height: 1;
    white-space: nowrap;
}

.settings-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 详细统计信息（可折叠�?*/
.detailed-stats {
    display: none;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.detailed-stats.show {
    display: flex;
}

.detailed-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 60px;
}

.detailed-stats .stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1;
}

.detailed-stats .stat-value {
    font-size: 12px;
    color: #ffc107;
    font-weight: bold;
    line-height: 1;
}

/* 兼容旧的类名 */
.game-stats {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.stat {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat span {
    color: #ffc107;
    font-weight: bold;
}

/* Game Controls - 参照Solitaired.com设计 */
.game-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}

/* 游戏模式选择 */
.game-mode-section {
    display: flex;
    align-items: center;
}

.mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mode-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 60px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 游戏统计 */
.game-stats-section {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: white;
}

/* 主要操作按钮 */
.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.action-btn.primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

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

.action-btn .icon {
    font-size: 16px;
}

/* 设置按钮 */
.settings-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 兼容旧的类名 */
.draw-options {
    display: flex;
    gap: 5px;
}

.draw-btn {
    background: #28a745;
    color: white;
    border: 2px solid #20c997;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.draw-btn:hover {
    background: #20c997;
    transform: translateY(-1px);
}

.draw-btn.active {
    background: #ffc107;
    color: #000;
    border-color: #ffb300;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.control-btn {
    background: #17a2b8;
    color: white;
    border: 2px solid #138496;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.control-btn:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-1px);
}

.control-btn:disabled {
    background: #6c757d;
    border-color: #5a6268;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Game Board */
.game-board {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 10px 2vw;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-x: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Top Row */
.top-row {
    display: flex;
    justify-content: space-between !important;
    align-items: flex-start;
    margin-top: 1%;
    margin-bottom: 20px;
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
}

.stock-waste-container {
    display: flex;
    flex-direction: row;
    gap: var(--foundation-spacing);
    flex-shrink: 0;
    flex-grow: 0;
}

.foundations-container {
    display: flex;
    flex-direction: row;
    gap: var(--foundation-spacing);
    flex-wrap: nowrap;
    flex-shrink: 0;
    flex-grow: 0;
    /* Foundation内部靠右对齐，让foundation-4紧贴容器右边�?*/
    justify-content: flex-end !important;
    /* 设置最小宽度，避免容器被压�?*/
    min-width: fit-content;
}

/* 确保foundation-4与tableau-7精确对齐 */
#foundation-4 {
    margin-right: 0;
    flex-shrink: 0;
}

#tableau-7 {
    margin-right: 0;
    flex-shrink: 0;
}

/* Card Slot SVG Backgrounds */
.waste-slot {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140'%3E%3Crect width='100' height='140' rx='8' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2' stroke-dasharray='5,5'/%3E%3Ctext x='50' y='75' text-anchor='middle' fill='rgba(255,255,255,0.4)' font-size='12' font-family='Arial'%3EWASTE%3C/text%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.stock-slot .empty-slot {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140'%3E%3Crect width='100' height='140' rx='8' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2'/%3E%3Ctext x='50' y='75' text-anchor='middle' fill='rgba(255,255,255,0.4)' font-size='12' font-family='Arial'%3ESTOCK%3C/text%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Card Slots */
.card-slot {
    flex: 0 0 clamp(var(--min-card-width), var(--card-width), var(--max-card-width));
    width: clamp(var(--min-card-width), var(--card-width), var(--max-card-width));
    height: clamp(var(--min-card-height), var(--card-height), var(--max-card-height));
    position: relative;
    border-radius: var(--card-border-radius);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Empty Slots */
.empty-slot {
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: var(--card-border-radius);
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stock-slot .empty-slot {
    background: rgba(255, 255, 255, 0.08);
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stock-slot:hover .empty-slot {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

/* Foundation Outlines */
.foundation-outline {
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--card-border-radius);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    /* 使用05.webp作为背景 */
    background-image: url('../images/back/05.webp');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* Foundation花色图标样式 */
.suit-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    z-index: 1;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 花色图标颜色（动态设置，不再固定分配�?*/

/* 当foundation有牌时，隐藏花色图标 */
.foundation-slot:not(:empty) .suit-icon {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Tableau */
.tableau-container {
    display: flex;
    justify-content: space-between;
    gap: var(--foundation-spacing);
    padding: 0 10px;
    flex: 1;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.tableau-column {
    flex: 0 0 clamp(var(--min-card-width), var(--card-width), var(--max-card-width));
    width: clamp(var(--min-card-width), var(--card-width), var(--max-card-width));
    min-height: calc(100vh - 100px); /* Increased height for better card stacking */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.tableau-column .empty-slot {
    width: 100%;
    height: clamp(var(--min-card-height), var(--card-height), var(--max-card-height));
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--card-border-radius);
    background: rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tableau-column .empty-slot::after {
    content: 'K';
    font-size: clamp(24px, 4vw, 48px);
    font-weight: bold;
    color: rgba(255, 255, 255, 0.25);
    font-family: Arial, sans-serif;
}

/* 目标列提示高亮 */
/* Hint source - highlight the card to be moved */
.card.hint-source {
    transform: translateY(-10px) !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(255, 215, 0, 0.6) !important;
    z-index: 1000 !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Ensure hint-source works for absolutely positioned cards (waste pile) */
.waste-slot .card.hint-source,
.foundation-slot .card.hint-source {
    transform: translateY(-10px) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, left 0.2s ease !important;
}

/* Hint target - deprecated, kept for compatibility */
.tableau-column.hint-target {
    background: rgba(255, 215, 0, 0.1);
    border-radius: var(--card-border-radius);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
    animation: hint-glow-pulse 2s ease-in-out infinite;
}

@keyframes hint-glow-pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.7), 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

.tableau-base {
    width: clamp(var(--min-card-width), var(--card-width), var(--max-card-width));
    height: clamp(var(--min-card-height), var(--card-height), var(--max-card-height));
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--card-border-radius);
    background: rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* Card Styles */
.card {
    width: clamp(var(--min-card-width), var(--card-width), var(--max-card-width));
    height: clamp(var(--min-card-height), var(--card-height), var(--max-card-height));
    position: absolute;
    cursor: pointer;
    cursor: grab;
    background: transparent; /* 透明背景，让SVG完全显示 */
    border: none; /* 移除边框 */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none; /* 禁止iOS长按弹出菜单 */
    /* 允许拖拽但禁止长按菜�?*/
}

.card:active {
    cursor: grabbing;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Drop zone visual feedback - 移除边框，保持原始外�?*/
/* No hover effects - keep original appearance */

.card.selected {
    /* 移除选中状态的装饰效果，保持原始外�?*/
    z-index: 101;
}

/* No special styles for dragging - keep original appearance */

/* Card Positioning */
.stock-slot .card,
.waste-slot .card,
.foundation-slot .card {
    top: 0;
    left: 0;
}

/* Waste Pile 扇形展开效果 */
.waste-slot {
    position: relative;
    overflow: visible;
}

.waste-slot .card {
    position: absolute;
    transition: left 0.2s ease;
}

/* Stock Pile 3D Stacking Effect */
.stock-slot {
    position: relative;
    cursor: pointer;
}

.stock-slot:hover {
    transform: scale(1.02);
}

/* Stock Pile卡片保持原始SVG外观，通过z-index和位置实�?D层叠效果 */

.stock-slot .card:nth-child(n+2) {
    left: calc(-1 * var(--stack-depth) * var(--stack-index, 0));
    top: calc(-1 * var(--stack-depth) * var(--stack-index, 0));
    z-index: calc(50 - var(--stack-index, 0));
}

.waste-slot .card:nth-child(n+2) {
    left: calc(var(--waste-card-offset) * var(--offset, 0));
    z-index: calc(10 + var(--offset, 0));
}

.foundation-slot .card {
    z-index: calc(10 + var(--index, 0));
}

.tableau-column .card {
    left: 50%;
    top: 0; /* 重置top位置，让JavaScript控制 */
    transform: translateX(-50%);
    z-index: calc(10 + var(--index, 0));
    position: absolute;
}

/* Tableau cards positioning is handled by JavaScript for optimal stacking */

.tableau-column .card.face-down {
    z-index: calc(5 + var(--index, 0));
}

.tableau-column .card.face-up {
    z-index: calc(15 + var(--index, 0));
}

/* Foundation Pile Hover Effect */
.foundation-slot:hover .foundation-outline {
    border-color: rgba(255, 255, 255, 0.5);
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Drop Zones - Simplified, no visual feedback */

/* Ensure drag and drop areas are properly set up */
.tableau-column,
.card-slot {
    pointer-events: auto;
}

.card-slot.invalid-drop {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Animations */
.card-flip {
    animation: flipCard 0.6s ease-in-out;
}

@keyframes flipCard {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

.card-deal {
    animation: dealCard 0.4s ease-out;
}

@keyframes dealCard {
    0% {
        transform: translateY(-50px) rotate(5deg) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

/* 纸牌提示样式 */
/* Removed: Klondike highlight styles (灯泡💡和半透明效果)
   Now using Scorpion-style flying hint animation only
   
.card.highlighted {
    animation: hint-pulse 1.5s infinite;
    position: relative;
    z-index: 1000;
}

.card.highlighted::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 400% 400%;
    border-radius: 12px;
    z-index: -1;
    animation: hint-glow 2s ease-in-out infinite;
}

.card.highlighted::after {
    content: '💡';
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 20px;
    z-index: 1001;
    animation: hint-bounce 1s ease-in-out infinite;
}

.card-slot.highlighted,
.tableau-column.highlighted {
    animation: target-pulse 1.5s infinite;
    border: 3px dashed #28a745 !important;
    background: rgba(40, 167, 69, 0.1) !important;
}
*/

/* 提示动画关键�?*/
@keyframes hint-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(78, 205, 196, 0.6);
    }
}

@keyframes hint-glow {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.8;
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
}

@keyframes hint-bounce {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes target-pulse {
    0%, 100% { 
        border-color: #28a745;
        background: rgba(40, 167, 69, 0.1) !important;
    }
    50% { 
        border-color: #ffc107;
        background: rgba(255, 193, 7, 0.2) !important;
    }
}

/* 纸牌拖拽动画提示 */
.card-drag-hint {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    opacity: 0.8;
    transform-origin: center;
    animation: card-drag-hint-move 2.5s ease-in-out;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    border: 2px solid #28a745;
    border-radius: var(--card-border-radius);
}

.card-drag-hint img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes card-drag-hint-move {
    0% {
        opacity: 0;
        transform: translate(var(--start-x), var(--start-y)) scale(1) rotate(0deg);
    }
    10% {
        opacity: 0.9;
        transform: translate(var(--start-x), var(--start-y)) scale(1.05) rotate(3deg);
        box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6);
    }
    20% {
        opacity: 0.8;
        transform: translate(var(--start-x), var(--start-y)) scale(1.1) rotate(-2deg);
    }
    80% {
        opacity: 0.8;
        transform: translate(var(--end-x), var(--end-y)) scale(1.05) rotate(2deg);
    }
    90% {
        opacity: 0.9;
        transform: translate(var(--end-x), var(--end-y)) scale(1.1) rotate(-1deg);
        box-shadow: 0 12px 35px rgba(40, 167, 69, 0.8);
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-x), var(--end-y)) scale(1) rotate(0deg);
    }
}

/* 拖拽轨迹线已移除，保持简�?*/

/* 多张纸牌序列拖拽动画 */
.card-sequence-hint {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    opacity: 0.8;
    transform-origin: center;
    animation: card-sequence-hint-move 2.5s ease-in-out;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    border: 2px solid #28a745;
    border-radius: var(--card-border-radius);
}

.card-sequence-hint img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes card-sequence-hint-move {
    0% {
        opacity: 0;
        transform: translate(var(--start-x), var(--start-y)) scale(1) rotate(0deg);
    }
    10% {
        opacity: 0.9;
        transform: translate(var(--start-x), var(--start-y)) scale(1.05) rotate(3deg);
        box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6);
    }
    20% {
        opacity: 0.8;
        transform: translate(var(--start-x), var(--start-y)) scale(1.1) rotate(-2deg);
    }
    80% {
        opacity: 0.8;
        transform: translate(var(--end-x), var(--end-y)) scale(1.05) rotate(2deg);
    }
    90% {
        opacity: 0.9;
        transform: translate(var(--end-x), var(--end-y)) scale(1.1) rotate(-1deg);
        box-shadow: 0 12px 35px rgba(40, 167, 69, 0.8);
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-x), var(--end-y)) scale(1) rotate(0deg);
    }
}

/* 发牌堆明显提示动�?*/
.stock-hint-pulse {
    animation: stock-hint-pulse 2s ease-in-out infinite;
    position: relative;
    transform: translateY(-10px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(255, 215, 0, 0.6);
    z-index: 100;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stock-hint-pulse::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.3) 50%, transparent 70%);
    border-radius: calc(var(--card-border-radius) + 10px);
    z-index: -1;
    animation: stock-glow 2s ease-in-out infinite;
}

.stock-hint-pulse::after {
    content: '👆 Klicken';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 0, 0.95);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
    animation: stock-hint-bounce 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes stock-hint-pulse {
    0%, 100% {
        transform: translateY(-10px) scale(1);
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.3),
            0 0 0 3px rgba(255, 215, 0, 0.6);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.3),
            0 0 0 3px rgba(255, 215, 0, 0.8),
            0 0 0 15px rgba(255, 215, 0, 0);
    }
}

@keyframes stock-glow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

@keyframes stock-hint-bounce {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.95;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }
}

/* 拖拽视觉提示已移�?- 保持简洁界�?*/

/* Win Animation */
.auto-complete-card {
    animation: autoComplete 1s ease-in-out;
    z-index: 1000 !important;
}

@keyframes autoComplete {
    0% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.05) rotate(-3deg); }
    75% { transform: scale(1.08) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Modal Styles - 现代德国设计风格 */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #2c3136;  /* 深灰�?- 现代德国UI常用�?*/
    color: #e8eaed;       /* 浅灰白文�?*/
}

.modal-header {
    background: #1e2124;  /* 更深的灰�?*/
    border-radius: 15px 15px 0 0;
    border-bottom: 2px solid #0066cc;  /* 德国蓝色强调 */
    color: #ffffff;
}

.modal-body {
    background: #2c3136;  /* 深灰背景 */
    color: #e8eaed;       /* 浅灰白文�?*/
}

.modal-body h6 {
    color: #ffffff;       /* 标题纯白 */
    font-weight: 600;
}

.modal-body .form-check-label {
    color: #d1d5db;       /* 表单标签浅灰 */
}

.modal-body .text-muted,
.modal-body small {
    color: #9ca3af !important;  /* 次要文字中灰 */
}

.modal-footer {
    background: #23272b;  /* 深灰 */
    border-top: 2px solid #3a3f47;
    border-radius: 0 0 15px 15px;
}

.modal .card {
    background: white;
    color: #333;
}

/* Modal 响应式适配 */
@media screen and (max-width: 767px) and (orientation: portrait) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
    
    .modal-dialog.modal-lg {
        max-width: calc(100vw - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .modal-body .col-8,
    .modal-body .col-4 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .stats-jumbotron {
        padding: 0.5rem !important;
    }
    
    .trophy-personal-stats .col {
        padding: 0.25rem;
    }
    
    .personal-stat {
        font-size: 1.3rem !important;
    }
    
    .highscore-body {
        padding: 0.5rem;
        overflow-x: auto;
    }
    
    .highscore-body table {
        font-size: 0.75rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .btn-sm {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
}

@media screen and (max-width: 767px) and (orientation: landscape) {
    .modal-dialog {
        margin: 0.3rem;
        max-width: calc(100vw - 0.6rem);
        max-height: calc(100vh - 0.6rem);
    }
    
    .modal-dialog.modal-lg {
        max-width: calc(100vw - 0.6rem);
    }
    
    .modal-content {
        max-height: calc(100vh - 0.6rem);
        overflow-y: auto;
    }
    
    .modal-body {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .stats-jumbotron {
        padding: 0.4rem !important;
    }
    
    .personal-stat {
        font-size: 1.2rem !important;
    }
    
    .highscore-body {
        padding: 0.4rem;
        max-height: 30vh;
        overflow-y: auto;
    }
    
    .btn-lg {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .btn-sm {
        font-size: 0.65rem;
        padding: 0.2rem 0.35rem;
    }
}

@media screen and (max-width: 480px) and (orientation: portrait) {
    .modal-body .col-8 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .modal-body .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .modal-body .row.mb-4 {
        flex-direction: column;
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .modal-dialog.modal-lg {
        max-width: 90vw;
    }
}

/* ===================================
   响应式设�?- 基于长宽比和设备方向
   =================================== */

/* 平板横屏 (Tablet Landscape) - 宽屏，较大屏�?*/
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    :root {
        --card-width: calc(((100vw - 4vw - 6 * var(--foundation-spacing)) / 7) * 0.8);
        --foundation-spacing: 0.5vw;
        --waste-card-offset: 18px;
    }
    
    .game-header {
        min-height: 55px;
    }
    
    .header-container {
        padding: 6px 14px;
        gap: 10px;
    }
    
    .game-title {
        font-size: 1.3rem;
    }
    
    .action-btn {
        min-width: 48px;
        min-height: 38px;
        padding: 5px 7px;
    }
    
    .game-board {
        padding: 10px 1.8vw;
        min-height: calc(100vh - 65px);
    }
    
    .top-row {
        padding: 0 8px;
        margin-bottom: 15px;
    }
    
    .tableau-column {
        min-height: calc(100vh - 100px);
    }
    
    .tableau-container {
        padding: 0 8px;
        gap: calc(var(--foundation-spacing) * 0.95);
    }
}

/* 平板竖屏 (Tablet Portrait) - 中等宽度，较高屏�?*/
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    :root {
        --card-width: calc(((100vw - 4vw - 6 * var(--foundation-spacing)) / 7) * 0.88);
        --foundation-spacing: 0.55vw;
        --waste-card-offset: 18px;
    }
    
    .game-header {
        min-height: 58px;
    }
    
    .header-container {
        padding: 7px 12px;
        gap: 10px;
    }
    
    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .game-title {
        font-size: 1.35rem;
    }
    
    .basic-stats {
        gap: 10px;
    }
    
    .action-btn {
        min-width: 50px;
        min-height: 38px;
    }
    
    .game-board {
        padding: 12px 1.5vw;
        min-height: calc(100vh - 68px);
    }
    
    .top-row {
        padding: 0 8px;
        margin-bottom: 18px;
    }
    
    .tableau-column {
        min-height: calc(100vh - 110px);
    }
    
    .tableau-container {
        padding: 0 8px;
    }
}

/* 手机横屏 (Mobile Landscape) - 基于高度的弹性缩�?*/
@media screen and (max-width: 767px) and (orientation: landscape) {
    :root {
        --card-width: calc(((100vw - 2vw - 6 * var(--foundation-spacing)) / 7));
        --foundation-spacing: 0.2vw;
        /* 卡牌尺寸基于屏幕高度的百分比，使用clamp确保合理范围 */
        --min-card-width: clamp(38px, 11vh, 48px);
        --min-card-height: clamp(53px, 15vh, 67px);
        --waste-card-offset: 12px;
    }
    
    /* Header高度基于屏幕高度�?%，范�?6-32px */
    .game-header {
        min-height: clamp(26px, 7vh, 32px);
        max-height: clamp(26px, 7vh, 32px);
    }
    
    .header-container {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: clamp(1px, 0.3vh, 2px) 3px;
        gap: clamp(1px, 0.5vh, 3px);
        justify-content: space-between;
        min-height: clamp(26px, 7vh, 32px);
    }
    
    .header-left {
        order: 1;
        flex: 0 0 auto;
        gap: clamp(2px, 0.7vh, 4px);
    }
    
    .game-title {
        font-size: clamp(0.7rem, 2vh, 0.9rem);
    }
    
    .basic-stats {
        gap: clamp(1px, 0.5vh, 3px);
    }
    
    .basic-stats .stat-label {
        font-size: clamp(4px, 1vh, 6px);
    }
    
    .basic-stats .stat-value {
        font-size: clamp(6px, 1.8vh, 9px);
    }
    
    .header-center {
        order: 2;
        flex: 0 0 auto;
        max-width: clamp(100px, 28vw, 140px);
    }
    
    .mode-btn {
        padding: clamp(1px, 0.3vh, 2px) clamp(3px, 1vh, 5px);
        font-size: clamp(6px, 1.7vh, 8px);
        min-width: clamp(28px, 8vw, 40px);
    }
    
    .header-right {
        order: 3;
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: clamp(1px, 0.5vh, 3px);
    }
    
    .action-buttons {
        gap: clamp(1px, 0.3vh, 2px);
    }
    
    .action-btn {
        min-width: clamp(24px, 6.5vw, 30px);
        min-height: clamp(20px, 5.5vh, 26px);
        padding: 1px 2px;
    }
    
    .action-btn .icon {
        font-size: clamp(6px, 1.7vh, 9px);
    }
    
    .action-btn .btn-text {
        font-size: clamp(4px, 1vh, 6px);
    }
    
    .settings-btn {
        width: clamp(16px, 4.5vh, 22px);
        height: clamp(16px, 4.5vh, 22px);
        font-size: clamp(6px, 1.7vh, 9px);
    }
    
    .game-board {
        padding: 0 0.3vw;
        /* 动态计算：100vh - Header高度(7vh) */
        min-height: calc(100vh - clamp(26px, 7vh, 32px));
    }
    
    .top-row {
        padding: 0 clamp(1px, 0.3vw, 3px);
        margin-bottom: 0px;
        margin-top: 0;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .tableau-container {
        gap: calc(var(--foundation-spacing) * 0.5);
        padding: 0 clamp(1px, 0.3vw, 3px);
    }
    
    .tableau-column {
        min-height: auto;
        max-height: none;
        overflow: visible;
    }
}

/* 手机竖屏 (Mobile Portrait) - 6个区域一行显�?*/
@media screen and (max-width: 767px) and (orientation: portrait) {
    :root {
        /* 优化卡牌尺寸以适应6个区域横向排�?*/
        --card-width: calc(((100vw - 1vw - 5 * 2px) / 6));
        --foundation-spacing: 2px;
        --min-card-width: 52px;
        --min-card-height: 73px;
        --card-height: calc(var(--card-width) * 1.4);
        --waste-card-offset: 15px;
    }
    
    .game-header {
        min-height: auto;
    }
    
    .header-container {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .header-left {
        order: 1;
        justify-content: center;
        gap: 12px;
        width: 100%;
    }
    
    .game-title {
        font-size: 1.3rem;
        text-align: center;
    }
    
    .basic-stats {
        gap: 10px;
    }
    
    .basic-stats .stat-label {
        font-size: 9px;
    }
    
    .basic-stats .stat-value {
        font-size: 12px;
    }
    
    .header-center {
        order: 2;
        max-width: none;
        width: 100%;
        justify-content: center;
    }
    
    .mode-toggle {
        width: 100%;
        max-width: 300px;
    }
    
    .mode-btn {
        flex: 1;
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .header-right {
        order: 3;
        justify-content: center;
        gap: 8px;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .action-buttons {
        gap: 5px;
        justify-content: center;
        width: 100%;
    }
    
    .action-btn {
        min-width: 55px;
        min-height: 42px;
        padding: 6px 8px;
    }
    
    .action-btn .icon {
        font-size: 14px;
    }
    
    .action-btn .btn-text {
        font-size: 9px;
    }
    
    .settings-buttons {
        gap: 5px;
    }
    
    .settings-btn {
        width: 32px;
        height: 32px;
    }
    
    .game-board {
        padding: 10px 0.5vw;
        min-height: calc(100vh - 150px);
    }
    
    /* 6个区域强制一行显�?*/
    .top-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        gap: 2px !important;
        padding: 0 0.5vw !important;
        margin-bottom: 12px;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: visible;
    }
    
    .stock-waste-container {
        display: flex !important;
        flex-direction: row !important;
        gap: 2px !important;
        flex-shrink: 0 !important;
        flex-wrap: nowrap !important;
    }
    
    .foundations-container {
        display: flex !important;
        flex-direction: row !important;
        gap: 2px !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
        justify-content: flex-end !important;
        max-width: none !important;
    }
    
    /* 确保所有卡牌槽尺寸一致且不被压缩 */
    .card-slot {
        flex-shrink: 0 !important;
        max-width: var(--card-width) !important;
        width: var(--card-width) !important;
    }
    
    .foundation {
        flex-shrink: 0 !important;
        max-width: var(--card-width) !important;
        width: var(--card-width) !important;
    }
    
    .tableau-container {
        gap: calc(var(--foundation-spacing) * 0.85);
        padding: 0 0.5vw !important;
    }
    
    .tableau-column {
        min-height: calc(100vh - 200px);
    }
}

/* 极小屏幕手机竖屏 (Small Mobile Portrait) - 6个区域一�?*/
@media screen and (max-width: 480px) and (orientation: portrait) {
    :root {
        /* 6个区域横向排列的卡牌尺寸计算 */
        --card-width: calc(((100vw - 1vw - 5 * 2px) / 6));
        --foundation-spacing: 2px;
        --min-card-width: 50px;
        --min-card-height: 70px;
        --card-height: calc(var(--card-width) * 1.4);
        --waste-card-offset: 12px;
    }
    
    .game-header {
        min-height: auto;
    }
    
    .game-title {
        font-size: 1.15rem;
    }
    
    .header-container {
        padding: 6px 8px;
        gap: 6px;
    }
    
    .basic-stats {
        gap: 8px;
    }
    
    .basic-stats .stat-label {
        font-size: 8px;
    }
    
    .basic-stats .stat-value {
        font-size: 11px;
    }
    
    .mode-btn {
        padding: 7px 12px;
        font-size: 12px;
    }
    
    .action-btn {
        min-width: 48px;
        min-height: 38px;
        padding: 5px 6px;
    }
    
    .action-btn .icon {
        font-size: 12px;
    }
    
    .action-btn .btn-text {
        font-size: 8px;
    }
    
    .settings-btn {
        width: 28px;
        height: 28px;
        padding: 4px;
    }
    
    .game-board {
        padding: 8px 0.5vw;
    }
    
    /* 6个区域强制一�?*/
    .top-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        gap: 2px !important;
        padding: 0 0.5vw !important;
        margin-bottom: 12px;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: visible;
    }
    
    .stock-waste-container {
        display: flex !important;
        flex-direction: row !important;
        gap: 2px !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    .foundations-container {
        display: flex !important;
        flex-direction: row !important;
        gap: 2px !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
        justify-content: flex-end !important;
        max-width: none !important;
    }
    
    /* 确保卡牌槽不被压�?*/
    .card-slot {
        flex-shrink: 0 !important;
        max-width: var(--card-width) !important;
        width: var(--card-width) !important;
    }
    
    .foundation {
        flex-shrink: 0 !important;
        max-width: var(--card-width) !important;
        width: var(--card-width) !important;
    }
    
    .tableau-container {
        gap: calc(var(--foundation-spacing) * 0.75);
        padding: 0 0.5vw !important;
        justify-content: space-between;
    }
    
    .tableau-column {
        min-height: calc(100vh - 180px);
    }
}

/* 极小屏幕手机横屏 (Small Mobile Landscape) - 继承主横屏规则，使用clamp自动适应 */
@media screen and (max-width: 667px) and (orientation: landscape) and (max-height: 500px) {
    /* 
     * 由于使用了clamp()和vh单位，大部分样式已自动适应极小屏幕
     * 这里只需要微调一些特殊情�?     */
    :root {
        --foundation-spacing: 0.15vw;  /* 稍微减小间距 */
        --waste-card-offset: 10px;
    }
    
    /* 在极小屏幕上进一步压缩padding */
    .game-board {
        padding: 0 0.2vw;
    }
    
    .tableau-container {
        gap: calc(var(--foundation-spacing) * 0.4);
    }
}

/* 桌面/大屏�?(Desktop) */
@media screen and (min-width: 1025px) {
    .game-board {
        padding: 15px 2vw;
    }
    
    .top-row {
        padding: 0 10px;
        margin-bottom: 25px;
    }
    
    .tableau-column {
        min-height: calc(100vh - 140px);
    }
}

/* 超宽屏幕适配 */
@media screen and (min-width: 1440px) {
    :root {
        --card-width: calc(((100vw - 4vw - 6 * var(--foundation-spacing)) / 7) * 0.75);
        --max-card-width: 180px;
        --max-card-height: 252px;
    }
    
    .header-container {
        max-width: 1400px;
    }
}

/* 针对特定长宽比的优化 */
@media screen and (min-aspect-ratio: 16/9) {
    /* 宽屏显示器优�?*/
    .game-board {
        justify-content: center;
    }
    
    /* �?移除 max-width 限制，因�?top-row�?个卡槽）�?tableau�?个卡槽）的内容宽度不�?       如果都限制为 1200px，即使居中也无法对齐右边�?       正确方法：保持全宽，通过相同�?padding 确保右边缘对�?*/
}

@media screen and (max-aspect-ratio: 9/16) and (min-width: 768px) {
    /* 超窄屏幕优化 - 仅桌面端 */
    .top-row {
        gap: 18px;
    }
    
    .foundations-container {
        flex-wrap: wrap;
        max-width: calc(2 * clamp(var(--min-card-width), var(--card-width), var(--max-card-width)) + var(--foundation-spacing));
    }
}

/* Accessibility */
.card:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.control-btn:focus, .draw-btn:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* No performance optimizations that affect appearance */

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .game-header {
        display: none;
    }
    
    .card {
        /* 打印时也保持原始SVG外观 */
        box-shadow: none;
    }
}

/* 撒花动画 */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg) scale(1);
        opacity: 1;
    }
    25% {
        transform: translateY(-50vh) rotate(180deg) scale(1.1);
        opacity: 0.9;
    }
    50% {
        transform: translateY(0vh) rotate(360deg) scale(0.9);
        opacity: 0.8;
    }
    75% {
        transform: translateY(50vh) rotate(540deg) scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

/* 增强版撒花动�?*/
@keyframes confetti-fall-enhanced {
    0% {
        transform: translateY(-100vh) rotate(0deg) scale(1) translateX(0);
        opacity: 1;
    }
    10% {
        transform: translateY(-80vh) rotate(90deg) scale(1.2) translateX(20px);
        opacity: 0.95;
    }
    25% {
        transform: translateY(-50vh) rotate(180deg) scale(1.1) translateX(-10px);
        opacity: 0.9;
    }
    40% {
        transform: translateY(-20vh) rotate(270deg) scale(1) translateX(15px);
        opacity: 0.85;
    }
    60% {
        transform: translateY(20vh) rotate(360deg) scale(0.9) translateX(-5px);
        opacity: 0.7;
    }
    80% {
        transform: translateY(60vh) rotate(450deg) scale(0.7) translateX(10px);
        opacity: 0.4;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.3) translateX(0);
        opacity: 0;
    }
}

/* 全屏大号彩蛋特效动画 */
@keyframes easter-egg-burst-0 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0.1);
        opacity: 1;
    }
    20% {
        transform: translate(0, -20vh) rotate(180deg) scale(1.2);
        opacity: 0.9;
    }
    40% {
        transform: translate(0, -40vh) rotate(360deg) scale(1);
        opacity: 0.8;
    }
    60% {
        transform: translate(0, -60vh) rotate(540deg) scale(0.8);
        opacity: 0.6;
    }
    80% {
        transform: translate(0, -80vh) rotate(720deg) scale(0.6);
        opacity: 0.4;
    }
    100% {
        transform: translate(0, -100vh) rotate(900deg) scale(0.3);
        opacity: 0;
    }
}

@keyframes easter-egg-burst-1 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0.1);
        opacity: 1;
    }
    15% {
        transform: translate(10vh, -15vh) rotate(90deg) scale(1.1);
        opacity: 0.9;
    }
    30% {
        transform: translate(20vh, -30vh) rotate(180deg) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(30vh, -50vh) rotate(270deg) scale(0.9);
        opacity: 0.7;
    }
    70% {
        transform: translate(40vh, -70vh) rotate(360deg) scale(0.7);
        opacity: 0.5;
    }
    100% {
        transform: translate(50vh, -100vh) rotate(450deg) scale(0.4);
        opacity: 0;
    }
}

@keyframes easter-egg-burst-2 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0.1);
        opacity: 1;
    }
    25% {
        transform: translate(15vh, -25vh) rotate(120deg) scale(1.3);
        opacity: 0.9;
    }
    50% {
        transform: translate(30vh, -50vh) rotate(240deg) scale(1);
        opacity: 0.8;
    }
    75% {
        transform: translate(45vh, -75vh) rotate(360deg) scale(0.7);
        opacity: 0.6;
    }
    100% {
        transform: translate(60vh, -100vh) rotate(480deg) scale(0.4);
        opacity: 0;
    }
}

@keyframes easter-egg-burst-3 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0.1);
        opacity: 1;
    }
    30% {
        transform: translate(20vh, -30vh) rotate(150deg) scale(1.4);
        opacity: 0.9;
    }
    60% {
        transform: translate(40vh, -60vh) rotate(300deg) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translate(60vh, -100vh) rotate(450deg) scale(0.5);
        opacity: 0;
    }
}

@keyframes easter-egg-burst-4 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0.1);
        opacity: 1;
    }
    10% {
        transform: translate(5vh, -10vh) rotate(45deg) scale(1.5);
        opacity: 0.95;
    }
    25% {
        transform: translate(15vh, -25vh) rotate(90deg) scale(1.3);
        opacity: 0.9;
    }
    40% {
        transform: translate(25vh, -40vh) rotate(135deg) scale(1.1);
        opacity: 0.85;
    }
    60% {
        transform: translate(35vh, -60vh) rotate(180deg) scale(0.9);
        opacity: 0.7;
    }
    80% {
        transform: translate(45vh, -80vh) rotate(225deg) scale(0.7);
        opacity: 0.5;
    }
    100% {
        transform: translate(55vh, -100vh) rotate(270deg) scale(0.4);
        opacity: 0;
    }
}

/* 胜利动画 */
.victory-animation {
    animation: victory-pulse 0.5s ease-in-out;
}



/* 发牌堆悬停效�?*/
.stock-slot:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.stock-slot:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

@keyframes victory-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 胜利弹窗样式 */
.stats-jumbotron {
    padding: 0.5em !important;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

.trophy-personal-stats .personal-stat {
    color: #28a745;
    font-weight: bold;
}

.congrats-inner {
    text-align: center;
}

.highscore-body {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
}

#leaderboardBody tr {
    border-bottom: 1px solid #dee2e6;
}

#leaderboardBody tr:last-child {
    border-bottom: none;
}

#leaderboardBody .high-score-username {
    min-width: 150px;
}

#leaderboardBody .form-inline {
    display: inline-block;
}

#leaderboardBody .congratsUsername {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

#leaderboardBody .saveUsername {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.ranking-text {
    color: #28a745;
    font-weight: bold;
}
/* ========================================
   Spider Solitär Specific Styles
   ======================================== */
