:root {
  color-scheme: light;
  --accent: #b98fa3;
  --accent-rgb: 185, 143, 163;
  --accent-2: #c9a9b6;
  --desktop-text: #5a4450;
  --desktop-text-shadow: 0 1px 2px rgba(255, 255, 255, 0.92), 0 0 10px rgba(255, 255, 255, 0.72);
  --window-bg: rgba(252, 249, 251, 0.76);
  --window-muted: rgba(249, 244, 247, 0.72);
  --surface: rgba(255, 253, 254, 0.56);
  --surface-solid: #fffdfe;
  --surface-soft: rgba(249, 243, 246, 0.64);
  --surface-hover: rgba(0, 0, 0, 0.055);
  --surface-active: rgba(0, 0, 0, 0.085);
  --text: #3d3037;
  --text-soft: #75636d;
  --text-faint: #9a8791;
  --border: rgba(84, 57, 70, 0.14);
  --border-strong: rgba(84, 57, 70, 0.22);
  --shadow-window: 0 28px 70px rgba(67, 35, 51, 0.18), 0 4px 14px rgba(67, 35, 51, 0.1);
  --shadow-menu: 0 22px 60px rgba(67, 35, 51, 0.16), 0 5px 18px rgba(67, 35, 51, 0.09);
  --shadow-soft: 0 10px 30px rgba(79, 48, 63, 0.1);
  --radius-window: 12px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --taskbar-h: 52px;
  --titlebar-h: 40px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --icon-filter: none;
  --jp-paper: #faf6f8;
  --jp-ink: #4a3b42;
  --jp-vermilion: #bd5f5a;
  --jp-indigo: #4f6173;
  --font-jp-sans: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --font-jp-serif: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", "Meiryo", "MS PGothic", sans-serif;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --accent: #d0a4b6;
  --accent-rgb: 208, 164, 182;
  --accent-2: #b895a5;
  --desktop-text: #f7fbff;
  --desktop-text-shadow: 0 1px 5px rgba(0, 0, 0, 0.48);
  --window-bg: rgba(42, 33, 38, 0.84);
  --window-muted: rgba(48, 38, 44, 0.82);
  --surface: rgba(53, 42, 48, 0.64);
  --surface-solid: #382f34;
  --surface-soft: rgba(54, 43, 49, 0.7);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --surface-active: rgba(255, 255, 255, 0.12);
  --text: #f8f1f4;
  --text-soft: #cebdc5;
  --text-faint: #a9959f;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --shadow-window: 0 30px 80px rgba(18, 8, 13, 0.52), 0 5px 18px rgba(18, 8, 13, 0.3);
  --shadow-menu: 0 24px 64px rgba(18, 8, 13, 0.5), 0 6px 20px rgba(18, 8, 13, 0.28);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--font-jp-sans);
  font-size: 13px;
  color: var(--text);
  background: #07172f;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.window-title,
.settings-heading,
.poker-title strong,
.poker-mode-card strong {
  font-family: var(--font-jp-serif);
  font-weight: 650;
  letter-spacing: 0.02em;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
.desktop-shortcut {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 82%, white);
  outline-offset: 2px;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 14px rgba(var(--accent-rgb), 0.26);
}

.primary-button:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
}

.secondary-button {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border);
}

.secondary-button:hover,
.ghost-button:hover {
  background: var(--surface-hover);
}

.ghost-button {
  color: var(--text-soft);
  background: transparent;
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active {
  transform: translateY(1px);
}

/* Boot */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  color: #5b414e;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.9), transparent 38%),
    linear-gradient(145deg, #f8eff3, #e7d3dc 56%, #d4b9c5);
  transition: opacity 0.7s var(--ease), visibility 0.7s ease;
}

.boot-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  transform: rotate(0deg);
}

.boot-mark span {
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(185, 143, 163, 0.2);
}

.boot-name {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.boot-note {
  margin: 0;
  color: rgba(91, 65, 78, 0.64);
  font-size: 13px;
}

.boot-progress {
  width: 180px;
  height: 4px;
  margin: 9px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(185, 143, 163, 0.2);
}

.boot-progress span {
  display: block;
  width: 44%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: boot-progress 1.2s var(--ease) infinite;
}

@keyframes boot-progress {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(350%);
  }
}

/* Desktop */
.desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

.desktop-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.desktop-decor span {
  position: absolute;
  color: rgba(255, 255, 255, 0.62);
  font-size: 34px;
  filter: drop-shadow(0 5px 12px rgba(55, 38, 47, 0.18));
  animation: decor-float 7s ease-in-out infinite;
}

.desktop-decor span:nth-child(1) { top: 10%; left: 72%; animation-delay: -1s; }
.desktop-decor span:nth-child(2) { top: 64%; left: 84%; font-size: 44px; animation-delay: -3s; }
.desktop-decor span:nth-child(3) { top: 18%; left: 88%; font-size: 40px; animation-delay: -5s; }
.desktop-decor span:nth-child(4) { top: 78%; left: 62%; animation-delay: -2s; }
.desktop-decor span:nth-child(5) { top: 7%; left: 56%; font-size: 40px; animation-delay: -4s; }
.desktop-decor span:nth-child(6) { top: 42%; left: 68%; font-size: 48px; animation-delay: -6s; }
.desktop-decor span:nth-child(7) { top: 30%; left: 48%; color: rgba(255, 255, 255, 0.52); }
.desktop-decor span:nth-child(8) { top: 54%; left: 44%; color: rgba(255, 255, 255, 0.55); }
.desktop-decor span:nth-child(9) { top: 72%; left: 92%; color: rgba(255, 255, 255, 0.5); }
.desktop-decor span:nth-child(10) { top: 22%; left: 40%; color: rgba(255, 255, 255, 0.48); }

@keyframes decor-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

.wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #b893a2, #d7bac6 48%, #ecdce2);
  transition: filter 0.25s ease, background 0.4s ease;
}

body[data-wallpaper] .wallpaper.has-image {
  background-image: var(--wallpaper-image);
  background-size: 124% 124%;
  background-position: center 42%;
  background-repeat: no-repeat;
  background-blend-mode: normal;
}

.wallpaper.has-image .wallpaper-glow,
.wallpaper.has-image .wallpaper-ribbon {
  opacity: 0;
}

body[data-wallpaper="bloom"] .wallpaper {
  background:
    radial-gradient(circle at 74% 16%, rgba(238, 209, 220, 0.82), transparent 30%),
    radial-gradient(circle at 20% 80%, rgba(201, 159, 178, 0.4), transparent 34%),
    linear-gradient(135deg, #a77f90 0%, #c9a3b2 43%, #dec2cc 69%, #f2e3e8 100%);
}

body[data-wallpaper="sunset"] .wallpaper {
  background:
    radial-gradient(circle at 82% 14%, rgba(255, 243, 235, 0.9), transparent 24%),
    linear-gradient(145deg, #8f6e79 0%, #bd8f9e 42%, #ddb8c2 72%, #f1d9df 100%);
}

body[data-wallpaper="forest"] .wallpaper {
  background:
    radial-gradient(circle at 15% 18%, rgba(244, 224, 231, 0.52), transparent 26%),
    linear-gradient(145deg, #6f5863 0%, #9d7d8b 48%, #c9a9b5 100%);
}

body[data-wallpaper="ink"] .wallpaper {
  background:
    radial-gradient(circle at 70% 20%, rgba(217, 174, 193, 0.2), transparent 30%),
    linear-gradient(145deg, #1d1419 0%, #392a31 52%, #24191f 100%);
}

body[data-wallpaper="paper"] .wallpaper {
  background:
    radial-gradient(circle at 18% 25%, rgba(255, 255, 255, 0.94), transparent 27%),
    linear-gradient(145deg, #eadde2, #faf4f6 45%, #dcc7d0);
}

.wallpaper-glow {
  position: absolute;
  width: 58vw;
  height: 58vw;
  left: 16%;
  top: 16%;
  border-radius: 42% 58% 64% 36% / 46% 42% 58% 54%;
  background: rgba(255, 255, 255, 0.07);
  filter: blur(1px);
  transform: rotate(-14deg);
}

.wallpaper-ribbon {
  position: absolute;
  width: 48vw;
  height: 48vw;
  border: 2px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.ribbon-one {
  right: 6%;
  top: 8%;
}

.ribbon-two {
  right: -17%;
  top: 24%;
  transform: scale(0.72);
}

.ribbon-three {
  left: -16%;
  bottom: -34%;
  transform: scale(0.9);
}

body:not([data-wallpaper="bloom"]) .wallpaper-ribbon,
body:not([data-wallpaper="bloom"]) .wallpaper-glow {
  opacity: 0.24;
}

.desktop-icons {
  position: absolute;
  inset: 12px auto var(--taskbar-h) 10px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 94px);
  grid-auto-columns: 88px;
  align-content: start;
  gap: 4px 8px;
  padding: 6px;
  max-height: calc(100vh - var(--taskbar-h) - 22px);
  user-select: none;
}

.desktop-shortcut {
  position: relative;
  width: 88px;
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 8px 4px 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--desktop-text);
  text-shadow: var(--desktop-text-shadow);
  background: transparent;
  cursor: default;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.desktop-shortcut:hover {
  background: rgba(255, 255, 255, 0.43);
}

body[data-theme="dark"] .desktop-shortcut:hover {
  background: rgba(255, 255, 255, 0.1);
}

.desktop-shortcut.is-selected {
  background: rgba(var(--accent-rgb), 0.32);
  border-color: rgba(255, 255, 255, 0.33);
}

.desktop-shortcut:active {
  transform: scale(0.98);
}

.shortcut-icon,
.app-icon {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--icon-bg, linear-gradient(145deg, #ad8598, #c9a7b4));
  border-radius: 10px;
  box-shadow: 0 5px 12px rgba(22, 42, 57, 0.18);
}

.app-icon svg {
  width: 58%;
  height: 58%;
}

.shortcut-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.24));
}

.shortcut-name {
  max-width: 82px;
  min-height: 30px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
}

/* Window manager */
.window-layer {
  position: absolute;
  inset: 0 0 var(--taskbar-h);
  pointer-events: none;
}

.window {
  position: absolute;
  min-width: 360px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-window);
  background: color-mix(in srgb, var(--window-bg) 74%, transparent);
  box-shadow: var(--shadow-window);
  backdrop-filter: blur(32px) saturate(165%);
  -webkit-backdrop-filter: blur(32px) saturate(165%);
  pointer-events: auto;
  animation: window-in 0.2s var(--ease);
}

body[data-theme="light"] .window::before,
.start-menu::before,
.quick-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), transparent 42%);
  opacity: 0.35;
}

.window.is-focused {
  box-shadow: var(--shadow-window), 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.window.is-minimized {
  display: none;
}

.window.is-maximized {
  inset: 7px 7px 7px !important;
  width: auto !important;
  height: auto !important;
  border-radius: 9px;
}

.window.is-closing {
  animation: window-out 0.16s ease forwards;
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes window-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}

.titlebar {
  position: relative;
  z-index: 2;
  height: var(--titlebar-h);
  flex: 0 0 var(--titlebar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-left: 12px;
  user-select: none;
  background: color-mix(in srgb, var(--window-muted) 84%, transparent);
  border-bottom: 1px solid var(--border);
}

.window-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 600;
}

.window-title .app-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  box-shadow: none;
}

.window-title .app-icon svg {
  width: 20px;
  height: 20px;
}

.window-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls {
  height: 100%;
  display: flex;
  align-items: stretch;
}

.window-control {
  width: 45px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: default;
}

.window-control:hover {
  background: var(--surface-hover);
}

.window-control.close:hover {
  color: #fff;
  background: #d73131;
}

.window-control svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}

.window-body {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1;
  overflow: auto;
  background: transparent;
}

.window-resize {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

.window-resize::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  opacity: 0.55;
}

.window.is-maximized .window-resize {
  display: none;
}

/* Start menu */
.start-menu {
  position: absolute;
  z-index: 9500;
  left: 50%;
  bottom: calc(var(--taskbar-h) + 10px);
  width: min(620px, calc(100vw - 20px));
  max-height: min(720px, calc(100vh - var(--taskbar-h) - 22px));
  overflow: auto;
  padding: 18px 20px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--window-bg) 74%, transparent);
  box-shadow: var(--shadow-menu);
  backdrop-filter: blur(34px) saturate(165%);
  -webkit-backdrop-filter: blur(34px) saturate(165%);
  transform: translateX(-50%);
  animation: menu-in 0.17s var(--ease);
}

.start-menu > * {
  position: relative;
  z-index: 1;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.start-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
}

.start-search input {
  width: 100%;
  height: 100%;
  padding: 0 17px 0 42px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-glyph,
.taskbar-search-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0.78;
}

.search-glyph {
  position: absolute;
  left: 15px;
  pointer-events: none;
}

.search-glyph::after,
.taskbar-search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 10px;
  font-size: 12.5px;
  font-weight: 650;
}

.text-button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
}

.text-button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.pinned-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  min-height: 154px;
}

.pinned-app {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 11px 4px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.pinned-app:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.pinned-app .app-icon {
  width: 42px;
  height: 42px;
}

.pinned-app span:last-child {
  width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 11.5px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-recommended {
  margin-top: 8px;
}

.recommended-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.recommended-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.recommended-item:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.recommended-item .app-icon {
  grid-row: 1 / 3;
  width: 36px;
  height: 36px;
}

.recommended-item strong,
.recommended-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommended-item strong {
  font-size: 12.5px;
  font-weight: 600;
}

.recommended-item small {
  color: var(--text-faint);
  font-size: 11px;
}

.start-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px -20px -14px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.user-chip,
.power-button {
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.user-chip {
  gap: 9px;
  padding: 5px 10px 5px 5px;
  font-size: 12.5px;
}

.user-chip:hover,
.power-button:hover {
  background: var(--surface-hover);
}

.user-avatar,
.lock-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
}

.user-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
  font-weight: 700;
}

.power-button {
  justify-content: center;
  width: 38px;
  height: 38px;
}

.power-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-results {
  display: grid;
  gap: 5px;
}

.search-result {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.search-result:hover {
  border-color: var(--border);
  background: var(--surface-hover);
}

.search-result .app-icon {
  width: 38px;
  height: 38px;
}

.search-result strong {
  display: block;
  font-size: 13px;
}

.search-result span {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 11.5px;
}

.search-result kbd {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-faint);
  font: inherit;
  font-size: 10px;
  background: var(--surface-soft);
}

/* Quick settings */
.quick-panel {
  position: absolute;
  right: 10px;
  bottom: calc(var(--taskbar-h) + 10px);
  z-index: 9500;
  width: min(380px, calc(100vw - 20px));
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--window-bg) 74%, transparent);
  box-shadow: var(--shadow-menu);
  backdrop-filter: blur(34px) saturate(165%);
  -webkit-backdrop-filter: blur(34px) saturate(165%);
  animation: quick-in 0.17s var(--ease);
}

@keyframes quick-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.quick-panel > * {
  position: relative;
  z-index: 1;
}

.quick-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.quick-panel-head strong {
  display: block;
  font-size: 14px;
}

.quick-panel-head span {
  display: block;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 11.5px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  font-size: 20px;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--surface-hover);
}

.quick-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quick-tile {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  text-align: left;
  background: var(--surface-soft);
  cursor: pointer;
}

.quick-tile:hover {
  background: var(--surface-hover);
}

.quick-tile.is-on {
  color: #fff;
  border-color: transparent;
  background: var(--accent);
}

.quick-tile-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  font-size: 17px;
  background: rgba(127, 127, 127, 0.12);
}

.quick-tile.is-on .quick-tile-icon {
  background: rgba(255, 255, 255, 0.2);
}

.quick-tile span:last-child {
  font-size: 12.5px;
  font-weight: 600;
}

.quick-slider {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 0 4px;
}

.quick-slider span {
  width: 24px;
  color: var(--text-soft);
  text-align: center;
}

.quick-slider input {
  width: 100%;
  accent-color: var(--accent);
}

.quick-panel-footer {
  display: flex;
  justify-content: space-between;
  margin: 13px -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.quick-footer-button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
}

.quick-footer-button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* Context menu and toast */
.context-menu {
  position: fixed;
  z-index: 9800;
  min-width: 216px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: color-mix(in srgb, var(--window-bg) 76%, transparent);
  box-shadow: var(--shadow-menu);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.context-menu button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  text-align: left;
  background: transparent;
  cursor: default;
}

.context-menu button:hover {
  background: var(--surface-hover);
}

.context-menu .menu-icon {
  width: 18px;
  color: var(--text-soft);
  text-align: center;
}

.context-menu hr {
  height: 1px;
  margin: 5px 7px;
  border: 0;
  background: var(--border);
}

.toast-stack {
  position: fixed;
  right: 14px;
  bottom: calc(var(--taskbar-h) + 14px);
  z-index: 9700;
  width: min(350px, calc(100vw - 28px));
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--window-bg) 78%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(155%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
  animation: toast-in 0.24s var(--ease);
}

.toast.is-leaving {
  animation: toast-out 0.22s ease forwards;
}

.toast-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
}

.toast strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12.5px;
}

.toast p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.45;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}

/* Taskbar */
.taskbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9000;
  height: var(--taskbar-h);
  display: grid;
  grid-template-columns: 1fr minmax(120px, auto) 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: #513946;
  background: rgba(252, 244, 248, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow: 0 -6px 24px rgba(91, 55, 72, 0.09);
  backdrop-filter: blur(36px) saturate(165%);
  -webkit-backdrop-filter: blur(36px) saturate(165%);
}

body[data-theme="dark"] .taskbar {
  color: #fff1f6;
  background: rgba(38, 27, 33, 0.72);
  border-top-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.14);
}

.taskbar-left,
.taskbar-apps,
.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 4px;
}

.taskbar-left {
  justify-self: start;
}

.taskbar-apps {
  justify-self: center;
  justify-content: center;
  min-width: 0;
}

.taskbar-tray {
  justify-self: end;
}

.taskbar-button,
.tray-button,
.taskbar-app-button {
  height: 40px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.taskbar-button:hover,
.tray-button:hover,
.taskbar-app-button:hover {
  background: rgba(122, 78, 98, 0.1);
}

.taskbar-button:active,
.tray-button:active,
.taskbar-app-button:active {
  background: rgba(122, 78, 98, 0.16);
}

body[data-theme="dark"] .taskbar-button:hover,
body[data-theme="dark"] .tray-button:hover,
body[data-theme="dark"] .taskbar-app-button:hover {
  background: rgba(255, 255, 255, 0.13);
}

body[data-theme="dark"] .taskbar-button:active,
body[data-theme="dark"] .tray-button:active,
body[data-theme="dark"] .taskbar-app-button:active {
  background: rgba(255, 255, 255, 0.18);
}

.start-button {
  width: 44px;
  display: grid;
  place-items: center;
}

.webdesk-logo {
  width: 22px;
  height: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  transform: rotate(0.001deg);
}

.webdesk-logo i {
  border-radius: 1.5px;
  background: currentColor;
}

.taskbar-search {
  min-width: 168px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  color: rgba(81, 57, 70, 0.72);
  background: rgba(255, 255, 255, 0.54) !important;
}

body[data-theme="dark"] .taskbar-search {
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.1) !important;
}

.taskbar-search-icon {
  width: 13px;
  height: 13px;
  border-width: 1.6px;
}

.taskbar-app-button {
  position: relative;
  width: 43px;
  display: grid;
  place-items: center;
}

.taskbar-app-button .app-icon {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  box-shadow: none;
}

.taskbar-app-button::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 5px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  transform: translateX(-50%);
  transition: width 0.15s ease, background 0.15s ease;
}

.taskbar-app-button.is-open::after {
  background: color-mix(in srgb, var(--accent) 82%, white);
}

.taskbar-app-button.is-active::after {
  width: 18px;
  background: color-mix(in srgb, var(--accent) 82%, white);
}

.taskbar-app-button.is-minimized {
  opacity: 0.72;
}

.tray-button {
  min-width: 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 8px;
  font-size: 11px;
}

.tray-status {
  min-width: 74px;
}

.tiny-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.wifi-glyph {
  width: 16px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-radius: 50% 50% 0 0;
}

.wifi-glyph::before,
.wifi-glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  border-top: 2px solid currentColor;
  border-radius: 50% 50% 0 0;
  transform: translateX(-50%);
}

.wifi-glyph::before {
  bottom: -1px;
  width: 10px;
  height: 8px;
}

.wifi-glyph::after {
  bottom: -2px;
  width: 4px;
  height: 4px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
}

.volume-glyph {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 8px solid currentColor;
}

.volume-glyph::after {
  content: "";
  position: absolute;
  left: 6px;
  top: -5px;
  width: 6px;
  height: 10px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.battery-glyph {
  position: relative;
  width: 20px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.battery-glyph::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 2px;
  width: 2px;
  height: 4px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
}

.battery-glyph i {
  position: absolute;
  inset: 1.5px;
  width: 72%;
  border-radius: 1px;
  background: currentColor;
}

.clock-button {
  min-width: 82px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  line-height: 1.25;
}

.clock-button span:first-child {
  font-size: 11.5px;
}

.clock-button span:last-child {
  font-size: 10.5px;
  opacity: 0.82;
}

/* Lock screen */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9900;
  display: grid;
  place-items: center;
  color: #5a3f4c;
  background:
    linear-gradient(rgba(250, 241, 245, 0.06), rgba(235, 213, 223, 0.22)),
    radial-gradient(circle at 68% 22%, rgba(255, 255, 255, 0.72), transparent 30%),
    linear-gradient(135deg, #f0e0e6, #d7b8c5 48%, #b991a3);
  backdrop-filter: blur(30px) saturate(130%);
  animation: fade-in 0.28s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.lock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-5vh);
}

.lock-avatar {
  width: 96px;
  height: 96px;
  margin-bottom: 18px;
  font-size: 36px;
  font-weight: 700;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.lock-card h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
}

.lock-card p {
  margin: 7px 0 21px;
  color: rgba(90, 63, 76, 0.68);
}

.lock-card .primary-button {
  min-width: 160px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.lock-actions {
  position: absolute;
  right: 22px;
  bottom: 22px;
  display: flex;
  gap: 8px;
}

.lock-action {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: #5a3f4c;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
}

.lock-action:hover {
  background: rgba(255, 255, 255, 0.68);
}

/* Generic app surfaces */
.app-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: color-mix(in srgb, var(--window-bg) 66%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.app-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--window-muted) 92%, transparent);
  scrollbar-width: none;
}

.app-toolbar::-webkit-scrollbar {
  display: none;
}

.toolbar-button {
  min-width: 33px;
  height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
}

.toolbar-button:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-hover);
}

.toolbar-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.toolbar-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: var(--border);
}

.address-bar,
.app-input {
  height: 34px;
  min-width: 0;
  flex: 1;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
}

.address-bar:focus,
.app-input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.13);
}

.app-statusbar {
  min-height: 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 11px;
  background: var(--window-muted);
}

/* Explorer */
.explorer-layout {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 208px 1fr;
}

.explorer-sidebar {
  min-height: 0;
  overflow: auto;
  padding: 11px 8px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--window-muted) 78%, transparent);
}

.sidebar-title {
  margin: 5px 9px 8px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
}

.sidebar-item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-soft);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.sidebar-item:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar-item.is-active {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.14);
  background: rgba(var(--accent-rgb), 0.12);
}

.sidebar-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.explorer-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--window-bg) 62%, transparent);
}

.explorer-breadcrumbs {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border);
  overflow: auto hidden;
}

.crumb {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
}

.crumb:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.crumb-separator {
  color: var(--text-faint);
  font-size: 11px;
}

.explorer-items {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  gap: 8px;
  padding: 14px;
  overflow: auto;
}

.explorer-items.is-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

.file-item {
  min-width: 0;
  min-height: 102px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: default;
}

.file-item:hover {
  background: var(--surface-hover);
}

.file-item.is-selected {
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.13);
}

.file-thumb,
.file-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
}

.file-thumb {
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(15, 25, 45, 0.12);
}

.file-icon svg {
  width: 50px;
  height: 50px;
}

.file-icon {
  box-shadow: none;
}

.file-name {
  max-width: 100%;
  min-height: 30px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
}

.file-meta {
  display: none;
  margin-left: auto;
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
}

.explorer-items.is-list .file-item {
  min-height: 40px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 4px 9px;
}

.explorer-items.is-list .file-thumb,
.explorer-items.is-list .file-icon,
.explorer-items.is-list .file-icon svg {
  width: 27px;
  height: 27px;
  border-radius: 6px;
}

.explorer-items.is-list .file-name {
  min-height: 0;
  display: block;
  text-align: left;
}

.explorer-items.is-list .file-meta {
  display: block;
}

.empty-folder {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--text-faint);
  text-align: center;
}

.empty-folder strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-soft);
}

/* Notepad */
.notepad-layout {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
}

.notepad-menu {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
}

.notepad-menu button {
  min-height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.notepad-menu button:hover {
  background: var(--surface-hover);
}

.notepad-textarea {
  width: 100%;
  min-height: 0;
  flex: 1;
  resize: none;
  padding: 16px 18px;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.6;
  background: transparent;
  tab-size: 4;
}

/* Calculator */
.calculator-app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: color-mix(in srgb, var(--window-bg) 64%, transparent);
}

.calculator-mode {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.calculator-display {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  padding: 21px 10px 13px;
  overflow: hidden;
}

.calculator-history {
  width: 100%;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-value {
  width: 100%;
  overflow: hidden;
  font-size: clamp(31px, 5vw, 45px);
  font-weight: 600;
  letter-spacing: -0.035em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.calculator-key {
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}

.calculator-key:hover {
  background: var(--surface-hover);
}

.calculator-key:active {
  transform: scale(0.975);
}

.calculator-key.is-function {
  color: var(--text-soft);
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

.calculator-key.is-equals {
  color: #fff;
  border-color: transparent;
  background: var(--accent);
}

/* Terminal */
.terminal-app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: #e9f1ff;
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  background: rgba(12, 16, 24, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.terminal-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: #a9b7cd;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #151b27;
}

.terminal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.terminal-dot.red {
  background: #ff5f56;
}

.terminal-dot.yellow {
  background: #ffbd2e;
}

.terminal-dot.green {
  background: #27c93f;
}

.terminal-output {
  min-height: 0;
  flex: 1;
  padding: 13px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-line {
  margin-bottom: 2px;
}

.terminal-line.command {
  color: #91c8ff;
}

.terminal-line.error {
  color: #ff8d8d;
}

.terminal-line.success {
  color: #7ce2a6;
}

.terminal-prompt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-prompt {
  flex: 0 0 auto;
  color: #7ce2a6;
}

.terminal-input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: #e9f1ff;
  font: inherit;
  background: transparent;
  caret-color: #7ce2a6;
}

/* Minesweeper and small games */
.game-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--window-bg) 64%, transparent);
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.game-stat {
  min-width: 58px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  text-align: center;
  background: var(--surface-soft);
}

.game-stat strong {
  color: var(--text);
}

.mine-board {
  width: min(100%, 390px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  user-select: none;
}

.mine-cell {
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  color: #4b303b;
  font-size: clamp(13px, 3.5vw, 19px);
  font-weight: 700;
  background: linear-gradient(145deg, #f0e3e9, #d7c1cb);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.75), 0 1px 2px rgba(22, 36, 58, 0.14);
  cursor: pointer;
}

.mine-cell:hover:not(.is-revealed) {
  filter: brightness(1.06);
}

.mine-cell.is-revealed {
  background: var(--surface-solid);
  box-shadow: inset 0 0 0 1px var(--border);
  cursor: default;
}

.mine-cell.is-flagged::after {
  content: "⚑";
  color: #d63b3b;
}

.mine-cell.is-mine {
  background: #ffd8d8;
}

.mine-cell.is-mine::after {
  content: "●";
  color: #222;
}

.mine-cell[data-count="1"] {
  color: #1d62d0;
}

.mine-cell[data-count="2"] {
  color: #16854a;
}

.mine-cell[data-count="3"] {
  color: #d13434;
}

.mine-cell[data-count="4"] {
  color: #6343c5;
}

.mine-cell[data-count="5"],
.mine-cell[data-count="6"],
.mine-cell[data-count="7"],
.mine-cell[data-count="8"] {
  color: #843f23;
}

.game-tip {
  margin: auto 0 0;
  color: var(--text-faint);
  font-size: 11.5px;
  text-align: center;
}

.game-2048 {
  max-width: 560px;
  margin: 0 auto;
}

.board-2048 {
  width: min(100%, 420px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 0 auto;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(185, 143, 163, 0.17);
  box-shadow: inset 0 1px 3px rgba(91, 55, 72, 0.08);
  user-select: none;
  outline: none;
}

.board-2048:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18), inset 0 1px 3px rgba(91, 55, 72, 0.08);
}

.tile-2048 {
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #5f4551;
  font-size: clamp(18px, 4.3vw, 32px);
  font-weight: 750;
  letter-spacing: -0.04em;
  background: rgba(255, 255, 255, 0.38);
  transition: background 0.15s ease, transform 0.15s ease;
}

.tile-2048[data-value="2"] {
  background: #f7edf1;
}

.tile-2048[data-value="4"] {
  background: #efdee5;
}

.tile-2048[data-value="8"] {
  color: #fff;
  background: #dfbfcb;
}

.tile-2048[data-value="16"] {
  color: #fff;
  background: #d1a9b9;
}

.tile-2048[data-value="32"] {
  color: #fff;
  background: #c497aa;
}

.tile-2048[data-value="64"] {
  color: #fff;
  background: #b6859a;
}

.tile-2048[data-value="128"] {
  color: #fff;
  background: #a97289;
}

.tile-2048[data-value="256"] {
  color: #fff;
  background: #9b627b;
}

.tile-2048[data-value="512"] {
  color: #fff;
  background: #8c526b;
}

.tile-2048[data-value="1024"] {
  color: #fff;
  background: #7e435d;
}

.tile-2048[data-value="2048"] {
  color: #fff;
  background: #73374f;
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.46);
}

.tile-2048[data-value="0"] {
  color: transparent;
}

.paint-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--window-bg) 62%, transparent);
}

.paint-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
}

.paint-swatch {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border: 2px solid rgba(84, 57, 70, 0.12);
  border-radius: 50%;
  cursor: pointer;
}

.paint-swatch.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--surface-solid), 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.paint-size {
  width: 92px;
  accent-color: var(--accent);
}

.paint-size-label {
  width: 35px;
  color: var(--text-faint);
  font-size: 11px;
  text-align: right;
}

.paint-canvas-wrap {
  min-height: 0;
  flex: 1;
  padding: 11px;
  background:
    linear-gradient(45deg, rgba(185, 143, 163, 0.05) 25%, transparent 25%, transparent 75%, rgba(185, 143, 163, 0.05) 75%),
    linear-gradient(45deg, rgba(185, 143, 163, 0.05) 25%, transparent 25%, transparent 75%, rgba(185, 143, 163, 0.05) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

#paint-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(91, 55, 72, 0.1);
  cursor: crosshair;
  touch-action: none;
}

.calendar-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: color-mix(in srgb, var(--window-bg) 62%, transparent);
}

.calendar-header {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.calendar-header h2 {
  margin: 0;
  font-size: 18px;
}

.calendar-clock {
  margin: 3px 0 0;
  color: var(--text-faint);
  font-size: 11.5px;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  margin-bottom: 5px;
  color: var(--text-faint);
  font-size: 11px;
  text-align: center;
}

.calendar-days {
  min-height: 0;
  flex: 1;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  background: var(--surface-soft);
  cursor: pointer;
}

.calendar-day-number {
  font-size: 12.5px;
  line-height: 1.1;
}

.calendar-day-sub {
  min-height: 12px;
  color: var(--text-faint);
  font-size: 9.5px;
  line-height: 1.1;
}

.calendar-day.is-other-month {
  color: var(--text-faint);
  opacity: 0.52;
  background: transparent;
}

.calendar-day.is-today {
  color: #fff;
  border-color: transparent;
  background: var(--accent);
  box-shadow: 0 7px 16px rgba(var(--accent-rgb), 0.25);
}

.calendar-day.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

.calendar-day.is-holiday {
  color: var(--jp-vermilion);
}

.calendar-day.is-holiday .calendar-day-sub {
  color: var(--jp-vermilion);
}

.calendar-holiday-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--jp-vermilion);
}

.calendar-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.22);
}

.calendar-info strong {
  font-size: 12px;
}

.calendar-info span {
  color: var(--text-soft);
  font-size: 10.5px;
  text-align: right;
}

.calendar-events {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.calendar-events span {
  padding: 4px 8px;
  border: 1px solid rgba(182, 91, 83, 0.18);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 10px;
  background: rgba(182, 91, 83, 0.05);
}

.calendar-events b {
  margin-right: 5px;
  color: var(--jp-vermilion);
  font-weight: 600;
}

.calendar-note {
  margin: 9px 0 0;
  color: var(--text-faint);
  font-size: 9.5px;
}

.taskmanager-app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: color-mix(in srgb, var(--window-bg) 62%, transparent);
}

.taskmanager-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.taskmanager-summary > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.taskmanager-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-faint);
  font-size: 10.5px;
}

.taskmanager-summary strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taskmanager-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.process-list {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}

.process-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.process-row .app-icon {
  width: 36px;
  height: 36px;
}

.process-info {
  min-width: 0;
}

.process-info strong,
.process-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-info strong {
  font-size: 12.5px;
}

.process-info span {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 11px;
}

.process-close {
  color: #b7657d;
}

.notes-app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--window-bg) 62%, transparent);
}

.notes-hint {
  color: var(--text-faint);
  font-size: 11px;
}

.notes-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  grid-auto-rows: 190px;
  align-content: start;
  gap: 12px;
  padding: 14px;
  overflow: auto;
}

.sticky-note {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(105, 65, 84, 0.12);
  border-radius: 12px;
  background: var(--note-bg);
  box-shadow: 0 8px 20px rgba(91, 55, 72, 0.09);
}

.sticky-note-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px 3px 11px;
  color: rgba(88, 59, 73, 0.72);
  font-size: 10.5px;
}

.sticky-note-head button {
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 7px;
  color: rgba(88, 59, 73, 0.72);
  background: transparent;
  cursor: pointer;
}

.sticky-note-head button:hover {
  background: rgba(255, 255, 255, 0.46);
}

.sticky-note textarea {
  width: 100%;
  min-height: 0;
  flex: 1;
  resize: none;
  padding: 5px 11px 12px;
  border: 0;
  outline: 0;
  color: #4e3944;
  font-size: 12.5px;
  line-height: 1.55;
  background: transparent;
}

.media-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--window-bg) 62%, transparent);
}

.media-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
}

.media-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.media-file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-stage {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--accent-rgb), 0.1), transparent 50%),
    var(--surface-soft);
}

.media-stage video {
  width: min(100%, 720px);
  max-height: 100%;
  border-radius: 12px;
  background: #160f13;
  box-shadow: 0 16px 38px rgba(71, 38, 54, 0.24);
}

.media-audio-card {
  width: min(100%, 460px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--window-bg);
  box-shadow: var(--shadow-soft);
}

.media-disc {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 42px;
  background:
    radial-gradient(circle, #f6eaf0 0 10%, transparent 11%),
    repeating-radial-gradient(circle, #b98fa3 0 5px, #a97f94 6px 10px);
  box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.28);
}

.media-audio-card audio {
  width: 100%;
}

.tarot-app,
.poker-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--window-bg) 58%, transparent);
}

.tarot-deck-count,
.poker-deck-count {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
}

.tarot-stage,
.poker-stage {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--accent-rgb), 0.12), transparent 48%),
    transparent;
}

.tarot-reading {
  width: min(100%, 940px);
  min-height: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  align-items: center;
  gap: 20px;
  margin: 0 auto;
}

.tarot-card {
  position: relative;
  min-height: 410px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(244, 224, 232, 0.62)),
    rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 42px rgba(92, 48, 70, 0.18);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  animation: card-deal 0.44s var(--ease) both;
  animation-delay: var(--deal-delay);
}

body[data-theme="dark"] .tarot-card {
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(160deg, rgba(75, 52, 63, 0.78), rgba(49, 34, 42, 0.7)),
    rgba(40, 28, 34, 0.4);
}

@keyframes card-deal {
  from {
    opacity: 0;
    transform: translateY(24px) rotate(-2deg) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tarot-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.tarot-card-top small {
  padding: 3px 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}

.tarot-card-art {
  position: relative;
  min-height: 206px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.88), transparent 36%),
    linear-gradient(145deg, rgba(207, 164, 182, 0.68), rgba(239, 218, 227, 0.46));
}

body[data-theme="dark"] .tarot-card-art {
  background:
    radial-gradient(circle at 50% 38%, rgba(212, 166, 186, 0.22), transparent 38%),
    linear-gradient(145deg, rgba(124, 84, 101, 0.62), rgba(58, 39, 48, 0.7));
}

.tarot-card-art strong {
  position: relative;
  z-index: 2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.tarot-orbit {
  position: absolute;
  border: 1px solid rgba(112, 67, 87, 0.2);
  border-radius: 50%;
}

.orbit-one {
  width: 168px;
  height: 168px;
}

.orbit-two {
  width: 124px;
  height: 124px;
}

.tarot-card-meaning {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding-top: 2px;
}

.tarot-card-meaning p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.tarot-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  color: var(--text-soft);
  text-align: center;
}

.tarot-empty h2 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
}

.tarot-empty p {
  max-width: 420px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
}

.tarot-deck-back {
  width: 170px;
  aspect-ratio: 0.68;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 30px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2) 0 8%, transparent 9%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #9e7286, #c29cae);
  box-shadow: 0 22px 50px rgba(79, 42, 60, 0.28);
}

.tarot-workbench {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: color-mix(in srgb, var(--window-bg) 55%, transparent);
}

.tarot-toolbar {
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}

.tarot-question {
  min-width: 0;
  height: 38px;
  flex: 1;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.34);
}

.tarot-question:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.13);
}

.tarot-spread-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.tarot-spread-button {
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  text-align: left;
  background: rgba(255, 255, 255, 0.24);
  cursor: pointer;
}

.tarot-spread-button:hover,
.tarot-spread-button.is-selected {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.1);
}

.tarot-spread-button strong,
.tarot-spread-button span {
  display: block;
}

.tarot-spread-button strong {
  margin-bottom: 4px;
  font-size: 12.5px;
}

.tarot-spread-button span {
  color: var(--text-faint);
  font-size: 10.5px;
  line-height: 1.4;
}

.tarot-deck-meta {
  padding: 7px 14px 0;
  color: var(--text-faint);
  font-size: 10.5px;
}

.tarot-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 14px 0;
}

.tarot-option-group {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-faint);
  font-size: 10.5px;
}

.tarot-option-group button {
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.24);
  cursor: pointer;
}

.tarot-option-group button:hover,
.tarot-option-group button.is-selected {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.1);
}

.tarot-quick-questions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 0;
}

.tarot-quick-questions > span {
  color: var(--text-faint);
  font-size: 10.5px;
}

.tarot-quick-questions button {
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.26);
  cursor: pointer;
}

.tarot-quick-questions button:hover {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.09);
}

.tarot-setup {
  min-height: 420px;
  flex: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 34px 20px;
  text-align: center;
}

.tarot-setup h2 {
  margin: 8px 0 0;
  font-size: 23px;
  font-weight: 600;
}

.tarot-setup p {
  max-width: 480px;
  margin: 0;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.tarot-table {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  padding: 24px 18px;
}

.tarot-slot {
  width: min(180px, 42vw);
}

.tarot-card-mat {
  position: relative;
  padding: 10px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(222, 188, 203, 0.52)),
    rgba(255, 255, 255, 0.22);
  box-shadow:
    0 18px 44px rgba(82, 43, 61, 0.17),
    inset 0 1px rgba(255, 255, 255, 0.76),
    0 0 0 1px rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
}

body[data-theme="dark"] .tarot-card-mat {
  background:
    linear-gradient(145deg, rgba(84, 58, 70, 0.76), rgba(48, 33, 41, 0.7)),
    rgba(40, 28, 34, 0.42);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tarot-card-mat::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 18px;
  pointer-events: none;
}

.tarot-mat-corner {
  position: absolute;
  z-index: 3;
  color: rgba(var(--accent-rgb), 0.6);
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
}

.tarot-mat-corner.top-left {
  top: 4px;
  left: 7px;
}

.tarot-mat-corner.top-right {
  top: 4px;
  right: 7px;
}

.tarot-mat-corner.bottom-left {
  bottom: 4px;
  left: 7px;
}

.tarot-mat-corner.bottom-right {
  right: 7px;
  bottom: 4px;
}

.tarot-position {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.tarot-flip {
  position: relative;
  width: 100%;
  aspect-ratio: 0.58;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.75s var(--ease);
}

.tarot-flip.is-revealed {
  transform: rotateY(180deg);
}

.tarot-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 42px rgba(92, 48, 70, 0.18);
}

.tarot-back-face {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 30px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2) 0 8%, transparent 9%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #9e7286, #c29cae);
}

.tarot-front-face {
  align-items: stretch;
  justify-content: flex-start;
  gap: 7px;
  padding: 8px;
  color: var(--text);
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.88), transparent 38%),
    linear-gradient(145deg, rgba(244, 228, 235, 0.94), rgba(218, 188, 201, 0.78));
  transform: rotateY(180deg);
}

body[data-theme="dark"] .tarot-front-face {
  background:
    radial-gradient(circle at 50% 35%, rgba(216, 173, 191, 0.2), transparent 38%),
    linear-gradient(145deg, rgba(79, 55, 66, 0.96), rgba(45, 31, 39, 0.94));
}

.tarot-front-symbol {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.tarot-art-frame {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.tarot-art-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.minor-art-wrap,
.minor-art {
  width: 100%;
  height: 100%;
  display: block;
}

.minor-art {
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: hidden;
  color: #8f687a;
  border: 1px solid rgba(120, 72, 93, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(145deg, #f8f0f3, #ead6de);
}

.minor-pips {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
}

.minor-pip svg {
  width: 23px;
  height: 23px;
}

.minor-art.court {
  align-content: center;
  gap: 8px;
  text-align: center;
}

.minor-court-icon svg {
  width: 52px;
  height: 52px;
}

.minor-art.court strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
}

.tarot-art-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tarot-art-info strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.7vw, 25px);
  font-weight: 500;
}

.tarot-art-info small {
  padding: 3px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 999px;
  color: var(--accent);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.28);
}

.tarot-keywords,
.tarot-detail-keywords {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.tarot-keywords i,
.tarot-detail-keywords i {
  padding: 3px 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 10px;
  font-style: normal;
  background: rgba(255, 255, 255, 0.32);
}

.tarot-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 18px 22px;
}

.tarot-actions span {
  color: var(--text-faint);
  font-size: 11px;
}

.tarot-reading-panel {
  margin: 0 18px 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--window-bg) 68%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.tarot-reading-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.tarot-reading-label {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.tarot-reading-head h2 {
  margin: 5px 0 0;
  font-size: 19px;
  font-weight: 620;
}

.tarot-reading-spread {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.28);
}

.tarot-reading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.tarot-overview {
  margin: 0 0 18px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.85;
}

.tarot-detail-list {
  display: grid;
  gap: 9px;
}

.tarot-detail {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.24);
}

.tarot-detail-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tarot-detail-art {
  width: 74px;
  flex: 0 0 auto;
  border: 1px solid rgba(91, 55, 72, 0.12);
  border-radius: 8px;
  background: #fff;
}

.minor-detail-art {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.minor-detail-art .minor-art {
  width: 100%;
  height: 100%;
  padding: 5px;
}

.minor-detail-art .minor-pip svg {
  width: 12px;
  height: 12px;
}

.minor-detail-art .minor-court-icon svg {
  width: 30px;
  height: 30px;
}

.tarot-detail-copy {
  min-width: 0;
  flex: 1;
}

.tarot-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.tarot-detail-head span {
  color: var(--text-faint);
  font-size: 10.5px;
}

.tarot-detail-head strong {
  font-size: 12.5px;
}

.tarot-detail p {
  margin: 0 0 9px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.72;
}

.tarot-detail .tarot-voice {
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.78;
}

.tarot-advice-box {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.07);
}

.tarot-advice-box > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
}

.tarot-advice-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.7;
}

.tarot-history {
  display: grid;
  gap: 7px;
  margin: 0 18px 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.tarot-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 11.5px;
}

.tarot-history-head span {
  color: var(--text-faint);
}

.tarot-history-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.tarot-history-item:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.08);
}

.tarot-history-item span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tarot-history-item small {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poker-stage {
  display: grid;
  place-items: center;
}

.poker-hand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.poker-card {
  width: 126px;
  aspect-ratio: 0.7;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid rgba(53, 37, 45, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 34px rgba(54, 33, 44, 0.18);
  animation: card-deal 0.38s var(--ease) both;
  animation-delay: var(--deal-delay);
}

.poker-card.red {
  color: #b94361;
}

.poker-card.black {
  color: #302731;
}

.poker-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1;
}

.poker-corner strong {
  font-size: 17px;
}

.poker-corner span {
  font-size: 16px;
}

.poker-corner.bottom {
  align-self: flex-end;
  transform: rotate(180deg);
}

.poker-center {
  font-size: 52px;
  line-height: 1;
  text-align: center;
}

.poker-result {
  margin-top: 24px;
  color: var(--text-soft);
  font-size: 14px;
  text-align: center;
}

.poker-result strong {
  color: var(--accent);
}

.poker-app-v2 {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--jp-paper) 84%, var(--window-bg));
}

.poker-header {
  min-height: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.42);
}

.poker-bank {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--text-faint);
  font-size: 11px;
}

.poker-bank strong {
  color: var(--text);
  font-size: 16px;
}

.poker-title {
  min-width: 0;
  text-align: center;
}

.poker-title strong {
  display: block;
  font-size: 15px;
}

.poker-title span {
  display: block;
  margin-top: 2px;
  color: var(--jp-vermilion);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.poker-record {
  color: var(--text-faint);
  font-size: 11px;
}

.poker-content {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.poker-menu {
  width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 22px;
}

.poker-mode-grid {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}

.poker-mode-card {
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid rgba(63, 54, 51, 0.14);
  border-radius: 16px;
  color: var(--text);
  text-align: left;
  background:
    radial-gradient(circle at 85% 15%, rgba(182, 91, 83, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(250, 245, 248, 0.62));
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.poker-mode-card:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-2px);
}

.poker-mode-card small {
  color: var(--jp-vermilion);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.poker-mode-card strong {
  font-size: 16px;
  font-weight: 620;
}

.poker-mode-card span {
  color: var(--text-soft);
  font-size: 10.5px;
  line-height: 1.55;
}

.poker-table,
.draw-table,
.blackjack-table,
.war-table,
.rank-table {
  width: 100%;
  max-width: 1080px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  margin: 0 auto;
  padding: 18px;
}

.poker-table-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.poker-table-info span {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.24);
}

.holdem-community {
  min-height: 122px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
}

.holdem-table {
  position: relative;
  width: 100%;
  max-width: 1020px;
  min-height: 430px;
  margin: 0 auto;
  border: 1px solid rgba(63, 54, 51, 0.12);
  border-radius: 48% / 42%;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.84), rgba(246, 238, 242, 0.58) 62%, rgba(226, 206, 216, 0.4));
  box-shadow: inset 0 0 0 9px rgba(255, 255, 255, 0.28), var(--shadow-soft);
}

.holdem-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, 62%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translate(-50%, -50%);
}

.holdem-pot {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.28);
}

.community-slot {
  width: 72px;
  height: 100px;
  display: inline-block;
  border: 2px dashed rgba(63, 54, 51, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
}

.holdem-seat {
  position: absolute;
  width: 205px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 22px rgba(70, 44, 57, 0.08);
}

.holdem-seat.is-you {
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.1);
}

.holdem-seat.is-folded {
  opacity: 0.42;
}

.holdem-seat.seat-0 {
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}

.holdem-seat.seat-1 {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.holdem-seat.seat-2 {
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
}

.holdem-seat.seat-3 {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.seat-avatar,
.poker-title-emoji,
.poker-mode-emoji {
  margin-right: 5px;
}

.poker-mode-emoji {
  position: absolute;
  top: 13px;
  left: 14px;
  font-size: 24px;
}

.poker-title-emoji {
  font-size: 15px;
}

.blackjack-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.blackjack-vs {
  color: var(--jp-vermilion);
  font-family: var(--font-jp-serif);
  font-size: 18px;
  font-weight: 700;
}

.blackjack-side.dealer,
.blackjack-side.player {
  min-height: 280px;
  justify-content: center;
}

.poker-placeholder {
  color: var(--text-faint);
  font-size: 12px;
}

.holdem-players {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.holdem-player {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
}

.holdem-player.is-you {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.08);
}

.holdem-player.is-folded {
  opacity: 0.45;
}

.holdem-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 11px;
}

.holdem-player-head span {
  color: var(--text-faint);
}

.dealer-chip {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: 6px;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  vertical-align: 1px;
  background: var(--accent);
}

.holdem-player > small {
  display: block;
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 10px;
}

.holdem-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.holdem-cards .poker-card {
  width: 56px;
  padding: 5px;
  border-radius: 8px;
}

.holdem-cards .poker-corner strong,
.holdem-cards .poker-corner span {
  font-size: 10px;
}

.holdem-cards .poker-center {
  font-size: 22px;
}

.poker-card.is-hidden {
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2) 0 8%, transparent 9%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 5px, transparent 5px 10px),
    linear-gradient(145deg, #9e7286, #c29cae);
}

.poker-back-mark {
  font-size: 22px;
}

.poker-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16), 0 16px 34px rgba(54, 33, 44, 0.18);
  transform: translateY(-6px);
}

.poker-card.is-dimmed {
  opacity: 0.42;
}

.poker-card.is-highlight {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.42), 0 16px 34px rgba(54, 33, 44, 0.2);
  transform: translateY(-4px);
}

.poker-card-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.poker-card-button:disabled {
  cursor: default;
}

.poker-message {
  min-height: 22px;
  color: var(--text-soft);
  font-size: 12.5px;
  text-align: center;
}

.holdem-log {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.holdem-log span {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.18);
}

.poker-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.poker-waiting {
  color: var(--text-faint);
  font-size: 11px;
}

.holdem-raise-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 3px;
}

.holdem-raise-row input {
  width: min(280px, 48vw);
  accent-color: var(--accent);
}

.holdem-raise-row span {
  min-width: 34px;
  color: var(--text-soft);
  font-size: 10.5px;
  text-align: right;
}

.draw-opponents {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.draw-opponent,
.draw-player,
.blackjack-side {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
}

.draw-opponent > strong,
.draw-player > strong,
.blackjack-side > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.draw-player > small,
.blackjack-side > small {
  display: block;
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 10.5px;
}

.blackjack-side {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.blackjack-side.has-split {
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.blackjack-hand {
  min-width: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.blackjack-hand.is-active {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.07);
}

.draw-opponent.is-folded,
.draw-player.is-folded {
  opacity: 0.45;
}

.war-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.war-row > strong {
  width: 46px;
  color: var(--text-soft);
  font-size: 12px;
  text-align: right;
}

.rank-answers {
  width: 100%;
  max-width: 720px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 7px;
  margin: 0 auto;
}

.rank-answers button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.24);
  cursor: pointer;
}

.rank-answers button:hover {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.rank-answers button.is-picked {
  border-color: var(--accent);
  color: var(--text);
}

.rank-answers button.is-correct {
  border-color: #4f8b69;
  color: #2f6b4a;
  background: rgba(79, 139, 105, 0.08);
}

/* Settings */
.settings-layout {
  min-height: 100%;
  display: grid;
  grid-template-columns: 205px 1fr;
}

.settings-nav {
  padding: 18px 10px;
  border-right: 1px solid var(--border);
  background: var(--window-muted);
}

.settings-nav-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-soft);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.settings-nav-item:hover,
.settings-nav-item.is-active {
  color: var(--text);
  background: var(--surface-hover);
}

.settings-nav-item.is-active {
  border-color: var(--border);
}

.settings-content {
  min-height: 0;
  padding: 26px 28px;
  overflow: auto;
}

.settings-content > section + section {
  margin-top: 30px;
}

.settings-heading {
  margin: 0 0 7px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.settings-subheading {
  margin: 0 0 20px;
  color: var(--text-soft);
  font-size: 12.5px;
}

.settings-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.settings-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 2px;
}

.settings-row + .settings-row {
  border-top: 1px solid var(--border);
}

.settings-label strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12.5px;
}

.settings-label span {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
}

.toggle {
  position: relative;
  width: 46px;
  height: 25px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background 0.16s ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.16s var(--ease);
}

.toggle.is-on {
  background: var(--accent);
}

.toggle.is-on::after {
  transform: translateX(21px);
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
}

.wallpaper-option {
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
}

.wallpaper-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.13);
}

.wallpaper-preview {
  height: 76px;
}

.wallpaper-option span:last-child {
  display: block;
  padding: 8px;
  color: var(--text-soft);
  font-size: 11.5px;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.swatch {
  width: 32px;
  height: 32px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.swatch.is-selected {
  border-color: var(--text);
  box-shadow: inset 0 0 0 3px var(--surface-solid);
}

.about-card {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 15px;
  align-items: center;
}

.about-logo {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.25);
}

.about-logo svg {
  width: 34px;
  height: 34px;
}

/* Web browser */
.webbrowser-layout {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.browser-page {
  min-height: 0;
  flex: 1;
  overflow: auto;
  background:
    radial-gradient(circle at 92% 8%, rgba(var(--accent-rgb), 0.12), transparent 28%),
    linear-gradient(180deg, var(--surface-solid), var(--surface-soft));
}

.browser-hero {
  padding: clamp(28px, 7vw, 64px) clamp(20px, 6vw, 58px) 32px;
}

.browser-eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.browser-hero h2 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.browser-hero p {
  max-width: 650px;
  margin: 15px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.browser-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 0 clamp(20px, 6vw, 58px) 46px;
}

.browser-link {
  min-height: 90px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-align: left;
  background: var(--window-bg);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.browser-link:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-1px);
}

.browser-link strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
}

.browser-link span {
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.45;
}

/* Photos */
.photos-layout {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  background: #10141c;
}

.photo-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 25px;
  overflow: hidden;
}

.photo-art {
  width: min(100%, 720px);
  aspect-ratio: 16 / 10;
  border-radius: 13px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.photo-info {
  padding: 18px;
  color: #e8eef9;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  background: #181e29;
}

.photo-info h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

.photo-info p {
  margin: 0 0 20px;
  color: #99a6ba;
  font-size: 11.5px;
  line-height: 1.55;
}

.photo-thumbnails {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.photo-thumb {
  aspect-ratio: 1.35;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.photo-thumb.is-selected {
  border-color: var(--accent);
}

/* Error / empty state */
.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
}

.empty-state-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 18px;
  color: var(--accent);
  font-size: 31px;
  background: rgba(var(--accent-rgb), 0.11);
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 16px;
}

.empty-state p {
  max-width: 360px;
  margin: 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.55;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-faint) 52%, transparent) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-faint) 52%, transparent);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text-faint) 72%, transparent);
  background-clip: padding-box;
}

@media (max-width: 860px) {
  .taskbar-search {
    min-width: 42px;
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .taskbar-search > span:last-child {
    display: none;
  }

  .explorer-layout {
    grid-template-columns: 162px 1fr;
  }

  .settings-layout {
    grid-template-columns: 162px 1fr;
  }
}

@media (max-width: 680px) {
  :root {
    --taskbar-h: calc(56px + env(safe-area-inset-bottom));
  }

  .desktop-icons {
    grid-auto-columns: 78px;
    grid-template-rows: repeat(auto-fill, 86px);
  }

  .desktop-shortcut {
    width: 78px;
    height: 84px;
  }

  .shortcut-icon {
    width: 42px;
    height: 42px;
  }

  .taskbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 4px env(safe-area-inset-bottom);
  }

  .taskbar-left .taskbar-search {
    display: none;
  }

  .taskbar-apps {
    justify-self: start;
    padding-left: 4px;
    overflow: auto hidden;
  }

  .tray-chevron,
  .tray-status,
  .notification-button {
    display: none;
  }

  .clock-button {
    min-width: 68px;
  }

  .window {
    min-width: 0;
    min-height: 0;
  }

  .window:not(.is-maximized) {
    left: 5px !important;
    top: 5px !important;
    width: calc(100vw - 10px) !important;
    height: calc(100vh - var(--taskbar-h) - 10px) !important;
  }

  .titlebar {
    padding-left: 9px;
  }

  .window-control {
    width: 40px;
  }

  .pinned-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .recommended-list {
    grid-template-columns: 1fr;
  }

  .start-menu {
    left: 5px;
    right: 5px;
    bottom: calc(var(--taskbar-h) + 5px);
    width: auto;
    max-height: calc(100vh - var(--taskbar-h) - 10px);
    transform: none;
  }

  @keyframes menu-in {
    from {
      opacity: 0;
      transform: translateY(10px) scale(0.985);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .quick-panel {
    right: 5px;
    left: 5px;
    bottom: calc(var(--taskbar-h) + 5px);
    width: auto;
  }

  .explorer-layout {
    grid-template-columns: 1fr;
  }

  .explorer-sidebar {
    display: none;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    display: flex;
    gap: 5px;
    padding: 8px;
    overflow: auto hidden;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .settings-nav-item {
    width: auto;
    flex: 0 0 auto;
    min-height: 34px;
    white-space: nowrap;
  }

  .settings-content {
    padding: 20px 16px;
  }

  .photos-layout {
    grid-template-columns: 1fr;
  }

  .photo-info {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 680px) {
  .tarot-stage,
  .poker-stage {
    padding: 14px;
  }

  .tarot-toolbar {
    flex-direction: column;
  }

  .tarot-spread-list {
    grid-template-columns: 1fr;
  }

  .tarot-table {
    gap: 10px;
    padding: 16px 8px;
  }

  .tarot-slot {
    width: min(150px, 44vw);
  }

  .tarot-reading-panel,
  .tarot-history {
    margin-right: 10px;
    margin-left: 10px;
  }

  .tarot-reading {
    grid-template-columns: 1fr;
  }

  .tarot-card {
    min-height: 340px;
  }

  .poker-hand {
    gap: 7px;
  }

  .poker-mode-grid,
  .draw-opponents {
    grid-template-columns: 1fr;
  }

  .holdem-players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .holdem-table {
    min-height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 12px;
    border-radius: 16px;
  }

  .holdem-center {
    position: static;
    width: 100%;
    grid-column: 1 / -1;
    order: -1;
    transform: none;
  }

  .holdem-seat {
    position: static;
    width: auto;
    transform: none;
  }

  .blackjack-board {
    grid-template-columns: 1fr;
  }

  .blackjack-vs {
    text-align: center;
  }

  .holdem-cards .poker-card {
    width: 44px;
    padding: 4px;
  }

  .holdem-cards .poker-center {
    font-size: 17px;
  }

  .poker-table,
  .draw-table,
  .blackjack-table,
  .war-table,
  .rank-table {
    padding: 12px;
  }

  .poker-card {
    width: 72px;
    padding: 6px;
    border-radius: 9px;
  }

  .poker-center {
    font-size: 31px;
  }

  .poker-corner strong {
    font-size: 12px;
  }

  .poker-corner span {
    font-size: 11px;
  }
}

@media (max-width: 1050px) and (min-width: 681px) {
  .poker-mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body[data-compat="basic"] .window,
body[data-compat="basic"] .start-menu,
body[data-compat="basic"] .quick-panel,
body[data-compat="basic"] .context-menu,
body[data-compat="basic"] .toast,
body[data-compat="basic"] .app-shell,
body[data-compat="basic"] .explorer-main,
body[data-compat="basic"] .explorer-sidebar,
body[data-compat="basic"] .notepad-layout,
body[data-compat="basic"] .calculator-app,
body[data-compat="basic"] .game-shell,
body[data-compat="basic"] .paint-app,
body[data-compat="basic"] .calendar-app,
body[data-compat="basic"] .taskmanager-app,
body[data-compat="basic"] .notes-app,
body[data-compat="basic"] .media-app,
body[data-compat="basic"] .tarot-workbench,
body[data-compat="basic"] .tarot-reading-panel,
body[data-compat="basic"] .tarot-card-mat,
body[data-compat="basic"] .poker-card {
  background: var(--window-bg);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-compat="basic"] .taskbar {
  background: rgba(252, 244, 248, 0.96);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Japanese paper and ink UI */
body {
  letter-spacing: 0.015em;
  font-feature-settings: "palt";
}

.window {
  border-color: rgba(63, 54, 51, 0.17);
  background: color-mix(in srgb, var(--jp-paper) 84%, transparent);
}

.titlebar {
  background: linear-gradient(90deg, rgba(182, 91, 83, 0.05), rgba(250, 246, 248, 0.74));
  border-bottom-color: rgba(63, 54, 51, 0.13);
}

.titlebar::after {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--jp-vermilion);
  opacity: 0.68;
  pointer-events: none;
}

.window-title {
  color: var(--jp-ink);
  font-size: 11px;
}

.taskbar {
  color: var(--jp-ink);
  border-top: 1px solid rgba(182, 91, 83, 0.28);
  background: rgba(250, 246, 248, 0.88);
}

body[data-theme="dark"] .taskbar {
  color: #f6eee9;
  border-top-color: rgba(208, 164, 182, 0.25);
  background: rgba(38, 27, 33, 0.88);
}

.start-menu,
.quick-panel,
.context-menu,
.toast {
  border-color: rgba(63, 54, 51, 0.16);
}

.section-heading,
.settings-heading {
  color: var(--jp-ink);
  font-size: 12px;
}

.settings-heading {
  font-size: 18px;
}

.shortcut-name,
.pinned-app span:last-child {
  font-size: 10.5px;
}

.recommended-item strong,
.user-chip,
.taskbar,
.clock-button {
  font-size: 10.5px;
}

.poker-app-v2 {
  background: color-mix(in srgb, var(--jp-paper) 86%, var(--window-bg));
}

body[data-theme="dark"] .poker-app-v2 {
  background: color-mix(in srgb, #33272d 90%, var(--window-bg));
}
