/* Google Fontsのインポート */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

/* quiz-app用CSS（ライトブルーテーマ） */
/* データベース接続警告 */
/* システムメッセージ共通スタイル */
.system-messages {
    width: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 10px;
}

.system-message {
    width: 100%;
    padding: 14px 22px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 14px;
    /* スライドダウンアニメーション削除 - 最小限のUI */
    margin: 0;
    border-left: 4px solid currentColor;
    backdrop-filter: blur(8px);
}

.system-message .message-content {
    flex: 1;
}

.system-message .message-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 4px;
    margin: -4px;
    transition: opacity 0.2s;
}

.system-message .message-close:hover {
    opacity: 1;
}

.db-warning-content {
    flex: 1;
}

.db-warning-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.db-warning-help {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.db-warning-help ol {
    margin: 4px 0 0 20px;
    padding: 0;
}

.db-warning-help li {
    margin: 4px 0;
}

.system-message.error {
    background-color: #f44336;
    color: white;
}

.system-message.info {
    background-color: #2196F3;
    color: white;
}

.system-message.success {
    background-color: #4CAF50;
    color: white;
}

.system-message.warning {
    background-color: #ff9800;
    color: white;
}

/* slideDownアニメーション削除 - 最小限のUI */

.db-warning i {
    margin-right: 12px;
    font-size: 24px;
    vertical-align: top;
}

.db-warning-content {
    display: inline-block;
}

.db-warning-title {
    font-size: 18px;
    margin-bottom: 5px;
}

.db-warning-message {
    font-weight: normal;
    margin-bottom: 10px;
}

.db-warning-help {
    font-size: 14px;
    font-weight: normal;
    background: rgba(0,0,0,0.1);
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 5px;
}

.db-warning-help ol {
    margin: 5px 0 0 20px;
    padding: 0;
}

.db-warning-help li {
    margin: 5px 0;
}

/* フッター */
.footer {
    width: 100%;
    padding: 20px 10px;
    background-color: var(--bg-secondary);
    text-align: center;
    font-size: 0.9em;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-content {
    opacity: 0.8;
}

/* コンテナーに最小高さを設定してフッターを下部に配置 */
.container,
.admin-container {
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* 共通スタイル */
:root {
    /* Primary Colors - より鮮やかで現代的なブルー */
    --primary-color: #0EA5E9;
    --primary-dark: #0284C7;
    --primary-light: #38BDF8;
    --primary-lighter: #7DD3FC;
    
    /* Accent Colors */
    --accent-color: #06B6D4;
    --accent-dark: #0891B2;
    
    /* Status Colors */
    --success-color: #10B981;
    --success-light: #34D399;
    --warning-color: #F59E0B;
    --warning-light: #FBBF24;
    --danger-color: #EF4444;
    --danger-light: #F87171;
    --info-color: #3B82F6;
    
    /* Background Colors - より深みのあるダーク */
    --dark-bg: #0A0E14;
    --card-bg: #0F1419;
    --card-hover: #161B22;
    --card-elevated: #1A1F26;
    
    /* Text Colors - アクセシビリティ改善 */
    --text-primary: #FFFFFF;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    --text-accent: #60A5FA;
    
    /* Border Colors */
    --border-color: #1E293B;
    --border-accent: #0EA5E9;
    --border-hover: #38BDF8;
    
    /* Gradients */
    --gradient-bg: linear-gradient(135deg, #0A0E14 0%, #0F1419 50%, #161B22 100%);
    --gradient-primary: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    --gradient-danger: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    --gradient-card: linear-gradient(135deg, #0F1419 0%, #161B22 100%);
    --gradient-glass: linear-gradient(135deg, rgba(15, 20, 25, 0.8) 0%, rgba(22, 27, 34, 0.8) 100%);
    
    /* Shadows - より立体的な影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px rgba(14, 165, 233, 0.12);
    --shadow-md: 0 6px 20px rgba(14, 165, 233, 0.15);
    --shadow-lg: 0 10px 30px rgba(14, 165, 233, 0.2);
    --shadow-xl: 0 20px 40px rgba(14, 165, 233, 0.25);
    --shadow-hover: 0 12px 35px rgba(14, 165, 233, 0.3);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    
    /* Glow Effects */
    --glow: 0 0 20px rgba(14, 165, 233, 0.4);
    --glow-strong: 0 0 30px rgba(14, 165, 233, 0.6);
    
    /* Backdrop Blur */
    --blur: blur(12px);
    --blur-strong: blur(20px);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Transitions - 最小限に短縮 */
    --transition-fast: 100ms ease;
    --transition-base: 150ms ease;
    --transition-slow: 200ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    padding-top: 56px; /* 追加: ステータスインジケーター分のパディング */
    overflow-x: hidden; /* アニメーション時の横スクロールバー防止 */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 1.2em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2rem;
    color: var(--text-primary);
}

h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

h4 {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

p {
    margin-bottom: 1em;
    color: var(--text-secondary);
}

strong {
    font-weight: 600;
    color: var(--text-primary);
}


/* 管理者画面用モダンスタイル */
.admin-body {
    padding: 12px;
    min-height: 100vh;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 2px solid var(--border-accent);
    position: relative;
}

.admin-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 4px rgba(79, 195, 247, 0.3);
}

.admin-header h1 i {
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px rgba(79, 195, 247, 0.5));
    font-size: 1.4rem;
}

.state-indicator {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: 12px 24px;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.4), 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 200px;
    text-align: center;
    opacity: 1 !important;
    z-index: 1000;
    white-space: nowrap;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 0;
    margin-bottom: 0;
    pointer-events: none;
}

.control-panel {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Input & Textarea Styles */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 14px 18px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-base);
    outline: none;
    box-shadow: var(--shadow-inner);
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
textarea:hover,
select:hover {
    border-color: var(--border-hover);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), var(--shadow-inner);
    background: var(--card-elevated);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* テキストエリアコンテナ */
.textarea-container {
    position: relative;
    width: 100%;
}

/* 文字数表示の改善 */
.char-limit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    margin-bottom: 6px;
    padding: 0 4px;
}

.char-counter {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.char-counter.warning {
    color: var(--warning-color);
    font-weight: 600;
}

.char-counter.danger {
    color: #ff9800;
    font-weight: 600;
}

.char-counter.error {
    color: var(--danger-color);
    font-weight: 600;
}

.char-status {
    font-size: 14px;
    transition: all 0.2s ease;
}

.char-status.warning {
    color: var(--warning-color);
}

.char-status.danger {
    color: #ff9800;
}

.char-status.error {
    color: var(--danger-color);
    /* パルスアニメーション削除 - 最小限のUI */
}

/* 入力フィールドコンテナ */
.input-container {
    position: relative;
    width: 100%;
}

.input-feedback {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding: 0 4px;
}

.input-status {
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-status.success {
    color: var(--success-color);
}

.input-status.info {
    color: var(--info-color);
}

.input-status.warning {
    color: var(--warning-color);
}

.input-status.error {
    color: var(--danger-color);
    /* パルスアニメーション削除 */
}

/* 送信ボタンの改善 */
.btn-submit {
    position: relative;
    overflow: hidden;
}

.btn-text,
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-loading {
    display: none;
}

/* 送信ボタンの無効化見た目補助 */
.btn.btn-disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(20%);
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    appearance: none;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px; /* ガイドライン準拠: 角丸8px */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease; /* ガイドライン準拠: 0.3s */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    min-width: 140px;
    min-height: 44px; /* ガイドライン準拠: タップターゲット */
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
    font-family: inherit;
    text-decoration: none;
    backdrop-filter: blur(8px); /* ガイドライン準拠: ガラス効果 */
}

/* 波紋エフェクト削除 - 最小限のUI */

.btn:hover {
    /* 浮上効果を削除 - 最小限のフィードバックのみ */
    box-shadow: var(--shadow-lg);
}

.btn:active {
    /* アクティブ効果を削除 */
    box-shadow: var(--shadow);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn i {
    font-size: 16px;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    border-color: var(--success-light);
}

.btn-warning {
    background: var(--gradient-warning);
    color: white;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
    border-color: var(--warning-light);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
    border-color: var(--danger-light);
}

.btn-secondary {
    background: var(--gradient-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--border-accent);
    background: linear-gradient(135deg, #161B22 0%, #1A1F26 100%);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563EB 100%);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-orange {
    background: linear-gradient(135deg, #FF8C00 0%, #FF7F00 100%);
    color: white;
    border: 1px solid rgba(255, 140, 0, 0.3);
}

.btn-orange:hover {
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.3);
}

/* ボタン状態変化のアニメーション - 削除（最小限のUI） */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}

/* content-grid内のOBSパネルを全幅で上段に表示 */
.content-grid .obs-panel {
    grid-column: 1 / -1;
    height: auto;
    min-height: auto;
}

.panel {
    background: var(--gradient-glass);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: var(--blur);
    transition: all var(--transition-slow);
    position: relative;
    display: flex;
    flex-direction: column;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.panel:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-accent);
}

.panel:hover::before {
    opacity: 1;
}

.panel-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.panel-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.panel-header:hover::before {
    left: 100%;
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
}

.panel-header h3 i {
    font-size: 1rem;
    opacity: 0.95;
}

.panel-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

input:checked+.slider {
    background: rgba(255, 255, 255, 0.9);
    border-color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

input:checked+.slider:before {
    transform: translateX(30px);
    background: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 172, 193, 0.5);
}

.toggle-switch .label {
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sort-select {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.sort-select:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.sort-select option {
    background: var(--card-bg);
    color: var(--text-primary);
    font-weight: 500;
}

/* 一斉判定ボタンコントロール */
.batch-grade-controls {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.05) 0%, rgba(0, 172, 193, 0.05) 100%);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.batch-grade-controls .btn {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 120px;
    max-width: 220px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.batch-grade-controls .btn i {
    font-size: 13px;
}

.batch-grade-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.list-container {
    padding: 16px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--card-bg);
}

/* PC版では基本スタイルを維持 */
@media (min-width: 481px) {
    .list-container {
        padding: 16px;
        min-height: auto;
        margin: 0;
    }
    
    .list-container::-webkit-scrollbar {
        width: 8px;
    }
    
    .list-container::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 4px;
    }
    
    .list-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .panel {
        height: auto;
        min-height: auto;
    }
}

.list-container::-webkit-scrollbar {
    width: 8px;
}

.list-container::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 4px;
}

.list-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.list-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.list-item {
    background: var(--gradient-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 10px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--blur);
}

.list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
    opacity: 0;
    transition: all var(--transition-base);
}

.list-item:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
    transform: translateX(6px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
}

.list-item:hover::before {
    opacity: 1;
    width: 4px;
}

/* グループヘッダーと切断ユーザー用スタイル */
.group-header {
    font-size: 1.1rem;
    margin: 10px 0;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-accent);
}

.list-item.disconnected {
    opacity: 0.6;
}

/* OBSパネル用スタイル */
.obs-panel .panel-body {
    padding: 0;
}

.obs-panel .obs-iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 8px;
    display: block;
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
    min-width: 0;
}

.list-item-name {
    font-weight: 700;
    color: var(--primary-light);
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(79, 195, 247, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    word-wrap: break-word;
}

/* ステータスバッジ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.status-badge:hover {
    transform: scale(1.05);
}

.status-correct {
    background: linear-gradient(135deg, var(--danger-color), var(--danger-light));
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-incorrect {
    background: linear-gradient(135deg, var(--info-color), #3B82F6);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 回答アイテムの背景色 */
.list-item.answer-correct {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(248, 113, 113, 0.04) 100%);
    border-left: 3px solid var(--danger-color);
}

.list-item.answer-incorrect {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(96, 165, 250, 0.04) 100%);
    border-left: 3px solid var(--info-color);
}

.list-item-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.list-item-content strong {
    color: var(--text-accent);
    font-weight: 600;
}

/* カラーパレット */
.color-palette-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.color-palette {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-btn {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.color-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.3);
    border-color: #fff;
    z-index: 2;
    position: relative;
}

.color-btn:active {
    transform: scale(1.05);
}

.color-btn-clear {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    color: #666;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 接続状態インジケーター */
.connection-status {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    font-size: 10px;
}

.connection-status.status-online {
    color: #4CAF50;
    /* パルスアニメーション削除 */
}

.connection-status.status-offline {
    color: #9E9E9E;
}

/* ドラッグ中のスタイル */
.list-item.sortable-ghost {
    opacity: 0.4;
    background: var(--glass-bg) !important;
}

.list-item.sortable-drag {
    box-shadow: var(--shadow-lg);
    transform: rotate(2deg);
    cursor: grabbing !important;
}

.list-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    max-width: 50%;
}

.btn-small {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 600;
    letter-spacing: 0.1px;
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--blur);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
    text-align: center;
}

.btn-small::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-small:hover::before {
    width: 200px;
    height: 200px;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-small:active {
    transform: translateY(0);
}

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-small:disabled:hover {
    transform: none !important;
    box-shadow: none;
}

.btn-hide {
    background: var(--gradient-warning);
    color: white;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.btn-hide:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-show {
    background: linear-gradient(135deg, var(--info-color), #2563EB);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.btn-show:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-correct {
    background: var(--gradient-danger);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-correct:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-incorrect {
    background: linear-gradient(135deg, var(--info-color), #1D4ED8);
    color: white;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.btn-incorrect:hover {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* リセットボタン用スタイリング */
.btn-small:not(.btn-correct):not(.btn-incorrect):not(.btn-show):not(.btn-hide):not(.btn-danger) {
    background: linear-gradient(135deg, #6B7280, #4B5563);
    color: white;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.btn-small:not(.btn-correct):not(.btn-incorrect):not(.btn-show):not(.btn-hide):not(.btn-danger):hover {
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.btn-kick {
    background: linear-gradient(135deg, var(--danger-color), #E57373);
    color: white;
    box-shadow: 0 4px 8px rgba(239, 83, 80, 0.3);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 60px 20px;
    font-style: italic;
    font-size: 16px;
    background: rgba(79, 195, 247, 0.05);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

/* 回答者画面用モダンフォーム */
#register-area,
#wait-area,
#answer-area {
    display: grid;
    gap: 20px;
    place-items: center;
    max-width: 600px;
    margin: 60px auto;
    padding: 40px 30px;
    background: var(--gradient-card);
    border: 2px solid var(--border-accent);
    border-radius: 20px;
    box-shadow: var(--glow);
}

#register-area input,
#answer-area textarea {
    width: 100%;
    max-width: 500px;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-color);
    padding: 12px 8px;
    font-size: 16px;
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#register-area input::placeholder,
#answer-area textarea::placeholder {
    color: var(--text-secondary);
}

#register-area input:focus,
#answer-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px var(--primary-color);
}

#register-btn,
#answer-btn {
    width: 100%;
    max-width: 300px;
    border-radius: 50px;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

#register-btn:hover,
#answer-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.02);
}

#register-msg,
#answer-msg {
    width: 100%;
    max-width: 500px;
    text-align: left;
    font-size: 14px;
    color: var(--text-accent);
    padding: 8px 12px;
}

/* スピナーアニメーション */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* メッセージスタイル */
.success-msg {
    background: rgba(72, 187, 120, 0.2);
    border: 1px solid var(--success-color);
    color: var(--success-color);
    border-radius: 6px;
}

.error-msg {
    background: rgba(245, 101, 101, 0.2);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    border-radius: 6px;
}

.info-msg {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 6px;
}

/* 番号バッジ */
.list-item-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary-color);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
}

/* 番号バッジがある行はヘッダー左に余白を確保して重なり回避 */
.list-item-number + .list-item-header {
    padding-left: 36px; /* 24pxバッジ + 余白 */
}

/* バージョン表示とシステムヘッダー */
.system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 20px;
}

.system-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.version-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.8;
    font-family: 'Courier New', monospace;
}

.user-name-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-card);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border-accent);
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
}

.user-name-display i {
    color: var(--primary-color);
    font-size: 1rem;
}

.user-greeting {
    background: var(--gradient-card);
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid var(--border-accent);
    color: var(--primary-light);
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.user-greeting span {
    color: var(--primary-color);
    font-weight: 700;
}

/* 管理者画面のバージョン表示 */
.admin-header .version-display {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* 統計ダッシュボード */
.stats-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    justify-content: space-between;
}

.stat-card {
    display: flex;
    align-items: center;
    flex: 1 1 calc(25% - 12px);
    min-width: 200px;
    max-width: calc(25% - 12px);
    padding: 12px;
    background: var(--gradient-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* 3個以下の場合の調整 */
.stats-dashboard:has(.stat-card:nth-child(3):last-child) .stat-card {
    flex: 1 1 calc(33.333% - 12px);
    max-width: calc(33.333% - 12px);
}

.stats-dashboard:has(.stat-card:nth-child(2):last-child) .stat-card {
    flex: 1 1 calc(50% - 12px);
    max-width: calc(50% - 12px);
}

.stats-dashboard:has(.stat-card:only-child) .stat-card {
    flex: 1 1 100%;
    max-width: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-accent);
}

.stat-card i {
    font-size: 1.6rem;
    margin-right: 15px;
    color: var(--primary-color);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* 一括操作 */
.bulk-controls {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.bulk-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.selected-count {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: auto;
}

.bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-checkbox {
    margin-right: 8px;
    accent-color: var(--primary-color);
}

/* 設定モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    /* 既定は非表示にし、JS 側で表示時に flex にする */
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 通知 */
/* slideInRightアニメーション削除 - 最小限のUI */

/* ダークモード機能は廃止 */

/* タイムスタンプは常時表示 */
.timestamp {
    display: inline;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 8px;
}

/* レスポンシブ対応 */

/* Tablet & Small Desktop (1024px and below) */
@media (max-width: 1024px) {
    :root {
        --spacing-lg: 20px;
        --spacing-xl: 28px;
    }
    
    .content-grid {
        gap: 20px;
    }
    
    .panel-header h3 {
        font-size: 1.2rem;
    }
}

/* Tablet Portrait (768px and below) */
@media (max-width: 768px) {
    :root {
        font-size: 15px;
    }
    
    .admin-container {
        padding: 12px;
    }

    .admin-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px 0;
    }

    .admin-header h1 {
        font-size: 1.8rem;
    }
    
    .list-item-actions {
        max-width: 60%;
        gap: 5px;
    }
    
    .btn-small {
        padding: 3px 6px;
        font-size: 9px;
        min-width: 50px;
    }

    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }

    .control-panel {
        justify-content: center;
        gap: 12px;
    }
    
    .btn {
        min-width: 140px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 16px;
    }

    .panel {
        border-radius: var(--radius-lg);
    }
    
    .list-container {
        max-height: 400px;
    }

    .panel-header {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
        gap: 12px;
    }
    
    .panel-header h3 {
        font-size: 1.1rem;
    }

    .panel-controls {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .list-item {
        padding: 14px;
    }

    .list-item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .list-item-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .btn-small {
        padding: 4px 6px;
        font-size: 9px;
        gap: 2px;
        min-width: 45px;
        max-width: 70px;
    }
    
    /* 4つのボタンが表示される場合の調整 */
    .list-item-actions:has(.btn-small:nth-child(4)) .btn-small {
        padding: 3px 4px;
        font-size: 8px;
        min-width: 40px;
    }
    
    .batch-grade-controls {
        padding: 16px 20px;
        gap: 10px;
    }
    
    .batch-grade-controls .btn {
        flex: 1 1 100%;
        min-width: unset;
    }

    #register-area,
    #wait-area,
    #answer-area {
        margin: 16px;
        padding: 24px 16px;
        border-radius: var(--radius-lg);
    }
    
    input[type="text"],
    input[type="number"],
    textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* 統計ダッシュボード: タブレット以下では3列レイアウト */
    .stats-dashboard {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        padding: 12px;
        gap: 10px;
    }
    
    .stat-card {
        flex: none;
        max-width: none;
        min-width: 0;
    }
}

    .bulk-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .bulk-actions {
        width: 100%;
    }

    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }

    .system-header {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        gap: 15px;
        flex-wrap: wrap;
    }

    .header-info {
        justify-content: flex-end;
    }

    .user-name-display {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .user-greeting {
        font-size: 1rem;
        padding: 10px 16px;
    }


/* Mobile (480px and below) */
@media (max-width: 480px) {
    :root {
        font-size: 14px;
        --spacing-md: 12px;
        --spacing-lg: 16px;
    }
    
    /* キーボードヘルプボタンをスマホでは非表示 */
    #keyboard-help-btn {
        display: none !important;
    }
    
    .btn {
        min-width: auto;
        flex: 1 1 100%;
        padding: 12px 16px;
        font-size: 13px;
        gap: 6px;
    }
    
    .btn i {
        font-size: 14px;
    }

    .control-panel {
        gap: 10px;
    }
    
    /* control-panel内のボタンは幅100%にしない */
    .control-panel .btn {
        flex: 0 0 auto;
    }

    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }

    .panel {
        border-radius: var(--radius-md);
    }

    .panel-header {
        padding: 14px 16px;
    }

    .panel-header h3 {
        font-size: 1rem;
    }
    
    .list-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .btn-small {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .batch-grade-controls {
        padding: 12px 16px;
    }
    
    .status-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    #register-area,
    #wait-area,
    #answer-area {
        margin: 12px;
        padding: 20px 14px;
    }
    
    /* 統計ダッシュボード: モバイルでも3列レイアウト、更にコンパクト */
    .stats-dashboard {
        padding: 12px 8px;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .stat-card {
        padding: 12px 8px;
        min-width: 0;
    }
    
    .stat-card i {
        font-size: 1.5rem;
        margin-right: 8px;
    }
    
    .stat-value {
        font-size: 1.8rem;
        font-weight: 700;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* コントロールボタン: アイコンのみ表示、横に詰める */
    .control-panel {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
        padding: 8px 4px;
        margin-bottom: 8px;
    }

    .control-panel .btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0;
        font-size: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        border-radius: 8px;
    }

    .control-panel .btn i {
        font-size: 18px;
        margin: 0;
    }
    
    /* スマホではキーボードショートカット非表示 */
    kbd,
    .shortcut-item {
        display: none !important;
    }
    
    /* スマホでのスクロールバー調整と余白最適化 */
    .list-container {
        padding: 8px; /* 全体的にpaddingを削減 */
        margin: 0; /* marginをリセット */
    }
    
    .list-container::-webkit-scrollbar {
        width: 4px; /* さらに細く */
    }
    
    .list-container::-webkit-scrollbar-thumb {
        background: rgba(79, 195, 247, 0.6);
        border-radius: 2px;
    }
    
    .list-item {
        padding: 10px; /* アイテムのpaddingも削減 */
        margin-bottom: 8px; /* マージンを削減 */
    }
    
    /* パネルとリストの高さを統一（スマホのみ） */
    .panel {
        height: auto;
        min-height: 300px;
    }
    
    .list-container {
        min-height: 250px; /* 最小高さを設定 */
    }
}

/* 問題管理 */
.question-panel .panel-body {
    max-height: 600px;
    overflow-y: auto;
}

.current-question-display {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.current-question-display h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1rem;
}

.current-question-info {
    color: var(--text-secondary);
    font-style: italic;
}

.current-question-detail h5 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.current-question-detail p {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.current-question-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question-item {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: move;
}

.question-item:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow);
}

.question-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.question-number {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.question-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.question-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.question-status.active {
    background: rgba(102, 187, 106, 0.2);
    color: var(--success-color);
}

.question-status.inactive {
    background: rgba(239, 83, 80, 0.2);
    color: var(--danger-color);
}

.question-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.question-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}

.no-questions {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}

/* 問題フォーム */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    margin-top: 25px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--primary-color);
}

/* ボタンサイズ */
.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-xs.active {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

/* スピナーアニメーション */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 登録フィードバック: ボタンの無効化スタイルは上部に集約済み */

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .question-meta {
        flex-direction: column;
        gap: 5px;
    }

    .question-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .current-question-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* テストデータパネル用スタイル */
.btn-purple {
    background: linear-gradient(135deg, #8E24AA 0%, #7B1FA2 100%);
    color: white;
    border: 1px solid #8E24AA;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #7B1FA2 0%, #6A1B9A 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.test-data-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
}

.control-group select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 8px 12px;
    min-width: 150px;
    transition: all 0.3s ease;
}

.control-group select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

.control-group select option {
    background: var(--card-bg);
    color: var(--text-primary);
}

.test-data-preview {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.preview-section h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1em;
}

.preview-section p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.preview-section strong {
    color: var(--text-primary);
}

.preview-section small {
    color: var(--text-secondary);
    font-style: italic;
}

/* .btn-small の基本スタイルは上部で定義済み */

/* slideInアニメーション削除 - 最小限のUI */

@media (max-width: 768px) {
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .control-group label {
        min-width: auto;
    }

    .control-group select {
        width: 100%;
    }
}

/* 前回の解答表示スタイル */
#last-answer-display {
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    color: var(--text-secondary);
}

#last-answer-display strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-light);
    font-weight: 600;
}

#last-answer-text {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
    font-size: 15px;
}

/* ============================================
   Additional Animations & Micro-interactions
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Fade in animation - 削除（最小限のUI） */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* アニメーション時の横スクロールバー防止 */
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.2);
}

/* Selection styling */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* Very small screens - button overflow prevention */
@media (max-width: 400px) {
    .list-item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .list-item-actions {
        justify-content: center;
        width: 100%;
        max-width: 100%;
        gap: 4px;
    }
    
    .btn-small {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 23%;
        padding: 3px 2px;
        font-size: 8px;
        gap: 1px;
    }
    
    /* 4つのボタン時はアイコンのみ表示 */
    .list-item-actions:has(.btn-small:nth-child(4)) .btn-small {
        padding: 4px;
        font-size: 0;
        min-width: 32px;
        max-width: 22%;
    }
    
    .list-item-actions:has(.btn-small:nth-child(4)) .btn-small i {
        font-size: 12px;
    }
    
    .list-item-name {
        text-align: center;
        justify-content: center;
    }
    
    /* 統計ダッシュボード: 400px以下でも3列グリッド維持、縦型カード */
    .stats-dashboard {
        padding: 8px;
        gap: 6px;
    }
    
    .stat-card {
        padding: 8px 6px;
        border-radius: var(--radius-sm);
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .stat-card i {
        font-size: 1.4rem;
        margin-right: 0;
        margin-bottom: 4px;
    }
    
    .stat-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .stat-value {
        font-size: 1.4rem;
        margin-bottom: 2px;
    }
    
    .stat-label {
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    /* コントロールボタン: アイコンのみ表示（さらにコンパクト） */
    .control-panel .btn {
        min-width: 44px;
        padding: 10px 8px;
        font-size: 0;
    }
    
    .control-panel .btn i {
        font-size: 16px;
        margin: 0;
    }
    
    /* ヘッダータイトルを小さく */
    .admin-header h1 {
        font-size: 1.3rem;
    }
    
    .system-title {
        font-size: 1.1rem;
    }
}

/* Extra small screens for very tight spaces */
@media (max-width: 320px) {
    .btn-small {
        padding: 3px 4px;
        font-size: 8px;
        gap: 1px;
    }
    
    .list-item-actions {
        gap: 4px;
    }
    
    .system-header {
        padding: 10px;
        gap: 10px;
    }
    
    .system-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
}

/* Dark Mode Styles: 廃止 */

/* Settings Modal Styles */
.setting-group {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-bg);
}

.setting-group h4 {
    margin: 0 0 12px 0;
    color: var(--primary-light);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 13px;
}

.setting-item input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
}

.setting-item input[type="range"] {
    flex: 1;
    margin: 0 8px;
}

.setting-item input[type="number"] {
    width: 80px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Character counter and timestamp styles are defined earlier to avoid duplication */

/* Loading shimmer effect - 削除（最小限のUI） */
.loading-shimmer {
    background: var(--card-bg);
}

/* キーボードショートカットヘルプ */
kbd {
    display: inline-block;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0 -2px 0 rgba(0,0,0,0.1);
    white-space: nowrap;
}

.shortcut-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.shortcut-item:hover {
    background: rgba(255,255,255,0.06);
    transform: translateX(4px);
}

/* =================================================================
   ADMIN UI/UX IMPROVEMENTS - ボタンフィードバック
   ================================================================= */

/* ボタン状態フィードバック */
.btn-success-flash {
    background: linear-gradient(135deg, var(--success-color), #0be881) !important;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-error-flash {
    background: linear-gradient(135deg, var(--danger-color), #ff3838) !important;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-success-flash,
.btn-error-flash {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* アクションボタンの改善 */
.control-panel .btn {
    position: relative;
    overflow: hidden;
}

.control-panel .btn::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;
}

.control-panel .btn:hover::before {
    left: 100%;
}

/* 統計ダッシュボードの数値強調 */
.stats-grid .card h3 {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin: 0.5rem 0;
}

/* 旧来のカラーリングを維持するため、パネルヘッダーの全体上書きは行わない */

/* システムヘッダーの改善 */
.enhanced-header {
    background: linear-gradient(135deg, var(--card-bg), rgba(255,255,255,0.03));
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.system-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    /* 以前の配色に合わせ、タイトルはブランドカラーで表示 */
    color: var(--primary-color);
}

.system-title i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.enhanced-state {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.875rem;
    border: 2px solid;
    background: rgba(255,255,255,0.05);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.version-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ヘッダー横ミニ統計 */
.header-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-stats .stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.header-stats .stat-chip i {
    font-size: 12px;
    opacity: 0.9;
}

.header-stats .stat-chip .value {
    color: var(--text-primary);
    font-weight: 600;
}

/* レスポンシブ - モバイル対応 */
@media (max-width: 768px) {
    .enhanced-header {
        padding: 0.75rem 1rem;
    }
    
    .header-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .enhanced-state {
        align-self: flex-end;
    }
    
    .header-info {
        width: 100%;
        justify-content: space-between;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .header-stats {
        gap: 6px;
    }
    
    .header-stats .stat-chip {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .version-display,
    .user-info {
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .header-actions {
        gap: 0.25rem;
    }
    
    .header-actions .btn {
        min-width: 36px;
        font-size: 0;
    }
    
    .header-actions .btn i {
        font-size: 1rem;
    }
}

    /* 強化されたコントロールパネル */
    .enhanced-controls {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
        margin: 1.5rem 0;
        padding: 1.5rem;
        background: linear-gradient(135deg, var(--card-bg), rgba(255,255,255,0.02));
        border-radius: 12px;
        border: 1px solid var(--border-color);
    }

    .control-section {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .control-section h4 {
        margin: 0;
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid var(--border-color);
    }

    .control-section h4 i {
        color: var(--primary-color);
        font-size: 0.9rem;
    }

    .button-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .button-group .btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
        position: relative;
    }

    /* 強化された統計ダッシュボード */
    .enhanced-stats {
        margin: 1.5rem 0;
    }

    .enhanced-stats .stats-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .enhanced-stats .card {
        text-align: center;
        padding: 1.5rem 1rem;
        background: linear-gradient(135deg, var(--card-bg), rgba(255,255,255,0.02));
        border: 1px solid var(--border-color);
        border-radius: 12px;
        position: relative;
        overflow: hidden;
    }

    .enhanced-stats .card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    }

    .enhanced-stats .card h4 {
        margin: 0 0 0.5rem 0;
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .enhanced-stats .card .stat-value {
        font-size: clamp(1.8rem, 4vw, 2.2rem);
        font-weight: 700;
        background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin: 0.5rem 0;
        line-height: 1;
    }

    .enhanced-stats .card .stat-subtitle {
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-top: 0.25rem;
    }

    /* モバイル対応 */
    @media (max-width: 768px) {
        .enhanced-controls {
            grid-template-columns: 1fr;
            gap: 1rem;
            padding: 1rem;
        }
    
        .control-section h4 {
            font-size: 0.9rem;
        }
    
        .button-group {
            gap: 0.5rem;
        }
    
        .button-group .btn {
            min-width: 100px;
            font-size: 0.875rem;
        }
    
        .enhanced-stats .stats-grid {
            grid-template-columns: repeat(3, 1fr);
            gap: 0.75rem;
        }
    
        .enhanced-stats .card {
            padding: 1rem 0.75rem;
        }
    }

    @media (max-width: 480px) {
        .button-group .btn .btn-text {
            display: none;
        }
    
        .button-group .btn {
            min-width: 48px;
            width: 48px;
            padding: 0.75rem;
        }
    
        .enhanced-stats .card .stat-value {
            font-size: 1.5rem;
        }

        /* スクロール時の一時ハイライト - 削除（最小限のUI） */
    
        .enhanced-stats .card h4 {
            font-size: 0.75rem;
        }
    }
