:root {
    --soviet-red: #cc0000;
    --soviet-gold: #ffcc00;
    --bg-color: #1a0000;
    --container-bg: rgba(40, 0, 0, 0.95);
    --text-color: #ffcc00;
    --word-color: #ffffff;
    --bar-color: #ff0000;
    /* 背景パターン用（コンクリート構造物と光条をイメージ） */
    --bg-pattern: radial-gradient(circle at 50% 50%, rgba(204, 0, 0, 0.15), transparent 60%),
                  linear-gradient(45deg, #110000 25%, #1a0000 25%, #1a0000 50%, #110000 50%, #110000 75%, #1a0000 75%, #1a0000 100%);
}

/* 資本主義モード（ライトモード） */
body.capitalism-mode {
    --soviet-red: #0044cc;
    --soviet-gold: #333333;
    --bg-color: #f0f2f5;
    --container-bg: rgba(255, 255, 255, 0.95);
    --text-color: #0044cc;
    --word-color: #111111;
    --bar-color: #00aa55;
    --bg-pattern: radial-gradient(circle at 50% 50%, rgba(0, 68, 204, 0.1), transparent 60%),
                  linear-gradient(45deg, #e5e7eb 25%, #f3f4f6 25%, #f3f4f6 50%, #e5e7eb 50%, #e5e7eb 75%, #f3f4f6 75%, #f3f4f6 100%);
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-pattern);
    background-size: 100% 100%, 40px 40px;
    color: var(--text-color);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    user-select: none;
    transition: background 0.3s, color 0.3s;
}

h1 {
    color: var(--soviet-red);
    font-size: 3.5rem;
    text-shadow: 2px 2px 0px var(--soviet-gold), 0 0 20px rgba(255, 0, 0, 0.3);
    margin-bottom: 5px;
    letter-spacing: 2px;
}

body.capitalism-mode h1 {
    text-shadow: 2px 2px 0px #bbbbbb;
}

#subtitle {
    font-size: 1.2rem;
    color: #ff9999;
    margin-bottom: 20px;
}
body.capitalism-mode #subtitle { color: #666666; }

#game-container {
    background: var(--container-bg);
    border: 4px solid var(--soviet-gold);
    border-radius: 10px;
    padding: 30px;
    width: 650px;
    height: 440px;
    text-align: center;
    box-shadow: 0 0 30px rgba(204, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}
body.capitalism-mode #game-container { box-shadow: 0 10px 25px rgba(0,0,0,0.1); }

/* ミス時の画面ブレ（アニメーションクラス） */
#game-container.miss-shake {
    animation: shake 0.15s linear;
    border-color: #ff0000 !important;
}
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.screen.active { display: flex; }

#word-kanji {
    font-size: 2.8rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--word-color);
}

#word-roma {
    font-size: 2rem;
    letter-spacing: 2px;
    margin-bottom: 15px;
    min-height: 2.5rem;
}

.typed {
    color: var(--soviet-red);
    background: rgba(255, 204, 0, 0.15);
}
body.capitalism-mode .typed { background: rgba(0, 68, 204, 0.1); }

.untyped { color: var(--text-color); }

/* タイムバー（プログレスバー）設定 */
#progress-container {
    width: 90%;
    height: 12px;
    background-color: #333333;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid var(--soviet-gold);
}
body.capitalism-mode #progress-container { background-color: #dddddd; }

#progress-bar {
    width: 100%;
    height: 100%;
    background-color: var(--bar-color);
    transition: width 0.1s linear;
}

#stats {
    width: 100%;
    display: flex;
    justify-content: space-around;
    font-size: 1.2rem;
    border-top: 2px dashed var(--soviet-gold);
    padding-top: 15px;
}

/* 称号リスト表示エリア */
.title-box {
    margin: 10px 0;
    font-size: 1.0rem;
    color: var(--word-color);
    max-height: 110px;
    overflow-y: auto;
    width: 90%;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 5px;
    border: 1px solid rgba(255,204,0,0.2);
    text-align: left;
}

.title-item {
    padding: 5px 8px;
    margin: 4px 0;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
}

.title-item.unlocked {
    background-color: var(--soviet-red);
    color: #ffcc00;
    font-weight: bold;
    border: 1px solid var(--soviet-gold);
}
body.capitalism-mode .title-item.unlocked { color: #ffffff; }

.title-item.locked {
    background-color: rgba(120, 120, 120, 0.1);
    color: #777;
    border: 1px dashed #555;
}

/* 用語概要のスタイル */
#word-description {
    width: 90%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--soviet-gold);
    padding: 10px;
    border-radius: 5px;
    font-size: 0.95rem;
    color: var(--word-color);
    text-align: left;
    margin-bottom: 15px;
    max-height: 80px;
    overflow-y: auto;
}
body.capitalism-mode #word-description { background: #ffffff; }

.particle {
    position: absolute;
    pointer-events: none;
    color: #ffcc00;
    text-shadow: 0 0 15px #cc0000;
    animation: fly 0.9s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    z-index: 100;
}
body.capitalism-mode .particle { color: #0044cc; text-shadow: 0 0 10px #ffffff; }

@keyframes fly {
    0% { transform: translate(0, 0) rotate(0deg) scale(0.5); opacity: 1; }
    100% { transform: translate(var(--mx), var(--my)) rotate(var(--mr)) scale(1.3); opacity: 0; }
}

button {
    background-color: var(--soviet-red);
    color: #ffcc00;
    border: 2px solid var(--soviet-gold);
    padding: 12px 35px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
    box-shadow: 0 5px 0 rgba(0,0,0,0.3);
    margin-top: 10px;
}
body.capitalism-mode button { color: #ffffff; }
button:hover { filter: brightness(1.2); transform: translateY(-2px); }
button:active { transform: translateY(3px); }

/* モード切り替えボタン用の固定配置 */
#mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.9rem;
    padding: 8px 15px;
    margin: 0;
    z-index: 200;
}