
@font-face {
  font-family: "Matcha Squishy";
  src: url("/fonts/matcha-squishy.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Komica Text";
  src: url("/fonts/komica-text.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #090b09;
  --panel: #111511;
  --panel-light: #191f19;
  --border: #293229;
  --green: #a8ff35;
  --text: #f2f5ef;
  --muted: #899187;
  --red: #ff5050;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Komica Text", sans-serif;
}

button, a, input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* HEADER */

.site-header {
  height: 62px;
  padding: 0 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: #0c100c;
}

.logo {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -1px;
}

.logo span {
  color: var(--green);
}

nav {
  display: flex;
  gap: 5px;
}

.nav-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 9px 15px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.nav-button.active,
.nav-button:hover {
  background: var(--panel-light);
  color: var(--green);
}

.social-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 9px 14px;
  background: var(--green);
  color: #10150b;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--green);
}

.social-button:hover,
.primary-button:hover {
  filter: brightness(1.12);
}

/* MAIN LAYOUT */

main {
  width: min(1450px, 94%);
  margin: 0 auto;
  min-height: 0;
}

.page {
  display: none;
  padding: 7px 0 8px;
}

.page.active {
  display: block;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

h1 {
  font-size: 23px;
  margin: 0 0 3px;
  letter-spacing: -1px;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* STUDIO COLUMNS */

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr) minmax(0, 0.5fr);
  gap: 8px;
  height: calc(100svh - 195px);
  min-height: 340px;
  align-items: stretch;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px;
  min-width: 0;
  min-height: 0;
}

.panel h2 {
  font-size: 12px;
  margin: 0 0 10px;
}

/* LEFT: CUSTOMIZATION */

.asset-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.category-button {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: #aab3a7;
  padding: 8px 4px;
  font-size: 10px;
  font-weight: 700;
}

.category-button:hover,
.category-button.active {
  border-color: var(--green);
  color: var(--green);
  background: #1b2815;
}

.category-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* THUMBNAILS */

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: #45513e transparent;
}

.asset-item {
  background: #1a201a;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  color: var(--text);
  text-align: center;
  padding: 4px;
  min-width: 0;
  display: flex;
flex-direction: column;
align-items: center;
}

.asset-item:hover {
  border-color: var(--green);
}

.asset-item img {
  display: block;
  width: 88%;
  height: 88%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
  background: #252b25;
  border-radius: 4px;
}

.asset-item span {
  display: none;
}

/* CENTER: EDITOR */

.editor-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: 12px;
}

.editor-toolbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.canvas-wrap {
  width: min(100%, calc(100svh - 440px));
  max-width: 100%;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  position: relative;
  background-color: #202520;
  background-image:
    linear-gradient(45deg, #303730 25%, transparent 25%),
    linear-gradient(-45deg, #303730 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #303730 75%),
    linear-gradient(-45deg, transparent 75%, #303730 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid var(--border);
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.canvas-container {
  width: 100% !important;
  height: 100% !important;
}

.canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.export-controls {
  display: flex;
  width: 100%;
  gap: 7px;
  margin-top: 9px;
  flex-shrink: 0;
}

.primary-button,
.secondary-button,
.danger-button,
.small-button {
  border-radius: 5px;
  padding: 9px 11px;
  font-weight: 800;
  font-size: 11px;
}

.primary-button {
  background: var(--green);
  border: 1px solid var(--green);
  color: #10150b;
  flex: 1;
}

.secondary-button,
.small-button {
  background: var(--panel-light);
  border: 1px solid var(--border);
  color: var(--text);
}

.secondary-button {
  flex: 1;
}

.small-button {
  padding: 6px 9px;
  font-size: 10px;
}

.hint {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  line-height: 1.4;
  margin: 7px 0 0;
  flex-shrink: 0;
}

/* RIGHT: SETTINGS AND LAYERS */

.settings-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-message {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  padding: 9px;
  background: var(--panel-light);
  border-radius: 5px;
}

#objectControls label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin: 11px 0;
}

#objectControls input {
  display: block;
  width: 100%;
  accent-color: var(--green);
  margin-top: 7px;
}

.danger-button {
  background: #321919;
  color: #ff7777;
  border: 1px solid #633030;
  width: 100%;
}

.layers-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  flex-shrink: 0;
}

.layers-heading h2 {
  margin: 0;
}

.layer-actions {
  display: flex;
  gap: 4px;
}

.layers-list {
  display: grid;
  align-content: start;
  gap: 5px;
  margin-top: 8px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: #45513e transparent;
}

.layer-item {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: #cbd2c8;
  text-align: left;
  padding: 7px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layer-item.active {
  border-color: var(--green);
  color: var(--green);
}

/* GALLERY */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.gallery-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  overflow: hidden;
}

.gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #1d241d;
  border-radius: 5px;
}

.gallery-card p {
  margin: 9px 3px 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

/* FOOTER */

footer {
  min-height: 65px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 4%;
  background: #0c100c;
}

.footer-links {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 11px;
}

.footer-links a:hover {
  color: var(--green);
}

/* SMALLER DESKTOPS AND TABLETS */

@media (max-width: 1000px) {
  .studio-layout {
    grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1.4fr);
    height: auto;
    min-height: 0;
  }

  .asset-panel,
  .settings-panel {
    min-height: 480px;
  }

  .editor-panel {
    min-height: 480px;
  }

  .canvas-wrap {
    width: min(100%, 480px);
  }

  .settings-panel {
    grid-column: 1 / -1;
  }

  .layers-list {
    max-height: 200px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* MOBILE */

@media (max-width: 650px) {
  .site-header {
    height: auto;
    min-height: 60px;
    padding: 12px 4%;
    flex-wrap: wrap;
  }

  .site-header nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .page-heading {
    align-items: flex-start;
  }

  .page-heading .social-button {
    display: none;
  }

  .studio-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .asset-panel,
  .settings-panel,
  .editor-panel {
    min-height: auto;
  }

  .asset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 350px;
  }

  .canvas-wrap {
    width: 100%;
  }

  .settings-panel {
    grid-column: auto;
  }

  .layers-list {
    max-height: 200px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  footer {
    gap: 12px;
    flex-wrap: wrap;
  }
}

.header-socials {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-socials .social-button {
  padding: 9px 12px;
  font-size: 11px;
}

.studio-layout {
  gap: 12px;
}

.panel {
  padding: 12px;
}

.category-list {
  gap: 5px;
  margin-bottom: 12px;
}

.asset-grid {
  gap: 6px;
}

/* =================================
   MEME / CARTOON THEME
================================= */

:root {
  --pink: #ff65c3;
  --blue: #55dfff;
  --yellow: #fcff00;
  --orange: #ff984f;
  --purple: #b58aff;
  --green: #a8ff35;
  --cartoon-outline: #050805;
}

h1 {
  font-size: 30px;
  color: var(--yellow);
  letter-spacing: 1px;
}

.logo {
  font-size: 25px;
  letter-spacing: 1.5px;
}

.panel h2,
.editor-toolbar {
  font-weight: normal;
}

/* Cartoon buttons */

button,
.social-button {
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.social-button,
.primary-button,
.secondary-button,
.category-button,
.nav-button,
.small-button,
.danger-button {
  border: 2px solid var(--cartoon-outline);
  border-radius: 9px;
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--cartoon-outline);
}

.social-button:hover,
.primary-button:hover,
.secondary-button:hover,
.category-button:hover,
.nav-button:hover,
.small-button:hover,
.danger-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--cartoon-outline);
  filter: brightness(1.08);
}

.social-button:active,
.primary-button:active,
.secondary-button:active,
.category-button:active,
.nav-button:active,
.small-button:active,
.danger-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--cartoon-outline);
}

/* Header buttons */

.header-socials .social-button:first-child {
  background: var(--green);
  color: #171007;
}

.header-socials .social-button:last-child {
  background: var(--blue);
  color: #071319;
}

/* Navigation */

.nav-button {
  color: var(--text);
  background: #222b22;
}

.nav-button.active {
  background: var(--pink);
  color: #170817;
}

/* Colorful customization categories */

.category-button {
  color: #171017;
  background: var(--blue);
}

.category-button:nth-child(2) {
  background: var(--yellow);
}

.category-button:nth-child(3) {
  background: var(--pink);
}

.category-button:nth-child(4) {
  background: var(--orange);
}

.category-button:nth-child(5) {
  background: var(--purple);
}

.category-button:nth-child(6) {
  background: var(--green);
}

.category-button.active {
  background: #ffffff;
  color: #111;
  border-color: #111;
  outline: 2px solid var(--green);
}

.category-button:disabled {
  filter: grayscale(1);
  opacity: 0.4;
}

/* Export buttons */

.primary-button {
  background: var(--green);
  color: #10150b;
}

.secondary-button {
  background: var(--blue);
  color: #10150b;
}

/* Object controls */

.danger-button {
  background: #ff5b67;
  color: #240609;
}

.small-button {
  background: var(--yellow);
  color: #171007;
}

/* Cartoon asset tiles */

.asset-item {
  border: 2px solid #343e32;
  border-radius: 9px;
  box-shadow: 2px 2px 0 #050805;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.asset-item:hover {
  transform: translateY(-2px) rotate(-1deg);
  border-color: var(--yellow);
}

/* Slight comic-style panel outlines */

.panel {
  border: 2px solid #354334;
  border-radius: 11px;
}

.gallery-card {
  border: 2px solid #354334;
  border-radius: 11px;
}

.footer-links {
  font-weight: 600;
}

/* =================================
   TYPOGRAPHY
================================= */

/* Default font for the entire website */
html,
body,
button,
a,
input,
select,
textarea,
p,
label,
span,
div {
  font-family: "Komica Text", sans-serif;
}

/* Display font for headings and logo */
h1,
h2,
h3,
.logo,
.panel h2,
.layers-heading h2 {
  font-family: "Matcha Squishy", sans-serif;
}

/* Heading styling */
h1 {
  font-size: 30px;
  color: var(--yellow);
  letter-spacing: 1px;
}

.logo {
  font-size: 25px;
  letter-spacing: 1.5px;
}

/* Slightly larger interface text */
button,
.nav-button,
.category-button,
.social-button,
.small-button,
.primary-button,
.secondary-button,
.danger-button {
  font-size: 14px;
}

/* Slightly larger menu and category labels */
nav button,
.category-list button {
  font-size: 14px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  display: block;
  width: 140px;
  height: 45px;
  object-fit: contain;
}

/* Logo + Bagsey brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  display: block;
  width: 140px;
  height: 45px;
  object-fit: contain;
}

.brand span {
  font-family: "Matcha Squishy", sans-serif;
  font-size: 27px;
  color: var(--yellow);
  letter-spacing: 1px;
  margin-left: -35px;
}

/* Website background */
body {
  background-image:
    linear-gradient(rgba(10, 12, 10, 0.65), rgba(10, 12, 10, 0.65)),
    url("/images/background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* CONTRACT ADDRESS */
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ca-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 0;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--green);
  border-radius: 8px;
  color: white;
  font-size: 13px;
  transition: background 0.2s, box-shadow 0.2s;
}

.ca-address {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ca-container.copied {
  background: rgba(168, 255, 53, 0.25);
  box-shadow: 0 0 18px rgba(168, 255, 53, 0.6);
}

.copy-ca-button.copied {
  background: white;
  color: #111;
}

/* Final text size overrides */
.hint,
.empty-message {
  font-family: "Komica Text", sans-serif !important;
  font-size: 12px !important;
  line-height: 1.5;
}