@font-face {
  font-family: 'Tangba11';
  src: url('Tangba11.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

* {
  font-family: 'Tangba11', sans-serif !important;
}

:root {
  --color-primary:     #ff6db6;
  --color-primary-dim: #845065;
  --color-primary-bg:  #ffb7d7;

  --color-bg:          #ffcee8;
  --color-surface:     #ec9acf;
  --color-border:      #ff69b4;
  --color-text:        #fff;
  --color-text-dim:    #fce4f3;

  --color-taskbar:     #ffa4df;
  --color-titlebar:    #ff69b4;
  --color-titlebar-fg: #fff;

  --color-active:      #ff69b4;
  --color-danger:      #ff3030;

  --icon-label-color:  #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
}

#desktop {
  width: 100vw;
  height: 100vh;
  background-color: var(--color-bg);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.window {
  position: absolute;
  min-width: 300px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 4px 4px 0 var(--color-primary-dim);
}

.window.focused {
  box-shadow: 6px 6px 0 var(--color-primary);
  z-index: 100;
}

.window.minimized { display: none; }
.window-titlebar {
  background: var(--color-titlebar);
  color: var(--color-titlebar-fg);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  font-size: 11px;
  user-select: none;
}

.window-titlebar button {
  background: var(--color-primary-dim);
  color: #fff;
  border: 1px solid #fff4;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 10px;
  font-family: inherit;
}

.window-titlebar button:hover { background: var(--color-primary); }
.window-body {
  padding: 14px;
  font-size: 11px;
  color: var(--color-text);
  line-height: 1.8;
}

#taskbar {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  height: 44px;
  background: var(--color-taskbar);
  border-top: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  z-index: 9999;
}

#start-btn {
  background: var(--color-primary);
  color: #fff;
  border: 2px solid #fff4;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

#start-btn:hover { background: var(--color-primary-dim); }

.taskbar-btn {
  background: var(--color-surface);
  color: var(--color-text-dim);
  border: 1px solid var(--color-border);
  padding: 3px 8px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
}

.taskbar-btn.active {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

#clock {
  position: fixed;
  bottom: 12px; right: 14px;
  font-size: 12px;
  color: var(--color-text);
  z-index: 9999;
}

#start-menu {
  position: fixed;
  bottom: 38px; left: 8px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  padding: 8px 0;
  z-index: 9999;
  min-width: 160px;
}

#start-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 10px;
  color: var(--color-text);
  text-decoration: none;
}

#start-menu a:hover {
  background: var(--color-primary);
  color: #fff;
}

.pixel-btn {
  background: var(--color-primary);
  color: #fff;
  border: 2px solid var(--color-primary-dim);
  padding: 8px 14px;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  image-rendering: pixelated;
  transition: background 0.15s;
}

.pixel-btn:hover    { background: var(--color-primary-dim); }
.pixel-btn.small    { padding: 4px 10px; font-size: 9px; }

.pixel-btn.danger   { background: var(--color-danger); border-color: #aa0000; }
.pixel-btn.danger:hover { background: #cc0000; }

.pixel-btn.active {
  background: var(--color-primary-dim);
  box-shadow: inset 2px 2px 0 #0004;
}

.dday-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  border-bottom: 1px solid var(--color-primary-bg);
}

.dday-count {
  color: #fff;
  font-size: 15px;
  text-shadow: 1px 1px 0 var(--color-primary-dim);
}

.dday-label { font-size: 10px; color: var(--color-text-dim); }

.music-layout {
  display: flex;
  height: 320px;
  overflow: hidden;
}

.music-player-left {
  flex: 0 0 52%;
  background: #dda0b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 18px;
  gap: 6px;
}

#now-playing { display: none; }

#track-title {
  font-size: 20px;
  font-weight: bold;
  color: #3a1525;
  text-align: center;
  margin-top: 8px;
}

#track-artist {
  font-size: 14px;
  color: #3a1525;
  text-align: center;
  margin-bottom: 14px;
}

#progress-bar {
  width: 90%;
  height: 5px;
  background: #f0c8d8;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

#progress-fill {
  height: 100%;
  background: #3a1525;
  border-radius: 4px;
  position: relative;
  transition: width 0.2s;
}

#progress-fill::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: #3a1525;
  border-radius: 50%;
}

.time-row {
  display: flex;
  justify-content: space-between;
  width: 90%;
  font-size: 11px;
  color: #3a1525;
  margin-top: 2px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}

#btn-prev, #btn-next, #btn-play, #btn-loop {
  background: none;
  border: none;
  color: #a25476;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  padding: 4px;
  transition: opacity 0.15s;
}

#btn-prev, #btn-next { font-size: 22px; }
#btn-play            { font-size: 28px; }
#btn-loop            { font-size: 16px; opacity: 0.5; }
#btn-loop.active     { opacity: 1; color: #bf597a; }

#btn-prev:hover, #btn-next:hover,
#btn-play:hover, #btn-loop:hover { opacity: 0.7; }

.music-player-right {
  flex: 1;
  border-left: 2px solid #b0789f;
  overflow-y: auto;
  background: #dda0b8;
}

.playlist-item {
  padding: 12px 14px;
  border-bottom: 1px solid #b0789b;
  cursor: pointer;
  transition: background 0.15s;
}

.playlist-item:hover  { background: rgba(255,255,255,0.15); }
.playlist-item.active { background: rgba(255,255,255,0.25); }

.pl-title {
  font-size: 13px;
  font-weight: bold;
  color: #3a1525;
}

.pl-artist {
  font-size: 11px;
  color: #5a3040;
  margin-top: 2px;
}

#msg-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 8px 0;
  border-bottom: 2px solid #914168;
  flex-wrap: wrap;
}

.msg-tab {
  padding: 4px 12px;
  font-family: inherit;
  font-size: 11px;
  background: #874c6b;
  color: #aaa;
  border: 1px solid #753453;
  cursor: pointer;
}

.msg-tab:hover {
  background: #96446a;
  color: #fff;
}

.msg-tab.active {
  background: #816573;
  color: #fff;
  border-bottom: 2px solid #fff;
}

#msg-tabs:empty {
  display: none;
}

#msg-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px;
  overflow-y: auto;
  height: 320px;
  background: #f9d6ea;
}

.chat-row {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.chat-row.right {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-row.left {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-sender {
  font-size: 10px;
  color: #b05080;
  margin-bottom: 4px;
  padding: 0 4px;
}

.chat-bubble {
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  border: 2px solid #d4608a;
}

.chat-row.right .chat-bubble {
  background: #e07194;
  color: #fff;
  border-radius: 16px 16px 2px 16px;
}

.chat-row.left .chat-bubble {
  background: #ffd6e7;
  color: #a6355d;
  border-radius: 16px 16px 16px 2px;
}

.msg-empty {
  padding: 16px;
  text-align: center;
  color: #888;
  font-size: 11px;
}

.msg-window-content {
  display: flex;
  flex-direction: column;
  padding: 0;
}

#icon-grid {
  position: absolute;
  top: 40px;
  left: 160px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px;
  width: 90px;
}

.desktop-icon:hover,
.desktop-icon:focus {
  background: var(--color-primary-bg);
  outline: 1px dashed var(--color-primary);
}

.desktop-icon span:first-child,
.desktop-icon .icon-emoji {
  font-size: 52px;
  text-shadow: none;
  display: block;
  text-align: center;
}

.desktop-icon .icon-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}

.desktop-icon span:last-child,
.desktop-icon .icon-label {
  font-size: 12px;
  color: var(--icon-label-color);
  text-align: center;
  text-shadow: none;
  word-break: keep-all;
  line-height: 1.4;
  white-space: nowrap;
}

#admin-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--color-bg);
}

#admin-header {
  background: var(--color-titlebar);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-bottom: 3px solid var(--color-primary-dim);
  letter-spacing: 1px;
}

#admin-tabs {
  display: flex;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  padding: 10px 12px 0;
  gap: 6px;
}

.tab-btn {
  background: var(--color-primary-bg);
  color: var(--color-text-dim);
  border: 2px solid var(--color-border);
  border-bottom: none;
  padding: 8px 14px;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  position: relative;
  bottom: -2px;
}

.tab-btn:hover {
  background: var(--color-primary-dim);
  color: #fff;
  transform: translateY(-2px);
}

.tab-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  bottom: -2px;
  z-index: 1;
}

@keyframes tabSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes tabFadeOut {
  from { opacity: 1; transform: translateY(0);    }
  to   { opacity: 0; transform: translateY(-8px); }
}

.tab-panel {
  display: none;
  padding: 24px 20px;
  flex: 1;
  overflow-y: auto;
}

.tab-panel.active {
  display: block;
  animation: tabSlideIn 0.22s ease forwards;
}

.tab-panel.leaving {
  display: block;
  animation: tabFadeOut 0.15s ease forwards;
  pointer-events: none;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--color-primary-bg);
  border-left: 4px solid var(--color-primary);
  margin-bottom: 8px;
  background: var(--color-surface);
  transition: background 0.15s;
}

.admin-item:hover { background: var(--color-primary-bg); }

.admin-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-item-info strong { font-size: 11px; color: #fff; }
.admin-item-info span   { font-size: 10px; color: var(--color-text-dim); }

.admin-input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.admin-input-row input,
.admin-input-row select,
.pixel-input {
  background: #fff3fa;
  color: #c0306a;
  border: 2px solid var(--color-border);
  padding: 8px 10px;
  font-size: 10px;
  font-family: inherit;
  flex: 1;
  min-width: 100px;
  transition: border-color 0.15s;
}

.admin-input-row input::placeholder,
.pixel-input::placeholder {
  color: #e895c0;
}

.admin-input-row input:focus,
.admin-input-row select:focus,
.pixel-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
}

#login-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background: #0009;
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
}

.login-box {
  background: var(--color-surface);
  border: 3px solid var(--color-border);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 340px;
  box-shadow: 8px 8px 0 var(--color-primary-dim);
}

.login-box h2 {
  font-size: 14px;
  color: #fff;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.login-box input {
  background: #fff3fa;
  color: #c0306a;
  border: 2px solid var(--color-border);
  padding: 10px 12px;
  font-size: 10px;
  font-family: inherit;
  width: 100%;
}

.login-box input::placeholder { color: #e895c0; }

.login-box input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
}

.login-box .pixel-btn {
  width: 100%;
  padding: 10px;
  font-size: 11px;
  text-align: center;
}

#landing-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background: var(--color-bg);
}

.landing-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 40px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 6px 6px 0 var(--color-primary-dim);
}

.landing-icon  { font-size: 56px; }
.landing-title { font-size: 18px; color: #fff; letter-spacing: 2px; }
.landing-desc  { font-size: 10px; color: var(--color-text-dim); }

.landing-back {
  font-size: 10px;
  color: var(--color-text-dim);
  text-decoration: none;
  margin-top: 4px;
}

.landing-back:hover { color: #fff; }

#admin-indicator {
  display: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 8px;
  padding: 2px 6px;
  border: 1px solid var(--color-primary-dim);
}

.admin-toast {
  position: fixed;
  bottom: 60px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 10px;
  border: 2px solid;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.admin-toast--show {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast--success {
  background: #1a2e1a;
  border-color: #44ff88;
  color: #44ff88;
}

.admin-toast--error {
  background: #2e1a1a;
  border-color: #ff4444;
  color: #ff4444;
}

#loading-screen {
  position: fixed;
  inset: 0;
  background: #ffd6e7;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease;
}

#loading-screen.hide {
  opacity: 0;
  pointer-events: none;
}

.loading-box {
  text-align: center;
}

.loading-title {
  font-size: 20px;
  color: #e08faa;
  margin-bottom: 20px;
}

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  position: relative;
  animation: spin 1.2s linear infinite;
}

.spinner::before {
  content: '💗';
  font-size: 48px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.loading-percent {
  font-size: 14px;
  color: #c06080;
  margin-top: 8px;
}

#taskbar-icons {
  display: none;
  gap: 8px;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.icon-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
}

.icon-img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  object-fit: contain;
}

.icon-emoji {
  font-size: 32px;
  line-height: 1;
}

.icon-label {
  font-size: 11px;
  text-align: center;
  margin-top: 4px;
  text-shadow: 1px 1px 2px #000;
}

#msg-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 8px 0;
  border-bottom: 2px solid #914168;
  flex-wrap: wrap;
}

.msg-tab {
  padding: 4px 12px;
  font-family: inherit;
  font-size: 11px;
  background: #874c6b;
  color: #7b7b7b;
  border: 1px solid #573947;
  cursor: pointer;
  transition: background 0.15s;
}

.msg-tab:hover {
  background: #444;
  color: #fff;
}

.msg-tab.active {
  background: #816573;
  color: #fff;
  border-bottom: 2px solid #fff;
}

#msg-tabs:empty {
  display: none;
}

.msg-empty {
  padding: 16px;
  text-align: center;
  color: #818181;
  font-size: 11px;
}

.msg-window-content {
  display: flex;
  flex-direction: column;
  padding: 0;
}

#msg-list {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-row label {
  font-size: 10px;
  color: #727272;
  letter-spacing: 0.05em;
}

.pixel-input {
  font-family: inherit;
  font-size: 11px;
  padding: 5px 8px;
  background: #e26eb2;
  border: 1px solid #bf5290;
  color: #eee;
  resize: vertical;
}

.pixel-input:focus {
  outline: none;
  border-color: #4f4148;
}

.sender-order-btns {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pixel-btn.small {
  padding: 2px 6px;
  font-size: 10px;
}

.pixel-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.input-row .pixel-input {
  flex: 1;
}

.admin-empty {
  font-size: 10px;
  color: #7a7a7a;
  padding: 8px;
  text-align: center;
}

#sys-tray {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
  height: 44px;
  border-left: 1px solid var(--color-border);
  flex-shrink: 0;
}

#sys-tray-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 100%;
  cursor: default;
}

#sys-tray-icons span {
  opacity: 0.85;
  transition: opacity 0.15s;
}
#sys-tray-icons span:hover { opacity: 1; }

#sys-tray-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border);
  opacity: 0.5;
}

#clock-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 100%;
  line-height: 1.3;
  cursor: default;
  min-width: 72px;
}

#clock-time {
  font-size: 12px;
  color: var(--color-text);
  font-weight: bold;
}

#clock-date {
  font-size: 9px;
  color: var(--color-text-dim);
  white-space: nowrap;
}

.gb-entry {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px dashed #f0a8ca;
}

.gb-entry-text {
  font-size: 12px;
  color: #7a2040;
  word-break: break-all;
}

.gb-entry-time {
  font-size: 9px;
  color: #c06080;
  opacity: 0.7;
}

#gb-input {
  color: #7a2040 !important;
  background: #fff !important;
}

#gb-input::placeholder {
  color: #d4a0b8 !important;
}