@import url(./reset.css);
@import url(./cat.css);
@import url(./timer.css);
@import url('https://cdn.jsdelivr.net/npm/galmuri@latest/dist/galmuri.css');

#cat-wrapper *{
    font-family:"galmuri9";
    font-size:12px;
    color:var(--default-text-color);
    cursor:default;
}

#cat-wrapper img{
  margin-left:auto;
  margin-right:auto;
  display:block;
}

#cat-wrapper input[type="number"],#cat-wrapper input[type="text"],#cat-wrapper input[type="password"]{
    cursor:text;
    background-color:transparent;
} 

#cat-wrapper a, #cat-wrapper a *, #cat-wrapper button, #cat-wrapper button *, #cat-wrapper .cat-btn, #cat-wrapper .cat-btn *{
    cursor:pointer;
}


/*btns*/

#cat-wrapper .btn-cat {
    position:relative;
    display:inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    -ms-transition: all 0.3s;
    -o-transition: all 0.3s;
    height:24px;
    line-height:24px;
    padding:2px;
    border-radius:6px;
    -webkit-border-radius:6px;
    -moz-border-radius:6px;
    -ms-border-radius:6px;
    -o-border-radius:6px;
    transform:translateY(-1px);
    -webkit-transform:translateY(-1px);
    -moz-transform:translateY(-1px);
    -ms-transform:translateY(-1px);
    -o-transform:translateY(-1px);
    background-color: var(--btn-color-default);
    box-shadow:0px 2px 0px var(--btn-color-default);
    border:2px solid var(--btn-border-default);
    color:var(--btn-text-default)
}
#cat-wrapper .btn-cat.btn-ico{
    width:24px;
}
#cat-wrapper .btn-cat.btn-point{
    background-color: var(--btn-color-point);
    box-shadow:0px 2px 0px var(--btn-color-point);
    border:2px solid var(--btn-border-point);
    color:var(--btn-text-point)
}
#cat-wrapper .btn-cat.noclick{
    height:26px;
    box-shadow: none;
    transform:none;
    -webkit-transform:none;
    -moz-transform:none;
    -ms-transform:none;
    -o-transform:none;
    cursor:default;
}

#cat-wrapper .btn-cat.noclick.btn-ico{
    width:26px;
}

#cat-wrapper .btn-cat:not(.btn-cat.noclick):not(.menu-icons .btn-cat):hover:not(:disabled) {
    transform: translateY(1px);
    -webkit-transform: translateY(1px);
    -moz-transform: translateY(1px);
    -ms-transform: translateY(1px);
    -o-transform: translateY(1px);
    box-shadow:none;
}

#cat-wrapper .btn-cat:disabled{
    cursor: default;
    filter:brightness(.9);
    -webkit-filter:brightness(.9);
}

#cat-wrapper .btn-adm{
    position:relative;
    display:inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    -ms-transition: all 0.3s;
    -o-transition: all 0.3s;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    color: var(--setting-text-color);
    background-color: var(--setting-bg-color);
    border:1px solid var(--setting-text-color);
    padding: 0px 5px;
    font-size:11px;
    font-weight:300;
}

#cat-wrapper .btn-adm:hover {
  background-color: var(--setting-text-color);
  color: var(--setting-bg-color);
}

#cat-wrapper .btn-adm.btn-point {
  background-color: var(--setting-text-color);
  color: var(--setting-bg-color);
}

#cat-wrapper .btn-adm.btn-point:hover {
  color: var(--setting-text-color);
  background-color: var(--setting-bg-color);
}
#cat-wrapper .btn-big{
    width:100%;
    height:36px;
    margin:0 auto;
}

/*tabs*/
#cat-wrapper .tabs {
  display: flex;
}
#cat-wrapper .tab {
  flex: 1;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--setting-text-color);
  transition: all 0.3s;
  -webkit-transition: all 0.3s;
  -moz-transition: all 0.3s;
  -ms-transition: all 0.3s;
  -o-transition: all 0.3s;
}

#cat-wrapper .tab:hover {
  background-color: var(--setting-text-color);
  color: var(--setting-bg-color);
}

#cat-wrapper .tab.active {
  background-color: var(--setting-text-color);
  color: var(--setting-bg-color);
}

/**icons**/

#cat-wrapper .cat-icon{
    display:block;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    image-rendering: pixelated;
    background-color:var(--default-text-color);
    width:24px;
    height:24px;
}
#cat-wrapper .cat-icon.cat{
    mask-image: url('./objects/icon_cat.png');
    -webkit-mask-image: url('./objects/icon_cat.png');
}
#cat-wrapper .cat-icon.reward{
    mask-image: url('./objects/icon_reward.png');
    -webkit-mask-image: url('./objects/icon_reward.png');
}
#cat-wrapper .cat-icon.timer{
    mask-image: url('./objects/icon_timer.png');
    -webkit-mask-image: url('./objects/icon_timer.png');
}
#cat-wrapper .cat-icon.setting{
    mask-image: url('./objects/icon_setting.png');
    -webkit-mask-image: url('./objects/icon_setting.png');
}
#cat-wrapper .cat-icon.cancle{
    mask-image: url('./objects/icon_cancle.png');
    -webkit-mask-image: url('./objects/icon_cancle.png');
}
#cat-wrapper .cat-icon.admin{
    mask-image: url('./objects/icon_admin.png');
    -webkit-mask-image: url('./objects/icon_admin.png');
}
#cat-wrapper .cat-icon.play{
    mask-image: url('./objects/icon_play.png');
    -webkit-mask-image: url('./objects/icon_play.png');
}
#cat-wrapper .cat-icon.stop{
    mask-image: url('./objects/icon_stop.png');
    -webkit-mask-image: url('./objects/icon_stop.png');
}
#cat-wrapper .cat-icon.pause{
    mask-image: url('./objects/icon_pause.png');
    -webkit-mask-image: url('./objects/icon_pause.png');
}
#cat-wrapper .cat-icon.history{
    mask-image: url('./objects/icon_history.png');
    -webkit-mask-image: url('./objects/icon_history.png');
}
#cat-wrapper .cat-icon.newwin{
    mask-image: url('./objects/icon_newwin.png');
    -webkit-mask-image: url('./objects/icon_newwin.png');
}

#cat-wrapper .new-badge {
  position: absolute;
  width:8px;
  height:8px;
  top: 2px;
  right: 2px;
  background-color: #ff00c9;
  color: white;
  border-radius: 50px;
}

/*alerts*/

#cat-wrapper .msg-badge{
  background: var(--setting-text-color);
  color: var(--setting-bg-color);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  position: absolute;
  left:50%;
  transform:translateX(-50%);
  -webkit-transform:translateX(-50%);
  -moz-transform:translateX(-50%);
  -ms-transform:translateX(-50%);
  -o-transform:translateX(-50%);
}

#cat-wrapper .msg-badge span{
    color:inherit;
    font-weight:900;
}

#cat-wrapper .message {
  padding: 6px 10px;
  margin: 0;
  border-radius: 0;
  display: none;
  position: absolute;
  top: 10px;
  left: 50%;
  width:calc(100% - 12px);
  transform: translateX(-50%);
  max-width: 500px;
  z-index: 1000;
  text-align: center;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-radius: 8px;
}

#cat-wrapper .message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #28a745;
  border-bottom: 2px solid #28a745;
}

#cat-wrapper .message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #dc3545;
  border-bottom: 2px solid #dc3545;
}

#cat-wrapper .message.show {
  display: block;
}

/*table*/
#cat-wrapper .cat-table {
  width: 100%;
  border-collapse: collapse;
  padding: 10px;
}


#cat-wrapper .cat-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--setting-text-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

#cat-wrapper .cat-table th {
  background-color: var(--setting-text-color);
  color: var(--setting-bg-color);
  border-bottom: 2px solid var(--setting-text-color);
}

#cat-wrapper .cat-table td {
  border-bottom: 1px solid var(--setting-text-color);
}

#cat-wrapper .cat-table *{
  color:inherit;
  text-align: center;
  font-weight: 400;
  color: var(--setting-text-color);
}

#cat-wrapper .cat-table tr:hover {
  background: var(--setting-text-color);
  color: var(--setting-bg-color);
}

/*form*/

#cat-wrapper form select,
#cat-wrapper form input[type="text"],
#cat-wrapper .form-preset select,
#cat-wrapper .form-preset input[type="text"]
 {
    width: 100%;
    border: 2px solid var(--setting-text-color);
    border-radius: 8px;
    transition: all 0.3s;
    padding: 2px;
}


#cat-wrapper .input-big,
#cat-wrapper input[type="password"],input-big,
#cat-wrapper form select.input-big,
#cat-wrapper form input[type="text"].input-big,
#cat-wrapper .form-preset input[type="text"].input-big,
#cat-wrapper .form-preset select.input-big {
    width: 100%;
    padding: 4px 10px;
    border: 2px solid var(--setting-text-color);
    background-color:var(--setting-bg-color);
    color:var(--setting-text-color);
    border-radius: 4px;
    font-size: 12px;
    transition: border-color 0.3s;
}

#cat-wrapper .input-big::placeholder,
#cat-wrapper .input-big::placeholder{
    color:inherit;
    opacity:.8
}

#cat-wrapper input:focus, #cat-wrapper select:focus, #cat-wrapper textarea:focus{
    outline: none;
    border: 2px solid var(--point-text-color);
}

/*wrapper*/

#cat-wrapper {
    /* 폴백: 구형 브라우저용 */
    width: 100vw;
    height: 100vh;
    /* iOS Safari 최적화: dvh/dvw (동적 뷰포트) */
    width: 100dvw;
    height: 100dvh;
    /* 최신 브라우저: svh/svw (작은 뷰포트) */
    width: 100svw;
    height: 100svh;
    
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    
    background-image:var(--bg-image);
    background-color:var(--bg-color);
    background-repeat:no-repeat;
    background-position:center center;
    background-size:cover;
    
    /* 모바일 브라우저 주소창 대응 */
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
}

#cat-wrapper #cat-area {
    position: relative;
    width: 100%;
    max-width: calc(var(--container-width) + 40px);
    height: 100%;
    max-height: calc(var(--area-height) + 40px);
    background-color:var(--area-bg-color);
    background-image:var(--area-bg-image);
    padding: 50px 20px 20px 20px;
    padding-top: 55px;
    border: 2px solid var(--area-border-color);
    box-shadow: 7px 3px var(--area-border-color);
    filter: drop-shadow(17px 15px 20px #00000090);
    border-bottom-width: 4px;
    border-right-width: 4px;
    border-radius:24px;
    -webkit-border-radius:24px;
    -moz-border-radius:24px;
    -ms-border-radius:24px;
    -o-border-radius:24px;
}

/*menu*/

#cat-wrapper .page-title{
    color: var(--menu-text-color);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

#cat-wrapper #cat-area #cat-menu{
    display: flex;
    align-items: center;
    justify-content: space-between;
    height:32px;
    position:absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    border-top-right-radius: 20px;
    border-top-left-radius:20px;
    background-color: var(--menu-bg-color);
    border-bottom: 2px solid var(--area-border-color);
    padding: 0px 15px;
    font-weight:900;
}

#cat-wrapper .menu-icons{
    display: inline-flex;
    justify-content: end;
    align-items: center;
    gap:2px;
}

#cat-wrapper .menu-icons .btn-cat.btn-ico{
    width:20px;
    height:20px;
    border-radius:2px;
    -webkit-border-radius:2px;
    -moz-border-radius:2px;
    -ms-border-radius:2px;
    -o-border-radius:2px;
    border-width:2px;
    box-shadow: none;
    transform:none;
    -webkit-transform:none;
    -moz-transform:none;
    -ms-transform:none;
    -o-transform:none;
    line-height:20px;
    position: relative;
}

/* Tooltip */
#cat-wrapper .menu-icons .btn-cat.btn-ico[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
    -moz-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    -o-transform: translateX(-50%);
    background-color: var(--menu-bg-color);
    color: var(--menu-text-color);
    padding: 4px 8px;
    border-radius: 4px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    -ms-border-radius: 4px;
    -o-border-radius: 4px;
    border: 2px solid var(--menu-border-color);
    white-space: nowrap;
    font-size: 10px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-out forwards;
    -webkit-animation: tooltipFadeIn 0.2s ease-out forwards;
}

/* Tooltip Arrow */
#cat-wrapper .menu-icons .btn-cat.btn-ico[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
    -moz-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    -o-transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--menu-border-color);
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-out forwards;
    -webkit-animation: tooltipFadeIn 0.2s ease-out forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@-webkit-keyframes tooltipFadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateX(-50%) translateY(4px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateX(-50%) translateY(0);
    }
}

#cat-wrapper .menu-icons .btn-cat.btn-ico:hover{
    filter:brightness(.9);
    -webkit-filter:brightness(.9);
}

#cat-wrapper .cat-area-inner{
    width:100%;
    height:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:16px;
}

#cat-wrapper #cat-area.setting{
    padding: 45px 10px 10px 10px;
}

#cat-wrapper #cat-area.setting .cat-area-inner {
    padding:10px;
    border-radius:10px;
    -webkit-border-radius: 16px;
    -moz-border-radius:10px;
    -ms-border-radius:10px;
    -o-border-radius:10px;
    background-color:var(--setting-bg-color );
    color:var(--setting-text-color);
    position:relative;
}


/*userpage*/
#cat-wrapper .userpage-top{
    position:relative;
    width:100%;
    display:flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height:180px;
    max-height:180px;
    min-height:180px;
}
#cat-wrapper .userpage-bottom{
    position:relative;
    width:100%;
    height:100%;
    margin-bottom:10px;
    overflow: hidden;
}

#cat-wrapper .userpage-top .msg-badge{
  position:relative;
  display:inline-block;
  left:initial;
  transform:none;
  -webkit-transform:none;
  -moz-transform:none;
  -ms-transform:none;
  -o-transform:none;
  margin: 10px auto;
  text-align: center;
}

#cat-wrapper .cat-card {
  border-radius: 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 20px auto;
  width: 80%;
  background-color: var(--card-bg-color);
  border: 2px solid var(--card-border-color);
  padding:  10px;
  overflow: hidden;
}

#cat-wrapper .cat-card .card-item {
  text-align: center;

}

#cat-wrapper .cat-card .card-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--card-point-color);
}

#cat-wrapper .cat-card .card-label {
  color: inherit;
  margin-top: 5px;
}



/*modal*/

#cat-wrapper .modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color:#00000035;
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#cat-wrapper .modal.active {
  display: flex;
}

#cat-wrapper .modal-content {
    background-color: var(--area-bg-color);
    border:2px solid var(--area-border-color);
    max-width: 600px;
    width: 100%;
    height: auto;
    max-height: 80vh;
    position: relative;
    animation: modalFadeIn 0.3s;
    min-height:300px;
    border-radius:4px;
    padding-top:32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#cat-wrapper .modal-menu{
    display: flex;
    align-items: center;
    justify-content: space-between;
    height:32px;
    position:absolute;
    top:0px;
    left:0px;
    width:100%;
    border-top-right-radius:4px; 
    border-top-left-radius:4px; 
    background-color:var(--menu-bg-color);
    border-bottom:2px solid var(--menu-border-color);
    color:var(--menu-text-color);
    padding: 0 10px;
    font-weight:900;
}

#cat-wrapper .modal-close {
  position: absolute;
  top: -7px;
  right: 8px;
  font-size: 28px;
  cursor: pointer;
  color: var(--menu-text-color);
    z-index:1;
}

#cat-wrapper .modal-close:hover {
    color: var(--default-text-color);
}

#cat-wrapper .modal-image {
    max-width: 100%;
    border-radius: 12px;
    margin:20px auto;
}
#cat-wrapper #commonModalBody{
    height:100%;
    width:100%;
    max-height: calc(80vh - 34px);
}

#cat-wrapper .modal-message {
    padding: 10px 20px;
    color:var(--default-text-color);
    width:100%;
    height: 100%;
    max-height: calc(80vh - 36px);
    overflow-y:auto;
    overflow-x:hidden;
}


@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

::-webkit-scrollbar {
    width: 4px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--area-bg-color);
    border-radius:  4px;
    -webkit-border-radius:  4px;
    -moz-border-radius:  4px;
    -ms-border-radius:  4px;
    -o-border-radius:  4px;
}

::-webkit-scrollbar-thumb {
    background: var(--area-border-color);
    border-radius: 4px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    -ms-border-radius: 4px;
    -o-border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--area-border-color);
}
@media (max-width: 280px) {
      #cat-wrapper #cat-area{
        max-height:initial;
        height:100%;
      }
    #cat-wrapper .cat-card {
        justify-content:center;
        flex-wrap:wrap;
    }
}
@media (max-height: 250px) {
  #cat-wrapper .userpage-top {
      height:100%;
      max-height:100%;
      min-height: 100%;
      overflow: auto;
      padding: 0;
  }
     #cat-wrapper .cat-card {
        padding:0;
    }
}

@media (max-height: 400px) {
    #cat-wrapper, #cat-wrapper #cat-area{
        overflow:hidden;
    }
}