/* ── Doodle Wall — MS Paint / Windows 98 aesthetic ── */

/* ── Paint Window ── */
.paint-window {
  background: #D4D0C8;
  border-top: 2px solid #FFFFFF;
  border-left: 2px solid #FFFFFF;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 1px 1px 0 #000000, inset 1px 1px 0 #DFDFDF;
  font-family: 'Tahoma', 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  user-select: none;
  max-width: 800px;
  margin: 0 auto;
}

/* ── Title bar ── */
.paint-titlebar {
  background: linear-gradient(90deg, #000080, #1084D0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px 3px 6px;
  gap: 6px;
}

.paint-titlebar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: bold;
  font-family: 'Tahoma', Arial, sans-serif;
  white-space: nowrap;
  overflow: hidden;
}

.paint-titlebar-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.paint-titlebar-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.paint-titlebar-btns {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.paint-wb {
  width: 16px;
  height: 14px;
  background: #D4D0C8;
  border-top: 1.5px solid #FFFFFF;
  border-left: 1.5px solid #FFFFFF;
  border-right: 1.5px solid #404040;
  border-bottom: 1.5px solid #404040;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  color: #000000;
  cursor: pointer;
  font-family: 'Marlett', 'Wingdings', monospace;
  font-weight: bold;
  letter-spacing: 0;
}

.paint-wb:hover {
  background: #C0BDBA;
}

.paint-wb:active {
  border-top: 1.5px solid #404040;
  border-left: 1.5px solid #404040;
  border-right: 1.5px solid #FFFFFF;
  border-bottom: 1.5px solid #FFFFFF;
}

.paint-wb-close {
  background: #C0C0C0;
}
.paint-wb-close:hover {
  background: #E81123;
  color: #FFFFFF;
}

/* ── Menu bar ── */
.paint-menubar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px 4px 0;
  border-bottom: 1px solid #C0BDBA;
}

.paint-menubar span {
  padding: 3px 8px;
  font-size: 11px;
  font-family: 'Tahoma', Arial, sans-serif;
  color: #000000;
  cursor: default;
  border: 1px solid transparent;
  display: inline-block;
}

.paint-menubar span:hover {
  border-color: #0A246A;
  background: #D4D0C8;
  color: #000000;
}

.paint-menubar span:focus {
  background: #000080;
  color: #FFFFFF;
  border-color: #000080;
  outline: none;
}

/* ── Body (toolbar + canvas area) ── */
.paint-body {
  display: flex;
  gap: 0;
}

/* ── Toolbar ── */
.paint-toolbar {
  width: 52px;
  flex-shrink: 0;
  border-right: 2px solid #808080;
  border-right-color: #808080;
  background: #D4D0C8;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset -1px 0 0 #FFFFFF;
}

.pt-tool,
.pt-sz {
  width: 100%;
  background: #D4D0C8;
  border-top: 1.5px solid #FFFFFF;
  border-left: 1.5px solid #FFFFFF;
  border-right: 1.5px solid #808080;
  border-bottom: 1.5px solid #808080;
  padding: 4px 2px;
  font-size: 11px;
  font-family: 'Tahoma', Arial, sans-serif;
  color: #000000;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background 0.05s;
  min-height: 28px;
  line-height: 1;
}

.pt-tool:hover,
.pt-sz:hover {
  background: #C8C4BC;
}

.pt-tool.active,
.pt-sz.active {
  border-top: 1.5px solid #808080;
  border-left: 1.5px solid #808080;
  border-right: 1.5px solid #FFFFFF;
  border-bottom: 1.5px solid #FFFFFF;
  background: #C8C4BC;
}

.pt-tool:active,
.pt-sz:active {
  border-top: 1.5px solid #808080;
  border-left: 1.5px solid #808080;
  border-right: 1.5px solid #FFFFFF;
  border-bottom: 1.5px solid #FFFFFF;
}

.toolbar-sep {
  height: 1px;
  background: #808080;
  margin: 2px 0;
  box-shadow: 0 1px 0 #FFFFFF;
}

.pt-fg-label {
  font-size: 9px;
  color: #555;
  text-align: center;
  margin-top: 2px;
}

.pt-fg-swatch {
  width: 32px;
  height: 20px;
  border-top: 1.5px solid #808080;
  border-left: 1.5px solid #808080;
  border-right: 1.5px solid #FFFFFF;
  border-bottom: 1.5px solid #FFFFFF;
  background: #000000;
  margin: 0 auto;
  display: block;
}

.pt-sz-label {
  font-size: 9px;
  color: #555;
  text-align: center;
}

/* ── Canvas area ── */
.paint-canvas-area {
  flex: 1;
  min-width: 0;
  border-left: 2px solid #808080;
  border-top: 2px solid #808080;
  border-right: 2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
  overflow: hidden;
  position: relative;
  background: #808080;
  box-shadow: inset 1px 1px 0 #000000;
}

.paint-canvas-area canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

/* ── Compliment bubble ── */
.compliment-bubble {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #FFFFFF;
  border: 2px solid #D4D0C8;
  border-top: 1.5px solid #FFFFFF;
  border-left: 1.5px solid #FFFFFF;
  border-right: 1.5px solid #808080;
  border-bottom: 1.5px solid #808080;
  border-radius: 12px 12px 3px 12px;
  padding: 5px 9px;
  font-family: 'Bitroad', monospace;
  font-size: 0.72rem;
  color: #000080;
  max-width: 140px;
  pointer-events: none;
  z-index: 10;
  transform-origin: bottom right;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.15);

  /* hidden by default */
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.25s ease, transform 0s;
}

.compliment-bubble.show {
  animation: bubble-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.compliment-bubble.hide {
  animation: bubble-fade 0.3s ease forwards;
}

@keyframes bubble-pop {
  0%   { opacity: 0; transform: scale(0); }
  60%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes bubble-fade {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.85); }
}

.bubble-star {
  color: #1414FF;
  margin-right: 4px;
}

/* ── Bottom row (palette + actions) ── */
.paint-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  border-top: 2px solid #808080;
  background: #D4D0C8;
  box-shadow: inset 0 1px 0 #FFFFFF;
  flex-wrap: wrap;
}

/* ── Color palette ── */
.paint-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 380px;
}

.color-swatch {
  width: 16px;
  height: 16px;
  border-top: 1.5px solid #808080;
  border-left: 1.5px solid #808080;
  border-right: 1.5px solid #FFFFFF;
  border-bottom: 1.5px solid #FFFFFF;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.2);
  z-index: 1;
}

.color-swatch.active::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid #000000;
  border-radius: 1px;
  pointer-events: none;
}

/* ── Actions ── */
.paint-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.paint-btn {
  padding: 4px 14px;
  background: #D4D0C8;
  border-top: 1.5px solid #FFFFFF;
  border-left: 1.5px solid #FFFFFF;
  border-right: 1.5px solid #808080;
  border-bottom: 1.5px solid #808080;
  font-size: 11px;
  font-family: 'Tahoma', Arial, sans-serif;
  color: #000000;
  cursor: pointer;
  transition: background 0.05s;
  white-space: nowrap;
}

.paint-btn:hover {
  background: #C8C4BC;
}

.paint-btn:active {
  border-top: 1.5px solid #808080;
  border-left: 1.5px solid #808080;
  border-right: 1.5px solid #FFFFFF;
  border-bottom: 1.5px solid #FFFFFF;
  padding: 5px 13px 3px 15px;
}

.paint-btn-primary {
  background: #000080;
  color: #FFFFFF;
  font-weight: bold;
  border-top-color: #6666CC;
  border-left-color: #6666CC;
  border-right-color: #000040;
  border-bottom-color: #000040;
}

.paint-btn-primary:hover {
  background: #0000AA;
}

.paint-btn-primary.saved {
  background: #006600;
  border-top-color: #44AA44;
  border-left-color: #44AA44;
  border-right-color: #003300;
  border-bottom-color: #003300;
}

/* ── Status bar ── */
.paint-statusbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 1px 4px;
  border-top: 2px solid #808080;
  background: #D4D0C8;
  box-shadow: inset 0 1px 0 #FFFFFF;
  min-height: 20px;
  font-family: 'Tahoma', Arial, sans-serif;
  font-size: 10px;
}

.paint-statusbar span {
  padding: 1px 8px 1px 6px;
  border-right: 1.5px solid #808080;
  color: #000000;
  white-space: nowrap;
}

.paint-statusbar span:last-child {
  border-right: none;
}

.paint-statusbar span::before {
  content: '';
}

/* ── Doodle gallery section ── */
.doodle-gallery-section {
  margin-top: 52px;
}

.doodle-gallery-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.doodle-gallery-title {
  font-family: 'Bitroad', monospace;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
}

.doodle-gallery-note {
  font-size: 0.75rem;
  color: var(--ink-mid);
  font-family: 'Instrument Sans', sans-serif;
}

.doodle-gallery-empty {
  font-family: 'Bitroad', monospace;
  font-size: 1.15rem;
  color: var(--ink-mid);
  text-align: center;
  padding: 32px 0;
}

/* ── Doodle grid ── */
.doodle-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.dg-card {
  background: #FFFFFF;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.12);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  animation: card-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.dg-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 4px 8px 20px rgba(0,0,0,0.18);
}

@keyframes card-slide-in {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.dg-card img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid #D4D0C8;
}

.dg-card-time {
  font-family: 'Tahoma', Arial, sans-serif;
  font-size: 9px;
  color: #666666;
  padding: 4px 6px;
  text-align: center;
  background: #F0EEE8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Doodle section (the wrapping .section) ── */
#doodle {
  background: var(--bg);
}

#doodle .sec-desc {
  color: var(--ink-mid);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 40px;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .paint-toolbar {
    width: 44px;
  }
  .pt-tool,
  .pt-sz {
    font-size: 10px;
    min-height: 24px;
    padding: 3px 1px;
  }
  .paint-palette {
    max-width: 260px;
  }
  .color-swatch {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 640px) {
  .paint-body {
    flex-direction: column;
  }
  .paint-toolbar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 2px solid #808080;
    padding: 4px;
    gap: 4px;
    box-shadow: none;
  }
  .pt-tool,
  .pt-sz {
    width: auto;
    flex: 1 0 60px;
    min-height: 26px;
  }
  .toolbar-sep {
    display: none;
  }
  .pt-fg-label,
  .pt-fg-swatch,
  .pt-sz-label {
    display: none;
  }
  .doodle-gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  .paint-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .paint-palette {
    max-width: 100%;
  }
}

/* ── Name dialog ── */
.doodle-name-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlay-in 0.15s ease;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.doodle-name-dialog {
  background: #D4D0C8;
  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, 8px 12px 32px rgba(0,0,0,0.35);
  font-family: 'Tahoma', 'MS Sans Serif', Arial, sans-serif;
  width: 300px;
  animation: dialog-pop 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes dialog-pop {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.doodle-name-titlebar {
  background: linear-gradient(90deg, #000080, #1084D0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px 3px 6px;
  gap: 6px;
}

.doodle-name-titlebar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
}

.doodle-name-body {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doodle-name-label {
  font-size: 12px;
  font-weight: bold;
  color: #000;
  margin: 0;
}

.doodle-name-sub {
  font-size: 11px;
  color: #555;
  margin: 0 0 4px;
}

.doodle-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  font-family: 'Tahoma', Arial, sans-serif;
  font-size: 12px;
  border-top: 1.5px solid #808080;
  border-left: 1.5px solid #808080;
  border-right: 1.5px solid #FFFFFF;
  border-bottom: 1.5px solid #FFFFFF;
  background: #FFFFFF;
  outline: none;
  color: #000;
}

.doodle-name-input:focus {
  outline: 1px dotted #000080;
  outline-offset: 1px;
}

.doodle-name-btns {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}
