@font-face {
  font-family: "Tarsius";
  src: url("fonts/TarsiusMono-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-color: #f7f7f7;
  --bg-color-yellow: #f3f3d8;
  --bg-color-red: #f6c8bd;
  --text-color: #000;
  --border-color: #000;
  --muted-text: #aeaeae;
  --content-width: 70%;
  --font-family: 'Tarsius', sans-serif;
  --font-size: clamp(8pt, 2vw + 0.5rem, 18pt);
  --border-width: 1px;
  --small-text: 10pt;
  --big-text: clamp(8pt, 4vw + 0.5rem, 40pt);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: var(--font-size);
  scroll-behavior: smooth;
    overflow-x: hidden;

}


/* ================================
   NAVIGATION
================================= */

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg-color-yellow);
  padding: 10px 10px;
  box-sizing: border-box;   
  /* border-bottom: var(--border-width) solid var(--border-color); */
  z-index: 50;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  margin-right: 15px;
  font-size: var(--font-size);
}

nav a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ================================
   DRAWING CONTROLS
================================= */

#controls {
  position: absolute;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-start; /* 🔹 kaikki vasempaan laitaan */
  align-items: center;
  gap: 20px;                   /* 🔹 väli painikkeiden väliin */
  padding: 20px 10px 10px 20px;
  z-index: 10;
  overflow-x: auto;       /* 🔹 mahdollistaa vaakaskrollin */
  overflow-y: hidden;
  white-space: nowrap;    /* 🔹 kaikki napit pysyvät yhdellä rivillä */
  -webkit-overflow-scrolling: touch; /* 🔹 smooth scroll mobiilissa */

}


#controls span,
#controls a {
  cursor: pointer;
  background: none;
  border: none;
  margin-right: 4px;
  font: inherit;
  color: var(--text-color);
}

#controls span:hover,
#controls a:hover {
  text-decoration: underline;
}

/* --- Special style for frontpage SAVE ENTRY button --- */
button#save {
  display: block;
  margin-top: 20px;
  padding: 15px 25px;
  font-size: var(--font-size);
  font-family: inherit;
  border: var(--border-width) solid var(--border-color);
  line-height: 1.2em;
  background: transparent;
  cursor: pointer;
  color: var(--text-color);
  transition: background 0.2s ease;
}

button#save:hover {
  background: var(--muted-text); 
  text-decoration: none;
}


#controls span,
#controls a,
#controls button {
  display: inline-block;
  padding: 8px 18px;
  border: var(--border-width) solid var(--border-color);
  border-radius: 9999px; /* 💊 pillerimuoto */
  background: var(--bg-color);
  color: var(--text-color);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Hover-efekti */
#controls span:hover,
#controls a:hover,
#controls button:hover {
  background: var(--text-color);
  color: var(--bg-color);
  text-decoration: none;
}

/* Klikkaustuntuma */
#controls span:active,
#controls a:active,
#controls button:active {
  transform: scale(0.97);
}

/* Vähän väliä nappeihin */
#controls {
  gap: 0;
}


/* ================================
   SPRAY SETTINGS
================================= */

.slider-container {
  display: none;
  position: absolute;
  top: 75px;
  left: 0;
  width: calc(100% - 0px);
  padding: 8px 20px 20px 20px;
  box-sizing: border-box;
  /* background: var(--bg-color);
  border-bottom: var(--border-width) solid var(--border-color); */
  z-index: 25;
}

.slider-container label {
  margin-right: 10px;
  font-size: var(--font-size);
}

/* ================================
   CANVAS AREA
================================= */

canvas {
  display: block;
  /* width: 100%;  ← POISTETAAN TÄMÄ */
  touch-action: none;
  border-bottom: var(--border-width) solid var(--border-color);
  margin-top: 55px;
}

/* ================================
   TEXT INPUT & BUTTONS
================================= */

.entry-input {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 96%;
  margin: 30px 2%;
  gap: 10px;
}

.entry-input textarea {
  flex: 1;
  height: 80px;
  font: inherit;
  border: var(--border-width) solid #ccc;
  padding: 8px;
  background: transparent;
  resize: vertical;
  
}

button {
  display: block;
  padding: 10px 20px;
  font: inherit;
  font-size: var(--font-size);
  border: var(--border-width) solid var(--border-color);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
  color: var(--text-color);
  max-width: 400px;
}

button:hover {
  background: var(--muted-text);
}


/* ================================
   CURSOR  STYLES
================================= */

.cursor-pencil {
  cursor: url("img/cursor-pencil.svg") 0 32, auto;
}

.cursor-eraser {
  cursor: url("img/cursor-eraser.svg") 15 15, auto;
}

.cursor-spray {
  cursor: url("img/cursor-spray.svg") 5 0, auto;
}

/* ================================
   GLOBAL LINK STYLES
================================= */

a {
  color: var(--text-color);
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:visited {
  color: var(--text-color); /* pysyy samana – ei violetti */
}

a:hover {
  color: var(--muted-text);
}

a:active {
  color: var(--text-color);
}


/* ================================
   ENTRIES
================================= */

.entry {
  width: 96%;
  margin: 0 auto 40px;
  padding-bottom: 20px;
  border-bottom: var(--border-width) solid var(--border-color);
}

#entries {
  width: 96%;
  margin: 120px auto;
}

/* ====== FRONT PAGE GRID (3 columns, responsive) ====== */
#frontEntries {
  width: 96%;
  margin: 120px auto 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

/* Yksittäinen entry laatikkona etusivulla */
#frontEntries .entry {
  border-bottom: none;
  padding-bottom: 0;
}

/* Responsiivisuus: 2 palstaa keskikokoisille näytöille, 1 palsta mobiilissa */
@media (max-width: 1100px) {
  #frontEntries {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  #frontEntries {
    grid-template-columns: 1fr;
  }
}

#frontEntries .entry a img {
  display: block;
  width: 100%;
  height: auto;
}

#frontEntries .entry a {
  display: block;       /* ankkuri täsmälleen kuvan kokoinen */
  line-height: 0;       /* poistaa mahdollisen “näkymättömän” rivivälin */
}

.entry img {
  width: 100%;
  display: block;
  margin-bottom: 20px;
}

.entry p,
.entry small,
.entry a {
  margin: 0;
  color: var(--text-color);
  text-decoration: none;
  font: inherit;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.entry a:hover {
  color: var(--muted-text);
  text-decoration: none;
}

.entry small {
  color: var(--muted-text);
  display: block;
  margin-top: 4px;
  font-size: var(--small-text);
}

#loginNotice {
  text-align: center;
  font: inherit;
  color: var(--text-color);
}

/* ================================
   TYPOGRAPHY / LAYOUT
================================= */

h2 {
  width: 96%;
  font-weight: normal;
  font-size: var(--big-text);
}

h3 {
  width: 96%;
  font-weight: normal;
  font-size: var(--font-size);
}

.content {
  width: var(--content-width);
  max-width: 900px;
  margin: 120px auto;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .content {
    width: 94%;
    margin: 100px auto;
  }
}

/* ================================
   SIDEBAR LABELS
================================= */

.sidebar-label {
  position: absolute;
  right: 10px;            /* kuinka kaukana oikeasta reunasta */
  font-size: var(--small-text);
  color: var(--muted-text);
  font-family: var(--font-family);
  text-transform: uppercase;
  pointer-events: none;  /* ei estä klikkauksia taustalla */
  z-index: 40;
    transform: translateX(-10px);  /* siirtää sisäänpäin */

}

/* sijoitus pystysuunnassa */

#label-controls {
  top: 0px;   /* sama korkeus kuin controls-valikko alkaa */
}

#label-canvas {
  top: 75px;  /* arvioitu kohta missä canvas alkaa */
}

@media (max-width: 1080px) {
  .sidebar-label {
    display: none;
  }
}


/* ================================
   LOGIN / SIGNUP PAGES
================================= */

.auth-container {
  width: 300px;
  margin: 150px auto;
  text-align: left;
  font-size: var(--font-size);
}

.auth-container h1,
.auth-container label,
.auth-container input,
.auth-container p,
.auth-container a {
  font: inherit;
}

.auth-container input {
  width: 100%;
  padding: 8px;
  border: var(--border-width) solid #ccc;
  margin-top: 4px;
  box-sizing: border-box;
}

.auth-container a {
  color: var(--text-color);
  text-decoration: underline;
}

.auth-container img {
  display: block;
  margin: 0 auto 10px auto;
  width: 100px;
  height: auto;
}

/* --- SPRAY SLIDER CUSTOMIZATION --- */
.slider-container input[type="range"] {
  -webkit-appearance: none;
  width: 200px;
  height: 14px; /* paksumpi track */
  background:  var(--muted-text); /* harmaa taustarata */
  border-radius: 10px;
  outline: none;
  margin: 10px 0;
}

@media (max-width: 900px) {
.slider-container input[type="range"] {
  width: 140px;
}
}

/* --- Track (Chrome, Edge) --- */
.slider-container input[type="range"]::-webkit-slider-runnable-track {
  height: 14px;
  background: var(--muted-text);
  border-radius: 10px;
}

/* --- Thumb/pallo (Chrome, Edge) --- */
.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border: var(--border-width) solid var(--border-color);
  background: var(--bg-color); /* taustavärisi */
  border-radius: 50%;             /* ympyrä */
  margin-top: -8px;               /* keskitys trackilla */
  cursor: pointer;
}

/* --- Firefox --- */
.slider-container input[type="range"]::-moz-range-track {
  height: 30px;
  background: var(--bg-color); /* taustavärisi */
  border-radius: 10px;
}

.slider-container input[type="range"]::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: var(--border-width) solid var(--border-color);
  background: var(--bg-color); /* taustavärisi */
  border-radius: 50%;
  cursor: pointer;
}
