body {
    font-family: "M PLUS Rounded 1c", "Yu Gothic", sans-serif;
    margin: 0;
    background: #000510;
    color: #f4f4f4;
    min-height: 100vh;
}

.game-shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    position: relative;
}

.hero {
    text-align: center;
    margin-bottom: 32px;
}

.hero h1 {
    font-size: 2.6rem;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    color: #fff;
}

.hero p {
    color: #b8c1ec;
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.panels {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.panel {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px;
    width: 320px;
    background: #000d1a;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
}

.panel h2,
.panel h3 {
    margin-top: 0;
    color: #ffe066;
    letter-spacing: 0.08em;
    font-size: 1.05rem;
}

.log {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #444;
    padding: 12px;
    background: #001a33;
    color: #fdfdfd;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.log ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.log li {
    margin-bottom: 4px;
}

.battle-rewards {
    display: flex;
    gap: 24px;
    justify-content: center;
    padding: 16px;
    margin-bottom: 16px;
}

.reward-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.reward-label {
    font-size: 0.85rem;
    color: #999;
    letter-spacing: 0.05em;
}

.reward-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffe066;
}

/* コンパクトな報酬表示 */
.battle-rewards-compact {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.reward-compact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
}

.reward-compact-item-full-width {
    flex-basis: 100%;
    width: 100%;
    margin-top: 4px;
}

.reward-compact-item-items {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.reward-compact-item-items-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.reward-compact-item-items .reward-compact-label {
    flex-shrink: 0;
}

.reward-compact-item-items .reward-items-list {
    flex-basis: 100%;
    margin-left: 0;
    padding-left: 0;
    margin-top: 0;
}

.reward-compact-label {
    color: #999;
    font-size: 1rem;
    flex-shrink: 0;
}

.reward-compact-value {
    color: #ffe066;
    font-weight: 700;
    font-size: 1.2rem;
}

.reward-value-white {
    color: #fff;
}

.battle-log-details {
    margin: 8px 0;
}

.battle-log-summary {
    cursor: pointer;
    padding: 8px 12px;
    background: #001a33;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    list-style: none;
}

.battle-log-summary::-webkit-details-marker {
    display: none;
}

.battle-log-summary::before {
    content: "▶ ";
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.2s;
}

.battle-log-details[open] .battle-log-summary::before {
    transform: rotate(90deg);
}

.battle-log-details .log {
    margin-top: 8px;
}

.explore-battle-container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.explore-section {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.battle-result-section {
    flex: 1;
    min-width: 0;
}

.battle-result-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #fff;
    font-size: 1.1rem;
}

.action-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.stage-select {
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid #555;
    background: #001a33;
    color: #eee;
    font-size: 1rem;
    appearance: none;
}

.stage-select:focus {
    outline: 2px solid #00c6ff;
}

.modern-button {
    padding: 12px 28px;
    border: none;
    border-radius: 999px;
    background: #f06595;
    color: #fff;
    font-size: 1rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: opacity 0.2s ease;
    box-shadow: none;
}

.modern-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.modern-button:not(:disabled):hover {
    opacity: 0.9;
}

.status-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    align-items: start;
}

.status-container {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px;
    background: #001a33;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px;
}

.status-col {
    min-width: 0;
}

.equip-col {
    border: 1px solid #444;
    border-radius: 12px;
    padding: 14px;
    background: #001a33;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.character-info-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 16px;
    margin-bottom: 16px;
    align-items: flex-start;
    width: 100%;
}

.character-image-container {
    flex: 0 0 150px;
    min-width: 150px;
    text-align: left;
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.character-image {
    max-width: 150px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    background-color: transparent;
    display: block;
    object-fit: contain;
}

.character-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.character-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.character-info-label {
    color: #999;
    font-weight: 600;
    min-width: 60px;
}

.character-info-value {
    color: #fff;
    font-weight: 600;
}

.character-placeholder {
    width: 100%;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
}

.equip-col h3 {
    margin: 0 0 12px 0;
    font-size: 1.05rem;
    color: #ffe066;
    letter-spacing: 0.08em;
}

.equip-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.equip-col li {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #ddd;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.equip-key {
    color: #999;
    min-width: 5em;
    flex-shrink: 0;
}

.equip-value {
    font-weight: 600;
    color: #fff;
}

.stat-item {
    padding: 8px 10px;
}

.stat-key {
    display: block;
    font-size: 0.72rem;
    color: #9ea7ff;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.xp-row {
    grid-column: 1 / span 2;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    background: #001a33;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 100%;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #1f1f3a;
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0;
    border: 1px solid #333;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.6);
}

.stat-progress-text {
    font-size: 0.9rem;
    color: #d1d1ff;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-log {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #444;
    padding: 12px;
    background: #001a33;
    border-radius: 10px;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4);
}

.chat-log ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-log li {
    color: #eee;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 6px 8px;
}

.chat-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chat-form textarea {
    flex: 1;
    min-width: 220px;
    border-radius: 10px;
    border: 1px solid #555;
    background: #001a33;
    color: #eee;
    padding: 10px;
    font-family: inherit;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}

/* 認証関連のスタイル */
.auth-panel {
    max-width: 400px;
    margin: 0 auto;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tab.active {
    color: #ffe066;
    border-bottom-color: #ffe066;
}

.auth-tab:hover {
    color: #fff;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form label span {
    color: #9ea7ff;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.auth-input {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #555;
    background: #001a33;
    color: #eee;
    font-size: 1rem;
}

.auth-input:focus {
    outline: 2px solid #00c6ff;
}

.error-message {
    padding: 12px;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    border-radius: 8px;
    color: #ff6b6b;
    margin-bottom: 16px;
}

.settings-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.settings-button {
    background: #001a33;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 12px 16px;
    cursor: pointer;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-button:hover {
    background: #00264d;
}

.settings-icon {
    display: inline-block;
    font-weight: bold;
}

.settings-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #001a33;
    border: 1px solid #444;
    border-radius: 4px;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.settings-dropdown.show {
    display: block;
}

.settings-user-info {
    padding: 12px 16px;
    color: #fff;
    border-bottom: 1px solid #444;
    font-size: 0.9rem;
}

.settings-menu-item {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #fff;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.settings-menu-item:hover {
    background: #00264d;
}

.settings-menu form {
    margin: 0;
}

.logout-button {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 戦闘画面：縦並びレイアウト（3行） */
.battle-layout-vertical {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.battle-row-1,
.battle-row-2,
.battle-row-3 {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* 戦闘画面：横並び表示（2列目内） */
.battle-screen-horizontal {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.battle-character-display {
    flex: 0 0 140px;
    width: 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.battle-character-image-container {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}

.battle-character-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.battle-character-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 4px;
}

/* レアキャラクター（放浪きのこ）の金色エフェクト */
.battle-character-name.rare-character {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 100%;
    animation: gold-shimmer 3s ease-in-out infinite, gold-text-glow 2s ease-in-out infinite;
    position: relative;
}

@keyframes gold-shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes gold-text-glow {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 6px rgba(255, 215, 0, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 12px rgba(255, 215, 0, 0.7)) drop-shadow(0 0 18px rgba(255, 215, 0, 0.5));
    }
}

.battle-character-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    width: 100%;
    gap: 8px;
}

.battle-stat-label {
    color: #b8c1ec;
    font-weight: 500;
}

.battle-stat-value {
    color: #fff;
    font-weight: 600;
}

/* HP/MPゲージのスタイル */
.battle-gauge-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    font-size: 0.8rem;
}

.battle-gauge-label {
    color: #b8c1ec;
    font-weight: 600;
    font-size: 0.75rem;
}

.battle-gauge-wrapper {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.battle-gauge-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.battle-gauge-hp {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.battle-gauge-mp {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.battle-gauge-text {
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    text-align: center;
}

/* アイテム表示スタイル */
.reward-items-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-left: 0;
    padding-left: 0;
}

.reward-items-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.item-name {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.item-name.normal-item {
    color: #808080;  /* 鼠色 */
}

.item-name.rare-item {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 100%;
    animation: gold-shimmer 3s ease-in-out infinite, gold-text-glow 2s ease-in-out infinite;
    position: relative;
}

