/* Modern Design System Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --shadow-card: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
    --border-radius: 20px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Global Styles */
* {
    font-family: var(--font-family);
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* Container adjustments */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100vw;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    overflow-x: hidden;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

/* Navigation */
.modern-navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
}

/* Glass Card Components */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(50, 50, 93, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Gradient Buttons */
.gradient-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    color: white;
}

.gradient-btn-success {
    background: var(--success-gradient);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.gradient-btn-warning {
    background: var(--warning-gradient);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.4);
}

.gradient-btn-danger {
    background: var(--secondary-gradient);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

/* Modern Cards */
.modern-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(50, 50, 93, 0.2), 0 15px 30px rgba(0, 0, 0, 0.1);
}

.modern-card img {
    transition: all 0.3s ease;
}

.modern-card:hover img {
    transform: scale(1.05);
}

/* カードの高さ統一 */
.equal-height-cards {
    display: flex;
    align-items: stretch;
}

.equal-height-cards .modern-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.equal-height-cards .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Team Section */
.team-section {
    margin-bottom: 2rem;
}

.user-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.user-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(50, 50, 93, 0.2), 0 10px 20px rgba(0, 0, 0, 0.15);
}

.user-card.current-user {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.user-card.current-user::before {
    content: 'YOU';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
}

.user-avatar-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: block;
}

.user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: block;
    object-fit: cover;
}

.user-card:hover .user-avatar {
    transform: scale(1.1) rotate(5deg);
}

.role-badge-overlay {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    background: white;
    padding: 2px;
    transition: all 0.3s ease;
    z-index: 2;
}

.role-badge-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.user-card:hover .role-badge-overlay {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.default-role-badge {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
}

.susgame-flag {
    width: 20px;
    height: auto;
    object-fit: contain;
}

.user-name {
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.user-role {
    background: var(--warning-gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-block;
}

.country-flag {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

.team-stats {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.team-header {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.team-country-flag {
    width: 240px;
    height: 180px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    border: 4px solid rgba(255, 255, 255, 0.9);
    background: white;
    padding: 4px;
}

.team-country-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.25);
    padding: 1.5rem 2rem;
    border-radius: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 300px;
    margin: 0 auto;
}

.team-country-text {
    text-align: center;
}

.game-title-modern {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.stats-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-3px);
}

.modern-table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.modern-table th {
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-weight: 600;
}

.modern-table td {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem;
}

.floating-action {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.modern-input {
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    padding: 12px 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

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

/* モーダル背景ブラー */
.modern-modal .modal-backdrop,
.modal-backdrop.show {
    background-color: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(15px) !important;
}

/* モーダル本体 */
.modern-modal .modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

/* 閉じるボタン - ミニマルで洗練されたデザイン */
.modern-modal .btn-close {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    font-size: 12px;
    font-weight: 600;
    color: rgba(44, 62, 80, 0.8);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modern-modal .btn-close:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #dc3545;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* モーダルタイトル */
.modern-modal .modal-title {
    color: rgba(44, 62, 80, 0.9);
    font-weight: 700;
}

/* モーダルセクション */
.modern-modal .modal-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.modern-modal .modal-body {
    background: rgba(255, 255, 255, 0.05);
}

.modern-modal .modal-footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.zoom-button {
    background: var(--success-gradient);
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.zoom-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.6);
    color: white;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title-modern {
        font-size: 2rem;
    }
    
    .user-profile {
        padding: 1rem;
    }
    
    .team-header {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .team-country-flag {
        width: 60px;
        height: 45px;
    }
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
}

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

/* Trade Section */
.trade-section {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.trade-header {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trade-table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.trade-table th {
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.trade-table td {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem;
    vertical-align: middle;
}

.trade-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.trade-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--warning-gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--success-gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.trade-checkbox {
    transform: scale(1.5);
    accent-color: #667eea;
}

.section-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-subtitle {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: inline-block;
}

/* Additional classes for index.php inline styles */
.main-container {
    margin-top: 100px;
}

.header-flag {
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.team-count-badge {
    background: var(--success-gradient);
    font-size: 1rem;
}

.country-title {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.country-subtitle {
    font-size: 1rem;
}

.register-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.register-icon {
    font-size: 3rem;
    opacity: 0.7;
}

.welcome-text {
    text-align: center;
    font-size: 20px;
}

.card-img-modern {
    height: 200px;
    object-fit: cover;
}

.card-overlay-primary {
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
}

.card-overlay-success {
    background: linear-gradient(45deg, rgba(67, 233, 123, 0.8), rgba(56, 249, 215, 0.8));
}

.card-overlay-danger {
    background: linear-gradient(45deg, rgba(240, 147, 251, 0.8), rgba(245, 87, 108, 0.8));
}

.card-icon {
    font-size: 3rem;
}

.alert-success-modern {
    background: var(--success-gradient);
    color: white;
    border-radius: 15px;
}

.alert-warning-modern {
    border-radius: 15px;
}

.alert-error-modern {
    background: var(--secondary-gradient);
    color: white;
    border-radius: 15px;
}

.modal-warning-icon {
    font-size: 3rem;
}

.trade-country-flag {
    width: 20px;
    height: auto;
    margin-right: 8px;
    object-fit: contain;
}

.empty-state-icon {
    font-size: 2rem;
    opacity: 0.5;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    max-width: 100%;
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chart-container canvas {
    max-height: 350px;
    max-width: 100%;
}