/* ============================================================
   Disky Fun — Reset
   픽셀 미학 + Win98 기본
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  
  /* 픽셀 미학 - 모든 이미지/SVG 픽셀화 */
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  
  /* 안티에일리어싱 X (진짜 픽셀) */
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-system);
  font-size: var(--fs-base);
  line-height: 1.2;
  color: var(--c-content-text);
  background: var(--c-desktop);
}

body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  cursor: default;
}

/* 입력 가능 요소만 선택/터치 허용 */
input, textarea, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
}

/* 버튼 기본 */
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: default;
}

/* 이미지 드래그 X */
img, svg {
  -webkit-user-drag: none;
  user-drag: none;
}

/* 링크 */
a {
  color: var(--c-link);
  text-decoration: underline;
  cursor: default;
}

a:visited { color: var(--c-link-visited); }

/* 포커스 (점선 - Win98 스타일) */
:focus-visible {
  outline: 1px dotted var(--c-content-text);
  outline-offset: -2px;
}

/* 스크롤바 — Win98 정확 */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
  background: var(--c-bg);
}

::-webkit-scrollbar-track {
  background-color: #b0b0b0;
  background-image:
    linear-gradient(45deg, #a0a0a0 25%, transparent 25%),
    linear-gradient(-45deg, #a0a0a0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #a0a0a0 75%),
    linear-gradient(-45deg, transparent 75%, #a0a0a0 75%);
  background-size: 4px 4px;
  background-position: 0 0, 0 2px, 2px -2px, -2px 0px;
}

::-webkit-scrollbar-thumb {
  background: var(--c-bg);
  border-top: 2px solid var(--c-white);
  border-left: 2px solid var(--c-white);
  border-right: 2px solid var(--c-black);
  border-bottom: 2px solid var(--c-black);
  box-shadow: 
    inset 1px 1px 0 var(--c-bg-light),
    inset -1px -1px 0 var(--c-bg-dark);
}

::-webkit-scrollbar-thumb:active {
  border-top: 2px solid var(--c-black);
  border-left: 2px solid var(--c-black);
  border-right: 2px solid var(--c-white);
  border-bottom: 2px solid var(--c-white);
}

::-webkit-scrollbar-button {
  background: var(--c-bg);
  border-top: 2px solid var(--c-white);
  border-left: 2px solid var(--c-white);
  border-right: 2px solid var(--c-black);
  border-bottom: 2px solid var(--c-black);
  box-shadow: 
    inset 1px 1px 0 var(--c-bg-light),
    inset -1px -1px 0 var(--c-bg-dark);
  display: block;
  height: 16px;
  width: 16px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px;
}

::-webkit-scrollbar-button:active {
  border-top: 2px solid var(--c-black);
  border-left: 2px solid var(--c-black);
  border-right: 2px solid var(--c-white);
  border-bottom: 2px solid var(--c-white);
}

::-webkit-scrollbar-button:vertical:start:single-button {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><polygon points='4,2 1,6 7,6' fill='black'/></svg>");
}

::-webkit-scrollbar-button:vertical:end:single-button {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><polygon points='1,2 7,2 4,6' fill='black'/></svg>");
}

::-webkit-scrollbar-button:horizontal:start:single-button {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><polygon points='2,4 6,1 6,7' fill='black'/></svg>");
}

::-webkit-scrollbar-button:horizontal:end:single-button {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><polygon points='2,1 6,4 2,7' fill='black'/></svg>");
}

::-webkit-scrollbar-button:vertical:start:double-button,
::-webkit-scrollbar-button:vertical:end:double-button,
::-webkit-scrollbar-button:horizontal:start:double-button,
::-webkit-scrollbar-button:horizontal:end:double-button {
  display: none;
}

::-webkit-scrollbar-corner {
  background: var(--c-bg);
}

/* Firefox */
* {
  scrollbar-color: var(--c-bg) #b0b0b0;
}

/* 텍스트 선택 - Win98 색 */
::selection {
  background: var(--c-accent);
  color: var(--c-accent-text);
}

/* 유틸리티 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 비활성 상태 - 음각 효과 (Win98 정확) */
.disabled {
  color: var(--c-disabled);
  text-shadow: 1px 1px 0 var(--c-disabled-shadow);
  pointer-events: none;
}
