/* ===================== Ομάδα «Ζωγραφική» ===================== */

/* ---- Κοινά: κουμπιά εργαλείων, παλέτα ---- */
.pt-tool {
  font-family: inherit; font-weight: 600; font-size: 12px; color: #37474f;
  background: #fff; border: 3px solid #ffd54f; border-radius: 14px; box-shadow: 0 3px 0 #e0b000;
  padding: 5px 2px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  cursor: pointer; transition: transform .1s, background .15s;
}
.pt-tool .e { font-size: 26px; line-height: 1.1; }
.pt-tool .n { line-height: 1.1; white-space: nowrap; }
.pt-tool:hover { transform: scale(1.05); }
.pt-tool:active { transform: translateY(2px); box-shadow: 0 1px 0 #e0b000; }
.pt-tool.sel { background: #ffe082; border-color: #ff9800; box-shadow: 0 3px 0 #ef6c00; }
.pt-tool.disabled { opacity: .4; pointer-events: none; }

.dw-color {
  width: 38px; height: 38px; border-radius: 50%; background: var(--c);
  border: 3px solid #fff; box-shadow: 0 0 0 2px #b0bec5; cursor: pointer; padding: 0;
  transition: transform .1s, box-shadow .1s; flex: none;
}
.dw-color:hover { transform: scale(1.12); }
.dw-color.sel { box-shadow: 0 0 0 4px #ff9800; transform: scale(1.18); }
.dw-color.custom {
  position: relative; display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: conic-gradient(#f44336, #ff9800, #ffeb3b, #4caf50, #2196f3, #9c27b0, #f44336);
}
.dw-color.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dw-color.eraser { background: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; }

.pt-label { font-weight: 700; font-size: 14px; color: #607d8b; margin: 8px 0 4px; text-transform: uppercase; letter-spacing: .5px; }
.pt-help { font-size: 14px; color: #546e7a; margin: 6px 0; line-height: 1.3; }

/* ---- Παράθυρο εισαγωγής κειμένου (textDialog) ---- */
.modal .tx-title { font-size: 34px; }
.tx-help { font-size: 16px; color: #78909c; font-weight: 600; margin: 0 0 10px; }
.tx-input {
  font-family: inherit; font-size: 26px; font-weight: 700; color: var(--ink); text-align: center; width: 100%;
  padding: 10px 16px; border: 4px solid #ffd54f; border-radius: 18px; background: #fffde7; outline: none; resize: none; line-height: 1.25;
  user-select: text; -webkit-user-select: text;
}
.tx-input:focus { border-color: #ff9800; box-shadow: 0 0 0 4px rgba(255,152,0,.25); background: #fff; }
.tx-input::placeholder { color: #bdbdbd; font-weight: 600; }
.tx-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0 2px; }
.tx-chip {
  font-family: inherit; font-size: 16px; font-weight: 700; color: #00695c; background: #e0f2f1; border: 2px solid #80cbc4;
  border-radius: 16px; padding: 5px 12px; cursor: pointer; transition: transform .1s;
}
.tx-chip:hover { transform: scale(1.06); background: #b2dfdb; }
.tx-actions { margin-top: 8px; }
.tx-actions .big-btn { font-size: 22px; padding: 10px 26px; }

/* ---- Ζωγραφική (Tux Paint) ---- */
.pt-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.pt-main { flex: 1; display: flex; gap: 10px; min-height: 0; }
.pt-tools {
  width: 172px; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start;
  overflow-y: auto; padding: 2px;
}
.pt-canvas-box { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
.pt-canvas-frame {
  position: relative; background: #fff; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 4px #fff, 0 8px 24px rgba(0,0,0,.22);
}
.pt-canvas-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pt-preview { touch-action: none; cursor: crosshair; }
.pt-tool[data-tool=save] { grid-column: span 2; }
.pt-text-box { position: absolute; z-index: 3; display: flex; align-items: center; gap: 4px; }
.pt-text-input {
  background: rgba(255,255,255,.6); border: 2px dashed #ff9800; border-radius: 6px; width: 260px; max-width: 45vw;
  outline: none; padding: 0 6px; line-height: 1.2; user-select: text; -webkit-user-select: text;
}
.pt-text-ok {
  font-size: 22px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #4caf50; color: #fff;
  box-shadow: 0 3px 0 #2e7d32; cursor: pointer; flex: none;
}
.pt-opts {
  width: 220px; flex: none; background: rgba(255,255,255,.78); border-radius: 18px; padding: 10px;
  overflow-y: auto; box-shadow: inset 0 0 0 3px rgba(255,255,255,.9);
}
.pt-opts-title { font-weight: 700; font-size: 20px; color: #ec407a; margin-bottom: 4px; text-align: center; }
.pt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pt-grid.stamps { grid-template-columns: repeat(4, 1fr); max-height: 240px; overflow-y: auto; }
.pt-row { display: flex; gap: 5px; flex-wrap: wrap; }
.pt-opt {
  font-family: inherit; font-size: 22px; line-height: 1; color: #37474f;
  background: #fff; border: 2px solid #cfd8dc; border-radius: 10px; height: 44px; min-width: 44px; padding: 0 4px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.pt-opt:hover { border-color: #ffb74d; }
.pt-opt.sel { border-color: #ff9800; background: #ffe082; }
/* Σφραγίδες με εικόνα PNG (img/props) — το emoji μένει κρυφό ως fallback και εμφανίζεται μόνο αν η εικόνα δεν φορτώσει */
.pt-opt.has-img { padding: 2px; min-width: 0; }
.pt-opt.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pt-opt.has-img .e { display: none; }
.pt-opt.size { flex: 1; font-size: 13px; font-weight: 700; }
.pt-opt.size i { display: block; border-radius: 50%; background: #37474f; }
.pt-opt.wide { font-size: 15px; font-weight: 600; flex: 1; justify-content: flex-start; padding: 0 10px; }
.pt-list { display: flex; flex-direction: column; gap: 5px; }
.pt-stamp-acts .pt-opt { justify-content: center; font-weight: 700; color: #fff; }
.pt-stamp-acts .ok { background: #4caf50; border-color: #2e7d32; }
.pt-stamp-acts .no { background: #ef5350; border-color: #c62828; }
.pt-stamp-acts .pt-opt:hover { filter: brightness(1.08); }
.pt-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.pt-tab {
  font-family: inherit; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 12px;
  border: 2px solid #cfd8dc; background: #fff; color: #546e7a; cursor: pointer;
}
.pt-tab.sel { background: #ec407a; border-color: #ec407a; color: #fff; }
.pt-colors {
  flex: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center;
  background: rgba(255,255,255,.78); border-radius: 18px; padding: 8px 12px;
}

/* ---- Τουβλάκια (pixel art) ---- */
.bk-wrap { position: absolute; inset: 0; display: grid; grid-template-columns: 172px 1fr 262px; gap: 10px; padding: 10px; }
.bk-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }
.bk-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 2px; }
.bk-size {
  background: rgba(255,255,255,.78); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px;
  font-weight: 700; font-size: 14px; color: #607d8b;
}
.bk-size select { font-family: inherit; font-size: 16px; font-weight: 600; padding: 4px; border-radius: 8px; border: 2px solid #cfd8dc; }
.bk-gridtoggle { font-weight: 600; color: #37474f; display: flex; align-items: center; gap: 6px; }
.bk-gridtoggle input { width: 18px; height: 18px; }
.bk-board-box { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.bk-board {
  display: grid; box-sizing: content-box; background: repeating-conic-gradient(#e6e9ec 0 25%, #f8f9fa 0 50%) 0 0 / 24px 24px; border: 4px solid #455a64; border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); touch-action: none; cursor: crosshair;
}
.bk-board[data-tool=picker] { cursor: copy; }
.bk-cell { background-size: 100% 100%; image-rendering: pixelated; box-shadow: inset 0 0 0 1px rgba(0,0,0,.13); }
.bk-board.nogrid .bk-cell { box-shadow: none; }
.bk-palette {
  background: rgba(255,255,255,.78); border-radius: 18px; padding: 10px; overflow-y: auto; min-height: 0;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.9);
}
.bk-cur { display: flex; align-items: center; gap: 10px; }
.bk-cur-swatch { width: 46px; height: 46px; border-radius: 8px; border: 3px solid #455a64; background-size: 100% 100%; image-rendering: pixelated; flex: none; }
.bk-cur-name { font-weight: 700; font-size: 17px; color: #37474f; }
.bk-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-colors .dw-color { width: 30px; height: 30px; }
.bk-blocks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bk-block {
  aspect-ratio: 1; background-size: 100% 100%; image-rendering: pixelated; border: 3px solid #fff; border-radius: 6px;
  box-shadow: 0 0 0 2px #b0bec5; cursor: pointer; padding: 0; transition: transform .1s, box-shadow .1s;
}
.bk-block:hover { transform: scale(1.1); }
.bk-block.sel { box-shadow: 0 0 0 4px #ff9800; transform: scale(1.12); }

/* ---- Συμμετρία ---- */
.sy-wrap { position: absolute; inset: 0; display: grid; grid-template-columns: 250px 1fr; gap: 10px; padding: 10px; }
.sy-side {
  background: rgba(255,255,255,.78); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; box-shadow: inset 0 0 0 3px rgba(255,255,255,.9);
}
.sy-title { font-weight: 700; font-size: 26px; color: #7e57c2; text-align: center; }
.sy-axis-info { text-align: center; font-weight: 600; font-size: 15px; color: #546e7a; background: #ede7f6; border-radius: 12px; padding: 6px; }
.sy-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.sy-actions { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.sy-actions .big-btn { font-size: 18px; padding: 10px 14px; margin: 3px 0; }
.sy-count { text-align: center; font-weight: 700; font-size: 18px; color: #37474f; margin-top: 6px; }
.sy-board-box { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.sy-board {
  position: relative; display: grid; box-sizing: content-box; background: repeating-conic-gradient(#e6e9ec 0 25%, #f8f9fa 0 50%) 0 0 / 24px 24px; border: 4px solid #455a64; border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); touch-action: none; transition: box-shadow .4s;
}
.sy-board.complete { box-shadow: 0 0 0 6px #ffd740, 0 0 48px #ffd740; }
.sy-cell { box-shadow: inset 0 0 0 1px rgba(0,0,0,.13); position: relative; }
.sy-cell.todo { cursor: crosshair; }
.sy-cell.given { cursor: not-allowed; }
.sy-cell.given::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.04); pointer-events: none; }
.sy-cell.water { background-color: #e3f2fd; }
.mode-diag .sy-cell.diagcell { box-shadow: inset 0 0 0 1px rgba(0,0,0,.13), inset 0 0 0 3px rgba(255,87,34,.25); }
.sy-cell.twin { outline: 4px solid #ff9800; outline-offset: -4px; z-index: 2; }
.sy-cell.popin { animation: sypop .25s ease-out; }
@keyframes sypop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.sy-cell.hintflash { animation: syflash .45s 5; z-index: 3; }
@keyframes syflash { 0%, 100% { outline: 4px solid transparent; outline-offset: -4px; } 50% { outline: 4px solid #ff5722; outline-offset: -4px; } }
.sy-axis { position: absolute; pointer-events: none; z-index: 4; }
.mode-lr .sy-axis { top: -8px; bottom: -8px; width: 0; border-left: 4px dashed #ff5722; margin-left: -2px; }
.mode-tb .sy-axis { left: -8px; right: -8px; height: 0; border-top: 4px dashed #ff5722; margin-top: -2px; }
.mode-diag .sy-axis { top: 0; left: 0; height: 0; border-top: 4px dashed #ff5722; transform-origin: 0 0; margin-top: -2px; }
.mode-adiag .sy-axis { top: 0; right: 0; height: 0; border-top: 4px dashed #ff5722; transform-origin: 100% 0; margin-top: -2px; }
.mode-adiag .sy-cell.diagcell { box-shadow: inset 0 0 0 1px rgba(0,0,0,.13), inset 0 0 0 3px rgba(255,87,34,.25); }

/* ---- Μικρότερες οθόνες ---- */
@media (max-width: 1100px) {
  .pt-tools { width: 150px; }
  .pt-opts { width: 190px; }
  .bk-wrap { grid-template-columns: 150px 1fr 220px; }
  .sy-wrap { grid-template-columns: 210px 1fr; }
}
@media (max-width: 820px) {
  .pt-tool .n { display: none; }
  .pt-tools { width: 110px; }
  .bk-wrap { grid-template-columns: 110px 1fr 200px; }
}
