:root {
    --font-heading: 'Verdana', sans-serif;
    --font-body: 'Times New Roman', serif;
    --font-code: 'lucida console', monospace;
	--font-handwritten: 'Brush Script MT', cursive;
    --color-paper: #FDFCEB;
    --color-ink: #222;
    --color-yellow: #FEF3B6;
    --color-pink: #FAE1EE;
    --color-blue: #D1EAF9;
    --color-green: #D1F9E3;
    --color-purple: #E8DFF5;
    --color-homework-bg: #E8F8F5;
    --color-crt-bg: #2c3e50;
    --color-crt-text: #F9D648;
    --color-code-keyword: #58D68D; 
    --color-code-string: #EC7063; 
    --color-code-number: #5DADE2; 
	--size-code:1.0rem;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-paper);
    color: var(--color-ink);
    line-height: 1.4;
	font-size:1.25rem;
    margin: 0;
    padding: 1.5rem;
}


.main-content {
    max-width: 800px;
    margin: 2rem auto;
}

h1 {
    font-family: var(--font-header);
    font-size: 3.5rem;
    text-align: center;
    color: #E74C3C;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.2);
    margin-bottom: 3rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.page-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    color: #E74C3C;
    text-shadow: 2px 2px 0px #000;
}


.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    align-items: start;
}


.panel {
    border: 3px solid var(--color-ink);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.5);

    transform: rotate(calc(var(--rotate, 0) * 1deg));
    position: relative; 
}


.panel.yellow { background-color: var(--color-yellow); }
.panel.pink { background-color: var(--color-pink); }
.panel.blue { background-color: var(--color-blue); }
.panel.green { background-color: var(--color-green); }
.panel.purple { background-color: var(--color-purple); }

.panel.full-width {
    grid-column: 1 / -1;
}

.panel-header {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.75rem;
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--color-ink);
    padding-bottom: 0.5rem;
}


.code-listing {
    font-family: var(--font-code);
    background-color: var(--color-crt-bg);
    color: white;
    padding: 1rem 0;
    border-radius: 8px;
    border: 3px solid var(--color-ink);
    overflow-x: auto;
	padding-top:24px;
    font-size: var(--size-code);
    position: relative; 
}
.minicode {
    overflow-y: auto;
	height:240px;
}


.copy-code-btn {
    position: absolute;
    top: -2px;
    right: 90px;
	width: 88px;
    font-family: var(--font-code);
    font-size: 0.9rem;
    background-color: var(--color-yellow);
    color: var(--color-ink);
    border: 2px solid var(--color-ink);
    border-radius: 5px;
    padding: 2px 8px;
    cursor: pointer;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    transition: all 0.1s ease-in-out;
}

.copy-code-btn:hover {
    background-color: #fff;
}

.copy-code-btn:active {
    box-shadow: none;
    transform: translate(2px, 2px);
}

.copy-code-btn.copied {
    background-color: var(--color-code-keyword);
    color: #fff;
}


.jse-code-btn {
    position: absolute;
    top: -2px;
    right: -2px;
	width:88px;
    font-family: var(--font-code);
    font-size: 0.9rem;
    background-color: var(--color-yellow);
    color: var(--color-ink);
    border: 2px solid var(--color-ink);
    border-radius: 5px;
    padding: 2px 8px;
    cursor: pointer;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    transition: all 0.1s ease-in-out;
}

.jse-code-btn:hover {
    background-color: #fff;
}

.jse-code-btn:active {
    box-shadow: none;
    transform: translate(2px, 2px);
}

.jse-code-btn.copied {
    background-color: var(--color-code-keyword);
    color: #fff;
}


.code-listing pre {
    margin: 0;
}

.code-listing code .line {
    display: flex;
    padding: 0 1rem;
    line-height: 1.5;
}

.code-listing .line-num {
    display: inline-block;
    width: 4ch;
    margin-right: 1.5rem;
    text-align: right;
    color: #7f8c8d;
    flex-shrink: 0;
}

.code-listing .code-text {
    color: var(--color-crt-text); 
    text-shadow: 0 0 5px rgba(249, 214, 72, 0.5); 
}


.code-listing .code-keyword { color: var(--color-code-keyword); }
.code-listing .code-string { color: var(--color-code-string); }
.code-listing .code-number { color: var(--color-code-number); }


.character-spot {
    position: relative;
    margin-top: 1.5rem;
    min-height: 150px;
}

.character-spot .character-element {
    width: 120px;
    height: auto;
    position: absolute;
    bottom: -48px;
    left: -32px;
    filter: drop-shadow(3px 3px 0px rgba(0,0,0,0.4));
    transition: transform 0.2s ease; 
}


.character-spot.flipped .character-element {
    left: auto;
    right: -32px;
    transform: scaleX(-1); 
	filter: drop-shadow(-3px 3px 0px rgba(0,0,0,0.4));	
}

.character-spot .character-element.sprite-char {
    width: 160px;
    height: 160px;
}


.sprite-char {
    width: 160px;
    height: 160px;
    background-image: url('greenie.webp');
    background-repeat: no-repeat;
    background-size: 640px 640px; 
	
}

.sprite-pos-0 { background-position: 0 0; }
.sprite-pos-1 { background-position: -160px 0; }
.sprite-pos-2 { background-position: -320px 0; }
.sprite-pos-3 { background-position: -480px 0; }

.sprite-pos-4 { background-position: 0 -160px; }
.sprite-pos-5 { background-position: -160px -160px; }
.sprite-pos-6 { background-position: -320px -160px; }
.sprite-pos-7 { background-position: -480px -160px; }

.sprite-pos-8 { background-position: 0 -320px; }
.sprite-pos-9 { background-position: -160px -320px; }
.sprite-pos-10 { background-position: -320px -320px; }
.sprite-pos-11 { background-position: -480px -320px; }

.sprite-pos-12 { background-position: 0 -480px; }
.sprite-pos-13 { background-position: -160px -480px; }
.sprite-pos-14 { background-position: -320px -480px; }
.sprite-pos-15 { background-position: -480px -480px; }

.character-spot .character-element.robot { fill: #d0d3d4; }


.speech-bubble {
    position: relative;
    background: white;
    border-radius: .4em;
    padding: 1em;
    border: 3px solid var(--color-ink);
    margin-left: 120px;margin-bottom:32px;
    font-style: italic;
}

.character-spot.flipped .speech-bubble {
    margin-left: 0;
    margin-right: 120px;
}

.speech-bubble:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 0;
    height: 0;
    border: 20px solid transparent;
    border-top-color: var(--color-ink);
    border-bottom: 0;
    border-left: 0;
    margin-left: -10px;
    margin-bottom: -23px;
}

.character-spot.flipped .speech-bubble:after {
    left: auto;
    right: 5%;
    border-right: 0;
    border-left: 20px solid transparent;
    margin-left: 0;
    margin-right: -10px;
}

.crt-screen {
    background: #222;
    padding: 1.5rem;
    border-radius: 15px;
    border: 3px solid var(--color-ink);
}
.crt-screen-inner {
    background: var(--color-crt-bg);
    border: 2px solid #111;
    padding: 1rem;
    height: 150px;
    border-radius: 5px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
    overflow-x: auto; 
}
.crt-screen-inner pre {
    margin: 0;
    color: #50E3C2; 
    font-family: var(--font-code);
    font-size: var(--size-code);
    text-shadow: 0 0 5px rgba(80, 227, 194, 0.5);
}


.taped-note {
    background: #fff;
    padding: 1rem;
    border: 1px dashed #999;
    transform: rotate(-2deg);
    box-shadow: 3px 3px 5px rgba(0,0,0,0.2);
    position: relative;
    margin: 1.5rem 0;
}


.taped-note::before, .taped-note::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 25px;
    background-color: rgba(254, 243, 182, 0.6); 
    border-left: 1px dashed rgba(0,0,0,0.2);
    border-right: 1px dashed rgba(0,0,0,0.2);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.taped-note::before {
    top: -15px;
    left: 30%;
    transform: rotate(-5deg);
}

.taped-note::after {
    bottom: -15px;
    right: 30%;
    transform: rotate(8deg);
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 4rem;
    color: var(--color-ink);
    line-height: 1;
    background-color: white;
    border: 3px solid var(--color-ink);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.highlight {
    background-color: var(--color-yellow);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

.highlightcmd {
	font-family: var(--font-code);
	font-weight:bold;
    background-color: var(--color-yellow);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}


.key-points {
    background: white;
    border: 3px solid var(--color-ink);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
}
.key-points h3 {
    font-family: var(--font-heading);
    font-weight: 900;
    margin-top: 0;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--color-ink);
    padding-bottom: 0.25rem;
    margin-bottom: 0.75rem;
}


.panel-screenshot {
    width: 100%;
    height: auto; 
    border-radius: 8px;
    border: none;
    margin-top: 1rem;
	margin-bottom: -1.5rem;
}

.dotted-line {
  border: none;              /* Remove default border */
  border-top: 3px dashed var(--color-ink); /* Set thickness, style, and color */
  margin: 8px 0;            /* Add some spacing (optional) */
}

.panel-homework {
    background-color: var(--color-homework-bg);
    border: 3px dashed var(--color-ink);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 3rem;
    position: relative;
    padding-top: 2rem;
}
.panel-homework::before {
    content: 'Why not try...';
    font-family: var(--font-handwritten);
    font-size: 2.5rem;
    color: var(--color-ink);
    position: absolute;
    top: -50px;
    left: 20px;
    transform: rotate(-5deg);
    background-color: var(--color-yellow);
    padding: 0 10px;
    border: 3px solid var(--color-ink);
    border-radius: 5px;
}

/* --- NEW: Navigation Styles --- */
.navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 3px dashed var(--color-ink-light);
}

.nav-button {
    font-family: var(--font-header);
    font-size: 1.5rem;
    color: var(--color-ink);
    background-color: #fff;
    border: 3px solid var(--color-ink);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
    transition: all 0.1s ease-in-out;
}
.nav-button:hover {
    background-color: var(--color-yellow);
}
.nav-button:active {
    box-shadow: none;
    transform: translate(4px, 4px);
}


.nav-opt {
    font-family: var(--font-header);
    font-size: 1.5rem;
    color: var(--color-ink);
    background-color: #fff;
    border: 3px solid var(--color-ink);
    padding: 0.25rem 0.25rem;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
    transition: all 0.1s ease-in-out;
	display:inline-block;
	width:95%;
}
.nav-opt-b {
    font-family: var(--font-header);
    font-size: 1.5rem;
    color: var(--color-ink);
    background-color: var(--color-blue);
    border: 3px solid var(--color-ink);
    padding: 0.25rem 0.25rem;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
    transition: all 0.1s ease-in-out;
	display:inline-block;
	width:95%;
	
}
.nav-opt:hover {
    background-color: var(--color-yellow);
}

.nav-day-counter {
    color: var(--color-ink-light);
	font-family: var(--font-header); font-size: 1.5rem; padding: 0.75rem 1.5rem;
}