

/* 모든 요소 적용 */
* {
    font-family: 'Jua', sans-serif;
    /* font-size: 1.2rem; */
}

/* 특정 태그 적용 */
h1 {
    text-align: center;
}
h2 {
    color: forestgreen;
    margin-top: 2px;
    margin-bottom: 5px;
    font-size: 20px;
}

body {
    background-color: #f0f0f0;
}


/* 클래스 정의 */
.hidden {
    display: none !important;
}
.no-pointer {
    pointer-events: none;
}
.container {
    /*display: flex;
    flex-wrap: wrap;*/ /*줄 바꿈을 위해 필요 */
    display: flex;
    justify-content: center;
    align-items: center;
}
.container-margin {
    margin: 20px;
}
.box-menu {
    background-color: #C6DAF2;
    width: 100vw;
    height: 100vh;
}
/* .box {
    flex: 1 1 auto;
    min-width: 400px;
    height: 98vh;
    background-color: #C6DAF2;
} */
.box-board {
    background-color: #C6DAF2;
    display: flex;
    flex-direction: column;
    position: relative;
}
.box-tools {
    position: relative; /* 장기판 회전 버튼 때문에 추가 */
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    background-color: #5e5e5e;
}
.box-buttons {
    gap: 10px;
    /* padding: 10px; */
}
.box-analysis {
    background-color: #f0f0f0;
}
.container-graphs {
    background-color: #f0f0f0;
    border: 0.1px solid  #cccccc;
}
.formation {
    margin: 15px;
    padding: 20px;
    background-color: #2C4CD1;
    border: none;
    border-radius: 15px;
    color: white;
}
.txt-player {
    font-size: 25px;
    margin-left: 5px;
    margin-bottom: 5px;
}
.btn-main-menu {
    background-color: #2C4CD1;
    color: #ffffff;
    border: none;
    border-radius: 15px;
    width: 300px; height: 100px;
    font-size: 30px;
    margin: 7px 0;
}
.btn-main-menu:active {
    transform: translateY(3px); /* 클릭 시 버튼 아래로 약간 이동 */
    background-color: #1E3BB6; /* 클릭 시 배경색 변경 */
}
.btn-main-menu:hover {
    background-color: #1E3BB6; /* 호버 시 배경색 변경 */
    cursor: pointer; /* 마우스 커서를 포인터로 변경 */
}
.btn-select {
    background-color: #2C4CD1;
    color: #ffffff;
    border: none;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    height: 110px;
    font-size: 30px;
    margin: 7px 0;
}
.btn-select-level-description {
    font-size: 20px;
}
.btn-mistake-description {
    color: #ffff00;
    font-size: 20px;
}
.btn-mistake-notes {
    height: 90px; /* 이 값이 덮어씌움 */
}
.btn-select:active {
    transform: translateY(3px); /* 클릭 시 버튼 아래로 약간 이동 */
    background-color: #1E3BB6; /* 클릭 시 배경색 변경 */
}
.btn-select:hover {
    background-color: #1E3BB6; /* 호버 시 배경색 변경 */
    cursor: pointer; /* 마우스 커서를 포인터로 변경 */
}
.btn-select:disabled {
    background-color: #5059F9; /* 연한 파랑 또는 회색 느낌 */
    color: #ECECEC;            /* 연한 글자색 */
    opacity: 0.6;
    pointer-events: none;
}
.btn-sub {
    padding: 10px 10px;
    background-color: #5e5e5e;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 20px;
    cursor: pointer;
}
.btn-sub:active {
    transform: translateY(2px); /* 클릭 시 버튼 아래로 약간 이동 */
    background-color: #4e4e4e; /* 클릭 시 배경색 변경 */
}
.btn-sub:hover {
    background-color: #4e4e4e;
}
.btn-tool {
    padding: 10px 20px;
    background-color: #2e2e2e;
    color: white;
    border: 4px solid white;
    border-radius: 30px;
    font-size: 20px;
    cursor: pointer;
}
.btn-tool:active {
    transform: translateY(2px); /* 클릭 시 버튼 아래로 약간 이동 */
    background-color: #1e1e1e; /* 클릭 시 배경색 변경 */
}
.btn-tool:hover {
    background-color: #1e1e1e;
}
.btn-tool:disabled {
    background-color: #555; /* 비활성화 시 더 연한 색상 */
    color: #bbb; /* 글자색도 연하게 */
    border-color: #777; /* 테두리 색상 변경 */
    cursor: default; /*비활성화 시 커서 변경*/
    transform: none; /* 클릭 시 이동 방지 */
}
.btn-settings {
    position: absolute;
    z-index: 999;
    top: 15px;
    right: 15px;
    padding: 10px 7px;
    background-color: #3e3e3e;
    color: white;
    font-size: 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.btn-settings:active {
    transform: translateY(2px); /* 클릭 시 버튼 아래로 약간 이동 */
    background-color: #2e2e2e; /* 클릭 시 배경색 변경 */
}
.btn-settings:hover {
    background-color: #2e2e2e;
}
#btn-flip-board {
    position: absolute;
    top: 0px;
    left: 5px;
    font-size: 25px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}
#btn-flip-board:hover {
    transform: rotate(90deg);
}
#btn-flip-board:active {
    transform: rotate(90deg);
}
.btn-back {
    position: absolute;
    z-index: 999;
    top: 15px;
    left: 15px;
    padding: 10px 10px;
    background-color: #5c6bc0;
    color: white;
    font-size: 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.btn-back:active {
    transform: translateY(2px); /* 클릭 시 버튼 아래로 약간 이동 */
    background-color: #3949ab; /* 클릭 시 배경색 변경 */
}
.btn-back:hover {
    background-color: #3f51b5;
}
.btn-back:disabled {
    background-color: #bababa; /* 비활성화 시 더 연한 색상 */
    color: #eee; /* 글자색도 연하게 */
    cursor: default; /*비활성화 시 커서 변경*/
    transform: none; /* 클릭 시 이동 방지 */
}
.btn-formation-cho {
    padding: 10px 10px;
    font-size: 20px;
    background-color: #2e2e2e;
    color: white;
}
.btn-formation-han {
    padding: 10px 10px;
    font-size: 20px;
    background-color: #2e2e2e;
    color: white;
}
.btn-formation-han-active {
    background-color: white;
    color: red;
}
.btn-formation-cho-active {
    background-color: white;
    color: blue;
}
.section-setting {
    padding: 10px 5px;
    border-bottom: 1px solid #9e9e9e;
}
.vertical-center {
    display: flex;
    flex-direction: column; /* 수직 방향으로 아이템 배치 */
    align-items: center; /* 수직 방향으로 가운데 정렬 */
    justify-content: center; /* 수평 방향으로 가운데 정렬 */
}
.horizontal-center {
    display: flex;
    justify-content: center;
    align-items: center;
}
.fill-parent {
    width: 100%;
    height: 100%;    
}
.width-fill-parent {
    width: 100%;
}
#icon-matsang {
    /* 맞상 아이콘 */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-150%, -110%);
    font-size: 1.5rem;
    width: 5.5rem;
    height: 2.5rem;
    background-color: #ff0000;
    color: rgb(255, 255, 255);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #fff000;
    text-shadow: 1px 1px 2px black;
}
#panel-gameover {
    position: absolute;
    width: 300px;
    height: 130px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);

    background: rgb(50, 88, 50);
    border: 5px solid #ebf0b0;
    border-radius: 30px;
    color: white;

    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
}
#panel-gameover.show {
    animation: bounce-in 0.6s ease forwards;
    visibility: visible;
}
#gibo-title {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.5rem;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
    min-width: 300px;
}
#gibo-title.show {
    opacity: 1;
}
.panel-notification {
    position: fixed;
    background: #ffe58f;
    color: #333;
    width: 300px;
    height: 320px;
    padding: 12px 24px;    
    top: 46%; /* 정중앙보다 조금 위 (기본은 50%) */
    left: 50%;
    transform: translate(-50%, -50%); /* 정확히 중앙 정렬 */
    z-index: 999;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 6px 6px rgba(0,0,0,0.15);
    font-size: 20px;
}
#btn-noti-panel-close {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}
.panel-settings {
    position: fixed;
    top: 65px; /* 설정 버튼 아래에 위치 */
    right: -320px;
    width: 280px;
    max-height: calc(100vh - 100px); /* 화면의 높이에 맞게 설정 */
    padding: 10px;
    background-color: white;
    border: 5px solid white;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 999; /* 메인 페이지보다 상단에 두기 위해 z-index 설정 */
    transition: right 0.3s ease; /* 슬라이드 애니메이션 */
    overflow-y: auto; /* 스크롤이 가능하도록 설정 */
}
.panel-settings.show {
    right: 0;
}
.panel-info {
    max-width: 600px;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.tab {
    overflow: hidden;
    border-bottom: 1px solid #ccc;
    display: flex;
}
.tab button {
    background-color: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    font-size: 20px;
    flex: 1; /* 각 버튼이 부모의 가로길이를 균등하게 나누도록 설정 */
}
.tab button:hover {
    background-color: #ddd;
}
.tab button.active {
    background-color: #ccc;
}
.tabcontent {
    display: none;
    padding: 6px 12px;
    border-top: none;
}
.margin-top-20 {
    margin-top: 20px;
}
.top-bar {
    position: fixed;
    text-align: left;    
    height: 50px;
    top: 15px;
    left: 15px;
    background-color: transparent;
}
.txt-accuracy {
    flex: 0.5;
    text-align: center;
}
.txt-status {
    text-align: center;
    font-size: 50px;
    color: #011a35;
}   
.txt-server-info {
    position: absolute;
    top: 50px;
    right: 50px;
    font-size: 20px;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 5px;
    text-align: right;
}
.txt-turn {
    text-align: center;
    color: white;
    font-size: 20px;
}
.glow {
    animation: glow-animation 1s ease-in-out infinite alternate;
}
.blink {
    animation: blink-animation 1s infinite;
}
.selected {
    /* 10% 확대 */
    /* transform: scale(1.1); */
}
.pulse {
    /* 무한 반복 애니메이션 */
    animation: pulse 0.5s infinite;
    transform-box: fill-box; /*변환의 기준점을 결정*/
    transform-origin: center; /*변환 기능에 대한 기준점을 설정 */
}
.fill-red {
    fill: red;
}
/* 기물 이미지 애니메이션 효과 */
.pieceImg {
    transform-box: fill-box; /*변환의 기준점을 결정*/
    transform-origin: center; /*변환 기능에 대한 기준점을 설정*/
    cursor: pointer
}
/* 텍스트 애니메이션 효과 */
.animatedText {
    stroke-dasharray: 0, 100%;
    animation: drawText 1s linear forwards;
}
.victory {
    animation: neon 3s alternate infinite;
}

/* 콤보 텍스트 */
.combo-text {
    animation: moveUpAndFade 1.5s ease-in-out forwards;
}

.txt-title {
    font-size: 40px;
    font-family: 'sans-serif';
    font-weight: 800;
    text-shadow: 0px 1px 2px #2C4CD1,
                 1px 1px 2px #2C4CD1,
                 1px 0px 2px #2C4CD1,
                 0px -1px 2px #2C4CD1,
                 -1px -1px 2px #2C4CD1,
                 -1px 0px 2px #2C4CD1,
                 -1px 1px 2px #2C4CD1,
                 1px -1px 2px #2C4CD1;
    color: white;
    position: relative;
    top: -30px;
}
.txt-title .white-circle {
    /* background-color: white; */
    border-radius: 50%;
    /* padding: 8px; */
}
#txt-player-rating {
    font-size: 60px;
    font-weight: 800;
    text-shadow: 0px 1px 2px #0f2271,
                 1px 1px 2px #0f2271,
                 1px 0px 2px #0f2271,
                 0px -1px 2px #0f2271,
                 -1px -1px 2px #0f2271,
                 -1px 0px 2px #0f2271,
                 -1px 1px 2px #0f2271,
                 1px -1px 2px #0f2271;
    color: #6c7fcb;
}
.radio-margin {
    margin-left: 20px; /* 라디오 버튼 간격 */
}
.information-circle {
    display: inline-block;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    text-align: center;
    line-height: 20px;
    font-weight: bold;
}
.gibo-item {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    padding: 8px;
    margin: 5px 0px;
    border-radius: 10px;
    background: #f9f9f9;
    cursor: pointer;
}
.gibo-item:hover {
    background-color: #eee;
}
.gibo-item:active {
    background-color: #ddd;
}
.admin-reply {
    margin-left: 5px;
    padding: 8px;
    color: #555;
    background: #fff8dc;
    /* font-family: 'sans-serif'; */
    border-radius: 10px;
}
.admin-reply-wrapper {
    display: flex;
    align-items: flex-start;
    margin-left: 10px;
    color: lightgray;
}
.gibo-result {
    font-size: 36px;
    width: 60px;
    height: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border-radius: 4px;
}
.gibo-result-win {
    background-color: #27ae60;
    color: white;
}
.gibo-result-lose {
    background-color: #7f8c8d;
    color: white;
}
.gibo-info {
    flex: 1;
    font-size: 15px;
    line-height: 1.4;
    margin-left: 14px;
}
.container-gibo {
    width: 90%;
    max-width: 500px;
    max-height: 75vh;
}
.list-gibo {
    overflow-y: auto;
    max-height: 90%;
    margin: 0 auto;
    padding: 10px;
    border-radius: 5px;
    background-color: #444;
}
.list-info {
    overflow-y: auto;
    max-height: 100%;
    -ms-overflow-style: none; /* 스크롤바 숨기기 IE/Edge */
    scrollbar-width: none;     /* 스크롤바 숨기기 Firefox */
}
.list-info::-webkit-scrollbar {
    display: none;      /* 스크롤바 숨기기 사파리 */
}
#gibo-controls {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}
#txt-empty-gibo {
    color: white;
    text-align: center;
}
.btn-edit-gibo {
    background: none;
    border: 1px solid #888;
    padding: 0px;
    font-size: 13px;
    cursor: pointer;
    margin-left: 3px;
}
.btn-edit-gibo:hover {
    background-color: #3498db;
}
.btn-share-gibo {
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    margin-left: 10px;
}
.btn-share-gibo:hover {
    background-color: #3498db;
}
.btn-delete-gibo {
    background: none;
    color: #999;
    border: none;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 0px;
}
.btn-delete-gibo:hover {
    background-color: #e74c3c;
}
.btn-remove-all {
    margin-top: 10px;
    padding: 12px 6px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
}
.btn-remove-all:hover {
    background-color: #c0392b;
}
.btn-remove-all:active {
    background-color: #c0392b;
    transform: translateY(2px);
}
.fancy-select {
    padding: 6px 12px;
    border: 1px solid #888;
    border-radius: 6px;
    background-color: #2c3e50;
    color: white;
    font-size: 16px;
    appearance: none;         /* 기본 브라우저 스타일 제거 */
    -webkit-appearance: none; /* Safari */
    -moz-appearance: none;    /* Firefox */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='white' d='M0 3l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.fancy-select:hover {
    border-color: #3498db;
}
#btn-toggle-sort {
    padding: 6px 12px;
    margin-left: 10px;
    border: 1px solid #888;
    border-radius: 6px;
    background-color: #2c3e50;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
#btn-toggle-sort:hover {
    border-color: #3498db;
    background-color: #34495e;
}
#btn-gibo {
    padding: 10px 10px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 20px;
    cursor: pointer;
}
#btn-gibo:active {
    transform: translateY(2px);
    background-color: #4e4e4e;
}
#btn-gibo:hover {
    background-color: #34495e;
}
#btn-feedback {
    padding: 10px 9px;
    background-color: #28283c;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 20px;
    cursor: pointer;
}
#btn-feedback:active {
    transform: translateY(2px);
    background-color: #1f1f2f;
}
#btn-feedback:hover {
    background-color: #32324d;
}
#btn-mistakes {
    padding: 10px 9px;
    background-color: #008b8b;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 20px;
    cursor: pointer;
}
#btn-mistakes:active {
    transform: translateY(2px);
    background-color: #006b6b;
}
#btn-mistakes:hover {
    background-color: #009e9e;
}
.btn-edit-name {
    border: none;
    background-color: #71aab7;
    color: #ffffff;
    font-size: 16px;
    border-radius: 15px;
    padding: 7px;
    margin-left : 10px;
    position: relative;
    top: -4px;
}
.btn-edit-name:hover {
    background-color: #5f8f9b;
}
.btn-edit-name:active {
    transform: translateY(2px);
}
.spinner-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}
#spinner-text {
    color: white;
    font-size: 1.4em;
}
#txt-feedback {
    width: 100%;
    resize: vertical;
    padding: 10px;
    font-size: 1rem;
    border: none;
}


/* 애니메이션 */
@keyframes grow {
    from { transform: scale(0.7); }
    to { transform: scale(1); }
}

@keyframes glow-animation {
    from {filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1))
                  drop-shadow(0 0 20px rgba(255, 255, 255, 1));}
    to {filter: drop-shadow(0 0 20px rgba(0, 0, 0, 1))
                drop-shadow(0 0 20px rgba(0, 0, 0, 1));}
}

/* 기물 이미지 크기 변환을 위한 키 프레임 애니메이션 */
@keyframes growAndShrink {
    0% { transform: scale(1); } /* 시작 시 원래 크기 */
    80% { transform: scale(1.5); } /* 중간에 크기 키우기 */
    100% { transform: scale(1); } /* 끝에 다시 원래 크기 */
}

@keyframes pulse {
    0% {transform: scale(1);}
    50% {transform: scale(1.5);}
    100% {transform: scale(1);}
}

@keyframes drawText {
    0% {
        stroke-dasharray: 0, 100%;
    }
    100% {
        stroke-dasharray: 100%, 0;
    }
}

@keyframes neon {
    0% { text-shadow: 
        0 0 10px #fff, 
        0 0 60px #00bfff; /* 하늘색 */
    }
    50% { text-shadow: 
        0 0 10px #fff, 
        0 0 60px #8a2be2; /* 보라색 */
    }
    100% { text-shadow: 
        0 0 10px #fff, 
        0 0 60px #00bfff; /* 하늘색 */
    }
}

@keyframes moveUpAndFade {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px);
    }
}

@keyframes blink-animation {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: translate(-50%, -70%);
    }
    50% {
        opacity: 0.5;
        transform: translate(-50%, -40%);
    }
    100% {
        opacity: 0.9;
        transform: translate(-50%, -50%);
    }
}

/* 미디어 쿼리 */
/* 가로가 세로보다 길 때 */
@media (min-aspect-ratio: 0.9/1) {
    .container {
        flex-direction: row;
    }
    .box-board {
        width: 100vmin;
        height: 100vmin;
    }
    .box-tools {
        /* width: 100px; */
        height: 100vmin;
        flex-direction: column;
    }
    .box-analysis {
        width: 600px;
        height: 100vmin;
    }
    #txt-turn-info {
        margin-bottom: 200px;
    }
    #btn-flip-board {
        left: 35px;
        top: 70px;
    }
}

/* 세로가 가로보다 길 때 */
@media (max-aspect-ratio: 0.9/1) {
    .container {
        flex-direction: column;
    }
    .box-board {
        width: 100vmin;
        height: 115vmin;
        margin-top: 70px;
    }
    .box-tools {
        width: 100vmin;
        justify-content: center;
        /* height: 50px; */
    }
    .box-analysis {
        width: 100vmin;
        height: 100px;
    }
    .container-graphs h1 { 
        display: none; /* 세로가 가로보다 길 땐, "평가 그래프" 글자 숨기기*/
    }
    #txt-turn-info {
        width: 100vmin;
    }
}

/* 휴대폰 전용 */
@media (max-width: 450px) {
/* 도구 버튼들이 휴대폰 화면에서 가로폭이 줄어들도록 */
    .btn-dynamic-padding {
        padding: 10px 10px;
    }

    .btn-formation-cho {
        padding: 10px 4px;
        font-size: 18px;
    }
    .btn-formation-han {
        padding: 10px 4px;
        font-size: 18px;
    }
    /* 기보 아이템 오른쪽 버튼들(공유,삭제) 세로 정렬 */
    .button-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .gibo-info {
        margin-left: 0px;
    }
}
@media (max-height: 750px) {
    .btn-main-menu {
        height: 70px;
    }
}