/* ProDobro Games — Shared base styles */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--pdg-font);
  color: var(--pdg-fg);
  background: var(--pdg-bg);
  background-image: var(--pdg-bg-image);
  background-attachment: fixed;
  transition: background-color var(--pdg-transition), color var(--pdg-transition);
}

.pdg-noise {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 100;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .pdg-noise {
  opacity: 0.04;
  mix-blend-mode: overlay;
}

.pdg-btn {
  font-family: var(--pdg-font);
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: var(--pdg-radius);
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow var(--pdg-transition), background var(--pdg-transition);
  color: #fff;
  background: linear-gradient(135deg, #34d399 0%, #22c55e 100%);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.pdg-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(34, 197, 94, 0.45); }
.pdg-btn:active { transform: translateY(0) scale(0.98); }

.pdg-btn--ghost {
  background: var(--pdg-surface);
  color: var(--pdg-fg);
  border: 1px solid var(--pdg-border);
  box-shadow: none;
}
.pdg-btn--ghost:hover { background: var(--pdg-surface-hover); box-shadow: var(--pdg-shadow-sm); }

.pdg-card {
  background: var(--pdg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--pdg-border);
  border-radius: var(--pdg-radius-lg);
  box-shadow: var(--pdg-shadow-sm);
  padding: var(--pdg-space-5);
}

.pdg-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Modals */
.pdg-modal {
  position: fixed; inset: 0;
  background: var(--pdg-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.pdg-modal.show { display: flex; }

.pdg-modal__panel {
  background: var(--pdg-surface-solid);
  border-radius: var(--pdg-radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--pdg-shadow);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.pdg-modal__icon-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pdg-surface);
  border: 1px solid var(--pdg-border);
  color: var(--pdg-fg-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--pdg-transition);
  z-index: 2;
}
.pdg-modal__icon-btn:hover { background: var(--pdg-surface-hover); color: var(--pdg-fg); transform: scale(1.05); }

/* Prompt textarea with custom scrollbar */
.pdg-prompt-textarea {
  width: 100%;
  height: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  background: var(--pdg-surface);
  color: var(--pdg-fg);
  border: 1px solid var(--pdg-border);
  border-radius: var(--pdg-radius-sm);
  padding: 10px 12px;
  padding-right: 12px;
  outline: none;
  resize: none;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--pdg-border) transparent;
}
.pdg-prompt-textarea:focus { border-color: var(--pdg-accent-2); }
.pdg-prompt-textarea::-webkit-scrollbar { width: 8px; height: 8px; }
.pdg-prompt-textarea::-webkit-scrollbar-track { background: transparent; }
.pdg-prompt-textarea::-webkit-scrollbar-thumb {
  background: var(--pdg-border);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.pdg-prompt-textarea::-webkit-scrollbar-thumb:hover { background: var(--pdg-fg-subtle); background-clip: padding-box; border: 2px solid transparent; }
.pdg-prompt-textarea::-webkit-scrollbar-corner { background: transparent; }

.pdg-prompt-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.pdg-prompt-copy[hidden] { display: none; }
.pdg-prompt-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--pdg-fg-muted);
  background: var(--pdg-surface-solid);
  border: 1px solid var(--pdg-border);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--pdg-transition), color var(--pdg-transition), border-color var(--pdg-transition), transform 0.15s ease;
}
.pdg-prompt-copy:hover {
  background: var(--pdg-surface-solid);
  color: var(--pdg-fg);
  border-color: var(--pdg-fg-subtle);
  transform: scale(1.06);
}
.pdg-prompt-copy svg { flex-shrink: 0; }
.pdg-prompt-copy .pdg-prompt-copy__icon-copy { display: block; }
.pdg-prompt-copy .pdg-prompt-copy__icon-check { display: none; }
.pdg-prompt-copy.is-copied {
  background: linear-gradient(135deg, #34d399 0%, #22c55e 100%);
  border-color: transparent;
  color: #fff;
}
.pdg-prompt-copy.is-copied:hover {
  background: linear-gradient(135deg, #34d399 0%, #22c55e 100%);
  border-color: transparent;
  color: #fff;
}
.pdg-prompt-copy.is-copied .pdg-prompt-copy__icon-copy { display: none; }
.pdg-prompt-copy.is-copied .pdg-prompt-copy__icon-check { display: block; }
.pdg-modal__title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
}
.pdg-modal__desc {
  font-size: 14px;
  color: var(--pdg-fg-muted);
  margin-bottom: 20px;
}

/* Profile picker list */
.profile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--pdg-radius);
  border: 1px solid var(--pdg-border);
  background: var(--pdg-surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--pdg-fg);
  font-size: 15px;
  font-weight: 700;
  transition: background var(--pdg-transition);
}
.profile-item:hover { background: var(--pdg-surface-hover); }
.profile-item__remove {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--pdg-fg-subtle);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.profile-item__remove:hover { color: var(--pdg-accent); background: rgba(255,117,140,0.1); }

/* Forms */
.create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Tiny eyebrow-style heading inside the create/edit form. Used above
   each section (Аватар, Цвет фона). Replaces a literal `style="..."`
   block that previously lived in profile.html. */
.create-form__section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--pdg-fg-subtle);
  margin-bottom: 8px;
}
.create-form__section-label + .avatar-grid + .create-form__section-label,
.create-form__section-label--spaced {
  margin: 16px 0 8px;
}
.create-form input[type="text"] {
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: var(--pdg-radius);
  border: 1px solid var(--pdg-border);
  background: var(--pdg-surface);
  color: var(--pdg-fg);
  outline: none;
}
.create-form input[type="text"]:focus {
  border-color: var(--pdg-accent-2);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.avatar-pick {
  font-size: 26px;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--pdg-surface);
  cursor: pointer;
  transition: all 0.2s ease;
}
.avatar-pick:hover { transform: scale(1.05); }
.avatar-pick.selected {
  border-color: var(--pdg-accent);
  background: rgba(255,117,140,0.12);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.color-pick {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.color-pick:hover { transform: scale(1.05); }
.color-pick.selected {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--pdg-surface), 0 0 0 4px var(--pdg-fg);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.modal-actions .pdg-btn { flex: 1; }
/* When the modal-actions row needs extra breathing room above (e.g.
   profile picker's "Создать игрока" sitting under the profile list). */
.modal-actions--spaced { margin-top: 20px; }
