table,th,td {
  border: 1px solid #fffffa;
  border-collapse: collapse;
}
th {
  text-align: left;
}
td {
  text-align: center;
}
th,td {
  padding: 5px;
}
.banned {
  color: red;
}
.label {
  font-size:larger;
  font-weight: bold;
}
h3 {
  font-size: 1.5em;
}
body {
    font-family: monospace;
}
#journalData {
  width: 350px;
}

#leftWrapper, #rightWrapper {
  display:inline;
  float:left;
  margin-right: 15px;
}
.date {
  font-weight: bold;
}
.center-h {
  text-align: center;
}
.neg {
	color: indianred;
}
.pos {
	color: lightgreen;
}
html {
	background-color: #06071a;
	color: #fffffa;
	font-size: 1.1em;
}
a {
	color: lightblue;
}
#memberTable th {
	text-align: center;
}
#nav{
	display: inline;
	font-size: 1.3em;
	font-weight: bold;
	color: grey;
}
#nav a {
	color: grey;
	hover: lightblue;
	text-decoration: none;
}
#nav a:hover {
	color: lightblue;
}
#nav a.activePage {
	color: white;
	pointer-events:none;
}
a:hover {
	text-decoration: none;
	color: crimson;
}
#memberTable tr:hover td {
	background-color: grey;
}
#memberTable tr.total-row td {
	font-weight: bold;
	border-top: 2px solid #555;
}
table {
  overflow: hidden;
}
#memberTable td, th {
  position: relative;
}
#memberTable td:hover::after,
#memberTable th:hover::after {
  content: "";
  position: absolute;
  background-color: grey;
  left: 0;
  top: -5000px;
  height: 10000px;
  width: 100%;
  z-index: -1;
}
.nohl {
	background-color: #06071a;
}
@media screen and (max-width: 500px) {
	#nav {
		display: block;
		text-align: center;
	}
	.spacer {
		display: none;
	}
	#nav a {
		display: block;
	}
}
* { box-sizing: border-box; }

/* Base dark-theme styling for all form controls — more specific selectors
   (gem calc, market) will override where needed */
button {
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.4);
    font-family: monospace;
    font-size: inherit;
    padding: 2px 10px;
    cursor: pointer;
}
button:hover {
    border-color: lightblue;
    color: lightblue;
}
input[type="text"],
input[type="number"],
select {
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.35);
    font-family: monospace;
    font-size: inherit;
    padding: 2px 6px;
}
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: lightblue;
    outline: none;
}

/* Smaller icons inside the search/compare buttons */
.searchBar button i {
    font-size: 0.75em;
}

/* Leaderboard controls */
.lb-controls {
    margin: 10px 0 16px;
}
#typeBtn   { width: 5.5em; }
#periodBtn { width: 6.5em; }
#statSelect { width: 13em; }

.autocomplete {
  /*the container must be positioned relative:*/
  position: relative;
  display: inline-block;
}

.autocomplete-items {
  position: absolute;
  border: 1px solid rgba(255,255,250,0.35);
  border-bottom: none;
  border-top: none;
  z-index: 99;
  top: 100%;
  left: 0;
  right: 0;
}
.autocomplete-items div {
  padding: 5px;
  cursor: pointer;
  background-color: #0d0f2b;
  color: #fffffa;
  border-bottom: 1px solid rgba(255,255,250,0.15);
}
.autocomplete-items div:hover {
  background-color: #1a1c40;
}
.autocomplete-active {
  background-color: #1e4a8a !important;
  color: #ffffff;
}

/* Trade skill colors — matched to in-game colors */
.fishing {
    color: #00b000;
}
.woodcutting {
    color: #966f33;
}
.mining {
    color: #e5e4e2;
}
.stonecutting {
    color: #88878f;
}

/* Emoji left, value centered in remaining space */
.fishing, .woodcutting, .mining, .stonecutting {
    display: flex;
    align-items: center;
}
.fishing::before    { content: '\1F3A3'; margin-right: auto; }
.woodcutting::before { content: '\1FAB5'; margin-right: auto; }
.mining::before     { content: '\26CF\FE0F'; margin-right: auto; }
.stonecutting::before { content: '\1FAA8'; margin-right: auto; }

/* Revert trade skill text color when row is highlighted */
#memberTable tr:hover td.fishing,
#memberTable tr:hover td.woodcutting,
#memberTable tr:hover td.mining,
#memberTable tr:hover td.stonecutting {
    color: #fffffa;
}

/* ============================================================
   Gem Calculator
   ============================================================ */

/* Gem dropdown background colors */
.gem-col select.gem-ruby       { background-color: #6b0000; color: #fff; border-color: #c04040; }
.gem-col select.gem-opal       { background-color: #4a3d00; color: #ffd700; border-color: #c8a800; }
.gem-col select.gem-sapphire   { background-color: #002060; color: #fff; border-color: #4070c0; }
.gem-col select.gem-emerald    { background-color: #003a00; color: #fff; border-color: #308030; }
.gem-col select.gem-amethyst   { background-color: #3a1060; color: #fff; border-color: #9060c0; }
.gem-col select.gem-diamond    { background-color: #004455; color: #fff; border-color: #50b8d0; }
.gem-col select.gem-amber      { background-color: #4a2800; color: #fff; border-color: #c07820; }
.gem-col select.gem-bloodstone { background-color: #2a0000; color: #fff; border-color: #602020; }

/* Gem name colors in the summary table */
.gem-text-ruby       { color: #e05050; }
.gem-text-opal       { color: #ffd700; }
.gem-text-sapphire   { color: #5090e0; }
.gem-text-emerald    { color: #50c050; }
.gem-text-amethyst   { color: #b070e0; }
.gem-text-diamond    { color: #50c8e0; }
.gem-text-amber      { color: #e0a030; }
.gem-text-bloodstone { color: #8C0000; }

#gemCalcWrapper {
    margin-top: 10px;
}

/* Preset / Level bar */
#presetBar {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

#presetBar label {
    font-weight: bold;
    margin-right: 4px;
}

#presetBar select {
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.35);
    padding: 4px 8px;
    font-family: monospace;
    font-size: 1em;
    cursor: pointer;
}


/* Level control: − [input] + */
#levelControl {
    display: flex;
    align-items: center;
    gap: 5px;
}

#levelControl label {
    font-weight: bold;
    margin-right: 2px;
}

#level {
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.35);
    padding: 4px 6px;
    font-family: monospace;
    font-size: 1em;
    width: 80px;
    text-align: center;
    /* hide browser spinners — we use our own buttons */
    -moz-appearance: textfield;
}
#level::-webkit-outer-spin-button,
#level::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#level:focus {
    border-color: lightblue;
    outline: none;
}

#levelDown,
#levelUp {
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.4);
    padding: 3px 10px;
    font-family: monospace;
    font-size: 1.1em;
    cursor: pointer;
    line-height: 1;
    user-select: none;
}
#levelDown:hover,
#levelUp:hover {
    border-color: lightblue;
    color: lightblue;
}

/* Equipment grid — 3-column RPG slot layout */
#equipGrid {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    grid-template-areas:
        "weapon  helmet  empty1"
        "gloves  breast  offhand"
        "empty2  boots   empty3";
    gap: 10px;
    margin-bottom: 20px;
}

#weapon      { grid-area: weapon; }
#helmet      { grid-area: helmet; }
#gloves      { grid-area: gloves; }
#breastplate { grid-area: breast; }
#offhand     { grid-area: offhand; }
#boots       { grid-area: boots; }
.gear-empty  { visibility: hidden; }

/* Individual slot card */
.gear-slot {
    border: 1px solid rgba(255,255,250,0.22);
    padding: 8px 10px;
    min-width: 210px;
}

.gear-slot h4 {
    margin: 0 0 7px 0;
    text-align: center;
    font-size: 0.9em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,250,0.15);
    color: rgba(255,255,250,0.8);
}

.gem-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
}

.gem-col-label {
    font-size: 0.72em;
    color: rgba(255,255,250,0.45);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gem-col select {
    display: block;
    width: 100%;
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.18);
    padding: 2px 4px;
    font-family: monospace;
    font-size: 0.82em;
    margin-bottom: 3px;
    cursor: pointer;
}

.gem-col select:hover,
.gem-col select:focus {
    border-color: lightblue;
    outline: none;
}

/* Results row */
#calcResults {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-start;
}

#ingredients {
    flex: 0 0 auto;
}

/* Gems / Total Bonus summary tables — centered in their cells */
.gem-summary-table {
    margin: 0 auto;
}

.gem-summary-table th {
    text-align: center;
    padding-bottom: 4px;
}

/* Ingredient name warning color — amber, distinct from red */
.ing-warn {
    color: #fff;
}

/* Carver section */
#carverSection {
    flex: 0 0 auto;
    min-width: 210px;
}

#carverSection h3,
#exportSection h3 {
    font-size: 1em;
    font-weight: bold;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,250,0.15);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,250,0.8);
}

#carverSection label {
    font-weight: bold;
    margin-right: 4px;
}

#carverSection select,
#carverSection input[type="text"] {
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.35);
    padding: 3px 6px;
    font-family: monospace;
    font-size: 0.95em;
    cursor: pointer;
    margin-bottom: 6px;
}

#carverSection select:hover,
#carverSection select:focus,
#carverSection input[type="text"]:focus {
    border-color: lightblue;
    outline: none;
}

/* Carver warning — orange so it stands out */
#carverWarning {
    color: orange;
    font-size: 0.85em;
    margin: 4px 0 6px;
}

.wire-row {
    display: flex;
    align-items: center;
    margin-top: 6px;
}

.wire-row textarea {
    margin-top: 0;
}

.wire-row .copy-btn svg {
    display: block;
}

#carverSection textarea {
    display: block;
    margin-top: 6px;
    font-family: monospace;
    font-size: 0.85em;
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.3);
    resize: none;
}

#carverSection small {
    display: block;
    margin-top: 6px;
    color: rgba(255,255,250,0.55);
    font-size: 0.8em;
    line-height: 1.4;
}

/* Export / Import section */
#exportSection {
    flex: 0 0 auto;
    min-width: 200px;
}

.eximport-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.eximport-btns {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.eximport-row .copy-btn svg {
    display: block;
}

#exportSection textarea {
    display: block;
    font-family: monospace;
    font-size: 0.85em;
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.3);
    resize: none;
    margin-bottom: 0;
}

#exportSection textarea::placeholder {
    color: rgba(255,255,250,0.35);
}

#exportSection small {
    display: block;
    margin-top: 4px;
    color: rgba(255,255,250,0.55);
    font-size: 0.8em;
    line-height: 1.4;
}

/* Shared button style */
#exportSection button,
#carverSection button {
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.4);
    padding: 4px 12px;
    font-family: monospace;
    font-size: 0.9em;
    cursor: pointer;
    margin-right: 5px;
    margin-top: 4px;
}

#exportSection button:hover,
#carverSection button:hover {
    border-color: lightblue;
    color: lightblue;
}

/* Mobile */
@media screen and (max-width: 700px) {
    #equipGrid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "weapon" "helmet" "gloves" "breast" "offhand" "boots";
    }
    .gear-empty  { display: none; }
    #calcResults { flex-direction: column; }
    .gear-slot   { min-width: unset; width: 100%; }
}

#presetBar select:hover,
#presetBar select:focus {
    border-color: lightblue;
    outline: none;
}

.copy-btn {
    display: inline-block;
    width: 1.4em;
    text-align: center;
    cursor: pointer;
    margin-left: 4px;
    opacity: 0.5;
    font-size: 0.85em;
    user-select: none;
    text-decoration: none;
}
.copy-btn:hover {
    opacity: 1;
}
.copy-btn.copy-confirmed {
    color: lightgreen;
    opacity: 1;
}

/* ============================================================
   Market page
   ============================================================ */

.market-controls {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.market-control-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.market-controls label {
    font-weight: bold;
}

.market-controls select {
    background: #0d0f2b;
    color: #fffffa;
    border: 1px solid rgba(255,255,250,0.35);
    padding: 4px 8px;
    font-family: monospace;
    font-size: 1em;
    cursor: pointer;
}

.market-controls select:hover,
.market-controls select:focus {
    border-color: lightblue;
    outline: none;
}

@media screen and (max-width: 500px) {
    .market-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    .chart-axis-text   { font-size: 30px; }
    .chart-band-text   { font-size: 30px; }
    .chart-legend-text { font-size: 32px; }
}

#chartContainer {
    position: relative;
    max-width: 900px;
}

#chartContainer svg {
    display: block;
    width: 100%;
}

#chartTooltip {
    position: fixed;
    display: none;
    background: #0d0f2b;
    border: 1px solid rgba(255,255,250,0.4);
    padding: 6px 10px;
    font-family: monospace;
    font-size: 0.9em;
    pointer-events: none;
    z-index: 10;
    line-height: 1.5;
}

.chart-grid-line {
    stroke: rgba(255,255,250,0.2);
    stroke-width: 1;
}

.chart-axis-line {
    stroke: rgba(255,255,250,0.7);
    stroke-width: 1;
}

.chart-axis-text {
    fill: #fffffa;
    font-size: 13px;
    font-family: monospace;
}

.chart-legend-text {
    fill: #fffffa;
    font-size: 14px;
    font-family: monospace;
}

.chart-line-low {
    fill: none;
    stroke: #5bc0de;
    stroke-width: 2;
}

.chart-line-avg {
    fill: none;
    stroke: #90ee90;
    stroke-width: 2;
}

.chart-crosshair {
    stroke: rgba(255,255,250,0.6);
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

.chart-band-text {
    fill: #fffffa;
    font-size: 13px;
    font-family: monospace;
}

.chart-band-border {
    stroke: rgba(255,255,250,0.15);
    stroke-width: 0.5;
}

.chart-label {
    margin: 12px 0 2px;
    font-weight: bold;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,250,0.6);
}
