.is-hidden-tab {
    display: none !important;
}
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

/* Global Styles */
body {
  margin: 0;
  padding: 0;
  background-color: #c0c0c0;
  height: 100vh;
  overflow: hidden;
  font-family: 'Pretendard', 'Pixelated MS Sans Serif', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header */
.site-header {
    padding: 10px 16px 0 16px;
    flex-shrink: 0;
}

.site-header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: bold;
    color: #000000;
}

.header-line {
    height: 2px;
    background: #808080;
    border-bottom: 2px solid white;
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Tab Menu */
.tab-menu {
    padding-left: 16px;
    margin: 0;
    margin-bottom: -2px;
    z-index: 10;
    position: relative;
}

/* App Wrapper */
.app-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 4px;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    background: #c0c0c0;
    margin: 0 4px 4px 4px;
    position: relative;
}

/* Tab Views */
.tab-view {
    display: none;
    height: 100%;
    width: 100%;
}

.tab-view.active {
    display: flex;
}

/* Blog Layout */
.blog-layout {
    flex-direction: row;
    width: 100%;
    gap: 4px;
}

/* Game Container Style */
.game-container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #202020;
    height: 100%;
    color: white;
}

/* Sidebars */
.sidebar-left, .sidebar-right {
  background: #c0c0c0;
  flex-shrink: 0;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar-left { width: 220px; }
.sidebar-right { width: 250px; }

/* Tree View */
.tree-view {
  background: white;
  padding: 6px;
  border: 2px solid #808080;
  border-top-color: #404040;
  border-left-color: #404040;
  border-right-color: #dfdfdf;
  border-bottom-color: #dfdfdf;
  height: 100%;
  overflow-y: auto;
  font-family: 'Pretendard', sans-serif; /* 사이드바도 깔끔하게 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

.tree-view ul { list-style-type: none; padding-left: 0; margin: 0; }
.tree-view li { padding: 2px 0; cursor: pointer; }

/* Tree Hover Effects */
.tree-view summary:hover,
.tree-item:hover,
.root-item:hover {
  background-color: #000080;
  color: white;
}
.tree-view details { margin-bottom: 4px; }
.tree-view summary { cursor: pointer; list-style: none; }

.tree-item { padding-left: 16px; position: relative; }
.tree-item::before { content: "-"; position: absolute; left: 4px; color: #808080; }

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: white;
  border: 2px solid #808080;
  border-top-color: #404040;
  border-left-color: #404040;
  border-right-color: #dfdfdf;
  border-bottom-color: #dfdfdf;
  position: relative; 
}

/* Custom Scrollbar */
.main-content::-webkit-scrollbar {
    width: 12px;
}
.main-content::-webkit-scrollbar-track {
    background: #dfdfdf;
    border-left: 1px solid white;
}
.main-content::-webkit-scrollbar-thumb {
    background-color: #c0c0c0;
    border: 2px solid #c0c0c0;
    border-top-color: #dfdfdf;
    border-left-color: #dfdfdf;
    border-right-color: #404040;
    border-bottom-color: #404040;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 40px;
}

.post-count {
  width: 100%;
  margin: 0 auto 12px;
  font-size: 0.95rem;
  color: #333;
  font-family: 'Pretendard', 'Pixelated MS Sans Serif', Arial, sans-serif;
}

.post-card {
  width: 100%;
  font-size: 1.2em;
}

.post-card .window-body {
  padding: 4px;
  line-height: 1.6;
  font-family: 'Pretendard', sans-serif; /* 글 목록도 깔끔하게 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.02em;
}

.post-card .window-body p {
  margin-bottom: 12px;
}

.post-card .title-bar-text {
  font-size: 1.3em;
  font-family: 'Pretendard', sans-serif;
  font-weight: bold;
}

/* Article View */
.article-view {
    display: none;
    flex-direction: column;
    height: 100%;
}
.article-view.visible {
    display: flex;
}

.article-view .window-body {
    background: #c0c0c0;
    border: 1px solid #000;
    font-family: 'Pretendard', sans-serif;
    padding: 24px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* 내용물 전체를 가운데 정렬하기 위해 flex 사용 */
    display: flex;
    flex-direction: column;
    align-items: center; 
}

/* Match detail content background with desktop and outline in black */
.article-view .window-body * {
    background: transparent;
    font-family: 'Pretendard', sans-serif;
}

/* 제목과 메타 정보 너비 제한 해제 */
#article-title, 
#article-meta, 
.article-view hr {
    width: 100%;
    max-width: none; /* 제한 해제 */
    text-align: left;
    box-sizing: border-box;
}

#article-title {
    margin-top: 20px;
    margin-bottom: 10px;
}

.article-content {
    padding: 20px 0;
    line-height: 1.8;
    color: #222;      
    width: 100%;      
    max-width: none;  /* 제한 해제 */
    text-align: left; 
    letter-spacing: -0.02em; 
}

.article-content {
    padding: 20px 0;
    line-height: 1.8;
    color: #222;      /* 조금 더 진한 회색으로 가독성 UP */
    max-width: 800px;
    margin: 0 auto;
    letter-spacing: -0.02em; /* 자간을 좁혀서 단단한 느낌 */
}

/* Typography for Article Content (Markdown Styles) */
.article-content h1,
.article-content h2,
.article-content h3 {
    color: #111;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.3;
}

.article-content h1 { font-size: 2.2em; border-bottom: 2px solid #ddd; padding-bottom: 10px; }
.article-content h2 { font-size: 1.8em; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.article-content h3 { font-size: 1.4em; }
.article-content h4 { 
    font-size: 1.2em; 
    margin-top: 1.2em; 
    margin-bottom: 0.5em; 
    color: #333;
}

.article-content p {
    margin-bottom: 1.2em;
    font-size: 1.1em;
    word-break: break-word; /* 긴 단어 줄바꿈 */
}

/* Article Images */
.article-content img {
    max-width: 70%;       /* 이미지 크기 축소 (화면의 70%) */
    height: auto;
    display: block;       /* 블록 요소로 변경하여 가운데 정렬 가능하게 함 */
    margin: 20px auto;    /* 상하 20px, 좌우 자동(가운데 정렬) */
    border: 1px solid #ddd; /* 깔끔한 테두리 추가 */
}

.article-content ul, 
.article-content ol {
    margin-bottom: 1.2em;
    padding-left: 1.5em;
}

.article-content li {
    margin-bottom: 0.5em;
    font-size: 1.1em;
}

.article-content strong {
    color: #000;
    font-weight: 700;
}

.article-content blockquote {
    margin: 1.5em 0;
    padding: 1em;
    border-left: 4px solid #000080; /* 윈도우 98 파란색 포인트 */
    background: #f1f1f1;
    color: #555;
}

.article-content hr {
    border: 0;
    height: 1px;
    background: #ccc;
    margin: 2em 0;
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 25px;
    right: 315px; /* Adjusted to 320px for perfect alignment */
    width: 30px;  /* Square size */
    height: 30px; /* Square size */
    min-width: 0; /* Override 98.css default min-width */
    display: none; 
    z-index: 100;
    font-weight: bold;
    font-size: 12px; 
    padding: 0;      
    line-height: 30px; /* Center text vertically */
    text-align: center; /* Center text horizontally */
    cursor: pointer;
}


/* Utils */
.search-bar { display: flex; gap: 4px; }
.search-input { flex: 1; padding: 2px; }

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: white;
  border: 2px solid #808080;
  border-top-color: #404040;
  border-left-color: #404040;
  border-right-color: #dfdfdf;
  border-bottom-color: #dfdfdf;
}

.tag-chip {
  background: #c0c0c0;
  border: 1px solid #808080;
  border-top-color: #dfdfdf;
  border-left-color: #dfdfdf;
  border-right-color: #404040;
  border-bottom-color: #404040;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
}
.tag-chip:active {
   border: 1px solid #808080;
   border-bottom-color: #dfdfdf;
   border-right-color: #dfdfdf;
   border-top-color: #404040;
   border-left-color: #404040;
}

/* Game Canvas */
canvas {
    background-color: #fff;
    border: 4px solid #c0c0c0;
    image-rendering: pixelated;
}
.game-controls { margin-top: 16px; text-align: center; }

/* CMD Terminal Styles */
#cmd-body {
    background-color: black;
    color: #c0c0c0;
    font-family: 'Courier New', Courier, monospace;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: 18px; /* 전체 CMD 폰트 크기 증가 */
}

#cmd-output {
    display: flex;
    flex-direction: column;
}

.cmd-line {
    margin: 0;
    line-height: 1.4;
    white-space: pre-wrap;
}

.cmd-input-line {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.cmd-prompt {
    margin-right: 4px;
    white-space: nowrap;
}

#cmd-input {
    background: transparent;
    border: none;
    color: #c0c0c0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px; /* 폰트 크기 증가 */
    width: 100%;
    outline: none;
    caret-color: #c0c0c0;
}

/* Tetris Retro Layout Styles */
.tetris-layout {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    background-color: #c0c0c0;
}

.tetris-main {
    border: 2px solid #808080;
    border-right-color: white;
    border-bottom-color: white;
    padding: 2px;
    background-color: #000;
}

.tetris-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 120px;
}

.tetris-panel {
    background: #c0c0c0;
    border: 2px solid white;
    border-right-color: #808080;
    border-bottom-color: #808080;
    padding: 4px;
    text-align: center;
    font-family: 'Pixelated MS Sans Serif', Arial, sans-serif;
}

.tetris-panel h4 {
    margin: 0 0 4px 0;
    font-size: 12px;
    background: #000080;
    color: white;
    padding: 2px;
    text-transform: uppercase;
}

.tetris-value {
    background: black;
    color: red; 
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    padding: 4px;
    border: 2px solid #808080;
    border-right-color: white;
    border-bottom-color: white;
    font-size: 16px;
    letter-spacing: 2px;
}

.next-piece-preview {
    width: 80px;
    height: 80px;
    background: black;
    margin: 0 auto;
    border: 2px solid #808080;
    border-right-color: white;
    border-bottom-color: white;
    position: relative;
}

.controls-info {
    font-size: 10px;
    text-align: left;
    padding: 4px;
}

/* Chatbot - Office Assistant Style */
.speech-bubble-window {
    position: fixed;
    bottom: 210px; /* Moved up further */
    right: 20px;   /* Aligned with dog */
    width: 280px;
    height: 350px;
    background-color: #ffffe1; /* Classic Tooltip Yellow */
    border: 1px solid black;
    border-radius: 8px;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.2);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    padding: 12px;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
}

/* Tail for speech bubble */
.speech-bubble-window::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 40px; /* Adjusted tail position */
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #ffffe1 transparent;
    display: block;
    width: 0;
}
.speech-bubble-window::before {
    content: '';
    position: absolute;
    bottom: -12px;
    right: 39px; /* Adjusted tail position */
    border-width: 11px 11px 0;
    border-style: solid;
    border-color: black transparent;
    display: block;
    width: 0;
}

.speech-content {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 8px;
    background: transparent;
}

.speech-input-area input {
    width: 100%;
    border: 1px solid #7a7a7a;
    padding: 4px;
    font-family: 'Pretendard', sans-serif;
    margin-bottom: 4px;
}

.speech-input-area button {
    border: 1px solid #7a7a7a;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    border-radius: 2px;
}
.speech-input-area button:hover {
    background: #e0e0e0;
    border-color: black;
}

.chat-message {
    margin-bottom: 8px;
}
.chat-message.system { color: black; font-weight: bold; }
.chat-message.user { color: #000080; text-align: right; }

.chat-bubble {
    padding: 0;
    border: none;
    background: transparent;
    color: inherit !important; /* Force inherit */
    word-wrap: break-word; /* 긴 단어 줄바꿈 */
}

/* Thinking Animation */
.thinking-dots::after {
    content: ' .';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ' .'; }
    40% { content: ' ..'; }
    60% { content: ' ...'; }
    80%, 100% { content: ''; }
}

/* Permanent Tooltip for Cedric */
.cedric-tooltip {
    position: absolute;
    top: -45px;
    right: 0;
    background-color: #ffffe1;
    border: 1px solid black;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: black;
    white-space: nowrap;
    text-align: center;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
    font-family: 'Pretendard', sans-serif;
    animation: float 2s ease-in-out infinite;
}

.cedric-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #ffffe1 transparent;
    display: block;
    width: 0;
}
.cedric-tooltip::before {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 19px;
    border-width: 7px 7px 0;
    border-style: solid;
    border-color: black transparent;
    display: block;
    width: 0;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}
@media (max-width: 768px) {
  body { overflow: auto; height: auto; display: block; }
  .app-wrapper { display: block; overflow: visible; height: auto; }
  .tab-view.active.blog-layout { flex-direction: column; }
  .sidebar-left, .sidebar-right { width: auto; height: auto; padding: 8px; }
  .main-content { overflow: visible; border: 2px solid #808080; border-top-color: #404040; }
  .tree-view { height: 200px; }
  .scroll-top-btn { right: 20px; bottom: 20px; }
  
  .tetris-layout {
      flex-direction: column;
      align-items: center;
  }
}