/* ================================
   미니게임 스타일 - 블랙 모던 테마
================================ */

.minigame-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.minigame-container h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* 탭 스타일 - 다크 테마 */
.minigame-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.minigame-tab {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.minigame-tab.active {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: #000;
    opacity: 1;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    border-color: transparent;
}

.minigame-tab:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    border-color: var(--gold-primary);
}

/* 방 목록 */
.room-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.room-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    border-left: 4px solid var(--gold-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2);
    border-color: var(--gold-primary);
}

.room-card.omok {
    border-left-color: #fff;
}

.room-card.othello {
    border-left-color: var(--neon-green);
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.room-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.room-type-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #000;
}

.room-type-badge.omok {
    background: linear-gradient(135deg, #e0e0e0, #fff);
}

.room-type-badge.othello {
    background: linear-gradient(135deg, var(--neon-green), #00a085);
}

.room-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.room-bet-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.room-bet-info .label {
    color: var(--text-secondary);
}

.room-bet-info .value {
    font-weight: 600;
    color: var(--text-primary);
}

.room-bet-info .gold {
    color: var(--gold-primary);
}

.room-bet-info .pokemon {
    color: var(--neon-red);
}

.room-host {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.room-actions {
    display: flex;
    gap: 10px;
}

.room-actions .btn-join {
    flex: 1;
    padding: 10px;
    border: none;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: #000;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.room-actions .btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.room-actions .btn-cancel {
    padding: 10px 15px;
    border: none;
    background: var(--neon-red);
    color: white;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}

/* 방 생성 버튼 - 다크 테마 */
.create-room-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px dashed var(--gold-primary);
    background: rgba(212, 175, 55, 0.05);
    color: var(--gold-primary);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-room-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-style: solid;
}

/* 방 생성 모달 - 다크 테마 */
.create-room-modal .modal-content {
    max-width: 500px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.create-room-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.form-group select,
.form-group input {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.form-group select option {
    background: #1a1a1a;
    color: var(--text-primary);
}

.bet-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bet-section h4 {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

/* 게임 보드 */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.player-info.current-turn {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    padding: 10px 15px;
    border-radius: 10px;
    color: #000;
}

.player-stone {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.player-stone.black {
    background: #2d3436;
    border-color: #2d3436;
}

.player-stone.white {
    background: white;
    border-color: #636e72;
}

.turn-indicator {
    font-weight: 700;
    color: var(--gold-primary);
}

/* 오목 보드 - 게임 특성상 유지 */
.omok-board {
    display: grid;
    grid-template-columns: repeat(15, 30px);
    grid-template-rows: repeat(15, 30px);
    background: #d4a373;
    padding: 15px;
    border-radius: 5px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.omok-cell {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.omok-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to bottom, transparent calc(50% - 1px), rgba(0, 0, 0, 0.6) calc(50% - 1px), rgba(0, 0, 0, 0.6) calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(to right, transparent calc(50% - 1px), rgba(0, 0, 0, 0.6) calc(50% - 1px), rgba(0, 0, 0, 0.6) calc(50% + 1px), transparent calc(50% + 1px));
    z-index: 0;
}

.omok-cell .stone {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    z-index: 1;
    transition: all 0.2s ease;
}

.omok-cell .stone.black {
    background: radial-gradient(circle at 30% 30%, #555, #000);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.omok-cell .stone.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.omok-cell .stone.last-move::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: #e74c3c;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.omok-cell:hover:not(.occupied)::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* 오셀로 보드 - 게임 특성상 유지 */
.othello-board {
    display: grid;
    grid-template-columns: repeat(8, 45px);
    grid-template-rows: repeat(8, 45px);
    background: #00a86b;
    padding: 10px;
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.othello-cell {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.2s ease;
}

.othello-cell:hover:not(.occupied) {
    background: rgba(255, 255, 255, 0.1);
}

.othello-cell .stone {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.othello-cell .stone.black {
    background: radial-gradient(circle at 30% 30%, #555, #000);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.othello-cell .stone.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.othello-cell.valid-move::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
}

/* 게임 액션 버튼 - 다크 테마 */
.game-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.game-actions button {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-surrender {
    background: var(--neon-red);
    color: white;
}

.btn-surrender:hover {
    background: #cc0040;
    transform: translateY(-2px);
}

.btn-leave {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.btn-leave:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* 게임 결과 모달 - 다크 테마 */
.game-result-modal .result-content {
    text-align: center;
    padding: 30px;
    background: var(--card-bg);
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.result-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-title.win {
    color: var(--neon-green);
}

.result-title.lose {
    color: var(--neon-red);
}

.result-title.draw {
    color: var(--text-secondary);
}

.result-reward {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.result-reward.gain {
    color: var(--neon-green);
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.result-reward.loss {
    color: var(--neon-red);
    background: rgba(255, 0, 128, 0.1);
    border: 1px solid rgba(255, 0, 128, 0.3);
}

/* 빈 상태 - 다크 테마 */
.room-list-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.room-list-empty .icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.room-list-empty .message {
    font-size: 1.1rem;
}

/* 포켓몬 선택 모달 - 다크 테마 */
.pokemon-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.pokemon-select-grid::-webkit-scrollbar {
    width: 8px;
}

.pokemon-select-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.pokemon-select-grid::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 4px;
}

.pokemon-select-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pokemon-select-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gold-primary);
}

.pokemon-select-item.selected {
    border-color: var(--neon-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.pokemon-select-item.in-team {
    opacity: 0.4;
    cursor: not-allowed;
}

.pokemon-select-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.pokemon-select-item .name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 5px;
    text-align: center;
}

/* 진행 중인 게임 알림 - 다크 테마 */
.active-game-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(240, 208, 96, 0.2));
    border: 1px solid var(--gold-primary);
    border-radius: 12px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.active-game-banner .info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-game-banner .btn-continue {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ========== 모바일 반응형 ========== */
@media (max-width: 768px) {
    .minigame-container {
        padding: 12px;
    }

    .minigame-container h2 {
        font-size: 1.3rem;
    }

    .minigame-tabs {
        gap: 8px;
    }

    .minigame-tab {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .room-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .room-card {
        padding: 16px;
    }

    .room-title {
        font-size: 1rem;
    }

    .create-room-btn {
        padding: 12px;
        font-size: 0.95rem;
    }

    .game-info-bar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
    }

    .turn-indicator {
        order: -1;
        width: 100%;
        text-align: center;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .omok-board {
        grid-template-columns: repeat(15, 22px);
        grid-template-rows: repeat(15, 22px);
        padding: 10px;
    }

    .omok-cell {
        width: 22px;
        height: 22px;
    }

    .omok-cell .stone {
        width: 18px;
        height: 18px;
    }

    .othello-board {
        grid-template-columns: repeat(8, 38px);
        grid-template-rows: repeat(8, 38px);
        padding: 8px;
    }

    .othello-cell {
        width: 38px;
        height: 38px;
    }

    .othello-cell .stone {
        width: 30px;
        height: 30px;
    }

    .game-actions {
        width: 100%;
        justify-content: center;
    }

    .game-actions button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .result-icon {
        font-size: 3rem;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .result-reward {
        font-size: 1rem;
    }

    .pokemon-select-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .pokemon-select-item img {
        width: 50px;
        height: 50px;
    }

    .active-game-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .minigame-tabs {
        flex-direction: column;
    }

    .minigame-tab {
        width: 100%;
    }

    .omok-board {
        grid-template-columns: repeat(15, 18px);
        grid-template-rows: repeat(15, 18px);
        padding: 8px;
    }

    .omok-cell {
        width: 18px;
        height: 18px;
    }

    .omok-cell .stone {
        width: 14px;
        height: 14px;
    }

    .othello-board {
        grid-template-columns: repeat(8, 32px);
        grid-template-rows: repeat(8, 32px);
        padding: 6px;
    }

    .othello-cell {
        width: 32px;
        height: 32px;
    }

    .othello-cell .stone {
        width: 26px;
        height: 26px;
    }

    .game-actions {
        flex-direction: column;
        gap: 10px;
    }

    .game-actions button {
        width: 100%;
    }

    .pokemon-select-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pokemon-select-item img {
        width: 45px;
        height: 45px;
    }

    .pokemon-select-item .name {
        font-size: 0.75rem;
    }

    .bet-section {
        padding: 12px;
    }

    .room-bet-info {
        flex-wrap: wrap;
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .omok-board {
        grid-template-columns: repeat(15, 16px);
        grid-template-rows: repeat(15, 16px);
        padding: 6px;
    }

    .omok-cell {
        width: 16px;
        height: 16px;
    }

    .omok-cell .stone {
        width: 12px;
        height: 12px;
    }

    .othello-board {
        grid-template-columns: repeat(8, 28px);
        grid-template-rows: repeat(8, 28px);
    }

    .othello-cell {
        width: 28px;
        height: 28px;
    }

    .othello-cell .stone {
        width: 22px;
        height: 22px;
    }
}

