/*
 * v0.7.0: The Penguin Department
 * Small in-world bureaucratic details; they do not trap interaction or
 * alter the core game positioning. Accessible dialog & reduced motion.
 */

.department-desk {
  display: grid;
  grid-template-columns: 64px minmax(0,1fr) auto;
  gap: 17px;
  align-items: center;
  width: 100%;
  flex-basis: 100%;
  min-width: 0;
  padding: 18px 19px;
  border: 1px solid #718b79a8;
  border-radius: 11px;
  background: linear-gradient(135deg,#21332e 0%,#1c2b35 46%,#142135 100%);
  box-shadow: inset 0 1px #d7fdb018,0 13px 24px #050a1429;
}
.department-desk[hidden] { display: none; }
.department-seal {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 62px;
  height: 62px;
  border: 2px double #cdf4b4;
  outline: 1px dashed #9abc8888;
  outline-offset: 3px;
  border-radius: 50%;
  color: #e8ffc8;
  text-align: center;
  line-height: 1;
  transform: rotate(-8deg);
}
.department-seal strong { font: 800 19px var(--sans); letter-spacing: -.065em; }
.department-seal span { margin-top: 5px; font: 600 8px var(--mono); letter-spacing: .06em; }
.department-copy { min-width: 0; }
.department-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #d3f5bc;
  font: 500 10px var(--mono);
  letter-spacing: .105em;
}
.department-copy h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: #f5f9ed;
  font-size: clamp(15px,2.3vw,19px);
  font-weight: 700;
  letter-spacing: -.04em;
}
.department-copy h2 small {
  color: #cee6b8;
  font: 500 10px var(--mono);
  letter-spacing: .03em;
}
.department-copy p {
  margin: 0;
  color: #d5e3d1;
  font-size: 12px;
  line-height: 1.5;
}
.department-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 9px;
  color: #acc4b0;
  font: 9px var(--mono);
}
.department-files-button {
  align-self: center;
  flex-shrink: 0;
  min-height: 45px;
  padding: 12px 13px;
  border: 1px solid #d7f8ac;
  border-radius: 8px;
  color: #122119;
  background: #d4f7ae;
  font: 700 10px var(--mono);
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
}
.department-files-button:hover { filter: brightness(1.1); }
.department-files-button:focus-visible,
.department-dialog button:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }
.department-dialog { width: min(690px,calc(100% - 28px)); }
.department-dialog .department-lead {
  padding: 11px 14px;
  border-left: 3px solid #c8ee95;
  background: #1c3041;
}
.department-records {
  display: grid;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 5px;
  margin-top: 16px;
}
.department-file {
  padding: 16px 17px;
  border: 1px solid #445c6c;
  border-radius: 9px;
  background: linear-gradient(155deg,#25384b,#17243a);
}
.department-file-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 7px 15px;
  color: #c7eda6;
  font: 11px var(--mono);
}
.department-file-header span { font-size: 9px; color: #a9bfc2; }
.department-file p { margin: 13px 0 8px; color: #f3f5f2 !important; }
.department-file small { color: #98b6ac; font: 9px var(--mono); letter-spacing: .04em; }
.department-file-footnote { font-style: italic; font-size: 12px !important; }

/* The department's instant environmental gestures live inside the arena. */
.department-effects {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.department-visual {
  position: absolute;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 13px 16px;
  background: #fff8e8e8;
  border: 3px double #455860;
  border-radius: 8px;
  color: #19323e;
  text-align: center;
  box-shadow: 0 8px 28px #0005;
  animation: department-enter 3.3s ease-in-out both;
}
.department-visual-glyph { font-size: 43px; line-height: 1.15; }
.department-visual-label {
  font: 700 10px/1.3 var(--mono);
  letter-spacing: .055em;
  max-width: 170px;
}
.department-visual--stamp {
  top: 17%;
  left: 50%;
  transform: translateX(-50%) rotate(-9deg);
  background: #fff3e7;
  border-color: #c65b57;
  color: #a63b3a;
  animation-name: department-stamp;
}
.department-visual--clipboard { top: 21%; left: 18%; transform: rotate(-9deg); }
.department-visual--caution {
  top: 42%; left: -6%; width: 112%;
  border: 0; border-radius: 0;
  padding: 8px 16px;
  background: repeating-linear-gradient(115deg,#f7d951 0 22px,#fce56d 22px 43px,#262127 43px 48px);
  box-shadow: 0 10px 25px #0005;
  transform: rotate(-7deg);
}
.department-visual--caution .department-visual-glyph { display: none; }
.department-visual--caution .department-visual-label { max-width: none; font-size: 14px; }
.department-visual--door { bottom: 16%; left: 5%; transform-origin: 0 100%; animation-name: department-door-open; }
.department-visual--desk { bottom: 11%; right: 7%; transform: rotate(7deg); }
.department-visual--evidence { bottom: 17%; left: 50%; transform: translateX(-50%) rotate(5deg); background: #eff6d4; }
.department-visual--light { top: 14%; right: 12%; background: #f5e8e0; animation-name: department-light-blink; }
.department-visual--envelope { top: 22%; right: 10%; transform: rotate(13deg); background: #eee4d7; border-color: #d7858e; }
@keyframes department-enter {
  0%,100% { opacity: 0; scale: .7; }
  19%,77% { opacity: 1; scale: 1; }
}
@keyframes department-stamp {
  0%,100% { opacity: 0; translate: 0 -35px; scale: 1.55; }
  23%,76% { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes department-door-open {
  0%,100% { opacity: 0; transform: rotateY(82deg); }
  23%,75% { opacity: 1; transform: rotateY(0deg); }
}
@keyframes department-light-blink {
  0%,100% { opacity: 0; }
  15%,30%,45%,60%,75% { opacity: 1; }
  23%,37%,53%,68% { opacity: .25; }
}

/* Official roles, tiny props, and ID badges on existing penguin visitors. */
.penguin-visitor.is-department-official {
  overflow: visible;
  z-index: 2;
}
.penguin-visitor.is-department-official .department-visitor-prop {
  position: absolute;
  top: -3px;
  right: -8px;
  z-index: 2;
  font-size: 29px;
  filter: drop-shadow(0 2px 2px #12202b90);
  transform: rotate(12deg);
  pointer-events: none;
}
.penguin-visitor.is-department-official .department-visitor-role {
  position: absolute;
  z-index: 4;
  bottom: -10px;
  left: 50%;
  padding: 5px 7px;
  max-width: 165px;
  white-space: nowrap;
  transform: translateX(-50%);
  border: 1px solid #b9f3b8;
  border-radius: 5px;
  background: #1b332c;
  color: #e5ffd1;
  font: 700 9px var(--mono);
  letter-spacing: .035em;
  pointer-events: none;
}
.penguin-visitor[data-department-role="director"] .department-visitor-role { background: #4a2d4c; border-color: #f2b2e6; }
.penguin-visitor[data-department-role="whistleblower"] .department-visitor-role { background: #5b2f39; border-color: #ffbda7; }
.penguin-visitor[data-department-role="intern"] .department-visitor-role { background: #273d56; border-color: #b2ccfa; }

@media (max-width: 760px) {
  .department-desk { grid-template-columns: 48px minmax(0,1fr); gap: 13px; padding: 16px; }
  .department-seal { width: 47px; height: 47px; }
  .department-seal strong { font-size: 15px; }
  .department-seal span { font-size: 7px; }
  .department-files-button { grid-column: 1/-1; width: 100%; }
  .department-visual-glyph { font-size: 33px; }
  .department-visual-label { font-size: 9px; }
  .department-visual--clipboard { left: 10%; }
  .department-visual--caution .department-visual-label { font-size: 11px; }
  .penguin-visitor.is-department-official .department-visitor-role { font-size: 8px; }
  .penguin-visitor.is-department-official .department-visitor-prop { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .department-visual, .department-visual--stamp, .department-visual--door,
  .department-visual--light { animation: none !important; opacity: 1; }
}
