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

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

.container {
    max-width: 100%;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hand-control {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.hand-display {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
}

.hand-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.next-hand-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.next-hand-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
}

.reset-hand-btn {
    padding: 12px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.reset-all-btn {
    padding: 12px 20px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.player-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.player-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

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

.player-name {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

.player-type {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.type-TAG {
    background: #4ade80;
    color: white;
}

.type-LAG {
    background: #f59e0b;
    color: white;
}

.type-TP {
    background: #3b82f6;
    color: white;
}

.type-LP {
    background: #ef4444;
    color: white;
}

.type-unknown {
    background: #9ca3af;
    color: white;
}

.player-actions {
    display: flex;
    gap: 5px;
}

.mini-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.remove-btn {
    background: #ef4444;
}

.hands-info {
    text-align: center;
    padding: 8px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat-item {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.stat-count {
    font-size: 10px;
    color: #999;
}

.action-section {
    margin-bottom: 15px;
}

.section-title {
    font-size: 12px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e0e0e0;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.action-btn {
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-call-pre {
    background: #10b981;
    color: white;
}

.btn-pfr {
    background: #f59e0b;
    color: white;
}

.btn-3bet {
    background: #ef4444;
    color: white;
}

.btn-cbet {
    background: #8b5cf6;
    color: white;
}

.btn-bet {
    background: #ec4899;
    color: white;
}

.btn-raise {
    background: #f97316;
    color: white;
}

.btn-call-post {
    background: #3b82f6;
    color: white;
}

.action-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.control-panel {
    padding: 0;
    background: transparent;
    margin: 0;
    box-shadow: none;
}

.add-player-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.add-player-btn::before {
    content: '➕';
    font-size: 20px;
}

.add-player-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.add-player-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.add-player-btn:hover::after {
    width: 300px;
    height: 300px;
}

@media (max-width: 1024px) {
    .player-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.classification-info {
    background: #f0f9ff;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    border: 2px solid #0ea5e9;
}

.classification-title {
    font-size: 14px;
    font-weight: bold;
    color: #0369a1;
    margin-bottom: 10px;
}

.classification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    font-size: 11px;
}

.classification-item {
    background: white;
    padding: 8px;
    border-radius: 5px;
    border-left: 3px solid #0ea5e9;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
}

.modal-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.modal-confirm {
    background: #667eea;
    color: white;
}

.modal-cancel {
    background: #e0e0e0;
    color: #333;
}

/* タブ機能 */
.tab-container {
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border-bottom: 3px solid #667eea;
    padding: 0;
}

.tab-btn {
    flex: 1;
    padding: 18px 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: #fbbf24;
}

.tab-content {
    display: none;
    padding: 25px;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* 保存済みプレイヤー */
.saved-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding: 15px 5px;
}

.saved-players-grid::-webkit-scrollbar {
    width: 8px;
}

.saved-players-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.saved-players-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.saved-player-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 18px;
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.saved-player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.saved-player-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

.saved-player-name {
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.saved-player-stats {
    font-size: 13px;
    color: #555;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.saved-player-stat {
    background: white;
    padding: 6px 10px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.saved-player-actions {
    display: flex;
    gap: 8px;
}

.load-player-btn {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.load-player-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.delete-saved-btn {
    padding: 10px 15px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-saved-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

.save-current-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.save-current-btn::before {
    content: '💾';
    font-size: 18px;
}

.save-current-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
}

.no-saved-players {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

/* モーダル拡張 */
.player-select-modal {
    max-height: 500px;
    overflow-y: auto;
}

.player-select-list {
    margin: 20px 0;
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
}

.player-select-list::-webkit-scrollbar {
    width: 6px;
}

.player-select-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.player-select-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.player-select-item {
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
    position: relative;
}

.player-select-item::before {
    content: '👤';
    position: absolute;
    left: 16px;
    font-size: 20px;
    opacity: 0.7;
}

.player-select-item>div {
    padding-left: 35px;
    width: 100%;
}

.player-select-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.player-select-item:hover .player-select-stats {
    color: rgba(255, 255, 255, 0.9);
}

.player-select-item strong {
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
}

.player-select-stats {
    font-size: 12px;
    opacity: 0.8;
    transition: all 0.3s;
}

.divider {
    border-top: 2px solid transparent;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    height: 2px;
    margin: 20px -20px;
    padding: 0 20px;
    position: relative;
}

.divider::after {
    content: '新規プレイヤー';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0 15px;
    color: #667eea;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

/* 検索機能 */
.search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box {
    flex: 1;
    padding: 12px 16px;
    padding-left: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
    position: relative;
}

.search-box:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 20px;
    pointer-events: none;
}

.search-wrapper {
    position: relative;
    flex: 1;
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.clear-search.active {
    display: flex;
}

.clear-search:hover {
    background: #667eea;
    color: white;
}

.search-stats {
    padding: 10px 20px;
    background: #f0f9ff;
    border-radius: 8px;
    font-size: 14px;
    color: #0369a1;
    font-weight: 500;
    display: none;
}

.search-stats.active {
    display: block;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-in;
}

.sort-container {
    display: flex;
    gap: 8px;
}

.sort-btn {
    padding: 10px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    white-space: nowrap;
}

.sort-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

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

/* プレイヤークイックアクセス */
.player-quick-access {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
}

.player-quick-access.active {
    display: block !important;
    /* !importantで確実に表示 */
}

.quick-access-title {
    font-size: 12px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.quick-access-title::before {
    content: '👥';
    font-size: 16px;
}

.player-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.player-quick-btn {
    padding: 10px 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.player-quick-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

.player-quick-btn .player-type-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: bold;
    text-transform: uppercase;
}

.player-type-badge.TAG {
    background: #4ade80;
    color: white;
}

.player-type-badge.LAG {
    background: #f59e0b;
    color: white;
}

.player-type-badge.TP {
    background: #3b82f6;
    color: white;
}

.player-type-badge.LP {
    background: #ef4444;
    color: white;
}

/* スクロールトップボタン */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    z-index: 100;
    transition: all 0.3s;
}

.scroll-to-top.active {
    display: flex;
}

.scroll-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

/* モバイル用調整 */
@media (max-width: 768px) {
    .player-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .player-quick-btn {
        font-size: 14px;
        padding: 14px 8px;
        min-height: 50px;
    }

    .player-card {
        scroll-margin-top: 60px;
    }

    .hand-control {
        position: sticky;
        top: 0;
        z-index: 50;
        background: white;
        margin-bottom: 10px;
    }

    .hand-display {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .hand-buttons {
        gap: 5px;
    }

    .next-hand-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .reset-hand-btn,
    .reset-all-btn {
        padding: 10px 15px;
        font-size: 12px;
    }

    /* クイックアクセスを目立たせる */
    .player-quick-access {
        background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
        border: 2px solid #667eea;
        padding: 20px 15px;
    }

    .quick-access-title {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 15px;
        color: #667eea;
    }
}

/* スムーズスクロール */
html {
    scroll-behavior: smooth;
}

/* 固定プレイヤー名表示 */
.sticky-player-name {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    display: none;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s;
}

.sticky-player-name.active {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sticky-player-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sticky-player-text {
    font-size: 18px;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

/* モバイルでのみ表示 */
@media (min-width: 769px) {
    .sticky-player-name {
        display: none !important;
    }
}

/* モバイル時の調整 */
@media (max-width: 768px) {

    /* 固定ヘッダー分の余白を追加 */
    body.has-sticky-header {
        padding-top: 60px;
    }

    .player-card {
        scroll-margin-top: 80px;
        position: relative;
    }

    /* プレイヤーカードの名前部分を強調 */
    .player-card.in-view {
        border: 2px solid #667eea;
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }

    .player-card.in-view .player-name {
        animation: pulse 1s infinite;
    }

    @keyframes pulse {
        0% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.05);
        }

        100% {
            transform: scale(1);
        }
    }
}