@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Courier New", Arial, sans-serif;
}

body {
  cursor:
    url("Dove Cursor.cur") 0 0,
    auto !important;
  background-color: #38cbf8;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.45) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 1.5px, transparent 1.5px);
  background-size: 32px 32px;
  background-attachment: fixed;
  background-position: 0 0;
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: #111111;
}

canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}
a {
  text-decoration: none;
  color: inherit;
}
button,
input[type="range"],
input[type="text"],
.playlist-item,
.win-btn,
.retro-btn,
.window-header,
a {
  cursor:
    url("Dove Cursor.cur") 0 0,
    pointer !important;
}
/* 드래그/리사이즈 중 iframe 이벤트 쏠림 방지 */
body.is-dragging iframe,
body.is-resizing iframe {
  pointer-events: none !important;
}

/* [Y2K 레트로 팝] 창 스타일 */
.window-container {
  position: relative;
  z-index: 10;
  background-color: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 10px;
  box-shadow: 4px 4px 0px #000000;
  user-select: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  min-height: 40px;
  overflow: visible;
  align-self: start;
  height: fit-content;
}

@media (max-width: 768px) {
  .window-container {
    inline-size: 90vw;
    block-size: auto;
  }
}

/* ★ 최대화 상태 클래스 */
.window-container.maximized {
  top: 0 !important;
  left: 0 !important;
  inset-inline-start: 0 !important;
  inset-block-start: 0 !important;
  width: 100vw !important;
  height: calc(100vh - 60px) !important;
  margin: 0 !important;
  transform: none !important;
  border-radius: 0 !important;
}
@media (max-width: 768px) {
  .window-container.maximized {
    width: 100vw !important;
    height: calc(100vh - 90px) !important;
  }
}

/* [공통] 창 상단 드래그 헤더 */
.window-header {
  background: linear-gradient(180deg, #ffb4dc 0%, #ff8fc5 100%);
  border-block-end: 2.5px solid #000000;
  padding: 7px 12px;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* 헤더 컬러 테마 */
.window-header.header-pink {
  background: linear-gradient(180deg, #ffb4dc 0%, #ff8fc5 100%);
}
.window-header.header-mint {
  background: linear-gradient(180deg, #6ee7ff 0%, #3cd0f7 100%);
}
.window-header.header-yellow {
  background: linear-gradient(180deg, #fff38a 0%, #fee458 100%);
}
.window-header.header-lavender {
  background: linear-gradient(180deg, #dfc2ff 0%, #cfabff 100%);
}

.window-title {
  font-family: "Press Start 2P", "Courier New", monospace;
  font-weight: normal;
  font-size: 0.54rem;
  color: #000000;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

/* [공통] 헤더 우측 상단 컨트롤 버튼 그룹 */
.window-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.window-btn {
  background-color: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 3px;
  box-shadow: 1px 1px 0px #000000;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background-color 0.1s ease,
    color 0.1s ease;
}

.window-btn:hover {
  background-color: #ff7ebb;
  color: #ffffff;
}

.window-btn:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

/* [공통] 창 내용 영역 */
.window-body {
  padding: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1;
  overflow: auto;
  background: #ffffff;
}

/* 창 숨김 상태 클래스 (OS 최소화용) */
.hidden {
  display: none !important;
}

/* --- Grid-snap resize grips (desktop tile cards) ---
   Drag a corner to change grid-column / grid-row spans.
   Double-click a grip resets the card to CSS defaults. */
#app-panel .window-container:not(.maximized) .window-body,
#app-panel .taskbar {
  position: relative;
}

#app-panel .resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 4px;
  box-shadow: 1px 1px 0 #000000;
  z-index: 60;
  touch-action: none;
}

#app-panel .resize-handle.nw {
  top: 6px;
  left: 6px;
  cursor: nwse-resize;
}

#app-panel .resize-handle.ne {
  top: 6px;
  right: 6px;
  cursor: nesw-resize;
}

#app-panel .resize-handle.sw {
  bottom: 6px;
  left: 6px;
  cursor: nesw-resize;
}

#app-panel .resize-handle.se {
  bottom: 6px;
  right: 6px;
  cursor: nwse-resize;
}

#app-panel .window-container.maximized .resize-handle {
  display: none;
}

/* --- 하단 작업 표시줄 스타일 (Y2K Pastel) --- */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 52px;
  background: linear-gradient(180deg, #ffffff 0%, #fff0f7 100%);
  display: flex;
  align-items: center;
  justify-content: left;
  padding: 0 16px;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
  overflow: visible;
  border-top: 2.5px solid #000000;
  box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.04);
}

.taskbar > * {
  pointer-events: auto;
}

.taskbar-notify-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 8px;
}

.taskbar-notify-button {
  position: relative;
  width: 38px;
  height: 38px;
  background: #fff8d8;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: 2px 2px 0 #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    background-color 0.1s ease;
}

.taskbar-notify-button:hover {
  background: #ffb4dc;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000000;
}

.taskbar-notify-button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000000;
}

.taskbar-notify-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #000000;
  background: #ff3b75;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: bold;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.taskbar-notify-panel {
  position: absolute;
  right: 0;
  left: auto;
  bottom: 56px;
  width: min(290px, calc(100vw - 32px));
  background: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 10px;
  box-shadow: 4px 4px 0 #000000;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s ease;
  z-index: 50;
}

.taskbar-notify-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-header {
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 2px dashed #000000;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item {
  padding: 8px 10px;
  border: 2px solid #000000;
  border-radius: 6px;
  background: #eefbff;
}

.notification-title {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 3px;
}

.notification-text {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #222222;
}

.taskbar-clock {
  min-width: 80px;
  padding: 6px 12px;
  color: #000000;
  font-size: 0.72rem;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  font-family: "Press Start 2P", "Courier New", monospace;
  background: #fff8d8;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: 2px 2px 0 #000000;
}

/* 작업 표시줄 내 앱 아이콘 스타일 */
.app-icon {
  width: 40px;
  height: 40px;
  background-color: #ffffff;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: 2px 2px 0px #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor:
    url("Dove Cursor.cur") 0 0,
    pointer !important;
  transition:
    transform 0.1s ease,
    background-color 0.1s ease,
    box-shadow 0.1s ease;
  overflow: hidden;
  padding: 3px;
}

@media (max-width: 768px) {
  .app-icon {
    width: 36px;
    height: 36px;
  }
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

.app-icon:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000000;
  background-color: #ffb4dc;
}

/* 앱 아이콘 열림 상태 */
.app-icon.is-open {
  background-color: #6fe7ff;
  box-shadow: inset 1px 1px 0 #000000;
}

.start-button {
  width: 44px;
  height: 44px;
  background: linear-gradient(180deg, #ffb4dc 0%, #ff8fc5 100%);
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: 2px 2px 0 #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor:
    url("Dove Cursor.cur") 0 0,
    pointer !important;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease;
}

.start-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000000;
}

.start-button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000000;
}

.start-menu {
  position: fixed;
  left: 16px;
  bottom: 60px;
  width: min(470px, calc(100vw - 32px));
  height: 430px;
  padding: 12px;
  background: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 12px;
  box-shadow: 5px 5px 0 #000000;
  display: grid;
  grid-template-rows: 78px 1fr 84px;
  gap: 10px;
  z-index: 999;
}

.start-menu[hidden] {
  display: none;
}

.start-menu-section {
  border: 2px solid #000000;
  border-radius: 8px;
  background-color: #fff9fc;
}

.start-menu-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ffeef8, #ffffff);
  border-radius: 8px;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #000000;
  background: linear-gradient(180deg, #ffd6a5, #ffb75e);
  color: #000000;
  font-weight: bold;
  font-size: 1.1rem;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-name {
  font-size: 0.9rem;
  font-weight: bold;
  color: #111111;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.profile-status {
  font-size: 0.56rem;
  color: #3e3e3e;
  letter-spacing: 0.05em;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.start-menu-apps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.2);
}

.start-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 6px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.18);
  color: #111111;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background-color 0.12s ease,
    border-color 0.12s ease;
}

.start-app-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.45);
  border-color: #000000;
}

.start-app-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.start-app-item span {
  font-size: 0.54rem;
  text-align: center;
  line-height: 1.4;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.start-menu-system {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.2);
}

.start-system-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px solid #000000;
  background: linear-gradient(180deg, #f4f5fa, #dfe7ff);
  color: #111111;
  cursor: pointer;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.52rem;
  transition:
    background-color 0.12s ease,
    transform 0.12s ease;
}

.start-system-item:hover {
  background: linear-gradient(180deg, #eef3ff, #ccd9ff);
  transform: translateY(-1px);
}

.system-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.system-action-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.48);
  z-index: 2000;
}

.system-action-overlay.hidden {
  display: none;
}

.system-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: min(320px, calc(100vw - 32px));
  padding: 18px 22px;
  border: 2px solid #000000;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 6px 6px 0 #000000;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.56rem;
  color: #111111;
}

.system-action-icon {
  font-size: 1.5rem;
}

.settings-panel-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(19, 22, 28, 0.42);
  backdrop-filter: blur(3px);
  z-index: 1800;
}

.settings-panel-overlay.hidden {
  display: none;
}

.settings-panel {
  width: min(520px, calc(100vw - 24px));
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #000000;
  box-shadow: 6px 6px 0 #000000;
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 640px);
}

.settings-panel-header,
.settings-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 2px solid #000000;
  background: linear-gradient(180deg, #eff5ff, #e7edfc);
}

.settings-panel-footer {
  border-top: 2px solid #000000;
  border-bottom: none;
}

.settings-panel-kicker {
  font-size: 0.5rem;
  opacity: 0.7;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.settings-panel-header h2 {
  margin: 6px 0 0;
  font-size: 1.1rem;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.settings-close,
.settings-primary,
.settings-secondary {
  border: 2px solid #000000;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.5rem;
  padding: 0.6rem 0.8rem;
}

.settings-primary {
  background: linear-gradient(180deg, #d7f4c5, #b9e3a1);
}

.settings-secondary {
  background: linear-gradient(180deg, #e9ecff, #d9e2ff);
}

.settings-panel-body {
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow: auto;
  background: rgba(247, 248, 252, 0.9);
}

.settings-section {
  border: 2px solid #000000;
  background: rgba(255, 255, 255, 0.74);
  padding: 12px;
}

.settings-section h3 {
  margin: 0 0 10px;
  font-size: 0.62rem;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.35);
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.48rem;
}

.settings-row:first-of-type {
  border-top: none;
}

.range-wrap {
  width: 140px;
}

.range-wrap input {
  width: 100%;
}

.toggle-pill {
  border: 2px solid #000000;
  background: #f4f4f4;
  color: #111111;
  cursor: pointer;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.46rem;
  min-width: 86px;
  padding: 0.55rem 0.7rem;
}

.toggle-pill.is-on {
  background: linear-gradient(180deg, #d8f7d2, #b5ecaa);
}

.sleep-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 18, 0.7);
  backdrop-filter: blur(8px) brightness(0.45);
  z-index: 2200;
}

.sleep-overlay.hidden {
  display: none;
}

.sleep-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 28px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(25, 28, 35, 0.68);
  color: #ffffff;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.45);
  font-family: "Press Start 2P", "Courier New", monospace;
  text-transform: uppercase;
}

.sleep-icon {
  font-size: 2.1rem;
  line-height: 1;
}

.sleep-text {
  font-size: 0.54rem;
}

body.sleeping .window-container,
body.sleeping .taskbar,
body.sleeping #desktop-icons,
body.sleeping .gifs,
body.sleeping #start-button,
body.sleeping .taskbar-notify-wrapper {
  filter: brightness(0.45) saturate(0.5);
  transition: filter 0.25s ease;
}

/* 터미널 스타일 */
.terminal-body {
  padding: 0;
  background-color: #111111;
  color: #f5f5f5;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow: auto;
}

.terminal-output {
  min-height: calc(100% - 32px);
  padding: 12px;
  white-space: pre-wrap;
}

.terminal-line {
  display: flex;
  align-items: center;
  padding: 0 12px 12px;
}

.terminal-prompt {
  color: #8ee28e;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  font: inherit;
  cursor: text;
  margin-left: 10px;
}

@media (max-width: 768px) {
  .start-menu {
    left: 10px;
    bottom: 65px;
    width: calc(100vw - 20px);
    height: 400px;
  }
}

.gifs {
  width: 150px;
  height: 150px;
  inset-inline-end: 20px;
  inset-block-end: 35px;
  position: fixed;
  z-index: 1;
}

/* --- 다마고치 버튼 스타일 --- */
.tama-btn {
  width: 32px;
  height: 32px;
  background-color: #e0e0e0;
  border: 2px solid #000000;
  border-radius: 50%;
  box-shadow: 2px 2px 0 #000000;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  padding: 0;
  transition:
    transform 0.1s ease,
    background-color 0.1s ease;
  box-sizing: border-box;
}

.tama-btn canvas {
  display: block !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 12px !important;
  height: 12px !important;
  image-rendering: pixelated;
  z-index: 1;
}

.tama-btn:hover {
  background-color: #d0d0d0;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000000;
}

.tama-btn:active,
.tama-btn.pressed {
  background-color: #b0b0b0;
  transform: translate(1px, 1px);
  box-shadow: none;
}

/* --- 블로그 전용 스타일 --- */
.blog-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #fffdf9;
  min-height: 0;
}

.diary-browser-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-bottom: 2px solid #000;
  background: #d8e3ff;
}

.diary-browser-button {
  display: grid;
  flex: 0 0 25px;
  width: 25px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 1px solid #222;
  box-shadow: 1px 1px 0 #222;
  background: #fffdf9;
  color: #222;
  font:
    bold 0.9rem "Courier New",
    Courier,
    monospace;
  cursor: pointer;
}

.diary-browser-button:hover:not(:disabled) {
  background: #f5a88f;
}

.diary-browser-button:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.diary-browser-button:disabled {
  color: #999;
  cursor: default;
  opacity: 0.65;
}

.diary-address-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  height: 24px;
  padding: 0 7px;
  border: 1px solid #222;
  background: #fffdf9;
}

.diary-address-lock {
  color: #6b806c;
  font-size: 0.75rem;
}

.diary-address {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #444;
  font:
    0.72rem "Courier New",
    Courier,
    monospace;
}

.diary-bookmark-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #d8e3ff;
  border-bottom: 1px solid #9b9277;
  font:
    0.72rem "Courier New",
    Courier,
    monospace;
  color: #d8e3ff;
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 2px solid #000;
}

.diary-bookmark-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid transparent;
  color: #334034;
  background: transparent;
  text-decoration: none;
}

.diary-bookmark-link:hover {
  background: #e7e2bf;
  border-color: #879d6d;
}

@media (max-width: 520px) {
  .diary-browser-toolbar {
    gap: 3px;
    padding: 4px;
  }

  .diary-browser-button {
    flex-basis: 23px;
    width: 23px;
    height: 23px;
  }

  .diary-address-wrap {
    gap: 4px;
    padding: 0 5px;
  }
}

.blog-top-banner {
  background-color: #222;
  color: #fff;
  padding: 12px 16px;
  border-bottom: 2px solid #000;
}

.blog-site-title {
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: -0.5px;
}

.blog-site-subtitle {
  font-size: 0.75rem;
  color: #bbb;
  margin-top: 2px;
}

.blog-nav-bar {
  display: flex;
  gap: 12px;
  padding: 6px 16px;
  background-color: #f1ede4;
  border-bottom: 2px solid #000;
  font-size: 0.75rem;
  font-weight: bold;
}

.blog-nav-item {
  padding: 0;
  border: 0;
  background: transparent;
  color: #444;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.blog-nav-item:hover {
  color: #000;
  text-decoration: underline;
}

.diary-page-frame {
  display: none;
  flex: 1;
  width: 100%;
  height: auto;
  min-height: 0;
  border: 0;
  background: #fffdf9;
}

.blog-posts-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.blog-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.blog-sidebar {
  padding: 14px;
  border-right: 2px solid #000000;
  background-color: #f1ede4;
  overflow-y: auto;
}

.blog-sidebar::-webkit-scrollbar {
  width: 6px;
}

.blog-sidebar::-webkit-scrollbar-thumb {
  background: #a09a8e;
}

.blog-profile {
  padding-bottom: 14px;
  border-bottom: 1px dashed #777;
  margin-bottom: 14px;
}

.blog-profile-info {
  min-width: 0;
}

.blog-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #000000;
  background: #fffdf9;
  color: #000000;
  font: inherit;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.blog-sidebar-toggle:active {
  transform: translate(1px, 1px);
}

.blog-profile-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border: 2px solid #000000;
  background: #f5a88f;
  font-size: 1.3rem;
  font-weight: bold;
}

.blog-profile-name {
  font-size: 0.9rem;
  font-weight: bold;
}

.blog-profile-copy {
  margin-top: 5px;
  color: #555;
  font-size: 0.7rem;
  line-height: 1.5;
}

.blog-sidebar-section {
  margin-bottom: 18px;
}

.blog-sidebar-heading {
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #000000;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  font-size: 0.72rem;
}

.blog-sidebar-list a {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: #333;
}

.blog-sidebar-list a:hover {
  color: #000;
  text-decoration: underline;
}

.blog-sidebar-list a.is-active {
  color: #000;
  font-weight: bold;
  text-decoration: underline;
}

.blog-count {
  color: #777;
}

.blog-sidebar-note {
  padding: 8px;
  border: 1px solid #000000;
  background: #fffdf9;
  font-size: 0.7rem;
  line-height: 1.5;
}

/* 스크롤바 디자인 통일 */
.blog-posts-area::-webkit-scrollbar {
  width: 8px;
}
.blog-posts-area::-webkit-scrollbar-track {
  background: #e2dfd8;
}
.blog-posts-area::-webkit-scrollbar-thumb {
  background: #a09a8e;
}

.blog-post-card {
  background-color: #ffffff;
  border: 2px solid #000000;
  box-shadow: 4px 4px 0px #000000;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blog-post-card[hidden] {
  display: none;
}

.blog-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 6px;
}

.blog-post-date {
  font-size: 0.75rem;
  color: #666;
}

.blog-post-category {
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 6px;
  border: 1px solid #000;
  background-color: #ffe4e6;
  color: #9f1239;
}

.blog-post-img-box {
  width: 100%;
  max-height: 1080px;
  overflow: hidden;
  border: 1.5px solid #000;
  background-color: #000;
}

.blog-post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.blog-post-card:hover .blog-post-img {
  transform: scale(1.02);
}

.blog-post-title {
  font-size: 1rem;
  font-weight: bold;
  color: #111;
  margin: 0;
}

.blog-post-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #333;
  white-space: pre-line;
  margin: 0;
}

/* --- 개별 창 위치 및 스타일 --- */
#serverWindow {
  /* inset-block-start: 20px; */
  /* inset-inline-end: 20px; */
  /* inline-size: 300px; */
  /* block-size: 603px; */
  background-color: #ffffff;
}
@media (max-width: 768px) {
  #serverWindow {
    inset-block-start: 20px;
    inset-inline-end: 20px;
    inline-size: 290px;
    block-size: 260px;
  }
}

#aboutWindow {
  inset-block-start: 20px;
  inset-inline-start: 20px;
  inline-size: 340px;
  background-color: #ffffff;
}

#socialWindow {
  inset-block-start: 40%;
  inset-inline-start: 40px;
  inline-size: 400px;
  background-color: #ffffff;
}
@media (max-width: 768px) {
  #socialWindow {
    inset-block-start: 40%;
    inset-inline-start: 40px;
    inline-size: 300px;
    background-color: #ffffff;
  }
}

/* socialWindow가 최대화 상태일 때 내부 iframe 높이를 100%로 강제 변경 */
#socialWindow.maximized .window-body iframe {
  height: 100% !important;
}

#mapWindow {
  top: 10%;
  inset-inline-start: 40%;
  inline-size: clamp(280px, 80vw, 500px);
  block-size: 400px;
  z-index: 5;
  background-color: #ffffff;
}

@media (max-width: 768px) {
  #mapWindow {
    inline-size: 370px;
    block-size: 500px;
    top: 30%;
    inset-inline-start: 50px;
  }
}

#diaryWindow {
  top: 10%;
  inset-inline-start: 30%;
  inline-size: 760px;
  block-size: 700px;
  z-index: 4;
  background-color: #ffffff;
}

@media (max-width: 768px) {
  #diaryWindow {
    inset-inline-start: 5%;
    inline-size: 90vw;
    block-size: 550px;
  }

  .blog-layout {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .blog-sidebar {
    flex: 0 0 auto;
    border-right: 0;
    border-bottom: 2px solid #000000;
    overflow-y: visible;
  }

  .blog-profile {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 28px;
    column-gap: 10px;
    align-items: start;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .blog-sidebar-toggle {
    display: inline-flex;
  }

  .blog-profile-mark {
    grid-row: span 2;
    margin-bottom: 0;
  }

  .blog-profile-copy {
    margin-top: 2px;
  }

  .blog-sidebar-content[hidden] {
    display: none;
  }

  .blog-sidebar-section {
    display: inline-block;
    vertical-align: top;
    width: calc(50% - 8px);
    margin: 0 12px 4px 0;
  }

  .blog-sidebar-section:nth-last-child(-n + 2) {
    margin-bottom: 0;
  }

  .blog-sidebar-note {
    margin-top: 6px;
  }
}

#terminalWindow {
  top: 10%;
  inset-inline-start: 20%;
  inline-size: 800px;
  block-size: 600px;
  z-index: 3;
  background-color: #111111;
}
@media (max-width: 768px) {
  #terminalWindow {
    inline-size: 380px;
    block-size: 550px;
  }
}

#galagaWindow {
  inline-size: 800px;
  block-size: 800px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 2px solid #000000;
  border-radius: 6px;
  background-color: #fff8d8;
  box-shadow: 2px 2px 0 #000000;
  font-size: 0.48rem;
  font-weight: bold;
  margin-block-end: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.status-dot {
  inline-size: 9px;
  block-size: 9px;
  border: 1.5px solid #000000;
  border-radius: 50%;
}

.status-badge.loading .status-dot {
  background-color: #94a3b8;
}
.status-badge.online .status-dot {
  background-color: #22c55e;
}
.status-badge.offline .status-dot {
  background-color: #ef4444;
}

.header-icon {
  inline-size: 80px;
  block-size: 80px;
  border: 1px solid #000000;
  margin-block-end: 8px;
  display: none;
}

.server_address {
  font-size: 1.2rem;
  font-weight: 700;
  margin-block-end: 2px;
  font-family: "Press Start 2P", "Courier New", monospace;
}

p.subtitle {
  color: #333333;
  font-size: 1rem;
  font-weight: 500;
  margin-block-end: 16px;
  min-block-size: 1.2em;
  word-break: break-all;
}

.info-grid {
  border-block-start: 1px dashed #000000;
  padding-block-start: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.info-label {
  color: #060505;
}
.info-value {
  color: #000000;
  font-weight: bold;
}

.mods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.mod-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 120px;
  padding: 8px 6px;
  border: 2px solid #000000;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 2px 2px 0 #000000;
  text-decoration: none;
  color: #111111;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.mod-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000000;
}

.mod-card.required {
  background: #fff7f7;
  border-color: #000000;
}

.mod-card img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  display: block;
  border: 1.5px solid #000000;
  border-radius: 6px;
  background: #f4f4f4;
}

.mod-label {
  font-size: 0.7rem;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
}

.mod-card.required .mod-label {
  color: #9c1c1c;
  font-weight: 800;
}

.required-mark {
  display: inline-block;
  color: #9c1c1c;
  font-size: 0.7rem;
  line-height: 1;
  transform: translateY(-1px);
}

.mod-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid #000000;
  background: #fffdf5;
  box-shadow: 3px 3px 0 #000000;
  color: #111111;
  font-size: 0.68rem;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
  white-space: normal;
}

.mod-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 서버 윈도우 탭 및 베드락 패널 스타일 --- */
.server-tabs {
  display: flex;
  gap: 4px;
  margin-block-end: 12px;
  border-block-end: 2px solid #000000;
  padding-inline: 2px;
}

.server-tab-btn {
  padding: 6px 14px;
  border: 2px solid #000000;
  border-block-end: none;
  background-color: #e6f1f8;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border-start-start-radius: 6px;
  border-start-end-radius: 6px;
  box-shadow: inset 1px 1px 0 #ffffff;
  color: #333333;
  transition: background-color 0.1s ease;
}

.server-tab-btn:hover {
  background-color: #fce8f3;
}

.server-tab-btn.active {
  background-color: #fff48f;
  color: #000000;
  border-block-end: 2px solid #fff48f;
  margin-block-end: -2px;
}

.server-panel {
  display: block;
}

.server-panel + .server-panel {
  margin-block-start: 24px;
  padding-block-start: 16px;
  border-block-start: 2px dashed #000000;
}

.server-port-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: bold;
  color: #02609e;
  background: #e0f6ff;
  border: 1.5px solid #000000;
  border-radius: 4px;
  box-shadow: 1px 1px 0 #000000;
  padding: 3px 8px;
  margin-block-end: 8px;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.bedrock-guide-box {
  margin-block-start: 16px;
  padding: 12px;
  border: 2px solid #000000;
  border-radius: 8px;
  background-color: #fffceb;
  box-shadow: 3px 3px 0 #000000;
}

.bedrock-guide-box .guide-title {
  display: block;
  font-weight: bold;
  font-size: 0.75rem;
  margin-block-end: 6px;
  color: #111111;
}

.bedrock-guide-box .guide-desc {
  font-size: 0.7rem;
  line-height: 1.45;
  color: #333333;
  margin: 0;
}

.diary-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  background-color: #fdfbf7;
}

.diary-body::-webkit-scrollbar {
  width: 8px;
}
.diary-body::-webkit-scrollbar-track {
  background: #e2dfd8;
}
.diary-body::-webkit-scrollbar-thumb {
  background: #a09a8e;
  border-radius: 0px;
}

.diary-card {
  background-color: #ffffff;
  border: 2px solid #222222;
  box-shadow: 3px 3px 0px #222222;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: bold;
}

.diary-date {
  color: #666666;
  font-family: monospace;
}

.diary-tag {
  padding: 2px 6px;
  border: 1px solid #222222;
  font-size: 11px;
  font-weight: bold;
  border-radius: 2px;
}

.diary-tag.game-tag {
  background-color: #e0f2fe;
  color: #0369a1;
}
.diary-tag.life-tag {
  background-color: #fef3c7;
  color: #b45309;
}

.diary-image-wrapper {
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  border: 1px solid #222222;
}

.diary-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.diary-card:hover .diary-img {
  transform: scale(1.03);
}

.diary-title {
  margin: 4px 0 0 0;
  font-size: 15px;
  color: #111111;
}
.diary-content {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #444444;
  white-space: pre-line;
}

#desktop-icons {
  position: fixed;
  top: 40px;
  left: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 5;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  transition: transform 0.15s ease;
}

.desktop-icon:hover {
  transform: scale(1.05);
}

.desktop-icon img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.4));
}

.desktop-icon a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.desktop-icon-label {
  margin-top: 8px;
  font-size: 0.62rem;
  font-weight: bold;
  color: #000000;
  text-shadow: none;
  font-family: "Press Start 2P", "Courier New", monospace;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #000000;
  border-radius: 6px;
  padding: 4px 8px;
  box-shadow: 2px 2px 0px #000000;
  line-height: 1.2;
}

/* --- Y2K 레트로 팝 버튼 공통 스타일 --- */
.pop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: 2px 2px 0 #000000;
  font-family: inherit;
  font-weight: bold;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  color: #000000;
  background-color: #fff36d;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    background-color 0.1s ease;
  outline: 1px dotted #000000;
  outline-offset: -3px;
}

.pop-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000000;
}

.pop-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000000;
}

.pop-btn-yellow {
  background-color: #fff36d;
}
.pop-btn-pink {
  background-color: #ffb4dc;
}
.pop-btn-mint {
  background-color: #6fe9d2;
}
.pop-btn-white {
  background-color: #ffffff;
}

/* --- 바탕화면 데코레이션 스티커 레이어 --- */
.desktop-decor-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.decor-sticker {
  position: absolute;
  user-select: none;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Stickers are clickable easter eggs (star burst + pop sound). */
.desktop-decor-layer .decor-sticker {
  pointer-events: auto;
  cursor:
    url("Dove Cursor.cur") 0 0,
    pointer;
}

.burst-particle {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3000;
  pointer-events: none;
  line-height: 1;
  will-change: transform, opacity;
}

.decor-sparkle {
  color: #ffffff;
  text-shadow: 2.5px 2.5px 0px #000000;
  font-size: 2.2rem;
  line-height: 1;
}

.decor-sparkle-yellow {
  color: #fff568;
  text-shadow: 2.5px 2.5px 0px #000000;
  font-size: 1.8rem;
}

.decor-tag {
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: 3px 3px 0 #000000;
  padding: 5px 12px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.65rem;
  font-weight: bold;
  color: #000000;
}

.decor-tag-pink {
  background: #ffb4dc;
}
.decor-tag-yellow {
  background: #fff36d;
}
.decor-tag-mint {
  background: #6fe9d2;
}

.decor-hearts-pill {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 14px;
  padding: 6px 5px;
  box-shadow: 2px 2px 0 #000000;
}

.decor-heart-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #000000;
}
.decor-heart-dot.d-yellow {
  background-color: #fff36d;
}
.decor-heart-dot.d-white {
  background-color: #ffffff;
}
.decor-heart-dot.d-pink {
  background-color: #ff9ec9;
}

/* ============================================================
   Y2K 데코레이션 애니메이션 & 확장 스티커 스타일
   ============================================================ */

/* 반짝 깜빡 애니메이션 */
@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  25% {
    opacity: 0.4;
    transform: scale(0.85) rotate(10deg);
  }
  75% {
    opacity: 0.9;
    transform: scale(1.1) rotate(-8deg);
  }
}

/* 위아래 둥실 애니메이션 */
@keyframes float-y {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 좌우 흔들 애니메이션 */
@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(6deg);
  }
}

/* 팝업 스케일 애니메이션 */
@keyframes pop-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

/* 무지개 이동 애니메이션 */
@keyframes rainbow-float {
  0%,
  100% {
    transform: translateY(0px) rotate(-3deg);
  }
  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

/* 스피닝 별 */
@keyframes spin-slow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 깜빡 알파 */
@keyframes blink-alpha {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* --- 애니메이션 적용 클래스 --- */
.anim-twinkle {
  animation: twinkle 2.2s ease-in-out infinite;
}
.anim-twinkle-slow {
  animation: twinkle 3.6s ease-in-out infinite;
}
.anim-float {
  animation: float-y 3s ease-in-out infinite;
}
.anim-float-slow {
  animation: float-y 4.5s ease-in-out infinite;
}
.anim-wiggle {
  animation: wiggle 1.8s ease-in-out infinite;
}
.anim-pop {
  animation: pop-pulse 2s ease-in-out infinite;
}
.anim-rainbow {
  animation: rainbow-float 3.5s ease-in-out infinite;
}
.anim-spin {
  animation: spin-slow 6s linear infinite;
}
.anim-blink {
  animation: blink-alpha 1.5s ease-in-out infinite;
}

/* 각기 다른 딜레이로 자연스럽게 */
.anim-delay-1 {
  animation-delay: 0.4s;
}
.anim-delay-2 {
  animation-delay: 0.9s;
}
.anim-delay-3 {
  animation-delay: 1.4s;
}
.anim-delay-4 {
  animation-delay: 1.9s;
}
.anim-delay-5 {
  animation-delay: 2.4s;
}

/* --- 큰 반짝이 별 --- */
.decor-sparkle-big {
  font-size: 3rem;
  line-height: 1;
  color: #ffffff;
  text-shadow: 3px 3px 0px #000000;
}

.decor-sparkle-pink {
  font-size: 2rem;
  color: #ff9ec9;
  text-shadow: 2.5px 2.5px 0px #000000;
}

.decor-sparkle-mint {
  font-size: 2rem;
  color: #6fe9d2;
  text-shadow: 2.5px 2.5px 0px #000000;
}

.decor-sparkle-lavender {
  font-size: 2rem;
  color: #cfabff;
  text-shadow: 2.5px 2.5px 0px #000000;
}

/* --- 하트 이모지 스티커 --- */
.decor-emoji {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(2.5px 2.5px 0px rgba(0, 0, 0, 0.5));
}

.decor-emoji-lg {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(3px 3px 0px rgba(0, 0, 0, 0.5));
}

.decor-emoji-sm {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.4));
}

/* --- 무지개 + 구름 캐릭터 --- */
.decor-rainbow-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.decor-rainbow-arc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.decor-rainbow-stripe {
  height: 6px;
  border-radius: 50px;
  border: 1.5px solid #000000;
}
.rs-red {
  width: 72px;
  background: #ff6b6b;
}
.rs-orange {
  width: 62px;
  background: #ffa94d;
}
.rs-yellow {
  width: 52px;
  background: #ffe066;
}
.rs-green {
  width: 42px;
  background: #69db7c;
}
.rs-blue {
  width: 32px;
  background: #74c0fc;
}
.rs-violet {
  width: 22px;
  background: #cc5de8;
}

.decor-clouds-row {
  display: flex;
  gap: 6px;
  margin-top: -4px;
}

.decor-cloud {
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 50px;
  width: 36px;
  height: 22px;
  box-shadow: 2px 2px 0 #000000;
  position: relative;
}

/* --- 스마일 / 귀여운 얼굴 --- */
.decor-smiley {
  width: 54px;
  height: 54px;
  background: #fff36d;
  border: 3px solid #000000;
  border-radius: 50%;
  box-shadow: 3px 3px 0 #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  line-height: 1;
}

/* --- 화살표 장식 그룹 --- */
.decor-arrows {
  display: flex;
  gap: 3px;
  align-items: center;
}
.decor-arrow-item {
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 4px;
  box-shadow: 2px 2px 0 #000000;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
}

/* --- 큐브 장식 --- */
.decor-cube-group {
  display: flex;
  gap: 4px;
}
.decor-cube {
  width: 28px;
  height: 28px;
  border: 2.5px solid #000000;
  border-radius: 4px;
  box-shadow: 2px 2px 0 #000000;
}
.cube-white {
  background: #ffffff;
}
.cube-pink {
  background: #ffb4dc;
}
.cube-mint {
  background: #6fe9d2;
}
.cube-yellow {
  background: #fff36d;
}

/* --- x x x 장식 --- */
.decor-cross-row {
  font-family: "Press Start 2P", monospace;
  font-size: 0.75rem;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #000000;
  letter-spacing: 5px;
}

/* --- 반짝 글로우 카드 태그 (이미지의 'Y2K' 등) --- */
.decor-tag-lavender {
  background: #e2cbff;
}
.decor-tag-white {
  background: #ffffff;
}

/* --- 별 클러스터 (여러 별 묶음) --- */
.decor-star-cluster {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

/* --- 채팅 버블 장식 --- */
.decor-bubble {
  background: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 12px;
  box-shadow: 3px 3px 0 #000000;
  padding: 8px 14px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  color: #000000;
  position: relative;
}

.decor-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 14px;
  width: 12px;
  height: 10px;
  background: #ffffff;
  border-right: 2.5px solid #000000;
  border-bottom: 2.5px solid #000000;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.decor-bubble-pink {
  background: #ffd6ec;
}
.decor-bubble-pink::after {
  background: #ffd6ec;
}

.decor-bubble-mint {
  background: #c8fff6;
}
.decor-bubble-mint::after {
  background: #c8fff6;
}

/* --- 하트 큰 단독 --- */
.decor-heart-single {
  font-size: 2.4rem;
  filter: drop-shadow(2.5px 2.5px 0px #000000);
  line-height: 1;
}

/* --- music / note 장식 --- */
.decor-music-box {
  background: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 10px;
  box-shadow: 3px 3px 0 #000000;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.decor-music-note {
  font-size: 1.5rem;
  line-height: 1;
}
.decor-music-bar {
  width: 42px;
  height: 6px;
  background: #d0d0d0;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.decor-music-bar::after {
  content: "";
  display: block;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, #ff9ec9, #74c0fc);
  border-radius: 3px;
}

/* --- 스티커 사이즈 헬퍼 --- */
.decor-xs {
  transform: scale(0.7);
}
.decor-sm {
  transform: scale(0.85);
}
.decor-md {
  transform: scale(1);
}
.decor-lg {
  transform: scale(1.3);
}
.decor-xl {
  transform: scale(1.6);
}

/* =========================================================
   App panel redesign
   The desktop is now a collection of always-visible app cards.
   ========================================================= */
body {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #ffd9f2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.38) 1px, transparent 1px);
  background-size: 28px 28px;
}

.desktop-decor-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.app-panel {
  position: relative;
  z-index: 2;
  width: min(1540px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 64px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 18px;
  align-items: stretch;
}

.panel-intro {
  grid-column: 1 / -1;
  padding: 22px 24px;
  color: #3f177f;
  background: linear-gradient(135deg, #ffffff 0 58%, #d9faff 58% 100%);
  border: 3px solid #4d21a9;
  border-radius: 14px;
  box-shadow: 6px 6px 0 #4d21a9;
  display: flex;
  align-items: center;
  gap: 16px;
}

.panel-intro-text {
  flex: 1 1 auto;
  min-width: 0;
}

.wallpaper-btn {
  flex: 0 0 auto;
  align-self: center;
  padding: 10px 14px;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.6rem;
  white-space: nowrap;
  color: #4d21a9;
  background: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 8px;
  box-shadow: 3px 3px 0 #000000;
  cursor:
    url("Dove Cursor.cur") 0 0,
    pointer;
}

.wallpaper-btn:hover {
  background: #4d21a9;
  color: #ffffff;
}

.wallpaper-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* Notification bell lives in the panel intro (left of the wallpaper
   button). The dropdown opens downward and floats above the cards. */
.panel-intro .taskbar-notify-wrapper {
  flex: 0 0 auto;
  align-self: center;
  margin-left: 0;
}

.panel-intro .taskbar-notify-panel {
  top: calc(100% + 10px);
  bottom: auto;
  z-index: 60;
  transform: translateY(-8px);
}

.panel-intro .taskbar-notify-panel.visible {
  transform: translateY(0);
}

/* Wallpaper restore button: fixed at the top-right of the page. */
.wallpaper-restore-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 2000;
  padding: 10px 16px;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.6rem;
  white-space: nowrap;
  color: #4d21a9;
  background: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 8px;
  box-shadow: 3px 3px 0 #000000;
  cursor:
    url("Dove Cursor.cur") 0 0,
    pointer;
}

.wallpaper-restore-btn:hover {
  background: #4d21a9;
  color: #ffffff;
}

.wallpaper-restore-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* Wallpaper mode: hide every panel window, keep only background + stickers. */
body.wallpaper-mode {
  overflow: hidden;
}

/* Isometric dancing-block backdrop, painted by script.js. */
#iso-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: none;
  pointer-events: none;
}

body.wallpaper-mode #iso-backdrop {
  display: block;
}

body.wallpaper-mode #app-panel .panel-intro,
body.wallpaper-mode #app-panel #desktop-icons,
body.wallpaper-mode #app-panel .window-container,
body.wallpaper-mode #app-panel .taskbar {
  display: none !important;
}

.panel-kicker {
  margin-bottom: 8px;
  color: #ef4f9e;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-intro h1 {
  margin: 0;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: clamp(1.05rem, 2.5vw, 1.8rem);
  line-height: 1.5;
}

.panel-intro-text > p:last-child {
  max-width: 680px;
  margin-top: 10px;
  color: #5e548e;
  font-size: 0.87rem;
  line-height: 1.5;
}

#app-panel .window-container,
#app-panel .window-container.hidden {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  display: flex !important;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  min-height: 0;
  margin: 0 !important;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 360ms cubic-bezier(0.2, 0.9, 0.25, 1.18),
    box-shadow 180ms ease;
}

#app-panel .window-container.is-spring-dragging {
  z-index: 30 !important;
  cursor: grabbing;
  transition: none;
}

#app-panel .window-container:hover:not(.maximized) {
  box-shadow: 7px 7px 0 #000000;
}

#app-panel .window-header {
  cursor: grab;
  flex: 0 0 auto;
}

/* Drag-to-reorder drop highlight + grab zones. */
#app-panel .is-drop-target {
  outline: 3px dashed #4d21a9;
  outline-offset: -3px;
}

#app-panel #desktop-icons,
#app-panel .taskbar {
  cursor: grab;
}

#app-panel .window-body {
  min-height: 0;
}

#app-panel .minimize-btn,
#app-panel .resize-handle,
#app-panel .app-icon,
#app-panel .start-button {
  display: none !important;
}

/* Resize grips must stay visible despite the chrome-hiding rule above.
   (Maximized cards and small viewports hide them via their own rules.) */
#app-panel .window-container:not(.maximized) .window-body > .resize-handle,
#app-panel .window-container:not(.maximized) > .resize-handle,
#app-panel #desktop-icons > .resize-handle,
#app-panel .taskbar > .resize-handle {
  display: block !important;
}

@media (max-width: 1100px) {
  #app-panel .window-container:not(.maximized) .window-body > .resize-handle,
  #app-panel .window-container:not(.maximized) > .resize-handle,
  #app-panel #desktop-icons > .resize-handle,
  #app-panel .taskbar > .resize-handle {
    display: none !important;
  }
}

/* Per-window tile sizing for tablet/mobile. (Moved out of top-level so
   desktop column spans stay user-controllable. Behavior below 1100px is
   unchanged: these still beat the non-important rules there.) */
@media (max-width: 1100px) {
  #aboutWindow {
    grid-column: span 1 !important;
    min-height: 200px !important;
  }
  #serverWindow {
    grid-column: span 1 !important;
    min-height: 200px !important;
  }
  #socialWindow {
    grid-column: span 1 !important;
    min-height: 200px !important;
  }
  #mapWindow {
    grid-column: span 1 !important;
    min-height: 200px !important;
  }
  #galagaWindow {
    grid-column: span 1 !important;
    min-height: 200px !important;
  }
  #diaryWindow {
    grid-column: span 2 !important;
    min-height: 200px !important;
  }
  #terminalWindow {
    grid-column: span 1 !important;
    min-height: 200px !important;
  }
  #statsWindow {
    grid-column: span 2 !important;
    min-height: 200px !important;
  }
  #petWindow {
    grid-column: span 1 !important;
    block-size: 200px !important;
  }
}

#desktop-icons {
  position: relative;
  inset: auto;
  z-index: auto;
  grid-column: span 2;
  grid-row: span 2;
  display: grid;
  /* grid-template-columns: 1fr; */
  align-content: center;
  gap: 12px;
  max-height: 270px;
  padding: 18px 12px;
  background: linear-gradient(180deg, #d5fff4 0%, #8de8e0 100%);
  border: 3px solid #4d21a9;
  border-radius: 14px;
  box-shadow: 6px 6px 0 #4d21a9;
}

.desktop-icon {
  margin: 0;
}

.desktop-icon a {
  gap: 4px;
}

.desktop-icon img {
  width: 42px;
  height: 42px;
}

.desktop-icon-label {
  max-width: 100%;
  margin-top: 0;
  font-size: 0.48rem;
}

#petWindow {
  background: linear-gradient(160deg, #ffc2df 0%, #ff8fc5 45%, #f76fb3 100%);
  border: 3px solid #2b2b3a;
  border-radius: 24px;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.55),
    inset 0 -5px 0 rgba(0, 0, 0, 0.12),
    inset 3px 0 0 rgba(255, 255, 255, 0.25),
    inset -3px 0 0 rgba(0, 0, 0, 0.08),
    6px 6px 0 rgba(43, 43, 58, 0.25);
}

#petWindow .window-header {
  background: linear-gradient(180deg, #ffc2df 0%, #ff8fc5 100%);
  border-block-end: 2.5px solid #2b2b3a;
}

#petWindow:hover:not(.maximized) {
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.55),
    inset 0 -5px 0 rgba(0, 0, 0, 0.12),
    inset 3px 0 0 rgba(255, 255, 255, 0.25),
    inset -3px 0 0 rgba(0, 0, 0, 0.08),
    7px 7px 0 rgba(43, 43, 58, 0.3);
}

#socialWindow .window-body,
#mapWindow .window-body,
#galagaWindow .window-body {
  padding: 0;
}

#mapWindow .window-body {
  display: flex;
  flex-direction: column;
}

#socialWindow iframe,
#mapWindow iframe,
#galagaWindow iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  border: 0;
}

#galagaWindow > iframe {
  flex: 1;
  min-height: 0;
}

#serverWindow .window-body {
  padding: 13px;
}

#serverWindow .mods-grid {
  max-height: 185px;
  overflow: auto;
}

.taskbar {
  position: relative;
  inset: auto;
  grid-column: span 3;
  min-height: 210px;
  height: auto;
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 12px;
  background: linear-gradient(145deg, #fff59b 0%, #ffd7ed 100%);
  border: 3px solid #4d21a9;
  border-radius: 14px;
  box-shadow: 6px 6px 0 #4d21a9;
  z-index: auto;
  pointer-events: auto;
  overflow: visible;
}

.panel-utility-copy {
  flex: 1 0 100%;
}

.panel-utility-label {
  display: block;
  margin-bottom: 6px;
  color: #4d21a9;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-utility-status {
  font-size: 0.8rem;
  font-weight: bold;
}

.taskbar-notify-wrapper {
  margin-left: 0;
}

.taskbar-notify-panel {
  right: auto;
  bottom: auto;
  top: calc(100% + 10px);
  left: 0;
  z-index: 100;
}

.taskbar-clock {
  min-width: 92px;
}

#app-panel .window-container.maximized {
  position: fixed !important;
  inset: 18px !important;
  z-index: 1000 !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  border-radius: 14px !important;
  box-shadow: 10px 10px 0 rgba(77, 33, 169, 0.5);
  transform: none !important;
}

#app-panel .window-container.maximized .window-body {
  flex: 1 1 auto;
}

#app-panel .window-container.maximized .maximize-btn {
  background: #4d21a9;
  color: #ffffff;
}

body:has(#app-panel .window-container.maximized) {
  overflow: hidden;
}

body.panel-focus-mode {
  overflow: hidden;
}

.start-menu,
.settings-panel-overlay,
.system-action-overlay,
.sleep-overlay {
  display: none !important;
}

@media (max-width: 1100px) {
  .app-panel {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  #desktop-icons {
    grid-column: span 2;
  }
  #aboutWindow {
    grid-column: span 2;
  }
  #serverWindow {
    grid-column: span 4;
  }
  #socialWindow,
  #mapWindow,
  #galagaWindow,
  #statsWindow,
  #petWindow {
    grid-column: span 3;
  }
  .taskbar {
    grid-column: span 2;
  }
  #diaryWindow,
  #terminalWindow {
    grid-column: span 6;
    min-height: 520px !important;
  }
}

@media (max-width: 680px) {
  .app-panel {
    width: min(100% - 24px, 560px);
    padding-top: 22px;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .panel-intro,
  #desktop-icons,
  #aboutWindow,
  #serverWindow,
  #socialWindow,
  #mapWindow,
  #galagaWindow,
  #diaryWindow,
  #terminalWindow,
  #statsWindow,
  #petWindow,
  .taskbar {
    grid-column: 1;
  }
  #desktop-icons {
    grid-template-columns: repeat(3, 1fr);
    grid-row: auto;
    min-height: 0;
  }
  #socialWindow,
  #mapWindow,
  #galagaWindow {
    min-height: 300px !important;
  }
  #diaryWindow,
  #terminalWindow {
    min-height: 480px !important;
  }
  #app-panel .window-container.maximized {
    inset: 8px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app-panel .window-container {
    transition: none;
  }
}

/* The launcher scrolls: the stats window lives below the fold. Long app
   content still belongs in the maximized view; cards show a cropped preview. */
body:not(.panel-focus-mode) {
  overflow-x: hidden;
}

.app-panel {
  min-height: 100dvh;
  padding: 22px 0;
  grid-template-rows: 92px minmax(172px, 0.8fr) minmax(250px, 1.2fr);
  overflow: visible;
}

.panel-intro {
  min-height: 0;
  padding: 14px 20px;
  overflow: visible;
}

.panel-kicker {
  margin-bottom: 4px;
}
.panel-intro h1 {
  font-size: clamp(0.88rem, 1.75vw, 1.3rem);
}
.panel-intro-text > p:last-child {
  margin-top: 4px;
  font-size: 0.76rem;
}

#app-panel .window-container,
#app-panel .window-container.hidden,
#desktop-icons,
.taskbar {
  min-height: 0 !important;
  max-height: 100%;
}

#desktop-icons {
  grid-column: span 2;
  grid-row: auto;
  min-height: 0;
}
#aboutWindow {
  grid-column: span 2;
  min-height: 0 !important;
}
#serverWindow {
  grid-column: span 3;
  min-height: 0 !important;
}
#socialWindow {
  grid-column: span 3;
  min-height: 0 !important;
}
.taskbar {
  grid-column: span 2;
  min-height: 0;
}
#galagaWindow {
  grid-column: span 3;
  min-height: 0 !important;
}
#mapWindow {
  grid-column: span 3;
  min-height: 0 !important;
}
#diaryWindow {
  grid-column: span 3;
  min-height: 0 !important;
}
#terminalWindow {
  grid-column: span 3;
  min-height: 0 !important;
}

#app-panel .window-container:not(.maximized) .window-body {
  overflow: hidden !important;
}

/* Welcome card stays scrollable even when small. */
#app-panel #aboutWindow:not(.maximized) .window-body {
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

#app-panel #aboutWindow:not(.maximized)::after {
  display: none;
}

#app-panel .window-container.maximized .window-body {
  overflow: auto !important;
}

#app-panel .window-container:not(.maximized)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34px;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.96));
}

#terminalWindow:not(.maximized)::after {
  background: linear-gradient(transparent, rgba(17, 17, 17, 0.98));
}

.panel-app-icon {
  width: 19px;
  height: 19px;
  margin-right: 7px;
  object-fit: contain;
  image-rendering: auto;
}

.panel-preview {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-content: center;
  gap: 9px;
  padding: 14px;
  color: #4d21a9;
  text-align: center;
  background: repeating-linear-gradient(
    45deg,
    #f7eaff 0 11px,
    #ddfaff 11px 22px
  );
}

.panel-preview img {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  object-fit: contain;
}

.panel-preview strong {
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.56rem;
  line-height: 1.55;
}

.panel-preview span {
  font-size: 0.7rem;
  font-weight: bold;
}

#galagaWindow > iframe:not([src]),
#mapWindow iframe:not([src]) {
  display: none;
}

#serverWindow:not(.maximized) .mods-grid,
#serverWindow:not(.maximized) .bedrock-guide-box {
  display: none !important;
}

#serverWindow:not(.maximized) .info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

#serverWindow:not(.maximized) .info-item:nth-child(n + 5) {
  display: none;
}

#diaryWindow:not(.maximized) .blog-container {
  min-width: 520px;
  transform: scale(0.64);
  transform-origin: top left;
  width: 156%;
}

@media (max-width: 1100px) and (min-width: 681px) {
  .app-panel {
    grid-template-rows: 92px minmax(165px, 0.75fr) minmax(250px, 1.25fr);
  }
  #desktop-icons,
  #aboutWindow,
  #serverWindow,
  #socialWindow,
  .taskbar {
    grid-column: span 2;
  }
  #galagaWindow,
  #mapWindow,
  #diaryWindow,
  #terminalWindow,
  #statsWindow,
  #petWindow {
    grid-column: span 3;
  }
}

@media (max-width: 680px) {
  .app-panel {
    width: calc(100% - 16px);
    height: 100dvh;
    padding: 8px 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 56px repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .panel-intro {
    grid-column: 1 / -1;
    padding: 10px 12px;
  }
  .panel-kicker,
  .panel-intro-text > p:last-child {
    display: none;
  }
  .panel-intro .wallpaper-btn {
    padding: 7px 9px;
    font-size: 0.45rem;
  }
  .wallpaper-restore-btn {
    top: 8px;
    right: 8px;
    padding: 8px 11px;
    font-size: 0.5rem;
  }
  .panel-intro h1 {
    font-size: 0.66rem;
    line-height: 1.7;
  }
  #desktop-icons,
  #aboutWindow,
  #serverWindow,
  #socialWindow,
  .taskbar,
  #galagaWindow,
  #mapWindow,
  #diaryWindow,
  #terminalWindow,
  #statsWindow,
  #petWindow {
    grid-column: span 1;
  }
  #desktop-icons {
    grid-template-columns: repeat(3, 1fr);
    padding: 8px 3px;
    gap: 2px;
  }
  .desktop-icon img {
    width: 28px;
    height: 28px;
  }
  .desktop-icon-label,
  .panel-utility-copy,
  .taskbar-notify-panel,
  #app-panel .window-container:not(.maximized) .window-body,
  #app-panel .window-container:not(.maximized) > iframe,
  #app-panel .window-container:not(.maximized) .panel-preview {
    display: none !important;
  }
  #app-panel .window-container:not(.maximized) .window-header {
    min-height: 100%;
    padding: 7px 6px;
  }
  .window-title {
    font-size: 0.42rem;
  }
  .panel-app-icon {
    width: 18px;
    height: 18px;
    margin-right: 4px;
  }
  .taskbar {
    padding: 8px;
    justify-content: center;
    align-content: center;
  }
  .taskbar-clock {
    min-width: 0;
    padding: 6px 4px;
    font-size: 0.48rem;
  }
  .taskbar-notify-button {
    width: 31px;
    height: 31px;
  }
  .taskbar-notify-icon img {
    width: 25px !important;
  }
  .notification-badge {
    transform: scale(0.75);
    transform-origin: top right;
  }
  /* The bell moved into the intro: its dropdown must still open on mobile. */
  #app-panel .panel-intro .taskbar-notify-panel.visible {
    display: block !important;
  }
}

/* Full app views must use every pixel of the maximized card. */
.panel-preview[hidden] {
  display: none !important;
}

#app-panel .window-container.maximized .panel-preview {
  display: none !important;
}

#app-panel .window-container.maximized {
  height: calc(100dvh - 36px) !important;
}

#app-panel .window-container.maximized .window-body {
  height: 0;
  min-height: 0;
  flex: 1 1 auto;
}

#galagaWindow.maximized > iframe {
  height: 0 !important;
  min-height: 0;
  flex: 1 1 auto;
}

#app-panel #serverWindow:not(.maximized) .window-body {
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

#app-panel #serverWindow.maximized .window-body {
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

#serverWindow.maximized .server-panel[data-panel="java"] {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

#serverWindow.maximized .mods-grid {
  flex: 1;
  max-height: none;
  overflow: auto;
}

/* The diary preview should be cropped by its card, not scaled down inside it. */
#diaryWindow:not(.maximized) .blog-container {
  min-width: 0;
  width: 100%;
  height: 100%;
  transform: none;
}

/* A maximized mobile card always shows the real application, never its tile. */
@media (max-width: 680px) {
  #app-panel .window-container.maximized .window-header {
    min-height: 0;
    padding: 7px 12px;
  }
  #app-panel .window-container.maximized .window-title {
    font-size: 0.54rem;
  }
  #app-panel .window-container.maximized .panel-app-icon {
    width: 19px;
    height: 19px;
    margin-right: 7px;
  }
  #app-panel .window-container.maximized .window-body {
    display: block !important;
    overflow: auto !important;
  }
  #app-panel #mapWindow.maximized .window-body {
    display: flex !important;
  }
  #app-panel .window-container.maximized > iframe {
    display: block !important;
  }
  #app-panel .window-container.maximized .panel-preview {
    display: none !important;
  }
}

/* --- traffic stats window --- */
.stats-status {
  margin-bottom: 12px;
  color: #5e548e;
  font-size: 0.8rem;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stats-card {
  padding: 10px 8px;
  text-align: center;
  background: #f7eaff;
  border: 2px solid #4d21a9;
  border-radius: 10px;
  box-shadow: 3px 3px 0 #4d21a9;
}

.stats-num {
  color: #4d21a9;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.stats-label {
  margin-top: 6px;
  color: #5e548e;
  font-size: 0.66rem;
}

.stats-block {
  margin-bottom: 18px;
}

.stats-block h4 {
  margin: 0 0 8px;
  color: #3f177f;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stats-chart {
  position: relative;
  height: 230px;
  padding: 10px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 10px;
}

.stats-chart-sm {
  height: 200px;
  max-width: 340px;
  margin: 0 auto;
}

.stats-refs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-refs li {
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: #3f177f;
}

.stats-refs .ref-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.stats-refs .ref-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-refs .ref-count {
  flex: 0 0 auto;
  font-weight: bold;
}

.stats-refs .ref-track {
  height: 8px;
  overflow: hidden;
  background: #f7eaff;
  border: 1.5px solid #4d21a9;
  border-radius: 5px;
}

.stats-refs .ref-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8fc5, #4d21a9);
}

@media (max-width: 680px) {
  .stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-chart {
    height: 200px;
  }
}

/* --- tamagotchi window (device = window) --- */
.pet-body {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
}

/* 노란 아이콘 스트립 (위/아래) */
.tama-icon-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #ffe45c 0%, #f7c948 100%);
  border: 2.5px solid #2b2b3a;
  border-radius: 10px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.tama-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  background: linear-gradient(180deg, #fff7d6 0%, #ffe9a3 100%);
  border: 2px solid #2b2b3a;
  border-radius: 8px;
  box-shadow: 0 2px 0 #2b2b3a;
  cursor: pointer;
  transition:
    transform 0.05s ease,
    box-shadow 0.05s ease,
    background 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Daily remaining count badge (feed/snack limits). */
.tama-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #4d21a9;
  color: #ffffff;
  border: 1.5px solid #2b2b3a;
  border-radius: 9px;
  font-size: 0.6rem;
  font-weight: bold;
  line-height: 1;
}

.tama-count.is-empty {
  background: #9a9ab0;
}

.tama-btn:hover {
  background: linear-gradient(180deg, #ffffff 0%, #fff2b8 100%);
}

.tama-btn:active,
.tama-btn.pressed {
  transform: translateY(2px);
  box-shadow: 0 0 0 #2b2b3a;
}

/* 아이콘은 항상 보인다 */
.tama-btn canvas {
  display: block;
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  opacity: 1;
}

.tama-btn:active canvas,
.tama-btn.pressed canvas,
.tama-btn:focus-visible canvas {
  opacity: 1;
}

/* 민트 LCD 화면 */
.tama-screen {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #bfe8d8;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.35) 1px,
    transparent 1px
  );
  background-size: 6px 6px;
  border: 3px solid #2b2b3a;
  border-radius: 14px;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.25);
  cursor:
    url("Dove Cursor.cur") 0 0,
    pointer;
}

.tama-screen canvas.pet-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Lights-out tint while the pet sleeps. */
.tama-screen.sleeping::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(24, 20, 64, 0.32);
  pointer-events: none;
}

.pet-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.06) 0 1px,
    transparent 1px 3px
  );
}

/* 화면 하단 HUD (상태 텍스트 + 바) */
.tama-screen-hud {
  padding: 8px 10px;
  background-color: #bfe8d8;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.35) 1px,
    transparent 1px
  );
  background-size: 6px 6px;
  border: 3px solid #2b2b3a;
  border-radius: 14px;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.25);
  color: #2b2b3a;
}

.pet-face.mood-happy {
  animation: pet-dance 0.9s ease-in-out infinite;
}

@keyframes pet-dance {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(4deg) translateY(-3px);
  }
}

.pet-face.pat {
  animation: pet-jump 0.45s ease;
}

@keyframes pet-jump {
  30% {
    transform: translateY(-14px) scale(1.12) rotate(-6deg);
  }
  60% {
    transform: translateY(0) scale(0.96);
  }
}

/* Pet maximize lives only on mobile tiles (desktop uses the embedded card). */
#petWindow .maximize-btn {
  display: none;
}

@media (max-width: 680px) {
  #petWindow .maximize-btn {
    display: flex;
  }

  /* The pet stays visible on its tile: header shrinks to normal size,
     body shows only the LCD, buttons and status wait for maximize. */
  #app-panel #petWindow:not(.maximized) .window-header {
    min-height: 0;
  }
  #app-panel #petWindow:not(.maximized) .window-body {
    display: block !important;
    padding: 6px;
  }
  #app-panel #petWindow:not(.maximized) .tama-screen {
    width: 100%;
    aspect-ratio: 1 / 1;
  }
  #app-panel #petWindow:not(.maximized) .tama-icon-strip,
  #app-panel #petWindow:not(.maximized) .tama-screen-hud,
  #app-panel #petWindow:not(.maximized) .pet-note,
  #app-panel #petWindow:not(.maximized) .pet-info,
  #app-panel #petWindow:not(.maximized) .pet-snacks {
    display: none !important;
  }
}

/* Mobile maximized pet: keep the flex column so the LCD gets real height.
   (The generic maximized rule flips bodies to display:block, which
   collapses the absolutely-positioned canvas to zero.) */
@media (max-width: 680px) {
  #app-panel #petWindow.maximized .window-body {
    display: flex !important;
    flex-direction: column;
    overflow: auto !important;
  }
}

.pet-mood {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: bold;
  color: #2b2b3a;
  text-align: center;
  min-height: 1.2em;
}

.pet-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pet-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
}

.pet-bar-label {
  flex: 0 0 34px;
  font-weight: bold;
  color: #2b2b3a;
}

.pet-gauge {
  flex: 1 1 auto;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: #2b2b3a;
  white-space: nowrap;
}

.pet-note {
  margin: 4px 0 0;
  min-height: 1.1em;
  font-size: 0.66rem;
  font-weight: bold;
  color: #2b2b3a;
  text-align: center;
}

.pet-info {
  margin: 2px 0 0;
  font-size: 0.62rem;
  color: #2b2b3a;
  text-align: center;
}

.desktop-emoji-icon {
  font-size: 40px;
  line-height: 1;
  display: inline-block;
}

.start-app-item .start-app-emoji {
  font-size: 30px;
  line-height: 1;
  font-family: inherit;
}

/* --- desktop grid: windows in two horizontal rows (four per row),
   stats + taskbar full-width at the bottom (stats lives below the fold).
   Vertical size is grid-driven too: 1 row unit = 120px (+18px gaps).
   Change any window's height with `grid-row: span n` below. --- */
/* Tile cards stay compact no matter how long their content is; the full
   content lives in the maximized view. */
#app-panel .window-container:not(.maximized) {
  max-height: none !important;
}
@media (min-width: 1101px) {
  .app-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto;
    grid-auto-rows: 120px;
  }
  #app-panel #desktop-icons,
  #app-panel #aboutWindow,
  #app-panel #serverWindow,
  #app-panel #socialWindow,
  #app-panel #galagaWindow,
  #app-panel #mapWindow,
  #app-panel #diaryWindow,
  #app-panel #terminalWindow {
    grid-column: span 1;
    grid-row: span 3;
  }
  #app-panel #petWindow,
  #app-panel .taskbar {
    grid-column: span 2;
    grid-row: span 3;
  }
  #app-panel #desktop-icons {
    max-height: none;
  }
  /* Cards must fill their grid areas for spans to resize them visibly.
     (Base .window-container sets align-self: start, which strands cards
     at content height and leaves dead track space on span changes.) */
  #app-panel .window-container:not(.maximized),
  #app-panel #desktop-icons,
  #app-panel .taskbar {
    align-self: stretch;
  }
  #app-panel #statsWindow {
    grid-column: 1 / -1;
    grid-row: span 4;
  }
  .stats-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }
  .stats-blocks .stats-block {
    min-width: 0;
  }
}
