/* –– Entry Textbox ––––––––––––––––––––– */
.entry-textbox {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(300px, calc(100vw - 32px));
  padding: 10px;
  background: rgba(210, 199, 162, 0.9);
  border: 1px solid rgba(187, 209, 255, 0.5);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  z-index: 5;
  font-size: 0.95rem;
}

.entry-textbox textarea {
  width: 100%;
  min-height: 135px;
  resize: none;
  font: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
  color: rgba(35, 28, 19, 1);
  /* background:  rgba(243, 246, 242, 1);; */ /* concourse bkg color */
  background: rgba(210, 199, 162, 0.9);
  border: 1px solid rgba(187, 209, 255, 0.4);
}

.entry-textbox textarea::placeholder {
  color: rgba(238, 244, 255, 0.65);
}

.entry-textbox label {
  display: flex;
  align-items: center;
}
@media (max-width: 768px) {
  .entry-textbox {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: min(200px, calc(100vw - 32px));
    font-size: 0.9rem;
    background-color: #FCFAF0;
  }

  .entry-textbox textarea {
    min-height: 90px;
    font-size: 0.9rem;
    background-color: #FCFAF0;
    color: #141414;
  }
}
/* ── homeheader & menubar ── */
.homeheader {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.menubar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, #dfdfdf, #c0c0c0);
  border-bottom: 2px solid #dfdfdf;
  border-top: 1px solid #ffffff;
  padding: 2px 2px;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
}
.menubar-title {
  padding: 2px 4px;
  color: #000;
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 5px;
  user-select: none;
}
.menubar-title-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.menubar-items {
  display: flex;
  gap: 0;
}
.menubar-item {
  padding: 2px 8px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all 0.1s;
  color: #000;
  position: relative;
}
.menubar-item:hover {
  border: 1px solid #000080;
  background: linear-gradient(to bottom, #bddf63, #5c6929);
  color: #ffffff;
}
.menubar-item.menu-open {
  background: linear-gradient(to bottom, #bddf63, #5c6929);
  color: #fff;
  border: 1px solid #000080;
}

/* ── Dropdown Menus ── */
.dropdown-menu {
  display: none;
  position: fixed;
  width: max-content;
  max-width: calc(100vw - 16px);
  background: #FCFAF0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  z-index: 1000;
  padding: 3px 0;
  font-weight: normal;
}
.dropdown-menu.open {
  display: block;
}
.dropdown-item {
  padding: 4px 16px 4px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: #000;
  white-space: normal;
  gap: 24px;
  user-select: none;
  font-family: 'windowsregular', "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: normal;
}
.dropdown-item:hover {
  background: linear-gradient(to bottom, #bddf63, #5c6929);
  color: #fff;
}
.dropdown-item:hover .dropdown-shortcut {
  color: rgba(255,255,255,0.75);
}
.dropdown-item.disabled {
  color: #aaa;
  cursor: default;
}
.dropdown-item.disabled:hover {
  background: none;
  color: #aaa;
}
.dropdown-shortcut {
  color: #888;
  font-size: 11px;
  margin-left: auto;
}
.dropdown-divider {
  margin: 3px 0;
  border: none;
  border-top: 1px solid #aaa;
  border-bottom: 1px solid #fff;
}

/* ── Modals ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}
.modal-window {
  background: #FCFAF0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 2px 2px 0 #000;
  width: min(480px, calc(100vw - 32px));
  font-family: 'windowsregular', "Courier New", Courier, monospace;
  font-size: 13px;
}
.modal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, #000080, #1084d7);
  color: #fff;
  padding: 3px 4px;
  font-size: 12px;
  font-weight: bold;
  user-select: none;
  cursor: default;
}
.modal-titlebar-text {
  display: flex;
  align-items: center;
  gap: 5px;
}
.modal-close-btn {
  width: 16px;
  height: 14px;
  background: linear-gradient(to bottom, #dfdfdf, #c0c0c0);
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #000;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-weight: bold;
  line-height: 1;
}
.modal-close-btn:active {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}
.modal-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-top-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.modal-img-box {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  width: 140px;
  height: 110px;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-app-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.modal-app-name {
  font-size: 14px;
  font-weight: bold;
  color: #000;
  margin-top: 4px;
}
.modal-divider {
  border: none;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
}
.modal-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: #000;
}
.modal-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.modal-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.modal-bar-label {
  width: 110px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}
.modal-bar-label img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.modal-bar-track {
  flex: 1;
  height: 12px;
  background: #fff;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  position: relative;
  overflow: hidden;
}
.modal-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: #000080;
}
.modal-ok-row {
  display: flex;
  justify-content: flex-end;
}
.modal-ok-btn {
  padding: 3px 20px;
  background: linear-gradient(to bottom, #dfdfdf, #c0c0c0);
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  font-family: 'windowsregular', "Courier New", Courier, monospace;
  font-size: 12px;
  cursor: pointer;
}
.modal-ok-btn:active {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

/* ── Toast ── */
.toast-msg {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #0a0a0a;
  color: #bddf63;
  font-family: 'windowsregular', "Courier New", Courier, monospace;
  font-size: 12px;
  padding: 6px 14px;
  border: 1px solid #bddf63;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}
.toast-msg.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Dark Mode ── */
body.dark-mode {
  filter: invert(1) hue-rotate(180deg);
}
body.dark-mode img,
body.dark-mode video {
  filter: invert(1) hue-rotate(180deg);
}

/* ── Glitch ── */
@keyframes glitch-anim {
  0%   { transform: skewX(0deg);                       filter: none; }
  8%   { transform: skewX(-3deg) translateX(4px);      filter: hue-rotate(90deg) brightness(1.4); }
  16%  { transform: skewX(3deg) translateX(-4px);      filter: hue-rotate(200deg); }
  24%  { transform: skewX(-2deg) translateX(3px);      filter: hue-rotate(300deg) saturate(2); }
  32%  { transform: skewX(2deg) translateX(-2px);      filter: hue-rotate(0deg); }
  40%  { transform: skewX(0deg) translateX(2px);       filter: none; }
  50%  { transform: skewX(-3deg);                      filter: hue-rotate(120deg); }
  60%  { transform: skewX(1deg) translateX(3px);       filter: brightness(0.6); }
  70%  { transform: skewX(0deg);                       filter: none; }
  80%  { transform: translateX(3px);                   filter: hue-rotate(240deg); }
  90%  { transform: translateX(-3px);                  filter: none; }
  100% { transform: translate(0);                      filter: none; }
}
body.glitching {
  animation: glitch-anim 0.75s steps(1) forwards;
}
