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

body {
    font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.8rem;
    background: linear-gradient(90deg, #4ecdc4, #44a39b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #888;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* ゲームボード */
.game-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.cell {
    width: 55px;
    height: 55px;
    border: 2px solid #3a3a5c;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.1s, border-color 0.2s;
}

.cell.active {
    border-color: #4ecdc4;
    animation: cellPulse 0.5s ease-in-out infinite;
}

@keyframes cellPulse {
    0%, 100% { border-color: #4ecdc4; }
    50% { border-color: #26a69a; }
}

.cell.filled {
    transform: scale(1.05);
    border-color: #5a5a7c;
}

.cell.correct {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    border-color: #27ae60;
    animation: flipIn 0.4s ease-out;
}

.cell.present {
    background: linear-gradient(145deg, #f39c12, #e67e22);
    border-color: #e67e22;
    animation: flipIn 0.4s ease-out;
}

.cell.absent {
    background: linear-gradient(145deg, #5a5a7c, #4a4a6c);
    border-color: #4a4a6c;
    animation: flipIn 0.4s ease-out;
}

@keyframes flipIn {
    0% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

/* キーボード */
.keyboard {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.keyboard-row {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.key {
    min-width: 30px;
    height: 45px;
    border: none;
    border-radius: 6px;
    background: #3a3a5c;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.key:active {
    transform: scale(0.9);
}

.key.wide {
    min-width: 50px;
    font-size: 0.8rem;
}

.key.correct {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
}

.key.present {
    background: linear-gradient(145deg, #f39c12, #e67e22);
}

.key.absent {
    background: #2a2a3c;
    color: #666;
}

/* メッセージ */
.message {
    text-align: center;
    min-height: 30px;
    font-size: 1rem;
    color: #4ecdc4;
    margin-bottom: 10px;
}

.message.error {
    color: #e74c3c;
    animation: shake 0.3s ease;
}

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

/* コントロール */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.control-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn:not(.share-btn) {
    background: linear-gradient(145deg, #4ecdc4, #26a69a);
    color: #fff;
}

.share-btn {
    background: linear-gradient(145deg, #1da1f2, #0d8ecf);
    color: #fff;
}

/* 結果オーバーレイ */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.result-content {
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    border: 2px solid #4ecdc4;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    min-width: 280px;
}

.result-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #4ecdc4;
}

.result-word {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.result-word span {
    color: #f39c12;
    font-weight: bold;
}

.result-stats {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 20px;
}

.result-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* レスポンシブ */
@media (max-width: 380px) {
    .cell { width: 48px; height: 48px; font-size: 1.5rem; }
    .key { min-width: 26px; height: 40px; font-size: 1rem; }
    .key.wide { min-width: 42px; }
}
