html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.header, .topControls, .bottomControls, .toolTips {
    flex-shrink: 0; 
}

:root {
    --bgColour: beige;
    --textColour: #000000;
    --canvasBg: #ffffff; 
    --canvasBorder: #ab7d33;
    --sliderColour: #feda58;
}

body.darkMode {
    --bgColour: #1b1c2e;
    --textColour: #eeeeee;
    --canvasBg: #888888;
    --canvasBorder: #aaa6ff;
    --sliderColour: #5d33c9; 
}

body {
    background-color: var(--bgColour);
    color: var(--textColour);
    transition: background-color 0.3s ease, color 0.3s ease; 
    padding: 1.25em;
    display: flex;
    flex-direction: column;
}

#canvas {
    background-color: var(--canvasBg);
    border-style: solid;
    border-width: 0.3125em;
    border-color: var(--canvasBorder);
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

* {
    image-rendering: pixelated;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25em;
    width: 100%;
    max-width: 62.5em;
    margin: 0 auto;
    height: 100%;
}

.header {
    text-align: center;
    padding: 0.625em;
    background-color: transparent;
    border-color: transparent;
}

.topControls {
    display: flex;
    width: 100%;
    align-items: center;
}

.control {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.625em;
}

.topLeft {
    justify-content: flex-start;
}

.topCenter {
    justify-content: center;
    gap: 1.25em;
}

.topRight {
    justify-content: flex-end;
}

input[type="color"].color-picker {
    width: 2.75em;
    height: 2.75em;
    cursor: pointer;
    background: none;
}

input[type="range"].opacity-range {
    width: 6.25em;
    cursor: pointer;
}

.canvasArea {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-grow: 1;
    flex-shrink: 1;
    min-height: 0;
}

.bottomControls {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.bottomCenter {
    flex-grow: 1;
    text-align: center;
}

.bottomRight {
    display: flex;
    gap: 0.625em;
}

.iconButton {
    width: 2.75em;
    height: 2.75em;
    background-color: white;
    cursor: pointer;
}

.iconButton:active {
    filter: brightness(0.5);
}

.iconButton img {
  width: 100%;
  height: 100%;
  object-fit: contain; 
  display: block;
  pointer-events: none; 
}

.iconButton.toggled {
    filter: brightness(0.6);
    box-shadow: inset 0 0 0.3125em rgba(0,0,0,0.5);
}

.sliderGroup {
  display: flex;
  flex-direction: column;
  gap: 0.625em;
  justify-content: center;
}

.sliderContainer {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.sliderContainer label {
    font-size: 0.875em;
    font-weight: bold;
    color: var(--textColour);
    width: 3.75em;
}

.slider {
  width: 7.5em;
  accent-color: var(--sliderColour);
  cursor: pointer;
}