/* 基本スタイル */
.shiritori-game-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.shiritori-game-container {
    font-family: 'Hiragino Sans', 'Yu Gothic Medium', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    height: 100vh;
    color: white;
    line-height: 1.6;
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* タイトル */
.shiritori-game-title {
    text-align: center;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: bold;
    margin: 5px 0;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* メインエリア */
.shiritori-game-main {
    display: flex;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 左パネル - 設定 */
.shiritori-settings-panel {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

.shiritori-panel {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.shiritori-panel.shiritori-player-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.shiritori-panel h3 {
    color: #4ecdc4;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ゲーム設定 */
.shiritori-setting-group {
    margin-bottom: 12px;
}

.shiritori-setting-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 13px;
}

.shiritori-setting-group input, .shiritori-setting-group select {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 13px;
}

.shiritori-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shiritori-radio-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shiritori-radio-item label {
    font-size: 12px;
    margin-bottom: 0;
}

.shiritori-radio-item input[type="radio"] {
    width: auto;
}

/* プレイヤー設定 */
.shiritori-player-count {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.shiritori-player-count input {
    width: 50px;
    text-align: center;
}

/* ボタン */
.shiritori-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shiritori-btn-primary {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.shiritori-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.5);
}

.shiritori-btn-secondary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.shiritori-btn-danger {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.shiritori-game-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.shiritori-game-controls .shiritori-btn {
    flex: 1;
    min-width: 80px;
}

/* プレイヤーリスト */
.shiritori-player-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

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

.shiritori-player-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.shiritori-player-list::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.6);
    border-radius: 3px;
}

.shiritori-player-list::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.8);
}

.shiritori-player-card {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.shiritori-player-card.active {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.25);
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.4);
}

.shiritori-player-card.eliminated {
    background: rgba(255, 107, 107, 0.25);
    border-color: #ff6b6b;
    opacity: 0.6;
}

.shiritori-player-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.shiritori-player-score {
    font-size: 18px;
    font-weight: 700;
    color: #4ecdc4;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.shiritori-player-info {
    font-size: 12px;
    color: #bbb;
}

/* 中央パネル - ゲーム状態 */
.shiritori-game-center {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.shiritori-game-status {
    text-align: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 15px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 380px;
}

.shiritori-limit-display {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 800;
    color: #4ecdc4;
    margin-bottom: 8px;
}

.shiritori-char-count {
    font-size: 1rem;
    color: #bbb;
}

.shiritori-timer-container {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 380px;
}

.shiritori-timer-label {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 8px;
    font-weight: 600;
}

.shiritori-timer {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    color: #4ecdc4;
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
    transition: all 0.3s ease;
}

.shiritori-timer.warning {
    color: #ffa726;
    animation: timerWarning 0.6s infinite alternate;
}

.shiritori-timer.danger {
    color: #ff6b6b;
    animation: timerDanger 0.3s infinite alternate;
}

@keyframes timerWarning {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

@keyframes timerDanger {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.shiritori-input-area {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 25px;
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.shiritori-input-field {
    width: 100%;
    padding: 15px 20px;
    font-size: 18px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-align: center;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.shiritori-input-field:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 25px rgba(78, 205, 196, 0.4);
}

.shiritori-input-field.error {
    border-color: #ff6b6b;
    box-shadow: 0 0 25px rgba(255, 107, 107, 0.4);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shiritori-input-field::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.shiritori-current-count {
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #bbb;
}

.shiritori-current-count.exact {
    color: #4ecdc4;
    font-weight: bold;
}

.shiritori-current-count.over {
    color: #ff6b6b;
    font-weight: bold;
}

/* 右パネル - 履歴 */
.shiritori-history-panel {
    flex: 1;
    min-width: 280px;
}

.shiritori-history-container {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px;
    height: 100%;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.shiritori-history-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    color: #4ecdc4;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.shiritori-history-list {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    padding-right: 8px;
}

.shiritori-history-list::-webkit-scrollbar {
    width: 8px;
}

.shiritori-history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.shiritori-history-list::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.6);
    border-radius: 4px;
}

.shiritori-history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.8);
}

.shiritori-history-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shiritori-history-item.exact {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.2);
}

.shiritori-history-item.zero {
    border-color: #ffa726;
    background: rgba(255, 167, 38, 0.2);
}

.shiritori-history-word {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shiritori-history-meta {
    font-size: 12px;
    color: #bbb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shiritori-score-badge {
    background: #4ecdc4;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.shiritori-score-badge.zero {
    background: #ffa726;
}

.shiritori-approval-checkbox {
    margin-left: 10px;
}

/* 採点フェーズ */
.shiritori-scoring-panel {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    border: 2px solid #ffa726;
    flex-shrink: 0;
}

.shiritori-scoring-summary {
    text-align: center;
    margin-bottom: 10px;
    color: #ffa726;
    font-weight: bold;
    font-size: 12px;
}

/* モーダル */
.shiritori-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
}

.shiritori-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 2% auto;
    padding: 30px;
    border-radius: 20px;
    width: min(500px, 90vw);
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    color: white;
    max-height: 90vh;
    overflow-y: auto;
}

.shiritori-modal-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.shiritori-winner-announcement {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    animation: gradientShift 3s ease-in-out infinite;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.shiritori-score-board {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
    backdrop-filter: blur(10px);
}

.shiritori-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin: 8px 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.shiritori-score-item.winner {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    box-shadow: 0 0 25px rgba(78, 205, 196, 0.6);
}

.shiritori-score-name {
    font-size: 18px;
    font-weight: 700;
}

.shiritori-score-points {
    font-size: 20px;
    font-weight: 800;
    color: #4ecdc4;
}

.shiritori-score-item.winner .shiritori-score-points {
    color: white;
}

/* レスポンシブ */
@media (max-width: 1024px) {
    .shiritori-game-main {
        flex-direction: column;
        gap: 8px;
    }
    
    .shiritori-settings-panel,
    .shiritori-history-panel {
        min-width: auto;
        flex: none;
        height: auto;
    }

    .shiritori-settings-panel {
        flex-direction: row;
        gap: 10px;
    }

    .shiritori-panel.shiritori-player-panel {
        flex: 1;
        min-height: 200px;
    }

    .shiritori-history-list {
        max-height: 180px;
    }

    .shiritori-player-list {
        max-height: 160px;
    }
}

@media (max-width: 768px) {
    .shiritori-game-container {
        padding: 5px;
    }

    .shiritori-player-list {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .shiritori-radio-group {
        gap: 8px;
    }

    .shiritori-radio-item label {
        font-size: 11px;
    }

    .shiritori-game-title {
        font-size: clamp(1rem, 3vw, 1.4rem);
        margin: 3px 0;
    }

    .shiritori-input-field {
        font-size: 14px;
        padding: 10px 14px;
    }

    .shiritori-modal-content {
        padding: 20px;
        margin: 5% auto;
    }

    .shiritori-modal-title {
        font-size: 1.5rem;
    }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    .shiritori-game-container *, .shiritori-game-container *::before, .shiritori-game-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.shiritori-game-container button:focus, 
.shiritori-game-container input:focus, 
.shiritori-game-container select:focus {
    outline: 2px solid #4ecdc4;
    outline-offset: 2px;
}