html {
  height: 100%;
}

.oogwrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

body {
  height: 100%;
  margin: 0px;
  font-family: Verdana, "Sans-Serif";
  font-weight: bold;
  text-shadow: 0 0 2px black, 0 0 2px black, 0 0 2px black, 0 0 2px black;
  font-size: 12px;
  color: white;
  scrollbar-width: thin;
  scrollbar-color: rgba(24, 24, 24, 1) rgba(51, 51, 51, 1);
  background-image: url("/png/bg2.png");
}

#restore-fullscreen {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 2147483647;
  transform: translateX(-50%);
  min-width: 220px;
  padding: 10px 18px;
  border: 1px solid #d39b28;
  border-radius: 8px;
  color: #fff3bd;
  background: linear-gradient(180deg, rgba(72, 48, 15, 0.98), rgba(31, 22, 10, 0.98));
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.75), 0 0 18px rgba(255, 177, 44, 0.65);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  animation: restore-fullscreen-pulse 1.5s ease-in-out infinite;
}

#restore-fullscreen[hidden] {
  display: none !important;
}

#restore-fullscreen:hover,
#restore-fullscreen:focus-visible {
  color: white;
  border-color: #ffd36b;
  background: linear-gradient(180deg, rgba(101, 67, 18, 0.99), rgba(42, 28, 10, 0.99));
  outline: none;
}

#restore-fullscreen span {
  display: inline-block;
  margin-right: 7px;
  font-size: 18px;
  line-height: 12px;
}

@keyframes restore-fullscreen-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.75), 0 0 10px rgba(255, 177, 44, 0.35);
  }

  50% {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.75), 0 0 24px rgba(255, 191, 66, 0.85);
  }
}

#battle-window-target {
  display: none;
  align-items: center;
}

/* Battle Window Bars */
.battle-window-bar-wrapper {
  display: flex;
  flex-direction: column;
}

.bar-holder {
  position: relative;
  height: 12px;
  background-color: #222;
  border: 1px solid black;
  margin: 1px 0;
}

.battle-window-target-stats-bar {
  height: 100%;
  /* Width is set by JS */
}

.health {
  background: rgb(0, 192, 0);
  /* Slightly darker green for readability? Or keep bright? Stick to Tibia green: 0, 192, 0 usually or 0, 255, 0 */
  background: #00C000;
}

.mana {
  background: #0000C0;
}

.bar-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 9px;
  color: white;
  line-height: 11px;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  pointer-events: none;
}

.battle-window-target-wrapper:hover {
  border: 1px solid white;
  cursor: pointer;
}

.battle-window-target-wrapper.battle-window-targeted {
  border-color: #d92222;
  box-shadow: inset 0 0 0 1px rgba(255, 72, 42, 0.42);
}

.battle-window-target-wrapper {
  display: flex;
  width: 100%;
  background-image: url("/png/bg2.png");
  margin: 0px 0px 1px 0px;
  border: 1px solid black;
  height: 40px;
}

.battle-window-target-title {
  color: rgba(0, 255, 0);
}

.battle-window-target-canvas {
  display: flex;
  flex: 0 0 32px;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
}

.battle-window-target-canvas>canvas {
  width: 32px;
  height: 32px;
}

.battle-window-target-stats {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding-left: 4px;
}

#battle-window .battle-window-health-bar .bar-holder {
  border-color: #00C000;
}

.visible {
  visibility: visible;
  opacity: 1;
}

.hidden {
  visibility: hidden;
  opacity: 0;
}

.zone-sub {
  font-size: 24px;
  color: white;
  font-family: Goudy Old Style;
}

.zone-title {
  font-variant: small-caps;
  font-family: Arno Pro;
  letter-spacing: 5px;
}

#zone-message hr {
  color: gold;
  padding: 0px;
  margin: 0px;
  background: gold;
}

#zone-message {
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  font-size: 36px;
  color: gold;
  top: 20%;
  text-align: center;
  position: absolute;
  z-index: 10000000;
  padding: 4px;
}

#server-message {
  display: none;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 4px;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  max-width: 256px;
  top: 50%;
  text-align: center;
  white-space: pre-line;
  position: absolute;
  padding: 4px;
}

.checkboxes {
  display: flex;
  justify-content: center;
}

.checkboxes label {
  display: inline-block;
  padding-right: 10px;
  white-space: nowrap;
  flex: 1 1 auto;
}

.checkboxes input {
  vertical-align: middle;
}

.checkboxes label span {
  vertical-align: middle;
}

.settings-checkboxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
}

.settings-checkboxes label {
  min-width: 0;
}

.close-button-transparent:hover {
  font-weight: bold;
  color: grey;
  border: none;
  box-shadow: none;
}

.close-button-transparent {
  position: absolute;
  right: 6px;
  border: 0px;
  background: none;
}

/* Styling for input */
input {
  background-image: url("/png/bg3.png");
  height: 14px;
  outline: none;
  padding: 4px;
  text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
  font-weight: bold;
  border: 0px;
}

hr {
  border: 0;
  height: 1px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0), grey, rgba(0, 0, 0, 0));
  margin: 8px;
}

/* Styling for buttons */
button {
  font-size: 10px;
  color: white;
  cursor: pointer;
  font-weight: bold;
  background-image: url("/png/bg3.png");
  border: 1px solid black;
  margin: 2px;
  padding: 4px;
  border-radius: 4px;
}

button:hover {
  border: 1px solid white;
  background-image: url("/png/bg2.png");
}

button:disabled {
  color: grey;
}

button:disabled:hover {
  border: 1px solid grey;
  box-shadow: 0 0 4px 1px grey;
}

/* Styling for custom buttons */
button.symbol-button.small {
  font-size: 8px;
}

button.symbol-button {
  padding: 0px;
  width: 18px;
  height: 18px;
  min-width: 18px;
  max-width: 18px;
}

.symbol-button-long {
  padding: 0px;
  min-width: 24px;
}

.close-button {
  position: absolute;
  right: 6px;
}

#game-wrapper {
  display: none;
  height: 100%;
  width: 100%;
  min-width: 992px;
  min-height: 508px;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Keep both desktop sidebars at their natural width. A long chat entry must
 * not shrink or resize them, while the right sidebar remains wide enough for
 * its controls. */
#game-wrapper > .oogwrap {
  flex: 0 0 auto;
  min-width: max-content;
}

#game-wrapper .column {
  display: flex;
  width: 180px;
  min-width: 180px;
  flex-direction: column;
  justify-content: flex-start;
  background-image: url("/png/bg2.png");
  max-height: 100%;
  min-height: 100%;
  flex: 0 1 auto;
  overflow: hidden;
}

#game-wrapper .main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

#clock-time {
  font-size: 10px;
  position: absolute;
  top: 4px;
  left: 4px;
}

.main .middle {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  align-items: flex-end;
  background-image: url("/png/bg.png");
}

.main .upper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  background-image: url("/png/bg.png");
  overflow: hidden;
}

.main .lower {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  background-image: url("/png/bg2.png");
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  max-height: 140px;
  flex: 1 1 auto;
}

.no-select {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.canvas-notification {
  text-align: center;
  color: white;
  position: absolute;
  bottom: 2px;
  width: 100%;
  z-index: 8000;
}

.stack-wrapper {
  width: 100%;
  height: 100%;
  max-height: 100%;
}

.stack-top {
  flex: 0 0 auto;
  height: 256px;
  overflow: auto;
}

#debug-statistics {
  z-index: 1000;
  margin: 8px;
  position: absolute;
  font-size: 10px;
  left: 0px;
  top: 0px;
}

.party-achievements-modal {
  box-sizing: border-box;
  width: min(500px, calc(100% - 24px));
  height: min(400px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: hidden;
}

.party-achievements-modal .modal-body {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: calc(100% - 22px);
  min-height: 0;
  overflow: hidden;
}
.achievements-summary { color: #ffd34d; font-weight: 700; margin-bottom: 8px; text-align: center; }
.achievements-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: grid; align-content: start; gap: 6px; }
.achievement-row { box-sizing: border-box; display: flex; width: 100%; gap: 10px; margin: 0; padding: 7px; text-align: left; background: rgba(8, 8, 12, .88); border: 1px solid #555; color: #ddd; cursor: pointer; }
.achievement-row.locked { opacity: .55; cursor: default; }
.achievement-row.active { box-shadow: 0 0 10px currentColor; border-color: currentColor; }
.achievement-row strong, .achievement-row span { display: block; }
.achievement-state { width: 24px; font-size: 18px; text-align: center; }
.achievement-content { flex: 1; }
.achievement-content strong { margin-bottom: 2px; color: currentColor; }
.achievement-progress { margin-top: 4px; color: #aaa; font-size: 10px; }
.achievement-progress-detail { margin-top: 2px; color: #bbb; font-size: 10px; }
.achievement-common { color: #fff; }
.achievement-rare { color: #56a8ff; }
.achievement-epic { color: #c36bff; }
.achievement-legendary { color: #ffd34d; }
.achievements-help { color: #aaa; font-size: 10px; text-align: center; margin: 8px 0 0; }

.party-maniacs-modal { box-sizing: border-box; width: min(480px, calc(100% - 24px)); height: min(430px, calc(100% - 24px)); overflow: hidden; }
.party-maniacs-modal .modal-body { box-sizing: border-box; display: flex; flex-direction: column; height: calc(100% - 22px); min-height: 0; }
.party-maniacs-tabs { display: flex; gap: 5px; margin-bottom: 8px; }
.party-maniacs-tab { flex: 1; margin: 0; padding: 7px; color: #bbb; border: 1px solid #555; background: rgba(5, 5, 10, .8); }
.party-maniacs-tab.selected { color: #ffd34d; border-color: #ffd34d; box-shadow: inset 0 0 10px rgba(255, 211, 77, .18); }
.party-maniacs-status { flex: 0 0 auto; min-height: 16px; margin-bottom: 7px; color: #aaa; text-align: center; font-size: 11px; }
.party-maniacs-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 5px; }
.party-maniacs-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; color: #ddd; border: 1px solid #444; background: rgba(5, 5, 10, .82); }
.party-maniacs-row:nth-child(1) { color: #ffd34d; border-color: #9d761a; }
.party-maniacs-row:nth-child(2) { color: #d8e1eb; border-color: #768493; }
.party-maniacs-row:nth-child(3) { color: #d89b65; border-color: #855932; }
.party-maniacs-position { width: 30px; text-align: center; font-size: 14px; }
.party-maniacs-player { flex: 1; min-width: 0; }
.party-maniacs-player strong, .party-maniacs-player small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-maniacs-player small { margin-top: 2px; color: #aaa; font-size: 10px; }
.party-maniacs-online { min-width: 42px; color: #55ef94; text-align: right; font-size: 9px; font-weight: 700; }
.party-maniacs-modal .modal-footer { flex: 0 0 auto; margin-top: 8px; }

.party-guide-modal { box-sizing: border-box; width: min(620px, calc(100% - 24px)); height: min(500px, calc(100% - 24px)); overflow: hidden; }
.party-guide-modal .modal-body { box-sizing: border-box; display: flex; flex-direction: column; height: calc(100% - 22px); min-height: 0; }
.party-guide-tabs { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 8px; }
.party-guide-tab { min-width: 0; margin: 0; padding: 7px 3px; color: #aaa; border: 1px solid #555; background: rgba(5, 5, 10, .82); font-size: 11px; }
.party-guide-tab.selected { color: #ffd34d; border-color: #ffd34d; box-shadow: inset 0 0 12px rgba(255, 211, 77, .16); }
.party-guide-content { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.party-guide-panel { display: none; box-sizing: border-box; height: 100%; overflow-y: auto; padding: 3px 5px 8px; }
.party-guide-panel.selected { display: block; }
.party-guide-panel h2 { margin: 4px 0 8px; color: #ffd34d; text-align: center; font-size: 18px; }
.party-guide-lead { margin: 4px 0 10px; color: #ccc; text-align: center; line-height: 1.4; }
.party-guide-rules { margin: 0; padding-left: 27px; }
.party-guide-rules li { margin: 0 0 8px; padding-left: 3px; line-height: 1.35; }
.party-guide-card { margin-bottom: 7px; padding: 8px 10px; border: 1px solid #4b4b58; background: rgba(5, 5, 10, .76); }
.party-guide-card h3 { margin: 0 0 4px; color: #65ddff; font-size: 13px; }
.party-guide-card p { margin: 0; color: #ccc; line-height: 1.38; }
.party-guide-achievements { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.party-guide-achievements article { padding: 7px 8px; border: 1px solid #494955; background: rgba(5, 5, 10, .76); }
.party-guide-achievements strong, .party-guide-achievements span { display: block; }
.party-guide-achievements strong { margin-bottom: 2px; color: #c878ff; }
.party-guide-achievements strong.achievement-rare { color: #56a8ff; }
.party-guide-achievements strong.achievement-epic { color: #c36bff; }
.party-guide-achievements strong.achievement-legendary { color: #ffd34d; }
.party-guide-achievements span { color: #bbb; font-size: 10px; line-height: 1.3; }
.party-guide-ranks { max-width: 430px; margin: 0 auto; display: grid; gap: 5px; }
.party-guide-ranks div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 11px; border: 1px solid #494955; background: rgba(5, 5, 10, .76); }
.party-guide-ranks div:nth-child(n+7) { color: #ffd34d; border-color: #8c711e; }
.party-guide-ranks span { color: #aaa; }
.party-guide-modal .modal-footer { flex: 0 0 auto; margin-top: 8px; }

.settings-maintenance { max-width: 360px; text-align: center; }
.settings-maintenance strong { display: block; margin-bottom: 4px; color: #ffd34d; }
.settings-maintenance p { margin: 0 0 8px; color: #aaa; font-size: 10px; line-height: 1.35; }
.settings-maintenance button { width: 100%; }

.party-choice-modal { box-sizing: border-box; width: min(500px, calc(100% - 24px)); overflow: hidden; }
.party-choice-modal .modal-body { padding: 12px; }
.party-choice-intro { margin: 0 0 10px; color: #ddd; text-align: center; }
.party-choice-section { margin-top: 9px; padding: 9px; border: 1px solid #4a4a55; background: rgba(4, 4, 10, .78); }
.party-choice-section h3 { margin: 0 0 8px; text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: .7px; }
.party-choice-games h3 { color: #65ddff; }
.party-choice-chance { border-color: #9b7420; box-shadow: inset 0 0 18px rgba(255, 201, 56, .08); }
.party-choice-chance h3 { color: #ffd34d; }
.party-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.party-choice-grid button { min-height: 42px; margin: 0; padding: 7px 9px; white-space: normal; }
.party-choice-games button { border-color: #35667a; }
.party-choice-roulette { color: #ffe47a; border-color: #d29b24 !important; box-shadow: inset 0 0 13px rgba(255, 205, 59, .16); }
.party-choice-random { color: #d18cff; border-color: #8954ae !important; box-shadow: inset 0 0 13px rgba(195, 107, 255, .16); }
.party-choice-timer { margin-top: 10px; color: #ffd34d; text-align: center; font-weight: 700; }

@media screen and (max-width: 520px) {
  .party-choice-modal { width: calc(100% - 20px); max-height: calc(100dvh - 20px); overflow-y: auto; }
  .party-choice-grid { grid-template-columns: 1fr; }
  .party-choice-grid button { min-height: 44px; }
}

.party-achievement-toast {
  position: absolute;
  z-index: 12000;
  top: 12%;
  left: 50%;
  width: min(390px, calc(100% - 24px));
  padding: 18px 20px;
  transform: translate(-50%, -25px) scale(.88);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  color: #ffd34d;
  border: 2px solid currentColor;
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(22, 15, 8, .97), rgba(5, 5, 9, .97));
  box-shadow: 0 0 25px currentColor, inset 0 0 24px rgba(255,255,255,.08);
  transition: opacity .35s, transform .35s;
}
.party-achievement-toast.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.party-achievement-toast.hidden { display: block; opacity: 0; }
.party-achievement-heading { color: #fff; font-size: 11px; letter-spacing: 2px; }
.party-achievement-name { margin: 7px 0; font-size: 22px; font-weight: 900; text-shadow: 0 0 10px currentColor; }
.party-achievement-description { color: #eee; font-size: 12px; }
.party-achievement-rare { color: #56a8ff; }
.party-achievement-epic { color: #c36bff; }
.party-achievement-legendary { color: #ffd34d; }
.achievement-confetti { position: absolute; left: 50%; top: 45%; width: 5px; height: 9px; background: var(--color); animation: achievement-confetti 1.4s var(--delay) ease-out forwards; }
@keyframes achievement-confetti {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--x), 140px) rotate(540deg); opacity: 0; }
}

@media (max-width: 700px) {
  .party-achievements-modal { width: calc(100% - 14px); height: min(400px, calc(100% - 14px)); max-height: calc(100% - 14px); }
  .party-achievement-toast { top: 8%; padding: 13px; }
  .party-achievement-name { font-size: 18px; }
  .party-maniacs-modal { width: calc(100% - 14px); height: min(430px, calc(100% - 14px)); }
  .party-guide-modal { width: calc(100% - 14px); height: min(500px, calc(100% - 14px)); }
  .party-guide-tabs { grid-template-columns: 1fr 1fr; }
  .party-guide-achievements { grid-template-columns: 1fr; }
}
