/* 基本リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* body要素の統一スタイル */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
header {
    background: linear-gradient(to right, #43a047, #66bb6a);
    color: white;
    text-align: center;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ナビゲーション */
nav {
    background: linear-gradient(to right, #66bb6a, #81c784);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

nav ul li a:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* メインコンテンツ */
main {
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* ツールカード */
.tool-card {
    background: linear-gradient(135deg, #ffffff, #e8f5e9);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

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

.tool-card h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #2e7d32;
    border-bottom: 2px solid #4caf50;
    padding-bottom: 0.5rem;
}

.tool-card h3 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #388e3c;
}

/* ボタン */
button {
    background: linear-gradient(to right, #4caf50, #45a049);
    color: white;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

button:hover {
    background: linear-gradient(to right, #45a049, #4caf50);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

/* フォーム要素 */
textarea {
    width: 100%;
    height: 200px;
    padding: 0.5rem;
    border: 1px solid #81c784;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 1rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* フッター */
footer {
    background: linear-gradient(to right, #43a047, #66bb6a);
    color: white;
    text-align: center;
    padding: 1rem 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    margin-top: auto;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    main {
        padding: 0 1rem;
    }
    .tool-card {
        padding: 1.5rem;
    }
    .radio-group {
        flex-direction: column;
    }
}

/* ゲーム固有のスタイル */
#game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1rem;
}

#canvas-wrapper {
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    color: #ffd700;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 10;
}

#stats {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 15px;
    background: rgba(0, 20, 20, 0.7);
    border: 1px solid #ffd700;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

#stats div {
    margin-bottom: 5px;
}

#hp-bar-container {
    width: 150px;
    height: 10px;
    background: #333;
    border: 1px solid #ffd700;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

#hp-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #f00, #ffd700);
    transition: width 0.3s ease;
}

#stats span {
    color: #fff;
    text-shadow: 0 0 5px #ffd700;
}

#instructions, #loading, #game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    pointer-events: auto;
    text-align: center;
    z-index: 20;
}

.instructions-content, .game-over-content {
    background: rgba(0, 10, 10, 0.95);
    padding: 3rem;
    border: 2px solid #ffd700;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    max-width: 80%;
}

.instructions-content h2, .game-over-content h2 {
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.instructions-content p {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

#loading p {
    font-size: 2rem;
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.4; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.4; transform: scale(0.98); }
}

#restart-button {
    margin-top: 2rem;
    background: linear-gradient(to right, #8b4513, #ffd700);
    color: #fff;
    border: none;
    box-shadow: 0 0 15px #ffd700;
}

#restart-button:hover {
    background: linear-gradient(to right, #ffd700, #8b4513);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    #game-container {
        height: 400px;
    }
    .instructions-content h2 {
        font-size: 1.8rem;
    }
}
