:root {
	--transition-1: all 0.3s ease-in-out;
	--transition-2: all 0.2s ease-in-out;

    --background-color: #fff;
    --text-color: #000;

    --box-shadow: 0, 0, 0;
}

.inverted {
  --background-color: #222222;
  --text-color: #faf9f6;

  --box-shadow: 255, 255, 255;
}

html {
	font-size: 16px;
	font-family: 'Swansea', sans-serif;
}

/* account for mobile devices */
@media (max-width: 600px) {
	html {
        font-size: 8px;
    }
}

@media (max-height: 600px) {
	html {
        font-size: 6px;
    }
}

body {
	margin: 0;
    padding: 0;
	padding-top: 1rem;
    background-color: var(--background-color);
    transition: var(--transition-1);

    /* visual bug on Safari */
    min-height: 100vh;
}

.header {
    position: fixed;
	text-align: center;
	-ms-user-select: none;
	    user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-webkit-touch-callout: none;

    left: 50%;
    transform: translateX(-50%);
}

.body {
    position: fixed;
    top: calc(12.5rem + 40px);

    left: 50%;
    transform: translateX(-50%);
}

.no_result {
	margin: 0.3rem;
	padding: 0.3rem 0.5rem;
	list-style: none;
	text-align: left;
	font-size: 1rem;
	color: #212121;
	transition: all 0.1s ease-in-out;
	border-radius: 0.35rem;
	background-color: rgb(255, 255, 255);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: all 0.2s ease;
	outline: none;
}

h1 {
    font-family: 'Swansea', sans-serif;
    font-style: italic;
    font-size: 5rem;
    margin-top: 45px;
    margin-bottom: 0.5rem;
	color: var(--text-color);
	transition: var(--transition-1);

    padding-left: 10px;
    padding-right: 10px;
}

h3 {
    font-family: 'Swansea', sans-serif;
    color: var(--text-color);
    margin-bottom: 3rem;
    transition: var(--transition-1);
}

h4 {
	margin-bottom: 5px;
	color: #ffc6c6;
}

h4::-moz-selection {
	color: #ffc6c6;
}

h4::selection {
	color: #ffc6c6;
}

.mode {
	margin-top: 20px;
}

.strict {
	display: inline;
}

.loose {
	display: inline;
}

.past-guesses {
	margin-top: 5vh;
	font-size: 1rem;
	font-weight: bold;
	color: var(--text-color);
	transition: var(--transition-1);
}

.guesses {
	margin-top: 2vh;
	font-size: 1.25rem;
	font-weight: bold;
	color: #ffc6c6;
	transition: var(--transition-1);
}

.guesses p {
    margin: 0.1rem;
}

button {
    font-size: 1rem;
    font-weight: medium;
    background-color: #ffc6c6;
    border-radius: 0.625rem;
    border: 0;
    box-shadow: 0 0.0625rem 0.25rem rgba(255, 122, 122, 0.2);
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem 1rem;
    margin-left: 0.75rem;
    margin-right: 0.75rem;
}

.button-container {
    display: center;
    margin-bottom: 1rem;
}

.modal {
    background-color: rgba(0,0,0,0.3);
    opacity: 0;
    position: fixed;
    inset: 0; /* top:0; bottom:0; left:0; right:0 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    z-index: -1;
    pointer-events: none;
}

.modal h2 {
    margin: 1rem;
    font-size: 2.625rem;
    color: #ff7a7a;
}

.modal p {
    color: var(--text-color);
}

.modal h5 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.modal a {
    color: var(--text-color);
}

.modal.open {
    opacity: 1;
    z-index: 999;
    pointer-events: auto;
}

.modal__inner {
    background-color: var(--background-color);
    border-radius: 1.5625rem;
    padding: 1rem 2.5rem;
    text-align: center;
    width: 50rem;
    max-width: 80%;
    box-shadow: 0 1px 4px rgba(var(--box-shadow),0.3);
}

.modal--icon h5 {
    margin: 2.5px;
}

.modal__close {
    margin-top: 0.6rem;
    cursor: pointer;
}

/* ===== STATS DISPLAY ===== */
/* difficulty selector */
.difficulty-switch {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.diff {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: #ffc6c6;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.diff.active {
    background: #ff7a7a;
    color: var(--background-color);
}

/* guess distribution bar graph */
.graph-title {
    color: var(--text-color);
}

.graph-container {
    display: flex;
    height: 16.25rem;
    margin-top: 1.55rem;
}

.bars {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    width: 100%;
}

.bar {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    color: var(--text-color);
}

.bar::before {
    content: attr(data-count);
    color: var(--background-color);
    width: 100%;
    height: var(--h);
    background: linear-gradient(#ffc6c6, #ff7a7a);
    border-radius: 0.625rem 0.625rem 0.25rem 0.25rem;

    box-sizing: border-box;
    padding-top: 0.375rem; 
}

.bar label {
    margin-top: 0.375rem;
    font-size: 0.9rem;
}

/* stats summary */
.stats-summary {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 0.0625rem solid #ff7a7a;
    color: var(--text-color);
}

.stats-summary div {
    text-align: center;
}

.stats-summary strong {
    display: block;
    font-size: 1.4rem;
}

.stats-summary span {
    font-size: 0.9rem;
}

/* ===== ICON BUTTONS ===== */
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    box-shadow: none;
    z-index: 10;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-button img {
    width: 32px;
    height: 32px;
    display: block;
}

.icon-button:hover {
    transform: scale(1.2);                
    box-shadow: 0 0 12px rgba(var(--box-shadow), 0.2);  
}

.icon-button:active {
    transform: scale(1.1);
    box-shadow: 0 0 6px rgba(var(--box-shadow), 0.1);
}

/* icon button positons */
.info-button {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
}

.contact-button {
    position: fixed;
    top: 1.25rem;
    left: calc(2.5rem + 32px);
}

.stats-button {
    position: fixed;
    top: 1.25rem;
    right: calc(2.5rem + 32px);
}

.rules-button {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
}

.diff-button {
    position: fixed;
    top: 1.25rem;
    left: calc(3.75rem + 64px);;
}

/* light / dark mode toggler */
.viewmode {
    position: fixed;
    display: flex;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 10;
}

.toggle {
    position: fixed;
    display: flex;
    border: 1px solid #ffc6c6;
    height: 28px;
    width: 96px;
    border-radius: 40px;
    justify-content: flex-start;
    align-content: center;
    transition: var(--transition-2);

    justify-content: flex-start;
    left: 50%;
    transform: translateX(-50%);
}

.toggler {
    display: grid;
    cursor: pointer;
    background-color: rgba(255, 198, 198, 1);
    color: var(--background-color);
    height: 20px;
    width: 48px;
    border-radius: 40px;
    margin: 4px;
    text-align: center;
    align-content: center;
    align-self: flex-start;
    transition: var(--transition-2);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -webkit-touch-callout: none;
}

.toggler:hover {
    width: 52px;
    background-color: rgba(255, 122, 122, 0.7);
}

.toggler::selection {
      color: var(--background-color);
}

/* ===== PROGRESS BAR & HINT UI ===== */
/* hint ui explanation */
.explain {
    font-size: 1rem;
    transform: translateX(-50%);
    position: fixed;
    bottom: 1rem;
    left: 50%;

    color: var(--text-color);
    transition: var(--transition-1);
}

/* hint display */
.content {
    position: fixed;
    bottom: calc(5.5rem + 10px); 
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    justify-content: center;
    width: 50vw;
    gap: 1rem;
    flex-wrap: wrap;

    padding: 2rem 2rem;
    border-radius: 1rem;
    background: rgba(255, 122, 122, 0.15);
    font-size: 1.5rem;
    font-weight: 600;

    text-align: center;

    color: var(--text-color);
    transition: var(--transition-1);
}

.content.hidden {
    opacity: 0;
}

/* progress bar */
.journey-bar {
    position: fixed;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 75vw;
    z-index: 1;
}

.journey-track {
    position: relative;
    height: 10px;
    background: #ddd;
    border-radius: 999px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.journey-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #ff7a7a;
    border-radius: 999px;
    z-index: 0;
    transition: width 0.3s ease;
}

/* hint nodes */
.stop {
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    background: white;
    border: 3px solid #999;
    border-radius: 50%;
    z-index: 1;
    transition: all 0.2s ease;
}

.stop.unlocked {
    border-color: #ff7a7a;
}

.stop.active {
    background: #ff7a7a;
    border-color: #ff7a7a;
}

/* fonts */
@font-face {
    font-family: "Swansea";
    src: url("./fonts/Swansea.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Swansea";
    src: url("./fonts/SwanseaItalic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: "Swansea";
    src: url("./fonts/SwanseaBold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: "Swansea";
    src: url("./fonts/SwanseaBoldItalic.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
}