body,
button,
input,
select,
textarea {
  font-family: 'Roboto', 'Helvetica Neue', 'Segoe UI', 'Arial', sans-serif;
}

/* ✅ iframe 구조 */
.cube-frame {
  height: 200px;
  width: 100%;
  max-width: 200px;
  border: none;
}
.iframe-wrapper {
  position: relative;
  width: fit-content;
}

/* 차후삭제
 .iframe-wrapper {
  width: fit-content;
  max-width: 100%;
}
 */


.iframe-wrapper iframe {
  pointer-events: none;
}

#f2l-container,
#oll-container,
#pll-container {
  background-color: #fefefe;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}




/* ─────────────────────────────── */
/* 🎨 2. 각 케이스 별 */
/* ─────────────────────────────── */
.case-box {
  background-color: #FFFBEA;
  border: 1px solid #aaa;
  border-radius: 8px;
  padding: 10px;
  margin: 0px 17px 20px 17px;
  overflow: hidden;
  max-width: 800px;
}


/* 즐겨찾기한 케이스가 없을 때 메세지*/
.no-favorite-msg {
  text-align: center;
  color: #666;
  font-size: 20px;
  margin-top: 100px;
  margin-bottom: 100px;
}

/* ─────────────────────────────── */
/* 🎨 3. 각 케이스별 첫번째 줄       */
/* ─────────────────────────────── */
/* === 공통 레이아웃 구성 === */
.case-inforow {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: left;
  gap: 0px;
  margin-left: 10px;
}

/* ─────────────────────────────── */
/* 🎨 3-1. 왼쪽 이미지 + 버튼       */
/* ─────────────────────────────── */
.case-left-box {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  flex: 0 0 auto;
}

/* === 버튼 / iframe 셀 === */
.button-cell {
  width: 30px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-shrink: 0;
  margin: 30px 0px;
}

.html-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 200px;
  flex-shrink: 1;
}

.image-cell {
  width: 200px;
  object-fit: contain;
  display: block;
  transition: transform 0.4s cubic-bezier(0.5,1.8,0.5,1); /* 부드러운 회전 */
  margin: 0 auto;
  user-select: none;
}


.rotate-btn {
  font-size: 24px;
  cursor: pointer;
  user-select: none;
  padding: 4px 10px;
  background-color: #C8E6C9;
  border-radius: 8px;
  border: 1px solid #66BB6A;
}

.rotate-btn.rotate-left {
  transform: scaleX(-1);
}


/* ─────────────────────────────── */
/* 🎨 3-2. 오른쪽 박스       */
/* ─────────────────────────────── */
.case-right-box {
  display: grid;
  grid-template-rows: auto auto;
  margin-left: 16px;
  flex: 1 1 auto;
  min-width: 0;
}

.name-row {
  padding: 0px 12px;
  font-size: 40px;
  font-weight: bold;
  background-color: #C8E6C9;
  border-radius: 6px;
  border: 3px solid #1d1c1c;
  cursor: pointer;
}

.setup-row {
  padding: 10px 0px;
  display: flex;
  flex-wrap: wrap;
  gap: 0px;
  background-color: transparent;
  border: none;
}
  
.setup-char {
  display: flex; 
  padding: 0px 0px;
  aspect-ratio: 1 / 1;
  justify-content: center;
  align-items: center;
  min-width: 28px;    
  background-color: #c28427;
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
}

.name-row input[type="checkbox"] {
  width: 30px;
  height: 30px;
  cursor: pointer; /* 네임로우 클릭 시 손 모양 커서 */
}
.name-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer; 
}



/* ─────────────────────────────── */
/* 📋 4. 알고리즘 표 및 토큰 */
/* ─────────────────────────────── */
.alg-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 40px;
  border: 1px solid #aaa;
  border-radius: 6px;
  transition: background 0.28s, transform 0.22s, box-shadow 0.22s, opacity 0.22s;
}

.alg-table td {
  border-top: 2px solid #ccc;
  border-bottom: 2px solid #ccc;
}

tr.selected-alg {
  background-color: #fff9c4; /* 연한 하늘색, 필요시 조정 */
}

.alg-table-wrapper {
  position: relative;
  overflow: hidden;
  max-height: none;
}


.alg-toggle-container {
  text-align: center;
  margin-top: 6px;
}

.alg-toggle-btn {
  all: unset; /* 버튼 스타일 초기화 */
  font-size: 20px;
  cursor: pointer;
  display: inline-block;
  padding: 0 16px; /* ⬅️ 좌우 여백만 */
  line-height: 1;  /* 높이 늘리지 않음 */
  text-align: center;
  transform: scaleX(1.8);
}

.combined-cell {
  padding: 4px 8px;
}

.combined-cell-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.combined-cell-content .alg-left {
  flex: 1;
  text-align: left;
}

.combined-cell-content .alg-right {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 20px; /* ✅ 글씨 크기 지정 */
}

.combined-cell-content .alg-right .youtube-btn {
  font-size: 20px;  /* ✅ YouTube 버튼 크기 조절 */
  padding: 2px 6px;
}

.combined-cell-content .alg-right .fav-count {
  font-size: 20px;  /* ✅ 즐겨찾기 숫자 크기 */
}

/* 알고리즘 열 */
.alg-char-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0px;
  cursor: pointer;  
}


.alg-char {
  display: flex; 
  aspect-ratio: 1 / 1;
  justify-content: center;
  align-items: center;
  background-color: #00897B;
  color: #fff;
  border-radius: 50%;
  width: 30px; 
  height: 30px;    
  font-size: 22px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

/* '의 간격 줄이기 */
.alg-char.tight-quote {
  letter-spacing: -0.5px; /* 필요에 따라 -2px ~ -6px 조절 */
  text-align: right; /* 오른쪽 정렬 */
}


.selected-alg .alg-char {
  background-color: #3949AB;
  font-weight: bold;
  font-size: 22px;
}


/* 애니메이션 강조 */
.alg-table tr.alg-row-anim {
  background: #ffe082 !important;
  box-shadow: 0 0 12px 0 #ffe08299;
  opacity: 0.88;
  z-index: 1;
}

/* 체크박스 셀 */
.checkbox-cell {
  width: 40px;
  text-align: left;
  vertical-align: middle;
  cursor: pointer;
}

.checkbox-cell input[type="checkbox"] {
  width: 30px;
  height: 30px;
}

/* 유튜브 버튼 */
.youtube-btn {
  background-color: red;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 1px 6px;
  cursor: pointer;
}

/* 알고리즘이 없을 경우 안내 문구 */
.empty-alg {
  text-align: center;
  vertical-align: middle;
  color: #888;
  padding: 16px 8px;
  font-size: 20px;
}


/* ─────────────────────────────── */
/* 🗂️ 1. 카테고리 선택 모듈 UI */
/* ─────────────────────────────── */
/* ✅ 최상단 카테고리 그룹 변수 */
.container {
  --cat-padding-b: 10px;
  --footer-btn-f: 15px;
}

#category-module-wrapper {
  border: 1.5px solid #444;
  border-radius: 4px;
  padding: 10px 5px var(--cat-padding-b) 5px;
  margin: 20px 17px 30px 17px;
  background: #fff;
  position: relative;
}

.category-module-title-row {
  position: absolute;
  top: -16px;
  left: 17px;
  background: #fff;
  padding: 0 9px;
  font-weight: bold;
  font-size: 23px;
  z-index: 2;
}

#category-module-wrapper {
  position: relative; /* 반드시 있어야 자식의 absolute 적용 */
}

#category-main-title {
  font-size: 22px;
  font-weight: bold;
  color: #333333;
}

#category-buttons-content-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  margin-bottom: 10px;
  margin-top: 20px;
  padding-left: 10px;
  padding-right: 10px;
}

.category-btn {
  background: #eaf8f7;
  border: 1.3px solid #59c3c3;
  border-radius: 5px;
  font-size: 17px;
  padding: 5px 5px;
  align-items: center;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 5px;
  color: #222;
}

.category-btn:hover {
  background: #ececec;
}

.category-btn.selected {
  background: #23b4ae;
  border-color: #3492e4;
  font-weight: bold;
  color: #fff;
}

/* 푸터 액션 버튼 (Select All, Clear 등) */
.category-module-footer-row {
  position: absolute;
  right: 17px;
  bottom: calc(-0.5 * (var(--footer-btn-f) + var(--cat-padding-b) + 4px));
  z-index: 10;
  background: none;
  pointer-events: auto;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-actions button {
  font-size: var(--footer-btn-f);
  border-radius: 5px;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: 1.5px solid #bbb;
  color: #333;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
  box-shadow: none;
  outline: none;
  user-select: none;
  height: 25 px;  
}

.footer-actions button:hover {
  background: #ececec;
}

.footer-actions button.selected {
  background: #b6d8fc;
  border-color: #3492e4;
  font-weight: bold;
}

/* 카테고리 그룹 최상단 타이틀 */
.category-title {
  grid-column: 1 / -1;
  font-size: 60px;
  font-weight: bold;
  margin: 0px 17px 10px 17px;
  color: #333;
  background-color: #FFE0B2;
  padding: 10px 20px;
  border-radius: 12px;
}

/* ─────────────────────────────── */
/* 🎨 카테고리 버튼 이미지 툴팁 스타일 */
/* ─────────────────────────────── */

.category-btn {
  position: relative;             /* 툴팁 기준 위치 */
}

.category-tooltip {
  position: absolute;
  top: 110%;                   /* 버튼 위쪽으로 여백 확보 */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.95);
  padding: 8px;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: none;                  /* 평소 숨김 */
  z-index: 2000;                  /* 충분히 높게 설정해 다른 요소 가림 */
  pointer-events: none;           /* 툴팁 클릭 방지 */
  white-space: nowrap;
  display: none;
  grid-template-columns: repeat(4, auto);
  gap: 10px;
}

.category-btn:hover .category-tooltip {
  display: grid;                  /* 마우스 호버 시 보이기 */
}

.tooltip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  user-select: none;
}

.tooltip-item img {
  width: 60px;           /* 툴팁 내 이미지 크기 */
  height: auto;
  border-radius: 4px;
  margin-bottom: 4px;
}

.tooltip-item-label {
  font-size: 13px;
  color: #333;
  word-break: break-word;
}









/* ───────────────────────────────  */
/* 🏁 7. 레이아웃 변경               */
/* ───────────────────────────────  */

 /* 1400px 이하일 때 기본적으로 1열 */
@media (max-width: 1400px) {
  #f2l-container,
  #pll-container,
  #oll-container {
    grid-template-columns: 1fr;
  }
}

/* === 모바일 레이아웃: 550px 이하 === */
@media (max-width: 550px) {
  .case-inforow {
    flex-direction: column;
    align-items: center;
    margin-left: 0;
  }

  .case-right-box {
    order: 1;         /* 🔼 위로 */
    width: 100%;
    margin-left: 0;
  }

  .case-left-box {
    order: 2;         /* 🔽 아래로 */
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    max-width: 100%;
    overflow: visible;
  }

  .rotate-btn {
    font-size: 30px;
  }


  .button-cell {
    margin: 10px 30px;
  }

  .html-cell {
    flex-grow: 1;
    width: 100%;
    /* max-width: calc(100% - 60px); */
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .image-cell {
    width: 150px;
  }

/* 
  .iframe-wrapper {
    width: 100%;
    max-width: none;
    max-width: 180px;
  }
 */

  .html-cell {
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
  }

  .category-title {
    grid-column: 1 / -1;
    font-size: 40px;
  }
/* 
  .category-tooltip {
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .category-tooltip.auto-hide {
    opacity: 1;
    pointer-events: auto;
    animation: fadeout 1s ease 1s forwards; 
  }
*/
}