* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #d400ff;
    --secondary-color: #9d00ff;
    --accent-color: #ff00ff;
    --dark-bg: #0a0a0a;
    --light-bg: #f5f5f5;
    --text-light: #ecf0f1;
    --text-dark: #2c3e50;
    --border-radius: 25px;
    --box-shadow: 0 4px 6px rgba(212, 0, 255, 0.2);
}

body {
    font-family: 'MS Pゴシック', 'Yu Gothic', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0033 100%);
    color: var(--text-light);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 20px;
}

/* セクション */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* ボタンスタイル */
.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 250px;
    margin: 0 auto;
    padding: 0.9em 2em;
    overflow: hidden;
    border: 1px solid var(--primary-color);
    border-radius: 25px;
    background-color: #fff;
    color: var(--primary-color);
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn::before {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    width: 0;
    height: 100%;
    background-color: var(--primary-color);
    content: '';
    transition: width .3s ease;
}

.btn:hover {
    background-color: transparent;
    color: #fff;
}

.btn:hover::before {
    width: 100%;
}

.btn-primary {
    width: 250px;
}

.btn-secondary {
    width: 250px;
}

.btn-guest {
    width: 250px;
}

.btn-action {
    padding: 0.7em 1.5em;
    width: auto;
    font-size: 0.9em;
    margin: 5px;
}

.btn-small {
    width: auto;
    padding: 0.6em 1.2em;
    font-size: 0.85em;
}

/* 入力フォーム */
.input {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    background-color: transparent;
    color: var(--text-light);
    font-size: 16px;
    transition: all 0.3s ease;
}

.input::placeholder {
    color: #8888aa;
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(212, 0, 255, 0.4);
    background-color: rgba(212, 0, 255, 0.05);
}

/* ===== ログイン画面 ===== */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.title {
    font-size: 48px;
    margin-bottom: 10px;
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(212, 0, 255, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 20px;
    margin-bottom: 40px;
    color: var(--text-light);
    font-style: italic;
}

.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-form .btn {
    margin-top: 10px;
}

.message {
    margin-top: 20px;
    padding: 10px;
    text-align: center;
    min-height: 20px;
}

.message.error {
    color: var(--primary-color);
}

.message.success {
    color: #27ae60;
}

/* ===== メニュー画面 ===== */
.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.user-info {
    background: linear-gradient(135deg, rgba(212, 0, 255, 0.1) 0%, rgba(157, 0, 255, 0.1) 100%);
    border: 1px solid rgba(212, 0, 255, 0.3);
    padding: 20px;
    border-radius: 15px;
    margin: 30px 0;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(212, 0, 255, 0.1);
}

.user-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.user-rank {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(212, 0, 255, 0.3);
}

.user-rp {
    font-size: 16px;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(212, 0, 255, 0.3);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-buttons .btn {
    width: 100%;
    max-width: 300px;
}

/* ===== ルーム画面 ===== */
.room-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.players-list {
    background: linear-gradient(135deg, rgba(212, 0, 255, 0.05) 0%, rgba(157, 0, 255, 0.05) 100%);
    border: 1px solid rgba(212, 0, 255, 0.2);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    min-width: 300px;
}

.player-item {
    padding: 10px;
    margin: 10px 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.status-message {
    margin: 20px 0;
    font-size: 18px;
}

/* ===== ゲーム画面 ===== */
.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    gap: 10px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: linear-gradient(90deg, rgba(212, 0, 255, 0.1) 0%, rgba(157, 0, 255, 0.05) 100%);
    border: 1px solid rgba(212, 0, 255, 0.2);
    border-radius: 15px;
}

.game-board {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(212, 0, 255, 0.05) 0%, rgba(157, 0, 255, 0.03) 100%);
    border: 1px solid rgba(212, 0, 255, 0.1);
    border-radius: 15px;
    overflow-y: auto;
}

.opponents-area {
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.opponent-card {
    background: linear-gradient(135deg, rgba(212, 0, 255, 0.2) 0%, rgba(157, 0, 255, 0.15) 100%);
    padding: 20px;
    border-radius: 15px;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(212, 0, 255, 0.2);
    border: 1px solid rgba(212, 0, 255, 0.3);
    transition: all 0.3s ease;
}

.opponent-card:hover {
    border-color: rgba(212, 0, 255, 0.6);
    box-shadow: 0 12px 24px rgba(212, 0, 255, 0.3);
}

.opponent-name {
    font-weight: bold;
    margin-bottom: 10px;
}

.opponent-damage {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.incident-area {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.incident-card {
    background: linear-gradient(135deg, rgba(212, 0, 255, 0.25) 0%, rgba(255, 0, 255, 0.15) 100%);
    padding: 30px;
    border-radius: 20px;
    min-width: 300px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(212, 0, 255, 0.35);
    border: 2px solid var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.incident-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.incident-points {
    font-size: 24px;
    font-weight: bold;
}

.turn-info {
    text-align: center;
}

.turn-text {
    font-size: 18px;
    font-weight: bold;
}

.player-status {
    padding: 15px;
    background: linear-gradient(90deg, rgba(212, 0, 255, 0.08) 0%, rgba(157, 0, 255, 0.05) 100%);
    border: 1px solid rgba(212, 0, 255, 0.15);
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.my-info {
    min-width: 200px;
}

.player-name {
    font-size: 18px;
    font-weight: bold;
}

.damage {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(212, 0, 255, 0.3);
}

/* 手札エリア */
.hand-area {
    padding: 15px;
    background: linear-gradient(90deg, rgba(212, 0, 255, 0.08) 0%, rgba(157, 0, 255, 0.05) 100%);
    border: 1px solid rgba(212, 0, 255, 0.15);
    border-radius: 15px;
}

.hand-label {
    font-weight: bold;
    margin-bottom: 10px;
}

.hand-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.card {
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(40, 20, 80, 0.8) 0%, rgba(60, 20, 100, 0.8) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 12px;
    min-width: 120px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(212, 0, 255, 0.3);
    border-color: rgba(212, 0, 255, 0.8);
    background: linear-gradient(135deg, rgba(212, 0, 255, 0.15) 0%, rgba(157, 0, 255, 0.1) 100%);
}

.card-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.card-effect {
    font-size: 12px;
    color: #aaaacc;
}

.card.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 8px 20px rgba(212, 0, 255, 0.5);
}

/* アクション領域 */
.action-area {
    padding: 15px;
    background: linear-gradient(90deg, rgba(212, 0, 255, 0.08) 0%, rgba(157, 0, 255, 0.05) 100%);
    border: 1px solid rgba(212, 0, 255, 0.15);
    border-radius: 15px;
    text-align: center;
}

/* ゲームログ */
.game-log {
    padding: 15px;
    background: linear-gradient(90deg, rgba(212, 0, 255, 0.08) 0%, rgba(157, 0, 255, 0.05) 100%);
    border: 1px solid rgba(212, 0, 255, 0.15);
    border-radius: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.log-label {
    font-weight: bold;
    margin-bottom: 10px;
}

.log-content {
    font-size: 12px;
    color: #bdc3c7;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-entry:last-child {
    border-bottom: none;
}

/* ===== 戦績画面 ===== */
.stats-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.stats-content {
    background: linear-gradient(135deg, rgba(212, 0, 255, 0.1) 0%, rgba(157, 0, 255, 0.1) 100%);
    border: 1px solid rgba(212, 0, 255, 0.3);
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(212, 0, 255, 0.1);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-weight: bold;
}

.stat-value {
    color: var(--primary-color);
    font-weight: bold;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .game-board {
        grid-template-columns: 1fr;
    }

    .hand-cards {
        max-width: 100%;
    }

    .title {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .btn,
    .auth-form .btn {
        width: 200px;
    }

    .incident-card {
        min-width: 200px;
    }

    .player-status {
        flex-direction: column;
        gap: 10px;
    }
}
