/*
 * Tibia Watch skin for CipSoft's Winter Update 2026 planner, vendored from the
 * test server. The markup is theirs and re-synced as-is, so every rule here
 * targets their classes and ids; tibia.com's own stylesheets are not vendored.
 *
 * The parent page mirrors its theme onto <html> as `light` or `dark`. The
 * values copy shared/ui/src/styles/tibia-watch-brand.css: the iframe cannot
 * read the parent's custom properties.
 */

:root {
  color-scheme: dark;
  --bg: hsl(20 7% 11%);
  --panel: hsl(20 6% 14%);
  --row: hsl(20 6% 16%);
  --row-alt: hsl(20 6% 18%);
  --border: hsl(22 8% 24%);
  --ink: hsl(30 12% 94%);
  --ink-soft: hsl(25 8% 68%);
  --ink-faint: hsl(25 6% 50%);
  --gold: hsl(45 90% 60%);
  --action: hsl(16 84% 55%);
  --action-ink: hsl(20 60% 8%);
  --bad: hsl(349 78% 62%);
  --good: hsl(158 66% 52%);
}

:root.light {
  color-scheme: light;
  --bg: hsl(40 30% 99%);
  --panel: hsl(38 24% 96%);
  --row: hsl(40 30% 99%);
  --row-alt: hsl(36 20% 92%);
  --border: hsl(34 16% 83%);
  --ink: hsl(0 0% 8%);
  --ink-soft: hsl(0 0% 20%);
  --ink-faint: hsl(0 0% 38%);
  --gold: hsl(40 84% 31%);
  --action: hsl(16 80% 44%);
  --action-ink: hsl(30 40% 99%);
  --bad: hsl(349 70% 44%);
  --good: hsl(158 74% 27%);
}

html,
body {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
  overflow: hidden;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

td {
  padding: 0;
  vertical-align: top;
}

br {
  display: none;
}

.hide {
  display: none !important;
}

.Bold {
  font-weight: 600;
}

.UseFullWidth {
  width: 100%;
}

/* ---- boxes: the caption frame becomes a band header ---- */

.TableContainer {
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.CaptionContainer {
  border-bottom: 1px solid var(--border);
}

.CaptionInnerContainer > span {
  display: none;
}

.CaptionInnerContainer .Text {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.Table5,
.Table3 {
  width: 100%;
}

.InnerTableContainer {
  padding: 12px 14px;
}

.TableContent {
  width: 100%;
}

.TableContent tr.Odd,
.TableContent tr.Even {
  background: var(--row);
}

.TableContent tr.Even {
  background: var(--row-alt);
}

.TableContent td {
  padding: 6px 8px;
}

.TableScrollbarWrapper {
  display: none;
}

.LabelV150 {
  width: 150px;
  padding-right: 8px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---- vocation and promotion points ---- */

#VocationList,
.OptionsContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.OptionContainer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.OptionContainer input {
  margin: 0;
  accent-color: var(--action);
}

input[type='text'],
input:not([type]),
.PromotionPointsLimit {
  box-sizing: border-box;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.PromotionPointsLimit {
  width: 96px;
}

input[type='text']:focus,
.PromotionPointsLimit:focus {
  outline: 2px solid var(--action);
  outline-offset: 1px;
}

/* ---- buttons: the gif buttons become flat actions ---- */

.BigButton,
.SmallButton {
  display: inline-block;
  margin: 4px 6px 4px 0;
}

.ButtonEventHook {
  position: relative;
}

.BigButtonOver,
.SmallButtonOver {
  display: none;
}

.BigButtonText,
.SmallButtonText {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.SmallButtonText {
  min-height: 32px;
  padding: 4px 10px;
}

.BigButtonText:hover,
.SmallButtonText:hover {
  border-color: var(--action);
}

#wod-code-import,
#wod-code-import-mobile {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-ink);
}

/* The host page owns sharing: the engine's "full URL" points at tibia.com. */
#wod-code-url,
#wod-code-url-mobile {
  display: none;
}

#wod-code,
#wod-code-mobile {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-break: anywhere;
}

#wod-code-invalid,
#wod-code-invalid-mobile {
  color: var(--bad);
}

/* The first box repeats the code rows for phones; desktop has its own code box. */
#wod-wrapper > .TableContainer:first-child :is(.CodeExport, .CodeImport, .ButtonRow) {
  display: none;
}

/* ---- vessels ---- */

#wod-vessels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.VesselContainer {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
}

.VesselContainer:hover {
  border-color: var(--action);
}

.VesselContainer.Locked {
  opacity: 0.5;
}

.VesselModsDisplay {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  margin-top: 4px;
}

.VesselModsDisplay .ModIcon {
  margin: 0 2px;
}

/* ---- selection, information and the wheel ---- */

#WheelOfDestinySelectionBlock {
  width: 100%;
  margin-bottom: 12px;
}

#WheelOfDestinySelection {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

#PerkInformationTables {
  display: flex;
  flex: 0 0 300px;
  flex-direction: column;
}

#PerkInformationTables > :nth-child(2) {
  display: none;
}

#WheelOfDestiny {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

#wod-canvas {
  display: block;
  width: 100%;
  max-width: 522px;
  height: auto;
  touch-action: manipulation;
}

#wod-selection-box-bar {
  position: relative;
  height: 18px;
  margin: 6px 0;
  border-radius: 9px;
  background: var(--row-alt);
  overflow: hidden;
}

#wod-selection-box-bar-filling {
  height: 100%;
  background: var(--good);
}

#wod-selection-box-bar-text {
  position: absolute;
  inset: 0;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.SmallButtonRow {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

#SubtractPerkButtons,
#AddPerkButtons {
  display: flex;
}

.SkillValue,
.ModEffectValue,
.LargePerkName,
.LargePerkValue {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.SkillValue.Locked,
.SkillValue .Locked,
.ModEffectValue.Locked,
.ModEffectValue .Locked,
.LargePerkName.Locked,
.LargePerkValue.Locked {
  color: var(--ink-faint);
}

.ModEffectValue {
  min-height: 2rem;
  margin: 2px 0 8px;
}

.ModEffectValue .InvalidMod {
  text-decoration: line-through;
  color: var(--bad);
}

.ModEffectWrapper {
  display: flex;
}

.ModEffectIconWrapper {
  width: 35px;
  height: 35px;
  margin: 6px 4px 0 0;
}

.ModIcon,
.LargePerkIcon {
  overflow: hidden;
  margin: auto;
}

.ModIcon img,
.LargePerkIcon img {
  max-width: unset;
  image-rendering: pixelated;
}

.ModIcon.Locked,
.ModIcon.InvalidMod,
.LargePerkIcon.Locked {
  opacity: 0.5;
}

.GemDropdown,
select {
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.GemWrapper {
  position: relative;
}

.GemWrapper .ModGrades {
  position: absolute;
  top: 5px;
  right: 8px;
}

/* ---- perks summary ---- */

#PerksSummary {
  width: 100%;
}

#PerksSummary > tbody > tr > td {
  width: 50%;
  padding: 0 6px;
  vertical-align: top;
}

.PerksSummaryHeader {
  margin: 10px 0 4px;
  font-weight: 600;
  color: var(--ink-soft);
}

.PerksSummaryValue {
  white-space: nowrap;
  text-align: right;
}

.PerksSummaryNote {
  padding: 6px 0;
  color: var(--ink-soft);
}

#PerksSummary .ModAugIcon {
  margin-right: 4px;
  vertical-align: middle;
}

/* In flow beside the value, so a long one ("Locked") never runs under it. */
.PerkTooltipContainer {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---- help tooltips (positioned by the host page) ---- */

.HelperDivIndicator {
  cursor: help;
}

#HelperDivContainer {
  position: absolute;
  z-index: 10;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
  font-size: 13px;
}

#HelperDivHeadline {
  margin-bottom: 4px;
  font-weight: 600;
}

#HelperDivText p {
  margin: 0 0 6px;
}

/* ---- narrow: the iframe is as wide as the page column ---- */

@media (max-width: 760px) {
  #wod-wrapper > .TableContainer:nth-child(3) {
    display: none;
  }

  #wod-wrapper > .TableContainer:first-child :is(.CodeExport, .CodeImport, .ButtonRow) {
    display: table-row;
  }

  #wod-vessels {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .VesselContainer {
    min-width: 0;
  }

  .LabelV150 {
    width: auto;
  }

  #WheelOfDestinySelection {
    flex-direction: column-reverse;
  }

  #PerkInformationTables {
    flex-basis: auto;
    width: 100%;
  }

  #WheelOfDestiny {
    box-sizing: border-box;
    width: 100%;
    padding: 6px;
  }

  #PerksSummary > tbody > tr {
    display: flex;
    flex-direction: column;
  }

  #PerksSummary > tbody > tr > td {
    width: auto;
  }
}
