/* PCMT Talent styles */

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  background: #121212;
  color: #e6e6e6;
}

/* light mode */
html.light body { background: #fff; color: #111; }

a { color: #6ab0ff; }
html.light a { color: #0645ad; }

h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 4px 0; }

input, select, textarea, button {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

input, select, textarea {
  padding: 4px 6px;
  border: 1px solid #555;
  background: #000;
  color: #e6e6e6;
}
html.light input, html.light select, html.light textarea {
  border-color: #999;
  background: #fff;
  color: #111;
}

button {
  padding: 4px 10px;
  border: 1px solid #555;
  background: #333;
  color: #eee;
  cursor: pointer;
}
button:hover { background: #444; }
html.light button { border-color: #999; background: #efefef; color: #111; }
html.light button:hover { background: #e2e2e2; }

button.on { font-weight: bold; background: #2e3a46; }
html.light button.on { background: #dde9ff; }

.hidden { display: none !important; }

/* hide buttons people dont have the role for (the database checks too) */
body:not(.can-talent) .talent-only { display: none !important; }
body:not(.can-admin) .admin-only { display: none !important; }

#main {
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 10px 40px 10px;
}

/* top nav */
#nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 2px solid #444;
}
html.light #nav { border-color: #bbb; }
#nav img { width: 28px; height: 28px; border-radius: 50%; }
#nav a { padding: 0 6px; border-left: 1px solid #555; }
#nav a:first-of-type { border-left: none; }
#nav a.current { font-weight: bold; color: inherit; text-decoration: none; }
#nav .count { color: #999; font-size: 12px; }
#logged-in { margin-left: auto; font-size: 12px; color: #999; }

#top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #444;
}
html.light #top { border-color: #bbb; }
#top .title { margin-right: auto; }
#page-sub { margin: 2px 0 0 0; color: #999; font-size: 13px; }
#preview-note { font-size: 11px; padding: 2px 6px; border: 1px dashed #fc3; color: #fc3; }
html.light #preview-note { border-color: #a60; color: #a60; }
#sync-status { font-size: 12px; color: #999; }
#notes-badge { background: #c00; color: #fff; padding: 0 4px; margin-left: 3px; font-size: 11px; font-weight: bold; }

/* boxes */
.box {
  border: 1px solid #444;
  background: #1c1c1c;
  padding: 10px;
  margin-bottom: 12px;
}
html.light .box { border-color: #bbb; background: #fff; }
.box-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  border-bottom: 1px solid #444;
  padding-bottom: 4px;
  margin-bottom: 8px;
}
html.light .box-title { border-color: #bbb; }
.box-title h2 { margin-right: auto; }

.small { font-size: 12px; color: #999; }
.grey { color: #999; }
.green { color: #5c5; font-weight: bold; }
.red { color: #f66; }
html.light .green { color: #080; }
html.light .red { color: #c00; }
.error { color: #f66; }
.ok { color: #5c5; }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

/* tables */
.table-wrap { overflow: auto; border: 1px solid #444; }
.table-wrap.tall { max-height: 70vh; }
html.light .table-wrap { border-color: #bbb; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid #444; padding: 4px 6px; text-align: left; vertical-align: top; }
html.light th, html.light td { border-color: #bbb; }
th { background: #2c2c2c; position: sticky; top: 0; white-space: nowrap; }
html.light th { background: #e4e4e4; }
th.sortable { cursor: pointer; text-decoration: underline; }
tbody tr:nth-child(even) td { background: #242424; }
html.light tbody tr:nth-child(even) td { background: #f4f4f4; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #262626; }
html.light tr.clickable:hover td { background: #f2f7ff; }
tr.selected td { background: #2e3a46 !important; }
html.light tr.selected td { background: #dde9ff !important; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.bold { font-weight: bold; }

.team { white-space: nowrap; }
.team img, .team .swatch { width: 16px; height: 16px; vertical-align: middle; margin-right: 3px; object-fit: contain; }
.swatch { display: inline-block; }

.tag { display: inline-block; padding: 0 4px; border: 1px solid #777; font-size: 11px; white-space: nowrap; }
.tag.fact { border-color: #39f; color: #39f; }
.tag.story { border-color: #c90; color: #c90; }
.tag.prod { border-color: #e44; color: #e44; }
.tag.say { border-color: #3a3; color: #3a3; }

/* facts sheet */
#matchup { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.team-card { border: 1px solid #444; padding: 10px; }
html.light .team-card { border-color: #bbb; }
.team-card .logo { width: 32px; height: 32px; float: left; margin-right: 8px; object-fit: contain; }
.team-card h3 { font-size: 17px; margin: 0; }
.stat-boxes { clear: both; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 10px 0; }
.stat-boxes div { border: 1px solid #444; background: #242424; padding: 4px 6px; }
html.light .stat-boxes div { border-color: #bbb; background: #f4f4f4; }
.stat-boxes b { display: block; font-size: 16px; }
.team-card ul { margin: 0; padding-left: 18px; }
.team-card li { margin-bottom: 3px; }
#vs { align-self: center; text-align: center; font-size: 12px; color: #999; }
#vs b { display: block; font-size: 22px; color: inherit; }

.records { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.record { border: 1px solid #444; background: #242424; padding: 6px 8px; }
html.light .record { border-color: #bbb; background: #f4f4f4; }
.record b { display: block; font-size: 17px; }

#leaders { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
#leaders h3 { text-decoration: underline; }
#leaders ol { margin: 0 0 10px 0; padding-left: 20px; }
#leaders li { cursor: pointer; padding: 1px 0; }
#leaders li span.val { float: right; font-weight: bold; }

#standings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#standings .table-wrap { min-width: 0; }

.note { border-bottom: 1px solid #444; padding: 6px 0; }
html.light .note { border-color: #ddd; }
.note:last-child { border-bottom: none; }
.note.pinned { border-left: 3px solid #fc3; padding-left: 6px; }
.note p { margin: 3px 0; white-space: pre-wrap; }
.note .x { float: right; padding: 0 5px; margin-left: 3px; }

/* highlights on the stats page */
#highlights { columns: 2; column-gap: 24px; }
#highlights .hl { break-inside: avoid; margin-bottom: 12px; }
#highlights h3 { text-decoration: underline; }
#highlights ul { margin: 0; padding-left: 18px; }
#highlights li { margin-bottom: 3px; }
@media (max-width: 800px) { #highlights { columns: 1; } }
.hl-edit { break-inside: avoid; margin-bottom: 12px; border: 1px dashed #555; padding: 6px; }
.hl-edit input[data-gname] { width: 60%; font-weight: bold; }
.hl-edit textarea { width: 100%; height: 120px; margin-top: 4px; box-sizing: border-box; }

/* record lists on the facts sheet */
.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rec-list h3 { text-decoration: underline; }
.rec-list table { font-size: 12px; }
.rec-list td { border: none; border-bottom: 1px solid #333; padding: 3px 4px; }
html.light .rec-list td { border-color: #ddd; }
.rec-list tbody tr:nth-child(even) td { background: none; }
@media (max-width: 800px) { .rec-grid { grid-template-columns: 1fr; } }

/* facts page + log */
#facts-table textarea { width: 100%; height: 50px; box-sizing: border-box; }
.team-card .saved { margin-top: 8px; border-top: 1px dashed #555; padding-top: 6px; }
.team-card .saved b { font-size: 12px; }
td.what-added { color: #5c5; } td.what-edited { color: #fc3; } td.what-deleted { color: #f66; }
html.light td.what-added { color: #080; } html.light td.what-edited { color: #a60; } html.light td.what-deleted { color: #c00; }
.old { text-decoration: line-through; color: #999; }

/* vods */
.day { margin: 14px 0 6px 0; font-size: 14px; text-decoration: underline; }
details.game { border: 1px solid #444; margin-bottom: 6px; }
html.light details.game { border-color: #bbb; }
details.game summary { padding: 6px 10px; cursor: pointer; }
details.game .score { font-weight: bold; padding: 0 6px; }
details.game .flags { float: right; }
.game-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 10px; border-top: 1px solid #444; }
html.light .game-body { border-color: #bbb; }
.game-body h4 { margin: 10px 0 4px 0; }
.game-body h4:first-child { margin-top: 0; }
.map-score { display: inline-block; border: 1px solid #555; padding: 1px 6px; margin: 0 4px 4px 0; }
.game-body form { display: flex; flex-wrap: wrap; gap: 4px; }
.game-body form input[type=url], .game-body form input[name=title] { flex: 1; min-width: 160px; }
.game-body textarea { width: 100%; height: 50px; }
.clip { border: 1px solid #444; padding: 3px 6px; margin-top: 4px; }

/* teams */
#teams-table tr.team-row td { background: #2c2c2c !important; font-weight: bold; cursor: pointer; }
html.light #teams-table tr.team-row td { background: #e4e4e4 !important; }
#teams-table ul { margin: 0; padding-left: 16px; }
mark { background: #fe6; color: #000; }

/* team sheet editor */
#sheet-editor .fields { display: grid; grid-template-columns: 160px 1fr; gap: 4px 8px; align-items: center; max-width: 700px; margin-bottom: 10px; }
#sheet-editor .fields input, #sheet-editor .fields textarea { width: 100%; box-sizing: border-box; }
#sheet-editor table input { width: 100%; box-sizing: border-box; min-width: 70px; }
#sheet-editor table textarea { width: 100%; min-width: 180px; height: 44px; box-sizing: border-box; }
#sheet-editor .buttons { margin-top: 8px; }
.edit-sheet { float: right; font-weight: normal; }

/* notes window */
#notes-box {
  position: fixed;
  top: 60px;
  right: 10px;
  width: 400px;
  max-width: calc(100% - 20px);
  max-height: calc(100% - 80px);
  overflow: auto;
  background: #1c1c1c;
  border: 2px solid #555;
  padding: 10px;
  z-index: 50;
}
html.light #notes-box { background: #fff; border-color: #999; }
#notes-box textarea { width: 100%; height: 70px; box-sizing: border-box; }
#note-game { max-width: 100%; }
#note-tags button { font-size: 11px; padding: 2px 6px; margin: 0 2px 3px 0; }
#notes-close { float: right; }

/* login */
#login-box {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
}
#login-box .inner {
  max-width: 460px;
  margin: 100px auto;
  background: #1c1c1c;
  border: 2px solid #555;
  padding: 20px;
}
html.light #login-box .inner { background: #fff; border-color: #999; }
#login-btn { background: #5865f2; color: #fff; border-color: #4752c4; padding: 8px 14px; }
#my-id { display: block; padding: 8px; background: #000; color: #ccc; font-size: 12px; overflow-x: auto; white-space: pre; margin: 8px 0; }

#update-bar, #toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  background: #ffc;
  color: #000;
  border: 1px solid #cc9;
  padding: 8px 12px;
  z-index: 150;
  max-width: 90%;
}
#update-bar { top: 10px; }
#toast { bottom: 20px; display: none; }
#ios-help {
  position: fixed;
  top: 60px;
  right: 10px;
  width: 300px;
  background: #fff;
  color: #000;
  border: 2px solid #999;
  padding: 12px;
  z-index: 150;
}

/* phones */
@media (max-width: 800px) {
  input[type=search] { width: 100%; box-sizing: border-box; }
  #standings > div { min-width: 0; }
  .two-cols, #standings, .game-body { grid-template-columns: 1fr; }
  #matchup { grid-template-columns: 1fr; }
  #leaders { grid-template-columns: 1fr 1fr; }
  .stat-boxes { grid-template-columns: 1fr 1fr; }
  #notes-box { top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; }
  #sync-status, #preview-note { display: none; }
}
