* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'M PLUS 1p', 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', Meiryo, メイリオ, Osaka, 'MS PGothic', arial, helvetica, sans-serif !important;
}

body {
    font-family: 'M PLUS 1p', 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', Meiryo, メイリオ, Osaka, 'MS PGothic', arial, helvetica, sans-serif !important;
    background: linear-gradient(135deg, #f5f0e8 0%, #faf7f2 50%, #f0e6d6 100%);
    min-height: 100vh;
    padding: 20px 20px 80px 20px;
    position: relative;
    overflow-x: hidden;
    animation: fadeIn 1s ease-in;
}

.dashboard-btn {
    background: #2c1810;
    color: #f5f0e8;
    border: 2px solid #dc143c;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.9rem;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.dashboard-btn:hover {
    background: #dc143c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(220, 38, 127, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 0 0 1px rgba(220, 20, 60, 0.1);
    border: 2px solid #dc143c;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.8s ease-out;
    backdrop-filter: blur(10px);
}

.user-info {
    background: linear-gradient(135deg, #2c1810, #1a0f0a);
    color: #f5f0e8;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #dc143c;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
}

.logout-btn {
    background: linear-gradient(135deg, #dc143c, #b91c3c) !important;
    color: #f5f0e8 !important;
    border: 1px solid #2c1810 !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    border-radius: 5px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
    font-weight: 400;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #b91c3c, #dc143c) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4) !important;
}

#welcomeUser {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #dc143c 0%, #ff6b6b 50%, #dc143c 100%);
}

h1 {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
    color: #f5f0e8;
    text-align: center;
    padding: 40px;
    margin-bottom: 0;
    font-weight: 400;
    letter-spacing: 2px;
    position: relative;
    font-size: 28px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
}

h1::after {
    content: '桜';
    position: absolute;
    right: 30px;
    top: 30%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #dc143c;
    opacity: 0.7;
}

.subtitle {
    font-size: 16px;
    font-weight: 300;
    opacity: 0.8;
    letter-spacing: 1px;
    margin-top: 8px;
    display: block;
}

.section {
    padding: 30px;
    border-bottom: 1px solid #eee;
    animation: sectionFade 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }

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

.section:last-child {
    border-bottom: none;
}

h2 {
    color: #2c1810;
    margin-bottom: 20px;
    border-left: 4px solid #dc143c;
    padding-left: 15px;
    font-weight: 500;
    position: relative;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
}

h2::before {
    content: '◆';
    color: #dc143c;
    margin-right: 8px;
    font-size: 12px;
}

.add-student {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

select, input, button {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
    transition: all 0.3s ease;
}

select:focus, input:focus {
    outline: none;
    border-color: #dc143c;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

select {
    min-width: 120px;
}

input[type="text"] {
    flex: 1;
    min-width: 200px;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.2);
    border-color: #dc143c;
}

input[type="number"] {
    width: 80px;
}

button {
    background: linear-gradient(135deg, #dc143c, #b91c3c);
    color: #f5f0e8;
    border: 2px solid #2c1810;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

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

button:active::after {
    width: 300px;
    height: 300px;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.5);
    background: linear-gradient(135deg, #b91c3c, #dc143c);
}

button:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s;
}

.branch-group {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #faf7f2, #f5f0e8);
    border-radius: 0;
    border: 2px solid #dc143c;
    border-left: 6px solid #2c1810;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.branch-group::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #dc143c;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.branch-title {
    font-weight: 500;
    color: #2c1810;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
}

.student-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.student-tag {
    background: linear-gradient(135deg, #2c1810, #1a0f0a);
    color: #f5f0e8;
    padding: 8px 16px;
    border-radius: 0;
    font-size: 13px;
    position: relative;
    box-shadow: 0 2px 8px rgba(44, 24, 16, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #dc143c;
    font-weight: 400;
    animation: tagSlideIn 0.4s ease-out;
    transform: translateX(0);
}

.student-tag.captain {
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    color: #333;
    font-weight: bold;
    animation: sparkle 2s infinite;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    border: 2px solid #ffd700;
}

@keyframes sparkle {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.3); }
}

@keyframes tagSlideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.student-tag::before {
    content: '●';
    color: #dc143c;
    margin-right: 6px;
    font-size: 8px;
}

.student-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(44, 24, 16, 0.5);
    background: linear-gradient(135deg, #1a0f0a, #2c1810);
    border-color: #ff6b6b;
}

.remove-btn {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
}

.team-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.team {
    background: linear-gradient(135deg, #faf7f2, #f5f0e8);
    border: 2px solid #dc143c;
    border-radius: 0;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    position: relative;
    animation: teamAppear 0.6s ease-out;
    transition: all 0.3s ease;
}

@keyframes teamAppear {
    from { 
        transform: scale(0.9) translateY(20px); 
        opacity: 0; 
    }
    to { 
        transform: scale(1) translateY(0); 
        opacity: 1; 
    }
}

.team:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.team::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 6px;
    background: linear-gradient(90deg, #dc143c, #2c1810, #dc143c);
}

.team-header {
    background: linear-gradient(135deg, #2c1810, #1a0f0a);
    color: #f5f0e8;
    padding: 15px 20px;
    margin: -25px -25px 20px -25px;
    border-radius: 0;
    font-weight: 500;
    letter-spacing: 1px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.captain-name {
    font-size: 14px;
    color: #ffd700;
    font-weight: normal;
}

.team-header::after {
    content: '組';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc143c;
    font-size: 18px;
}

.team-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.member {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 0;
    border-left: 4px solid #dc143c;
    border-bottom: 1px solid #2c1810;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: memberSlide 0.5s ease-out;
}

.member.male {
    border-left: 4px solid #4a90e2;
    background: linear-gradient(135deg, #e6f3ff, #ffffff);
    animation: maleGlow 3s infinite;
    position: relative;
}

.member.female {
    border-left: 4px solid #ff69b4;
    background: linear-gradient(135deg, #ffe6f3, #ffffff);
    animation: femaleGlow 3s infinite;
    position: relative;
}

.member.captain {
    border-left: 4px solid #ffd700 !important;
    background: linear-gradient(135deg, #fff9e6, #ffffff) !important;
    animation: captainGlow 3s infinite !important;
    position: relative;
}

.member.captain::after {
    content: '👑';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 16px;
}

@keyframes captainGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.6), 0 0 25px rgba(255, 215, 0, 0.2); }
}

@keyframes maleGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(74, 144, 226, 0.3); }
    50% { box-shadow: 0 0 15px rgba(74, 144, 226, 0.6), 0 0 25px rgba(74, 144, 226, 0.2); }
}

@keyframes femaleGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 105, 180, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 105, 180, 0.6), 0 0 25px rgba(255, 105, 180, 0.2); }
}

@keyframes memberSlide {
    from { 
        transform: translateX(-30px); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

.member::before {
    content: '◉';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc143c;
    font-size: 8px;
    background: #f5f0e8;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member:hover {
    transform: translateY(-2px) translateX(5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background: rgba(250, 247, 242, 0.95);
    border-left-width: 6px;
}

.member-name {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.member-id {
    font-size: 12px;
    color: #dc143c;
    font-weight: 500;
    margin: 2px 0;
}

.member-branch {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.bulk-import {
    margin-top: 20px;
    padding: 20px;
    border: 2px solid #dc143c;
    background: linear-gradient(135deg, #faf7f2, #f5f0e8);
    display: none;
    animation: expandDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
}

#captainImportSection {
    background: linear-gradient(135deg, #fff9e6, #f8f9fa);
    border: 2px solid #ffd700;
}

#bulkCaptains {
    width: 100%;
    min-height: 120px;
    margin: 10px 0;
    padding: 12px;
    border: 2px solid #ffd700;
    border-radius: 8px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
    resize: vertical;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

#bulkCaptains:focus {
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

.captain-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #dc143c, #b91c3c);
    padding: 12px;
    border: 2px solid #2c1810;
    border-radius: 8px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
}

.captain-checkbox:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.5);
    background: linear-gradient(135deg, #b91c3c, #dc143c);
}

.captain-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ffd700;
    cursor: pointer;
}

@keyframes expandDown {
    from { 
        transform: scaleY(0) translateY(-20px); 
        opacity: 0; 
    }
    to { 
        transform: scaleY(1) translateY(0); 
        opacity: 1; 
    }
}



.bulk-import h3 {
    color: #667eea;
    margin-bottom: 15px;
}

#bulkStudents {
    width: 100%;
    min-height: 120px;
    margin: 10px 0;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
    resize: vertical;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

#bulkStudents:focus {
    border-color: #dc143c;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
    background: rgba(255, 255, 255, 1);
}

.bulk-options {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.format-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    font-style: italic;
}

.bulk-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
}

.remaining-students {
    background: linear-gradient(135deg, #fff8e1, #fffbf0);
    border: 2px solid #ff6b6b;
    border-radius: 0;
    padding: 25px;
    margin-top: 25px;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.2);
    position: relative;
}

.remaining-students::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 6px;
    background: linear-gradient(90deg, #ff6b6b, #dc143c, #ff6b6b);
}

.remaining-header {
    background: linear-gradient(135deg, #ff6b6b, #dc143c);
    color: #f5f0e8;
    padding: 15px 20px;
    margin: -25px -25px 20px -25px;
    border-radius: 0;
    font-weight: 500;
    letter-spacing: 1px;
    position: relative;
}

.remaining-header::after {
    content: '待';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #f5f0e8;
    font-size: 18px;
}

.remaining-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.remaining-member {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 0;
    border-left: 4px solid #ff6b6b;
    border-bottom: 1px solid #dc143c;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    position: relative;
}

.remaining-member::before {
    content: '◉';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff6b6b;
    font-size: 8px;
    background: #fff8e1;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remaining-member:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: rgba(255, 248, 225, 0.95);
}

@media (max-width: 768px) {
    .add-student {
        flex-direction: column;
    }
    
    .team-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-options {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Sakura Petals Animation */
.sakura-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.sakura {
    position: absolute;
    font-size: 20px;
    color: #ffb3d9;
    opacity: 0.7;
    animation: fall linear infinite;
}

.sakura:nth-child(1) {
    left: 10%;
    animation-duration: 8s;
    animation-delay: 0s;
}

.sakura:nth-child(2) {
    left: 20%;
    animation-duration: 12s;
    animation-delay: 2s;
}

.sakura:nth-child(3) {
    left: 30%;
    animation-duration: 10s;
    animation-delay: 4s;
}

.sakura:nth-child(4) {
    left: 40%;
    animation-duration: 14s;
    animation-delay: 1s;
}

.sakura:nth-child(5) {
    left: 50%;
    animation-duration: 9s;
    animation-delay: 3s;
}

.sakura:nth-child(6) {
    left: 60%;
    animation-duration: 11s;
    animation-delay: 5s;
}

.sakura:nth-child(7) {
    left: 70%;
    animation-duration: 13s;
    animation-delay: 0.5s;
}

.sakura:nth-child(8) {
    left: 80%;
    animation-duration: 15s;
    animation-delay: 2.5s;
}

.sakura:nth-child(9) {
    left: 90%;
    animation-duration: 7s;
    animation-delay: 1.5s;
}

.sakura:nth-child(10) {
    left: 15%;
    animation-duration: 16s;
    animation-delay: 4.5s;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced Sakura Animation */
.sakura {
    animation: fall linear infinite, sway 3s ease-in-out infinite;
}

@keyframes sway {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(10px) rotate(5deg); }
    75% { transform: translateX(-10px) rotate(-5deg); }
}

/* Pulse Animation for Important Elements */
.copy-all-btn, .clear-all-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 20, 60, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 20, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 20, 60, 0); }
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Copy Button Styles */
.copy-btn {
    background: linear-gradient(135deg, #2c1810, #1a0f0a) !important;
    color: #f5f0e8 !important;
    border: 1px solid #dc143c !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    margin-left: 10px;
    font-weight: 400 !important;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #1a0f0a, #2c1810) !important;
    transform: translateY(-1px) !important;
}

.copy-all-btn {
    background: linear-gradient(135deg, #dc143c, #b91c3c) !important;
    margin-bottom: 20px;
    padding: 10px 20px !important;
}

.share-link-btn {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: #f5f0e8 !important;
    border: 2px solid #2c1810 !important;
    margin-bottom: 20px;
    padding: 10px 20px !important;
    margin-left: 10px;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-link-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4) !important;
}

.teams-header {
    text-align: right;
    margin-bottom: 10px;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.delete-btn {
    background: linear-gradient(135deg, #dc143c, #b91c3c) !important;
    color: #f5f0e8 !important;
    border: 1px solid #2c1810 !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #b91c3c, #dc143c) !important;
    transform: translateY(-1px) !important;
}

.clear-all-btn {
    background: linear-gradient(135deg, #ff6b6b, #dc143c) !important;
    margin-bottom: 20px;
    padding: 10px 20px !important;
    margin-left: 10px;
}

.clear-all-btn:hover {
    background: linear-gradient(135deg, #dc143c, #ff6b6b) !important;
}

.student-search {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f8ff, #e6f3ff);
    border: 2px solid #667eea;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#searchInput {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #667eea;
    border-radius: 5px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
}

#searchResult {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    border-left: 4px solid #667eea;
    display: none;
}

.search-highlight {
    background: rgba(255, 255, 0, 0.3);
    animation: highlight 2s ease-out;
}

@keyframes highlight {
    0% { background: rgba(255, 255, 0, 0.6); }
    100% { background: rgba(255, 255, 0, 0.1); }
}

.search-result-item {
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    border-left: 4px solid #28a745;
    margin-bottom: 5px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
}

.captain-badge {
    margin-left: 8px;
    font-size: 14px;
}

#shuffleBtn {
    background: linear-gradient(135deg, #2c1810, #1a0f0a) !important;
    border: 2px solid #dc143c !important;
    margin-left: 10px;
}

#shuffleBtn:hover {
    background: linear-gradient(135deg, #1a0f0a, #2c1810) !important;
}

.member {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #dc143c;
    cursor: pointer;
    transition: all 0.2s ease;
}

.member-content {
    flex: 1;
}

.select-btn {
    background: linear-gradient(135deg, #2c1810, #1a0f0a) !important;
    border: 1px solid #dc143c !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    margin-right: 5px;
}

.select-btn.active {
    background: linear-gradient(135deg, #dc143c, #b91c3c) !important;
}

.remove-selected {
    margin-top: 15px;
    padding: 10px;
    background: rgba(220, 20, 60, 0.1);
    border-radius: 5px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.remove-btn {
    background: linear-gradient(135deg, #dc143c, #b91c3c) !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
}

.remove-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.cancel-selection-btn {
    background: linear-gradient(135deg, #666, #555) !important;
    border: 1px solid #2c1810 !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
}

.remaining-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remaining-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.create-team-btn {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: #f5f0e8 !important;
    border: 2px solid #2c1810 !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

.create-team-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4) !important;
}

/* Removed Students Styles */
.removed-students {
    background: linear-gradient(135deg, #ffe6e6, #fff0f0);
    border: 2px solid #ff6b6b;
    border-radius: 0;
    padding: 25px;
    margin-top: 25px;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.2);
    position: relative;
    animation: teamAppear 0.6s ease-out;
}

.removed-students::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 6px;
    background: linear-gradient(90deg, #ff6b6b, #dc143c, #ff6b6b);
}

.removed-header {
    background: linear-gradient(135deg, #ff6b6b, #dc143c);
    color: #f5f0e8;
    padding: 15px 20px;
    margin: -25px -25px 20px -25px;
    border-radius: 0;
    font-weight: 500;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.removed-header::after {
    content: '🗑️';
    font-size: 18px;
}

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

.return-btn {
    background: linear-gradient(135deg, #2c1810, #1a0f0a) !important;
    color: #f5f0e8 !important;
    border: 1px solid #ff6b6b !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
}

.return-btn:hover {
    background: linear-gradient(135deg, #1a0f0a, #2c1810) !important;
    transform: translateY(-1px) !important;
}

.removed-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.removed-member {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 0;
    border-left: 4px solid #ff6b6b;
    border-bottom: 1px solid #dc143c;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: memberSlide 0.5s ease-out;
}

.removed-member::before {
    content: '◉';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff6b6b;
    font-size: 8px;
    background: #ffe6e6;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.removed-member:hover {
    transform: translateY(-2px) translateX(5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background: rgba(255, 230, 230, 0.95);
    border-left-width: 6px;
}

/* Add Student to Team Styles */
.add-student-btn {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    border: 1px solid #2c1810 !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    margin-right: 5px;
}

.add-student-btn.active {
    background: linear-gradient(135deg, #20c997, #28a745) !important;
}

.add-student-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 5px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.add-student-select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #28a745;
    border-radius: 5px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
    background: white;
}

.add-to-team-btn {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
    border: 1px solid #2c1810 !important;
}

.cancel-add-btn {
    background: linear-gradient(135deg, #666, #555) !important;
    border: 1px solid #2c1810 !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
}

@media (max-width: 768px) {
    .add-student-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .add-student-select {
        min-width: auto;
    }
}

/* Watermark */
.watermark {
    position: fixed;
    bottom: 15px;
    right: 15px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif;
    font-size: 11px;
    color: rgba(44, 24, 16, 0.5);
    font-weight: 400;
    letter-spacing: 0.5px;
    z-index: 500;
    pointer-events: none;
    text-transform: uppercase;
    text-align: right;
    line-height: 1.3;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 10px;
    border-radius: 3px;
    border: 1px solid rgba(44, 24, 16, 0.1);
    backdrop-filter: blur(3px);
    animation: watermarkFade 5s ease-in-out infinite alternate;
}

.watermark-jp {
    font-size: 10px;
    font-weight: 300;
    text-transform: none;
    opacity: 0.8;
}

@keyframes watermarkFade {
    0% { opacity: 0.6; }
    100% { opacity: 0.9; }
}

/* Share Teams Section */
.share-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.share-btn, .qr-btn {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: #f5f0e8 !important;
    border: 2px solid #2c1810 !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.share-btn:hover, .qr-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4) !important;
}

#qrCodeDisplay {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #faf7f2, #f5f0e8);
    border: 2px solid #28a745;
    border-radius: 12px;
    margin-top: 20px;
}

#qrCodeDisplay h3 {
    color: #2c1810;
    margin-bottom: 15px;
    font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif;
}

#qrCodeDisplay p {
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

#qrcode {
    display: inline-block;
    margin: 10px 0;
    border: 3px solid #2c1810;
    border-radius: 8px;
    overflow: hidden;
}

/* Event Management Styles */
.event-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#eventSelect {
    min-width: 200px;
    background: linear-gradient(135deg, #f5f0e8, #faf7f2);
    border: 2px solid #dc143c;
    color: #2c1810;
    font-weight: 500;
}

/* Data Management Styles */
.data-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.data-controls button {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #f5f0e8 !important;
    border: 2px solid #2c1810 !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-controls button:hover {
    background: linear-gradient(135deg, #764ba2, #667eea) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

/* Statistics Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #faf7f2, #f5f0e8);
    position: relative;
    padding: 30px;
    border: 3px solid #dc143c;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    margin: 20px;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.close {
    color: #dc143c;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
    transition: all 0.3s ease;
}

.close:hover {
    color: #2c1810;
    transform: scale(1.2);
}

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

.stat-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 2px solid #dc143c;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #dc143c, #2c1810, #dc143c);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    color: #2c1810;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    padding: 0;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #dc143c;
    margin-bottom: 5px;
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Branch Statistics */
.branch-stats {
    margin-bottom: 30px;
}

.branch-stats h3 {
    color: #2c1810;
    margin-bottom: 20px;
    border-left: 4px solid #dc143c;
    padding-left: 15px;
}

.branch-chart {
    background: white;
    border: 2px solid #dc143c;
    border-radius: 8px;
    padding: 20px;
}

.branch-bar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.branch-name {
    min-width: 100px;
    font-weight: 500;
    color: #2c1810;
    text-transform: uppercase;
    font-size: 12px;
}

.bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar {
    height: 20px;
    background: linear-gradient(135deg, #dc143c, #ff6b6b);
    border-radius: 10px;
    transition: all 0.8s ease;
    animation: barGrow 1.5s ease-out;
    box-shadow: 0 2px 8px rgba(220, 20, 60, 0.3);
}

@keyframes barGrow {
    from { width: 0 !important; }
}

.bar-count {
    font-weight: bold;
    color: #2c1810;
    min-width: 30px;
}

/* Gender Statistics */
.gender-stats {
    text-align: center;
}

.gender-stats h3 {
    color: #2c1810;
    margin-bottom: 20px;
    border-left: 4px solid #dc143c;
    padding-left: 15px;
    text-align: left;
}

.gender-pie {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.pie-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(
        #4a90e2 0deg calc(var(--male-percentage, 50) * 3.6deg),
        #ff69b4 calc(var(--male-percentage, 50) * 3.6deg) 360deg
    );
    border: 4px solid #2c1810;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    animation: pieRotate 2s ease-out;
}

@keyframes pieRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #2c1810;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #2c1810;
}

.legend-color.male {
    background: #4a90e2;
}

.legend-color.female {
    background: #ff69b4;
}

@media (max-width: 768px) {
    .event-controls,
    .data-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .gender-pie {
        flex-direction: column;
        gap: 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

