/* 扑克数据分析面板样式 */

:root {
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-lighter: #0f3460;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --accent: #e94560;
    --success: #4ade80;
    --danger: #f87171;
    --border: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

.navbar {
    background: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    margin-left: 2rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

h2 {
    margin: 2rem 0 1rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

h3 {
    margin: 1.5rem 0 0.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-grid.small {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card.winner {
    border-color: var(--success);
}

.stat-card.loser {
    border-color: var(--danger);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-lighter);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.data-table a {
    color: var(--accent);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

.profit-positive {
    color: var(--success);
}

.profit-negative {
    color: var(--danger);
}

.winner-row {
    background: rgba(74, 222, 128, 0.1) !important;
}

/* 筛选表单 */
.filter-form {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.filter-form.inline {
    display: inline-block;
    padding: 0.5rem 1rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-dark);
    color: var(--text-primary);
}

.filter-group input {
    width: 120px;
}

.btn {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
}

.btn:hover {
    opacity: 0.9;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.result-count {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* 两栏布局 */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-lighter);
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* 手牌详情 */
.hand-info {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.info-item .value {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.info-item .value.board {
    font-family: monospace;
    letter-spacing: 2px;
}

.cards {
    font-family: monospace;
    letter-spacing: 1px;
}

/* 动作时间线 */
.actions-timeline {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.street-header {
    font-weight: bold;
    color: var(--accent);
    padding: 0.5rem 0;
    margin-top: 1rem;
    border-bottom: 1px solid var(--border);
}

.street-header:first-child {
    margin-top: 0;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
}

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

.player-name {
    width: 120px;
    color: var(--text-primary);
}

.action-type {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.action-folds {
    background: #666;
}

.action-checks {
    background: #444;
}

.action-calls {
    background: #2563eb;
}

.action-bets {
    background: #16a34a;
}

.action-raises {
    background: #dc2626;
}

.action-posts {
    background: #7c3aed;
}

.action-amount {
    color: var(--success);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========== 手牌详情页增强样式 ========== */

/* 公共牌显示 */
.board-display {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.community-cards {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.card {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    border: 2px solid #333;
    min-width: 45px;
    text-align: center;
}

.card.red {
    color: #dc2626;
}

.card.black {
    color: #1a1a1a;
}

.card.small {
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    min-width: 35px;
}

.card.muted {
    opacity: 0.5;
}

.card.highlight {
    box-shadow: 0 0 10px var(--accent);
    border-color: var(--accent);
}

.no-board {
    color: var(--text-secondary);
    font-style: italic;
}

/* 玩家手牌卡片 */
.players-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.player-card-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.player-card-box.winner {
    border-color: var(--success);
    background: rgba(74, 222, 128, 0.1);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.player-header .seat {
    color: var(--text-secondary);
}

.player-header .position {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-lighter);
    font-weight: bold;
}

.player-header .position.btn {
    background: #f59e0b;
    color: #000;
}

.player-header .position.sb {
    background: #6366f1;
}

.player-header .position.bb {
    background: #8b5cf6;
}

.player-header .winner-badge {
    font-size: 1.2rem;
}

.player-card-box .player-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.player-card-box .player-name a {
    color: var(--accent);
    text-decoration: none;
}

.hole-cards {
    margin: 0.75rem 0;
}

.hidden-cards {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.player-result {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.player-result .stack {
    color: var(--text-secondary);
}

.player-flags {
    margin-top: 0.5rem;
}

.flag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    border-radius: 3px;
    margin: 0.1rem;
}

.flag.vpip {
    background: #3b82f6;
}

.flag.pfr {
    background: #ef4444;
}

.flag.flop {
    background: #22c55e;
}

.flag.showdown {
    background: #f59e0b;
    color: #000;
}

/* 行动回放 */
.action-replay {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.street-section {
    margin: 1rem 0;
}

.street-title {
    font-weight: bold;
    color: var(--accent);
    padding: 0.75rem 0;
    text-align: center;
    font-size: 1rem;
}

.street-cards {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px dashed var(--border);
}

.action-row:last-child {
    border-bottom: none;
}

.action-player {
    width: 150px;
    font-weight: 500;
}

.result-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
}

.winner-result {
    background: rgba(74, 222, 128, 0.15);
    border-radius: 6px;
}

.winner-name {
    font-weight: bold;
    color: var(--success);
}

.win-amount {
    color: var(--success);
    font-size: 1.1rem;
}

/* ========== 扑克牌花色符号样式 ========== */

.poker-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
    border: 2px solid #333;
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    margin: 0 2px;
    min-width: 40px;
    min-height: 50px;
    font-weight: bold;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.poker-card.small {
    padding: 0.2rem 0.3rem;
    min-width: 30px;
    min-height: 38px;
    font-size: 0.85rem;
}

.poker-card.large {
    padding: 0.6rem 0.8rem;
    min-width: 55px;
    min-height: 70px;
    font-size: 1.3rem;
}

.poker-card .card-rank {
    font-size: 1.1em;
    line-height: 1;
}

.poker-card .card-suit {
    font-size: 1.3em;
    line-height: 1;
}

.poker-card.suit-hearts,
.poker-card.suit-diamonds {
    color: #dc2626;
}

.poker-card.suit-clubs,
.poker-card.suit-spades {
    color: #1a1a1a;
}

.poker-card.unknown {
    background: #444;
    color: #999;
}

/* ========== 牌桌动画播放器 ========== */

.poker-table-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.animation-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-lighter);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.anim-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.anim-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.anim-btn.play {
    background: var(--success);
    color: #000;
    font-weight: bold;
}

.anim-btn.playing {
    background: #f59e0b;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.speed-control input[type="range"] {
    width: 100px;
}

.step-display {
    margin-left: auto;
    font-family: monospace;
    color: var(--text-secondary);
}

.poker-table {
    position: relative;
    background: linear-gradient(180deg, #0d5c2e 0%, #0a4a25 50%, #073d1e 100%);
    border: 12px solid #5c3d2e;
    border-radius: 120px;
    padding: 2rem;
    min-height: 550px; /* FIXED: Increased height for seats */
    margin: 3rem 2rem; 
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.table-surface {
    text-align: center;
    padding: 2rem 0;
}

.community-area {
    margin-bottom: 1rem;
}

.board-cards {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.board-card {
    transition: transform 0.3s ease;
}

.board-card.new-card {
    animation: cardDeal 0.5s ease;
}

.board-card.empty {
    opacity: 0.3;
    font-size: 2rem;
}

@keyframes cardDeal {
    0% {
        transform: translateY(-50px) rotateY(90deg);
        opacity: 0;
    }

    100% {
        transform: translateY(0) rotateY(0);
        opacity: 1;
    }
}

.pot-display {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fbbf24;
    margin: 1rem 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.current-action {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    display: inline-block;
    margin-top: 0.5rem;
}

.current-action .action-player {
    font-weight: bold;
    margin-right: 0.5rem;
}

.current-action .waiting {
    color: var(--text-secondary);
    font-style: italic;
}

.current-action .finished {
    color: var(--success);
    font-weight: bold;
}

.seats-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 1rem;
    margin-top: 1rem;
}

.seat {
    position: absolute;
    min-width: 130px;
    background: rgba(17, 24, 39, 0.9) !important;
    border: 1px solid #4b5563 !important;
    border-radius: 8px;
    padding: 6px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    backdrop-filter: blur(8px);
}

.seat.active {
    border-color: #facc15 !important;
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.5), inset 0 0 10px rgba(250, 204, 21, 0.1) !important;
    transform: scale(1.05) !important;
    z-index: 20;
}

.seat.folded {
    opacity: 0.5;
    filter: grayscale(100%) brightness(0.6);
    transform: scale(0.95);
    border-color: #374151 !important;
}

.seat.winner {
    border-color: #10b981 !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important;
    background: rgba(6, 78, 59, 0.9) !important;
}

.seat-position {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: bold;
}

.seat-name {
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
    color: #f3f4f6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.seat-stack {
    font-size: 0.85rem;
    color: #fbbf24;
    font-family: 'Consolas', monospace;
    font-weight: 700;
    margin-bottom: 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 0 4px;
    display: inline-block;
}

.seat-stats {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2px !important;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 2px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.stat-item .label {
    color: #9ca3af;
    font-size: 0.5rem;
    margin-bottom: 1px;
    text-transform: uppercase;
    transform: scale(0.9);
}

.stat-item .value {
    color: #e5e7eb;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: monospace;
}

.stat-item .profit-pos {
    color: #34d399;
}

.stat-item .profit-neg {
    color: #f87171;
}

.seat-cards {
    margin-top: 4px;
    min-height: 36px;
    display: flex;
    justify-content: center;
}

.poker-card.back {
    background: #1f2937;
    background-image: repeating-linear-gradient(45deg, #1f2937 25%, transparent 25%, transparent 75%, #1f2937 75%, #1f2937), repeating-linear-gradient(45deg, #1f2937 25%, #1e3a8a 25%, #1e3a8a 75%, #1f2937 75%, #1f2937);
    background-position: 0 0, 5px 5px;
    background-size: 10px 10px;
    border: 1px solid #fff;
    color: transparent;
    width: 25px;
    height: 35px;
    border-radius: 3px;
    display: inline-block;
    margin: 0 1px;
}

.action-log {
    height: 200px;
    overflow-y: auto;
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.log-street {
    font-weight: bold;
    color: var(--accent);
    padding: 0.5rem 0;
    text-align: center;
}

.log-entry {
    display: flex;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
}

.log-entry.current {
    background: rgba(233, 69, 96, 0.2);
    border-left: 3px solid var(--accent);
}

.log-player {
    min-width: 100px;
    font-weight: 500;
}

.log-action {
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.log-amount {
    color: var(--success);
}

/* =========================================
   V12 ULTIMATE DESIGN (OpenPokerAI)
   ========================================= */

.navbar-brand span {
    background: linear-gradient(135deg, #facc15 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 0 0 30px rgba(250, 204, 21, 0.2);
    letter-spacing: -0.5px;
    display: inline-block;
}

.hero-section {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 3rem;
    position: relative;
    background: radial-gradient(circle at center, rgba(250, 204, 21, 0.05) 0%, transparent 70%);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #9ca3af;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.8;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.glass-panel:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(250, 204, 21, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.glass-panel .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.3s;
}

.glass-panel:hover .stat-icon {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.1) rotate(5deg);
}

.glass-panel .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
    color: #f3f4f6;
}

.glass-panel .stat-label {
    font-size: 0.85rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.glass-panel.winner .stat-value {
    color: #34d399;
}

.glass-panel.loser .stat-value {
    color: #f87171;
}

.glass-panel.primary {
    border: 1px solid rgba(250, 204, 21, 0.2);
    background: rgba(250, 204, 21, 0.05);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.dealer-button {
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    color: black;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    border: 1px solid #d1d5db;
    z-index: 15;
    top: -8px;
    left: -8px;
}

.flying-chip {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #fbbf24;
    border: 2px solid #d97706;
    border-radius: 50%;
    color: #78350f;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transform: translate(-50%, -50%);
}
