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

body {
    font-family: 'Segoe UI', 'Hiragino Sans', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

h1 {
    text-align: center;
    color: #764ba2;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.week-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.week-btn {
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.week-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.week-btn.active {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    transform: scale(1.05);
}

.flashcard-container {
    display: none;
    text-align: center;
}

.flashcard-container.active {
    display: block;
    animation: fadeIn 0.5s;
}

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

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.flashcard {
    width: 100%;
    height: 300px;
    margin: 20px auto;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 20px;
}

.card-front {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.card-back {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    transform: rotateY(180deg);
}

.card-text {
    font-size: 3em;
    font-weight: bold;
    color: #333;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.card-hint {
    font-size: 1.5em;
    color: #666;
    margin-top: 10px;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.diff-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    min-height: 60px;
}

.diff-btn.repeat {
    background: linear-gradient(135deg, #f857a6 0%, #ff5858 100%);
}

.diff-btn.hard {
    background: linear-gradient(135deg, #ffa751 0%, #ffe259 100%);
}

.diff-btn.normal {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.diff-btn.easy {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.diff-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

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

.stat-box {
    padding: 15px;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

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

.control-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.ctrl-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 48px;
}

.ctrl-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    font-size: 14px;
    font-weight: bold;
    color: #764ba2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.hint-toggle {
    margin-top: 15px;
    padding: 8px 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd194 0%, #d1913c 100%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.hint-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.hint-toggle:focus {
    outline: none;
}

.hint-text {
    margin-top: 10px;
    font-size: 1.2em;
    color: #555;
    display: none;
}

.hint-text.visible {
    display: block;
}

.turn-tracker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 10px 0 20px;
    flex-wrap: wrap;
}

.turn-label {
    font-weight: bold;
    color: #764ba2;
}

.turn-indicators {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.turn-indicator {
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.turn-indicator.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    transform: scale(1.05);
}

.turn-indicator.player {
    min-width: 90px;
    height: auto;
    padding: 6px 12px;
    border-radius: 999px;
    gap: 8px;
    background: rgba(118, 75, 162, 0.12);
    color: #764ba2;
}

.turn-indicator.player .turn-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(118, 75, 162, 0.16);
    font-size: 18px;
}

.turn-indicator.player .turn-name {
    font-weight: bold;
    font-size: 14px;
}

.turn-indicator.player.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.turn-indicator.player.active .turn-avatar {
    background: rgba(255, 255, 255, 0.25);
}

.turn-count-select {
    padding: 6px 12px;
    border-radius: 999px;
    border: 2px solid #764ba2;
    background: white;
    font-weight: bold;
    color: #764ba2;
    cursor: pointer;
}

.player-scoreboard {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.player-scoreboard[data-empty="true"] {
    width: 100%;
    justify-content: center;
    background: rgba(118, 75, 162, 0.08);
    border-radius: 12px;
    padding: 12px 18px;
    color: #764ba2;
    font-weight: bold;
}

.scoreboard-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.9);
    border-left: 6px solid var(--player-color, #764ba2);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 180px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.scoreboard-card.active {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.scoreboard-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: rgba(118, 75, 162, 0.1);
}

.scoreboard-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scoreboard-name {
    font-weight: bold;
    color: #764ba2;
}

.scoreboard-stats {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: #555;
}

.scoreboard-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.scoreboard-stat.positive {
    color: #2f9a5d;
}

.scoreboard-stat.streak.hot {
    color: #ff7a59;
}

.empty-state {
    text-align: center;
    color: #888;
    padding: 16px 0;
}
.instruction {
    text-align: center;
    color: #666;
    margin: 10px 0;
    font-size: 18px;
}

.boxing-emoji {
    font-size: 2em;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.word-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.word-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.word-item.selected {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    transform: scale(1.05);
}

.word-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.word-label {
    cursor: pointer;
    font-weight: 500;
    flex: 1;
}

.category-header {
    grid-column: 1 / -1;
    font-weight: bold;
    color: #764ba2;
    padding: 10px;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
}

.mode-selector {
    animation: fadeIn 0.5s;
}

.custom-selector {
    animation: fadeIn 0.5s;
}

.edit-mode {
    animation: fadeIn 0.5s;
}

.edit-category {
    margin-bottom: 30px;
}

.edit-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    border-radius: 10px;
    margin-bottom: 15px;
}

.edit-category-title {
    font-weight: bold;
    font-size: 18px;
    color: #764ba2;
}

.edit-word-item {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.edit-input {
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.edit-input:focus {
    outline: none;
    border-color: #764ba2;
}

.delete-btn {
    padding: 8px 12px;
    background: linear-gradient(135deg, #f857a6 0%, #ff5858 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.3s;
}

.delete-btn:hover {
    transform: scale(1.1);
}

.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: none;
    animation: slideIn 0.5s;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.completion-message {
    display: none;
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.completion-message.show {
    display: block;
    animation: tada 1s;
}

@keyframes tada {
    0% { transform: scale(1); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0); }
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 18px;
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    position: relative;
}

.player-modal h3 {
    color: #764ba2;
    margin-bottom: 8px;
}

.modal-subtitle {
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: #764ba2;
}

.modal-close:hover {
    transform: scale(1.1);
}

.player-list-header {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.player-list {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.player-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: #f8f9ff;
    border: 2px solid rgba(118, 75, 162, 0.1);
}

.player-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(118, 75, 162, 0.12);
}

.player-name-input {
    font-size: 18px;
    font-weight: bold;
    border: none;
    background: transparent;
    color: #333;
    width: 100%;
}

.player-name-input:focus {
    outline: none;
    border-bottom: 2px solid #764ba2;
}

.player-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #555;
}

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

.player-actions label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.player-actions input[type="text"] {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
}

.player-actions input[type="color"] {
    width: 44px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.player-actions button {
    padding: 8px 10px;
    font-size: 13px;
}

.player-active-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.player-active-toggle input {
    width: 16px;
    height: 16px;
}

.player-form {
    background: #f8f9ff;
    border-radius: 14px;
    padding: 16px;
    border: 2px dashed rgba(118, 75, 162, 0.2);
}

.player-form h4 {
    color: #764ba2;
    margin-bottom: 12px;
}

.player-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.player-form-row label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.player-form-row input[type="text"] {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    font-size: 16px;
}

.player-form-row input[type="text"]:focus {
    border-color: #764ba2;
    outline: none;
}

.player-form-row input[type="color"] {
    width: 56px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.player-form .ctrl-btn {
    width: fit-content;
}

.session-summary {
    margin-top: 20px;
    text-align: left;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.15);
}

.session-summary table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.session-summary th,
.session-summary td {
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    text-align: left;
    color: #fff;
}

.session-summary tr:last-child td {
    border-bottom: none;
}
    
