@import url('https://fonts.googleapis.com/css2?family=Cascadia+Code:ital,wght@0,200..700;1,200..700&family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Quattrocento:wght@400;700&family=STIX+Two+Text:ital,wght@0,400..700;1,400..700&family=VT323&display=swap');

:root{
	--fg: #333;
	--bg: #fff;
  --header: #efefef;
	--link: #b67add;
	--linkhover: #c591e8;
	
	--normal-font: "Quattrocento", serif;
	--normal-size: 20px;
	--mono-font: "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", monospace;

	--prefill-color: #656565;
	--hint-color: #6f4393;
	--hint-light: #f7f2fb;
  --notice-color: #8d4306;

  --game-width: 751px; /* from haven.css:47 for max width of #output */
}

#vorple {
	background-color: var(--bg);
	color: var(--fg);
}

#output {
  max-width: var(--game-width);
}

.status-line-container {
  width: 100%;
  padding: 0.3rem 0rem;
  margin-bottom: 0.6rem;
}

body, input, label {
    font-family: var(--normal-font);
    font-size: var(--normal-size);
}

#lineinput {
	padding: 0.5em;
	border: 2px solid var(--fg);
	margin-bottom: 2em;
}
#lineinput-prefix{
  font-size: var(--normal-size);
}
#lineinput-field {
	font-family: var(--normal-font);
  font-size: var(--normal-size);
	padding-left: 0.5em;
}

.lineinput {
	font-weight: bold;
}

.hint {
  color: var(--hint-color);
  background: var(--hint-light);
  display: block;
  padding: 0.5rem;
  border-radius: 10px;
  margin-bottom: -1.5rem;
}

.notice {
  color: var(--notice-color)
}

.scream {
  font-size: 3rem;
  color: var(--notice-color);
  font-weight: bold;
  padding-top: 3rem;
  display: flex;
  line-height: 3rem;
  text-align: center;
}

a, a:visited {
	color: var(--link);
	font-weight: bold;
}

a:hover{
	color: var(--linkhover);
	text-decoration: none;
}

hr {
  border-top: 2px dashed var(--hint-color);
  width: 95%;
}

.layout {
	display: grid;
	grid-template-columns: 200px var(--game-width) 1fr;
	gap: 20px;
	padding: 20px;
  padding-top: 0px;
	max-width: 1400px;
	margin: auto;
}

aside.sidebar {
  background: none;
	padding: 0.8rem;
	top: 1rem;
	height: 90vh;
	overflow-y: auto;
	position: sticky;
	margin-top: 10px;
	padding-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.sidebar.right-sidebar{
  background: none;
  padding: 0;
  right: 1rem;
}

.sidebar.left-sidebar {
  border-radius: 10px;
  border: 5px double var(--hint-color);
}

.window-block {
  background-color: #efefef;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
}

.window-block h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.window-block img {
  /* max-width: 100%; */
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.graphic-window img,
.map-window img {
	width: 100%;
	border-radius: 8px;
	margin-bottom: 15px;
}

.sidebar-button {
  cursor: pointer;
}

.sidebar-button:hover {
  background-color: var(--hint-light);
}

.sidebar-item {
	background-color: rgba(0, 0, 0, 0);
  color: var(--hint-color);
  border: none;
  padding: 0.2rem 0.5rem;
  margin-bottom: 0.3rem;
  cursor: pointer;
  font-weight: bold;
  text-align: left;
  border-radius: 6px;
  font-family: var(--normal-font);
  font-size: var(--normal-size);
}

.quick-menu {
  /* background-color: #eae3f9; */
  /* margin-bottom: 0.5rem; */
}

.quick-menu-header {
  border-radius: 6px 6px 0 0;
  margin-bottom: 0px;
}

.quick-menu-body {
  padding: 0rem 0rem 0rem 1rem;
  border-top: none;
  border-radius: 0 0 4px 4px;
}

.quick-menu-body a {
  display: block;
  padding: 0.4rem 0;
  color: var(--link);
  text-decoration: none;
  font-weight: normal;
  position: relative;
}

.quick-menu-body a:hover {
  font-weight: bold;
  padding-left: 0.5rem;
  cursor: pointer;
}

.quick-menu-body a:hover::before {
  content: "> ";
  position: absolute;
  left: 0;
  color: var(--link);
  font-weight: bold;
}

/* Help Pop-up */
.help-popup{
	display: none;
	position: fixed;
	top: 10%;
	left: 50%;
	transform: translateX(-50%);
	width: 80%;
	max-width: 900px;
	height: 70vh;
	background: white;
	border-radius: 10px;
	z-index: 1001;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
	display: flex;
	overflow: hidden;
}
.tab-sidebar {
  display: flex;
  flex-direction: column;
  width: 160px;
  background: var(--header);
  border-right: 1px solid #ccc;
  overflow-y: auto;
}
.tab-button {
  padding: 10px;
  font-family: var(--mono-font);
  font-size: 16px;
  font-weight: bold;
  background: none;
  border: none;
  border-bottom: 1px solid #ddd;
  text-align: left;
  cursor: pointer;
}
.tab-button.active {
  background: var(--hint-light);
  color: var(--hint-color);
}

.help-tabs {
	display: flex;
	border-bottom: 1px solid #ddd;
}

.help-tabs button {
	flex: 1;
	padding: 10px;
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	font-weight: bold;
	cursor: pointer;
}

.help-tabs button.active {
	border-bottom: 3px solid var(--hint-color);
	background: var(--hint-light);
}

.help-scroll {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.help-content {
  display: none;
  font-size: 18px;
}

.help-content.active {
  display: block;
}

.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	z-index: 900;
	display: none;
}

/* Accordion formatting */
.accordion-header {
  background: var(--header);
  border: none;
  padding: 12px;
  width: 100%;
  text-align: left;
  font-weight: bold;
  font-family: var(--normal-font);
  cursor: pointer;
  border: 1px solid #ccc;
  margin-top: 0.5em;
  border-radius: 5px;
}

.accordion-header:hover {
  background: var(--hint-light);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 12px;
}

.accordion-content.open {
  padding: 12px;
  max-height: 500px; /* Adjust based on content length */
}

.vex.vex-theme-plain .vex-content {
  border-radius: 10px;
  font-family: var(--mono-font);
}

/* dialogue pop ups for saving and restoring game */
.vex.vex-theme-plain .vex-dialog-button{
  border-radius: 4px !important;
}

.vex.vex-theme-plain .vex-dialog-button.vex-dialog-button-primary{
  background: var(--link);
}

@media (max-width: 700px) {
  .help-popup.side-tabs {
    flex-direction: column;
    height: auto;
  }

  .tab-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ccc;
  }

  .tab-button {
    flex: 1 0 50%;
    text-align: center;
  }
}

.custom-popup {
  position: fixed;
	top: 10%;
	left: 50%;
	transform: translateX(-50%);
	width: 80%;
	max-width: 900px;
	height: 70vh;
	background: white;
	border-radius: 10px;
	z-index: 1001;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
	display: flex;
	overflow: hidden;
}

.file-explorer {
  padding: 1rem;
}

.file-scroll {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.file-section {
  margin-bottom: 1rem;
}

.file-section h2 {
  font-size: 1.2em;
  margin-bottom: 0.5em;
}

.file-entry {
  cursor: pointer;
  margin-left: 20px;
  overflow-wrap:break-word;
  justify-content: space-between;
  display: flex;
  word-break: break-all;   
  margin-bottom: 0.2rem;
}

.file-entry:hover {
  background-color: #eef;
}

.file-preview {
  background: #f8f8f8;
  border: 1px solid #ccc;
  padding: 1em;
  margin-top: 0.5em;
  white-space: pre-wrap;
}

.command-echo { display: none; }