/* ブラックジャック - リアルタイム対戦 スタイルシート */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f4c3a 0%, #1a5d4a 50%, #2d8a5f 100%);
    min-height: 100vh;
    color: white;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: #333;
    max-width: 500px;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(10px);
}

.game-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: #333;
    width: 100%;
    max-width: 1200px;
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #0f4c3a;
}

h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #0f4c3a;
}

h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #1a5d4a;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0f4c3a;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #2d8a5f;
    box-shadow: 0 0 0 3px rgba(45, 138, 95, 0.1);
}

.btn {
    background: linear-gradient(135deg, #2d8a5f, #1a5d4a);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(45, 138, 95, 0.3);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.btn-blue:hover {
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.3);
}

.btn-red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.btn-red:hover {
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.hidden {
    display: none !important;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.success-message {
    background: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.game-code {
    background: #f8f9fa;
    border: 2px dashed #2d8a5f;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #0f4c3a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.copy-btn {
    background: #2d8a5f;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.players-list {
    text-align: left;
    margin: 30px 0;
}

.player-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-item.host {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #f39c12;
}

.player-item.you {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border: 2px solid #17a2b8;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #27ae60;
    animation: pulse 2s infinite;
}

.status-indicator.disconnected {
    background: #e74c3c;
    animation: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.dealer-area {
    background: #2c3e50;
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.players-area {
    margin-bottom: 30px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.player-game-card {
    background: white;
    border: 2px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s;
}

.player-game-card.current-player {
    border-color: #f39c12;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.3);
    transform: scale(1.02);
}

.player-game-card.you {
    border-color: #17a2b8;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    min-height: 120px;
    align-items: center;
}

.card-item {
    width: 60px;
    height: 84px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.card-item.red {
    color: #e74c3c;
}

.card-item.black {
    color: #2c3e50;
}

.card-item.face-down {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

.card-rank {
    font-size: 16px;
    margin-bottom: 5px;
}

.card-suit {
    font-size: 18px;
}

.score {
    font-size: 18px;
    font-weight: bold;
    margin-top: 15px;
}

.actions {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
}

.waiting-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.result-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 10px;
}

.result-win {
    background: #27ae60;
    color: white;
}

.result-lose {
    background: #e74c3c;
    color: white;
}

.result-push {
    background: #f39c12;
    color: white;
}

.result-blackjack {
    background: #8e44ad;
    color: white;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card, .game-area {
        padding: 20px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .players-grid {
        grid-template-columns: 1fr;
    }
    
    .cards-container {
        gap: 5px;
    }
    
    .card-item {
        width: 50px;
        height: 70px;
        font-size: 12px;
    }
}