:root {
    --bg-dark: #080c10;
    --bg-card: rgba(20, 30, 45, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 210, 255, 0.3);
    
    --neon-blue: #00d2ff;
    --neon-magenta: #ff007f;
    --neon-green: #39ff14;
    --neon-gold: #ffcc00;
    --text-light: #f0f6fc;
    --text-dim: #8b949e;
}

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

body {
    background: radial-gradient(circle at center, #0f172a 0%, var(--bg-dark) 100%);
    color: var(--text-light);
    font-family: 'Outfit', 'Shippori Mincho', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}

#app-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.glow-text {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.3rem;
    color: #fff;
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px rgba(0, 210, 255, 0.5);
    margin-bottom: 0.2rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    letter-spacing: 0.1rem;
}

.nav-back-link {
    display: inline-block;
    margin-top: 0.8rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-back-link:hover {
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.6);
}

/* メインレイアウト */
main {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    width: 100%;
}

@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }
}

/* ガラスモーフィズムパネル */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(0, 210, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 210, 255, 0.1);
}

/* ダーツボードセクション */
.board-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

#dartboard-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 210, 255, 0.1);
    cursor: crosshair;
    transition: transform 0.2s ease;
    touch-action: none; /* スマホでのスクロールやダブルタップズームを防止し、タップ操作に専念させる */
}

#dartboard-canvas:active {
    transform: scale(0.98);
}

.board-instruction {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    text-align: center;
}

/* スコアセクション */
.score-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.score-display {
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.score-display .label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.15rem;
    color: var(--text-dim);
}

.score-value {
    font-size: 4.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 15px var(--neon-blue), 0 0 30px rgba(0, 210, 255, 0.3);
    line-height: 1;
    margin-top: 0.5rem;
}

/* スタッツカード */
.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.1rem;
    font-weight: 700;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

/* ボタン */
.control-panel {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

button {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.primary-button {
    background: linear-gradient(135deg, var(--neon-blue), #0072ff);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 210, 255, 0.3);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* 履歴エリア */
.history-container {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 250px;
}

.history-container h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.4rem;
}

#history-list {
    list-style: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.5rem;
}

/* スクロールバーのカスタマイズ */
#history-list::-webkit-scrollbar {
    width: 6px;
}

#history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

#history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    animation: slideIn 0.3s ease;
}

.history-item .number {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.history-item .pts {
    font-weight: 700;
}

.history-item.pts-100 .pts { color: var(--neon-gold); text-shadow: 0 0 8px rgba(255, 204, 0, 0.4); }
.history-item.pts-75 .pts { color: var(--neon-blue); }
.history-item.pts-50 .pts { color: var(--neon-green); }
.history-item.pts-25 .pts { color: var(--neon-magenta); }
.history-item.pts-0 .pts { color: var(--text-dim); }

.empty-message {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 1.5rem 0;
    font-style: italic;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
