@font-face {
    font-family: 'Roboto';
    src: url('/fonts/Roboto-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Courier Prime';
    src: url('/fonts/CourierPrime-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'OpenSans';
    src: url('/fonts/OpenSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'MuseoModerno';
    src: url('/fonts/MuseoModerno-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'CrimsonPro';
    src: url('/fonts/CrimsonPro-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('/fonts/BricolageGrotesque-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Lato';
    src: url('/fonts/Lato-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'EBGaramond';
    src: url('/fonts/EBGaramond-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

@font-face {
    font-family: 'Raleway';
    src: url('/fonts/Raleway-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/fonts/Montserrat-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}




/* =========================================================
   MUICSS
   ========================================================= */


.mui-textfield {
    overflow: visible;
    min-height: 65px;
}

.mui-textfield > label {
    display: block;
    position: static;
    margin: 8px 0 12px;
    font-size: 16px;
    line-height: 1.5;
}

.mui-textfield input[type="color"] {
    display:block;
	width:100%;
	height:42px;
	margin-top:6px;
	cursor:pointer;
}

.mui-select > label {
	font-size: 16px;
}

.mui-btn {
	font-size: 24px;
}

.mui-btn.font-case-btn {
    text-transform: none !important;
}

.mui-btn.purple {
	background: #7e57c2;
}

.mui-btn.unlock {
	font-size: 16px;
}

.mui-btn.unlock.purple {
	background: #7e57c2;
}


/* =========================================================
   LICENSE INFO
   ========================================================= */


.license-info {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    background: #f7f7fc;
    border: 1px solid #1434a4;
    border-left: 10px solid #1434a4;
    border-radius: 16px;
    color: #1434a4;
    font-size: 1.1rem;
    line-height: 0.8;
}

.license-info.purple {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    background: #f7f7fc;
    border: 1px solid #7f00ff;
    border-left: 10px solid #7f00ff;
    border-radius: 16px;
    color: #7f00ff;
    font-size: 1.1rem;
    line-height: 0.8;
}

.license-info strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}

.license-info div {
    overflow-wrap: anywhere;
}

.license-info div:last-child {
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

.license-time-info {
    margin-top: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.license-time-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 4px;
}

.license-time-label {
	font-size: 1rem;
    font-weight: 600;
    color: #1434a4;
}

.license-time-label.purple {
	font-size: 1rem;
    font-weight: 600;
    color: #7f00ff;
}

.local-time {
	font-size: 1rem;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.license-time-note {
    margin-top: 6px;
    color: #666;
    font-size: 1rem !important;
    font-style: italic;
}


/* =========================================================
   DOWNLOAD LINKS
   ========================================================= */

.download-link {
    border: none;
    background: none;
    padding: 0;
    color: #1434a4;
    cursor: pointer;
    font-size: 16px;
	font-weight: bold;
}

.download-link.purple {
    border: none;
    background: none;
    padding: 0;
    color: #7f00ff;
    cursor: pointer;
    font-size: 16px;
	font-weight: bold;
}

.download-link:hover {
    color: #244FD1;
}

.download-link.purple a:hover {
    color: #7f00ff;
}

/* =========================================================
   PUZZLE ACCESS
   ========================================================= */

.puzzle-access {
    max-width: 600px;
    margin: 30px auto;
    padding: 28px;
    background: #c5cef3;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

.puzzle-access.blue2 {
	background: #b8c8f5;
	border-radius: 48px;
}

.puzzle-access.purple {
	background: #d0c5f3;
}

.puzzle-access.purple2 {
	background: #c9c4ee;
	border-radius: 48px;
}

.puzzle-access__intro h3 {
    margin: 0 0 18px;
    font-size: 24px;
    font-weight: 600;
}

.puzzle-access__intro p {
    margin: 8px 0;
    color: #555;
    font-size: 16px;
}

.puzzle-access__premium {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #eee;
}

.puzzle-access__premium p {
    margin: 0 0 12px;
    font-weight: 600;
}

.puzzle-access__description {
    font-size: 16px;
	color: #555;
}

.puzzle-access__purchase {
    margin: 1.25rem 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.puzzle-access__purchase.note {
	font-size: 0.85rem;
	color: #555;
    line-height: 1.7;
}

.purchase-details summary {
    color: #444;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
}

.purchase-details.blue summary:hover {
    color: #1434a4;
}

.purchase-details.blue summary::marker {
    color: #1434a4;
}

.purchase-details.purple summary:hover {
    color: #7f00ff;
}

.purchase-details.purple summary::marker {
    color: #7f00ff;
}

.purchase-comparison {
    width: 100%;
    margin-top: 0.75rem;
    border-collapse: collapse;
    text-align: left;
}

.purchase-comparison th {
    color: #555;
    font-weight: 700;
    border-bottom: 2px solid #d8d2eb;
}

.purchase-comparison th,
.purchase-comparison td {
    padding: 0.6rem 0.75rem;
    vertical-align: top;
}

.purchase-comparison td {
    border-bottom: 1px solid #e8e8ef;
}

.purchase-comparison tbody tr:last-child td {
    border-bottom: none;
}

.purchase-comparison.blue a {
    color: #1434a4;
    font-weight: 600;
    text-decoration: underline;
}

.purchase-comparison.purple a {
    color: #7f00ff;
    font-weight: 600;
    text-decoration: underline;
}

.purchase-comparison.blue a:hover {
    color: #244FD1;
    text-decoration: underline;
}

.purchase-comparison.purple a:hover {
    color: #7f00ff;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .purchase-comparison th,
    .purchase-comparison td {
        padding: 0.5rem 0.35rem;
        font-size: 0.82rem;
    }
}




/* =========================================================
   PUZZLE FORM
   ========================================================= */

.puzzle-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.puzzle-form input {
    flex: 1;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 18px;
}

.puzzle-form input:focus {
    outline: none;
    border-color: #555;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.puzzle-form button {
    height: 48px;
    padding: 0 20px;
    border-radius: 8px;
    white-space: nowrap;
}


/* =========================================================
   WORD BUILDER
   ========================================================= */


.letter-tile.highlight-tile {
    background-color: #1434A4;
    color: #ffffff;
    border-color: #1434A4;
}

.letter-tile.highlight-tile.selected {
    background-color: #7F00FF;
    border-color: #7F00FF;
    color: #ffffff;
}


.scramble-letters .letter-tile.highlight-tile,
.scramble-letters .letter-tile.highlight-tile:hover,
.scramble-letters .letter-tile.highlight-tile:focus,
.scramble-letters .letter-tile.highlight-tile:active,
.scramble-letters .letter-tile.highlight-tile.selected {
    background-color: #1434A4 !important;
    border-color: #1434A4 !important;
    color: #ffffff !important;
}



/* =========================================================
   WORD SCRAMBLE
   ========================================================= */

.scramble-letters {
    display: flex;
	align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 20px;
}

.scramble-number {
    width: 30px;
    text-align: right;
    margin-right: 20px;
}

.letter-tile {
    max-width: 40px;
    height: 48px;
    padding: 0 12px;
    border: 2px solid #1976d2;
    border-radius: 5px;
    background: #e3f2fd;
    box-sizing: border-box;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;

    cursor: pointer;
}

.letter-tile:hover {
    border-color: #0d47a1;
    background: #bbdefb;
    color: #0d47a1;
}

.letter-tile.selected {
    border-color: #0d47a1;
    background: #1976d2;
    color: #fff;
}


/* =========================================================
   SENTENCE SCRAMBLE
   ========================================================= */

.scramble-words {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 100%;
}

.scramble-translation {
	margin-top: 0;
	margin-bottom: 20px;
	line-height: 1.5;
}

.word-tile {
    width: 100%;
    height: 48px;
    padding: 0 6px;

    border: 2px solid #d0c5f3;
    border-radius: 5px;
    background: #e5dcf9;
    box-sizing: border-box;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 18px;
    font-weight: bold;
    text-transform: none;
    white-space: wrap;

    cursor: pointer;
}

.word-tile:hover {
    border-color: #7e57c2;
    background: #e0d6f7;
    color: #7f00ff;
}

.word-tile.selected {
    border-color: #7f00ff;
    background: #7f00ff;
    color: #fff;
}

.word-tile.training-selected {
	background-color: #f0ad4e;
	color: #fff;
}

.word-tile.training-correct {
	background-color: #5cb85c;
	color: #fff;
}

.word-tile.training-inactive {
	opacity: 0.5;
	cursor: default;
}


/* =========================================================
   WORD LADDER
   ========================================================= */

[id^="word-selected-"] {
    padding: 2px 4px;
    background: #c5cef3;
    font-weight: bold;
}

.word-ladder-puzzle {
    margin-bottom: 40px;
}

.word-ladder-rows {
    margin: 15px 0;
}

.word-ladder-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 12px 0;
}


/* Current word */

.word-display {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
    min-width: 0;
}


/* Fixed letters */

.fixed-letter {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    min-width: 40px;
    height: 42px;
    padding: 0;

    border: 2px solid #ccc;
    border-radius: 4px;
    background: #f5f5f5;
    box-sizing: border-box;

    color: #333;
    font-size: 25px;
    font-weight: bold;
    text-transform: uppercase;
}


/* Clickable letters */

.letter-btn {
    width: 38px;
    min-width: 38px;
    height: 42px;
    padding: 0;

    border: 2px solid #1976d2;
    border-radius: 4px;
    background: #e3f2fd;
    box-sizing: border-box;

    color: #1976d2;
    font-size: 21px;
    font-weight: bold;
    text-transform: uppercase;

    cursor: pointer;
}

.letter-btn:hover {
    border-color: #0d47a1;
    background: #bbdefb;
    color: #0d47a1;
}

.letter-btn.selected {
    border-color: #0d47a1;
    background: #1976d2;
    color: #fff;
}

.letter-btn.wrong {
    border: 2px solid #d32f2f;
    background: #ffebee;
	color: #ff0000;
}


/* Replacement choices */

.word-ladder-choices {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-left: 12px;
    padding-left: 12px;

    border-left: 2px solid #ccc;
    flex-shrink: 0;
}

.letter-choice {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;

    border: 2px solid #1976d2;
    border-radius: 4px;
    background: #e3f2fd;
    box-sizing: border-box;

    color: #1976d2;
    font-size: 25px;
    font-weight: bold;
    text-transform: uppercase;

    cursor: pointer;
}

.letter-choice:hover {
    border-color: #0d47a1;
    background: #bbdefb;
    color: #0d47a1;
}

.letter-choice.used {
    opacity: 0.4;
}


/* Start and finish words */

.fixed-word {
    display: flex;
    gap: 3px;
    margin: 15px 0;
}




.number-pad {
	max-width: 460px;
	margin: 30px auto;
	display: grid;
	grid-template-columns: repeat(3, 110px);
	gap: 10px;
	justify-content: center;
}


/* =========================
   SECRET NUMBER
   ========================= */

.secret-number-field {
	grid-column: 1 / 4;
	margin-bottom: 0;
}

.secret-number-field .mui-textfield {
	margin: 0;
}

.secret-number-field input {
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	font-size: 32px;
	letter-spacing: 6px;
}

.secret-number-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 20px auto 0;
}

.secret-number-keyboard .number-btn,
.secret-number-keyboard .action-btn {
    width: 100%;
    max-height: 40px;
    margin: 0;
}



/* =========================
   GUESS RESULT
   ========================= */

.guess-result {
	grid-column: 1 / 4;
	min-height: 28px;
	margin: 0;
	text-align: center;
	font-size: 20px;
	font-weight: 600;
}


/* =========================
   ATTEMPTS
   ========================= */

.guess-attempts {
	grid-column: 1 / 4;
	margin: -2px 0 8px;
	text-align: center;
	font-size: 16px;
}


/* =========================
   ALL BUTTONS
   ========================= */

.number-btn,
.action-btn,
.digit-btn {
	width: 110px !important;
	height: 52px !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box;
	display: block;
}


/* =========================
   NUMBER BUTTONS
   ========================= */

.number-btn,
.number-btn.selected {
    font-size: 24px;
    font-weight: 500;

    border: 2px solid #1976d2 !important;
    border-radius: 4px;
    background: #e3f2fd !important;
    box-sizing: border-box;
}

.number-btn:hover {
    border-color: #0d47a1;
    background: #bbdefb;
    color: #0d47a1;
}




/* =========================
   ACTION BUTTONS
   ========================= */

.action-btn {
	font-size: 16px;
}


/* =========================
   DIGIT BUTTONS
   ========================= */

.digit-actions {
	grid-column: 1 / 4;
	display: flex;
	flex-direction: row;
	gap: 10px;
	justify-content: center;
	align-items: center;
	margin-top: 18px;
	padding-top: 18px;
}

.digit-actions button {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.digit-actions .action-btn {
	width: 110px !important;
	min-width: 110px !important;
	max-width: 110px !important;
	height: 42px;
	margin: 0;
	padding-left: 0;
	padding-right: 0;
	box-sizing: border-box;
	text-align: center;
}




/* =========================================================
   SUM GRID
   ========================================================= */


.number-grid1 {
    display: grid;
    grid-template-columns: repeat(3, 90px);
    gap: 10px;
    justify-content: center;
    margin: 30px auto;
}

.number-grid2 {
    display: grid;
    grid-template-columns: 70px repeat(3, 90px);
    gap: 10px;
    width: max-content;
    margin: 30px auto;
    align-items: center;
}

.number-cell1,
.number-cell2,
.grid-answer {
	width: 90px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	font-size: 24px;
}

.number-cell1 {
	border: 1px solid #1976d2;
	background: #e3f2fd;
	cursor: pointer;
}

.number-cell2 {
	border: 1px solid #ccc;
	background: #fff;
	cursor: pointer;
}

.grid-answer {
	font-size: 22px;
	font-weight: 600;
}

.grid-answer.hidden {
	visibility: hidden;
}

.number-cell1.selected {
	border-color: #0d47a1;
	background: #1976d2;
	color: #fff;
}

.number-cell2:disabled {
	cursor: default;
	opacity: 1;
}







/* =========================================================
   ACHIEVEMENTS
   ========================================================= */

.achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.achievement-button {
    position: relative;

    display: inline-flex;
    align-items: center;

    padding: 8px 12px;
    border-radius: 20px;
    background: #f1f3f4;

    color: #333;
    font-size: 14px;
    font-weight: 600;

    cursor: help;
}


/* Achievement tooltip */

.achievement-button::after {
    content: attr(data-tooltip);

    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 100;

    padding: 6px 10px;
    border-radius: 5px;
    background: #333;

    color: #fff;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateX(-50%);
    transition: opacity 0.2s ease;
}

.achievement-button:hover::after {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   PUZZLE GRIDS
   ========================================================= */

.puzzle {
    font-size: 24px;
    font-weight: 600;
}

.puzzle-section {
    margin-bottom: 40px;
}

.puzzle-section-title {
    margin: 0 0 16px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.puzzle-section-subtitle {
    margin: -8px 0 20px;
    color: #777;
    font-size: 14px;
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.puzzle-grid.blue a:hover {
	color: #1434a4;
}

.puzzle-grid.purple a:hover {
	color: #7f00ff;
}

.puzzle-card {
    display: flex;
    align-items: center;

    min-height: 58px;
    padding: 0 18px;

    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #d6dcf7;
    box-sizing: border-box;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.puzzle-card.free.purple,
.puzzle-card.premium.purple {
	background: #e0d6f7;
}

.puzzle-card a {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 58px;

    color: #333;
    font-weight: 500;
    text-decoration: none;
}

.puzzle-name {
    flex: 1;
}

.puzzle-arrow {
    margin-left: 10px;
    color: #aaa;
    font-size: 18px;
}

.puzzle-card.locked {
    background: #dce2f9;
    color: #777;
}

.puzzle-card.locked.purple {
    background: #e5dcf9;
    color: #777;
}

.puzzle-card.locked .puzzle-name {
    color: #666;
}

.puzzle-card.premium:hover {
    border-color: #bbb;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}




/* =========================================================
   SECRET WORD
   ========================================================= */


.secret-word-keyboard {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 20px auto 0;
}

.secret-word-keyboard .letter-btn {
    width: 100%;
	min-width: 40px;
    min-height: 40px;
    margin: 0;
}

.secret-word-display {
    font-size: 34px;
    font-weight: bold;
	color: #1434a4;
    letter-spacing: 2px;
    margin: 20px 0;
}

.secret-word-incorrect-guess {
	font-size: 20px;
    font-weight: bold;
	color: #1434a4;
    margin: 20px 0;
}


/* =========================================================
   KANJI CHALLENGE
   ========================================================= */

.kanji-challenge-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

.kanji-challenge-number {
	flex-shrink: 0;
	font-size: 24px;
	min-width: 32px;
}

.kanji-challenge-kanji {
	font-size: 32px;
	flex-shrink: 0;
}

.kanji-challenge-choices {
    flex-basis: 100%;
    display: flex;
    gap: 12px;
    width: 100%;
}

.kanji-challenge-choices .kanji-choice-button {
	flex: 1;
    min-width: 0;
	background: #e0d6f7;	
	font-size: 22px;
	padding: 10px 18px;
	cursor: pointer;
}

.kanji-choice-button:hover {
	background: #7f00ff;
	color: #fff;
}


/* =========================================================
  A-Z QUIZ
   ========================================================= */

.a-z-quiz-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

.a-z-quiz-number-and-question {
	font-size: 24px;
	min-width: 32px;
}

.answer-choice-button {
	width: 100%;
	background: #e0d6f7;
	font-size: 22px;
	padding: 10px 18px;
	cursor: pointer;
	box-sizing: border-box;
}

.answer-choice-button:hover {
	background: #7f00ff;
	color: #fff;
}



/* =========================================================
   VISUALIZATION TOOLS
   ========================================================= */


.font-case-btn {
    background-color: #fff;
    color: #1434A4;
    border: 1px solid #1434A4;
    min-width: 55px;
}

.font-case-btn.selected {
    background-color: #1434A4;
    color: #fff;
    border-color: #1434A4;
}


/* ---------------------------------
   Font Options
--------------------------------- */

#fontOptions {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

#fontOptions.open {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.font-option {
    width: 100%;
    min-width: 0;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid #d0c5f3;
    border-radius: 4px;
    background: #f5f2fc;
    color: #1434A4;
	font-size: 16px;
    cursor: pointer;
}

.font-option.purple {
    width: 100%;
    min-width: 0;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid #d0c5f3;
    border-radius: 4px;
    background: #f5f2fc;
    color: #7f00ff;
    cursor: pointer;
}

.font-option.active {
    background: #1434A4;
    color: #ffffff;
    border-color: #1434A4;
}

.font-option.active.purple {
    background: #7f00ff;
    color: #ffffff;
    border-color: #7f00ff;
}


.font-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.font-options-grid .font-option {
    min-width: 0;
    white-space: normal;
    padding: 10px 6px;
}

/* ---------------------------------
   Template Options
--------------------------------- */

#templateOptions {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

#templateOptions.open {
    display: grid !important;
}

.template-option {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid #d0c5f3;
    border-radius: 4px;
    background: #f5f2fc;
    color: #1434A4;
    cursor: pointer;
}

.template-option.purple {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid #d0c5f3;
    border-radius: 4px;
    background: #f5f2fc;
    color: #7f00ff;
    cursor: pointer;
}

.template-option.active {
    background: #1434A4;
    color: #ffffff;
    border-color: #1434A4;
}

.template-option.active.purple {
    background: #7f00ff;
    color: #ffffff;
    border-color: #7f00ff;
}


/* ---------------------------------
   Color Palette Options
--------------------------------- */

.palette-preset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin: 10px 0 20px;
    box-sizing: border-box;
}

.palette-preset-grid > button {
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
	font-size: 16px;
}

/* Background Color */
.background-color {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
}

.background-color.active {
    border: 3px solid #1434A4 !important;
}

/* Text Color Palette */
.palette-option.active {
    border: 4px solid #fff !important;
}

#paletteOptions {
    display: none;
}

#paletteOptions.open {
    display: grid !important;
    grid-template-columns: repeat(2, 180px);
    gap: 8px;
}


/* =========================================================
   GENERAL
   ========================================================= */

body {
    padding-top: 60px;
    background: #e6e6fa;
}

body a {
    color: #2c3e50;
    font-weight: bold;
    text-decoration: none;
}

body a:hover {
    color: #7f00ff;
    font-weight: bold;
    text-decoration: none;
}

p,
li,
th,
td {
    font-size: 16px;
}

small {
    font-size: 14px;
}

#small {
	font-size: 14px;
}

#largeprint {
    font-size: 24px;
}

#target {
	color: #555;
    font-size: 20px;
}

#bg {
    padding: 40px;
    background: #cbc3e3;
}

#font_entry {
    font-size: 16px;
}

#font_backto {
    font-size: 14px;
}

#error_status {
    color: #1434a4;
    font-size: 50px;
    font-weight: bold;
}

#error_description {
    font-size: 20px;
    font-style: italic;
}

footer {
    padding: 20px;
}

.font_footer {
    font-size: 14px;
}

.instructions {
	color: #555;
	font-size: 18px;
}

.arrow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 50px;
    height: 50px;

    font-size: 28px;
    line-height: 1;
}

.target-selector {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.target-selector label {
	font-size: 20px;
	color: #555;
	margin: 0;
}



/* =========================================================
   IMAGE RESIZER
   ========================================================= */

.resizer-panel {
	max-width: 650px;
	margin: auto;
	padding: 30px;
	background: #ffffff;
	border-radius: 8px;
}

.preview-container {
	margin-top: 20px;
	text-align: center;
}

#image-preview {
	max-width: 100%;
	max-height: 300px;
	display: none;
	margin: 15px auto;
	border-radius: 5px;
}

.resize-options {
	margin-top: 25px;
}

.custom-fields {
	display: none;
	margin-top: 20px;
}

.dimension-row {
	display: flex;
	gap: 15px;
}

.dimension-row > div {
	flex: 1;
	min-width: 0;
}

.submit-button {
	margin-top: 25px;
	background: #1434a4;
	color: #ffffff;
}

.submit-button:hover {
	background: #7f00ff;
}

.help-text {
	color: #777777;
	font-size: 13px;
}


/* =========================================================
   IMAGE CONVERTER/RESIZER/WATERMARKER
   ========================================================= */

.tool-container {
	max-width: 650px;
	margin: 50px auto;
	padding: 20px;
}

.tool-card {
	padding: 30px;
	border-radius: 10px;
	box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

.upload-area {
	border: 2px dashed #ccc;
	border-radius: 8px;
	padding: 30px 15px;
	text-align: center;
	margin: 25px 0;
	background: #e0d6f7;
}

.upload-area input {
	max-width: 100%;
}

.format-description {
	color: #777;
	font-size: 13px;
	margin-top: 12px;
}

.error-message {
	background: #fff0f0;
	color: #a33;
	padding: 12px;
	border-radius: 5px;
	margin-bottom: 20px;
}

.format-section {
	margin-top: 25px;
}

.format-section label {
	font-weight: 600;
}

.watermark-position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.watermark-position-option {
    cursor: pointer;
    margin: 0;
}

.watermark-position-option input {
    display: none;
}

.watermark-position-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 22px;
    color: #7e57c2;
    background: #e5dcf9;
    transition: all 0.2s ease;
}

.watermark-position-option input:checked + span {
    background: #7e57c2;
    color: #fff;
    border-color: #7e57c2;
}

.watermark-position-option:hover span {
    border-color: #7f00ff;
}

#opacity {
    width: 100%;
    cursor: pointer;
}

#text_color {
    width: 60px;
    height: 38px;
    padding: 3px;
    cursor: pointer;
}

@media(max-width: 600px) {

	.tool-container {
		margin: 15px auto;
		padding: 10px;
	}

	.tool-card {
		padding: 20px;
	}

}





/* =========================================================
   LEGAL
   ========================================================= */


.legal-policy {
	margin-bottom: 1.5rem;
}

.legal-policy > summary {
	cursor: pointer;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.4;
	padding: 0.5rem 0;
}

.legal-policy > summary:focus-visible {
	outline: 2px solid #1434a4;
	outline-offset: 4px;
}

.legal-policy[open] > summary {
	margin-bottom: 1rem;
}


/* =========================================================
   SITEMAP
   ========================================================= */

.sitemap-section {
    margin: 30px 0;
}

.sitemap-section h2 {
    margin-bottom: 12px;
    font-size: 20px;
}

.sitemap-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sitemap-links li {
    margin: 8px 0;
}

.sitemap-links a {
    display: block;

    padding: 12px 16px;
    border-radius: 6px;
    background: #fff;

    font-size: 17px;
    text-decoration: none;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.sitemap-links a:hover {
    background: #eef2ff;
    transform: translateX(3px);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media screen and (max-width: 600px) {

    /* Puzzle access */

    .puzzle-access {
        margin: 20px auto;
        padding: 22px;
    }


    /* Puzzle forms */

    .puzzle-form {
        flex-direction: column;
        align-items: stretch;
    }

    .puzzle-form input,
    .puzzle-form button {
        width: 100%;
    }


    /* Puzzle grid */

    .puzzle-grid {
        grid-template-columns: 1fr;
    }


    /* Word ladder */

    .word-ladder-puzzle {
        margin-bottom: 30px;
    }

    .word-ladder-rows {
        margin: 10px 0;
    }

    .word-ladder-row {
        flex-wrap: nowrap;
        margin: 8px 0;
    }

    .word-display {
        gap: 2px;
        width: auto;
        min-width: 0;
        flex: 0 0 auto;
    }

    .fixed-letter,
    .letter-btn {
        width: 30px;
        min-width: 30px;
        max-width: 30px;
        height: 38px;

        font-size: 19px;
    }

    .word-ladder-choices {
        gap: 4px;

        margin-left: 6px;
        padding-left: 8px;

        flex: 0 0 auto;
    }

    .letter-choice {
        width: 34px;
        min-width: 34px;
        max-width: 34px;
        height: 38px;

        font-size: 18px;
    }

    .fixed-word {
        gap: 2px;
        margin: 10px 0;
    }


    /* Sitemap */

    .sitemap-section {
        margin: 24px 0;
    }
}