/* @ignore next line@ */
/* needed for itext */
@page {
    margin: 10px 0 0 0;
}

@page landscape {
    size: A4 landscape;
}

body {
    margin: 0;
    font-family: Arial;
}

* {
    box-sizing: border-box;
}

/* @ignore next line@ */
@media print {
    body.mail {
        padding: 10px;
    }

    tournament-scoresheet {
        page: landscape;
        overflow: hidden;
        height: 205mm;
    }

    tournament-scoresheet .tournament-scoresheet-component.scoreboards table.tournament tbody td.play.lower {
        background-image: none !important;
    }

    tournament-scoresheet .tournament-scoresheet-component.scoreboards table.tournament tbody td.play.selected {
        background-color: unset !important;
    }

    tournament-scoresheet td > div.scoreboard,
    tournament-scoresheet td > div.result > div.none {
        display: none !important;
    }

    /* @ignore next line@ */
}

tournament-scoresheet {
    display: block;
}

tournament-scoresheet .tournament-scoresheet-component {
    cursor: default;
}

tournament-scoresheet .tournament-scoresheet-component.zoomable {
    cursor: zoom-in;
}

tournament-scoresheet.tournament-placeholder,
tournament-scoresheet.tournament-placeholder .tournament-scoresheet-component {
    width: 100% !important;
    height: 100%;
}

tournament-scoresheet table.tournament {
    background-color: white;
}

/* thead */

tournament-scoresheet table.tournament thead tr td.header div {
    padding: 10px;
}

tournament-scoresheet table.tournament thead tr td.header table {
    width: 100%;
}

tournament-scoresheet table.tournament thead tr td.header h1 {
    font-size: 1.8em;
}

tournament-scoresheet table.tournament thead tr td.header h2 {
    font-size: 1.4em;
}

tournament-scoresheet table.tournament thead tr td.header div {
    font-size: 1.2em;
}

tournament-scoresheet table.tournament thead tr td {
    border: none;
    white-space: nowrap;
}

tournament-scoresheet table.tournament thead tr td.logo {
    padding-left: 20px;
}

tournament-scoresheet table.tournament thead tr td.buffer {
    width: 100%;
}

tournament-scoresheet table.tournament thead tr td.header label {
    font-weight: bold;
    margin-right: 10px;
}

tournament-scoresheet table.tournament thead tr td.header span:not(.unit) {
    display: inline-block;
    height: 1.3em;
    border-bottom: 1px solid black;
    font-size: 1.3em;
}

tournament-scoresheet table.tournament thead tr td.header span span.unit {
    display: inline;
    font-weight: bold;
    border-bottom: none;
}

tournament-scoresheet table.tournament thead tr td.header .host-club label,
tournament-scoresheet table.tournament thead tr td.header .discipline label:not(.classification) {
    width: 100px;
    text-align: right;
}

tournament-scoresheet table.tournament thead tr td.header .host-club span {
    width: 340px;
}

tournament-scoresheet table.tournament thead tr td.header .discipline .value {
    width: 190px;
    margin-right: 10px;
}

tournament-scoresheet table.tournament thead tr td.header span.classification {
    width: 140px;
    text-align: right;
}

tournament-scoresheet table.tournament thead tr td.header .bottom {
    vertical-align: bottom;
}

tournament-scoresheet table.tournament thead tr td.header .date label,
tournament-scoresheet table.tournament thead tr td.header .distance label {
    width: 80px;
    text-align: right;
}

tournament-scoresheet table.tournament thead tr td.header .date span.date {
    width: 120px;
    text-align: center;
    margin-right: 10px;
}

tournament-scoresheet table.tournament thead tr td.header .date span.time {
    width: 70px;
    text-align: center;
}

tournament-scoresheet table.tournament thead tr td.header .distance span {
    text-align: right;
}

tournament-scoresheet table.tournament thead tr td.header .distance .points {
    width: 70px;
    margin-right: 10px;
}

tournament-scoresheet table.tournament thead tr td.header .distance .innings {
    width: 60px;
}

/* tbody */

tournament-scoresheet table.tournament {
    table-layout: fixed;
    border-spacing: 0;
    border-collapse: collapse;
    border: 1px solid black;
    transform-origin: top left;
}

tournament-scoresheet table.tournament th.center,
tournament-scoresheet table.tournament td.center {
    text-align: center;
}

tournament-scoresheet table.tournament th.rotate90 {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    min-height: 140px;
}

tournament-scoresheet table.tournament th.bottom {
    vertical-align: bottom;
}

tournament-scoresheet table.tournament th.middle {
    vertical-align: middle;
}

tournament-scoresheet table.tournament th,
tournament-scoresheet table.tournament td {
    border: 1px solid black;
    padding: 5px;
    text-align: left;
}

tournament-scoresheet table.tournament thead > tr > th:not(:first-child):not(:last-child) {
    padding-bottom: 20px; /* the content is turned around => bottom is top */
}

tournament-scoresheet table.tournament tbody > tr {
    height: 80px;
}

tournament-scoresheet table.tournament th.w1,
tournament-scoresheet table.tournament td.w1 {
    min-width: 160px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

tournament-scoresheet table.tournament th.w2,
tournament-scoresheet table.tournament td.w2 {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
}

tournament-scoresheet table.tournament th.w3,
tournament-scoresheet table.tournament td.w3 {
    min-width: 70px;
    max-width: 70px;
    width: 70px;
}

tournament-scoresheet table.tournament th.w4,
tournament-scoresheet table.tournament td.w4 {
    min-width: 100px;
}

tournament-scoresheet table.tournament th.w5,
tournament-scoresheet table.tournament td.w5 {
    min-width: 40px;
    max-width: 40px;
    width: 40px;
}

tournament-scoresheet table.tournament td.score {
    font-size: 1.5em;
    text-align: center;
}

tournament-scoresheet table.tournament th.w6,
tournament-scoresheet table.tournament td.w6 {
    min-width: 200px;
}

tournament-scoresheet table.tournament th > div {
    padding: 5px;
}

tournament-scoresheet table.tournament td.square {
    position: relative;
}

tournament-scoresheet table.tournament td.no-play {
    background-color: lightgray;
}

tournament-scoresheet table.tournament td > .position,
tournament-scoresheet table.tournament td > .points,
tournament-scoresheet table.tournament td > .innings,
tournament-scoresheet table.tournament td > .average,
tournament-scoresheet table.tournament td > .maximum,
tournament-scoresheet table.tournament td > .icon {
    display: none;
}

tournament-scoresheet table.tournament tfoot div.result {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    border: 1px solid black;
}

tournament-scoresheet table.tournament td.no-play > .position {
    display: block;
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    font-size: 2em;
}

tournament-scoresheet table.tournament tbody td.play div.result {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

tournament-scoresheet .tournament-scoresheet-component.scoreboards table.tournament tbody td.play:not(.lower):hover div.result {
    display: none;
}

tournament-scoresheet .tournament-scoresheet-component.scoreboards table.tournament tbody td.play.selected {
    background-color: #cce7ff;
}

tournament-scoresheet .tournament-scoresheet-component.scoreboards table.tournament tbody td.play.lower {
    background-image: linear-gradient(45deg, #e6e6e6 25%, transparent 25%),
    linear-gradient(-45deg, #e6e6e6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6e6e6 75%),
    linear-gradient(-45deg, transparent 75%, #e6e6e6 75%);
    background-size: 2px 2px;
    background-position: 0 0, 1px 0, 1px -1px, 0px 1px;
}

tournament-scoresheet table.tournament tbody div.scoreboard {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    overflow: hidden;
}

tournament-scoresheet .tournament-scoresheet-component.scoreboards table.tournament tbody div.scoreboard.attached {
    display: block;
}

tournament-scoresheet .tournament-scoresheet-component.scoreboards table.tournament tbody td.play:hover div.scoreboard {
    display: block;
    cursor: pointer;
}

tournament-scoresheet table.tournament tbody div.scoreboard > i {
    position: absolute;
    top: 21px;
    left: 9px;
    font-size: 2.4em;
    background-color: white;
    padding-left: 10px;
    padding-right: 10px;
}

tournament-scoresheet table.tournament tbody td.selected div.scoreboard > i {
    background-color: #cce7ff;
}

tournament-scoresheet table.tournament tbody div.scoreboard.attached > i {
    color: #0070C0;
}

tournament-scoresheet .tournament-scoresheet-component.scoreboards table.tournament tbody td.play:hover div.scoreboard > i {
    display: none;
}

tournament-scoresheet table.tournament tbody div.scoreboard > i > span {
    position: absolute;
    top: 8px;
    left: 27px;
    font-size: 0.4em;
}

tournament-scoresheet table.tournament .result > .points {
    display: block;
    position: absolute;
    top: 2px;
    left: 4px;
}

tournament-scoresheet table.tournament .result > .innings {
    display: block;
    position: absolute;
    top: 2px;
    right: 4px;
}

tournament-scoresheet table.tournament .result > .average {
    display: block;
    position: absolute;
    bottom: 2px;
    left: 4px;
}

tournament-scoresheet table.tournament .result > .maximum {
    display: block;
    position: absolute;
    bottom: 2px;
    right: 4px;
}

tournament-scoresheet table.tournament .result > .icon {
    display: block;
    position: absolute;
    width: 30px;
    height: 30px;
    top: 30%;
    right: 30%;
}

tournament-scoresheet table.tournament .result > .icon > span {
    display: none;
    height: 30px;
    width: 30px;
    border-radius: 50%;
    border: 1px solid black;
}

tournament-scoresheet table.tournament .result > .icon > span.lost {
    display: inline-block;
    background-color: black;
}

tournament-scoresheet table.tournament .result > .icon > span.won {
    display: inline-block;
    background-color: white;
}

tournament-scoresheet table.tournament .result > .icon > span.draw1 {
    display: inline-block;
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    background-color: black;
    border-radius: 15px 0 0 15px;
}

tournament-scoresheet table.tournament .result > .icon > span.draw2 {
    display: inline-block;
    position: absolute;
    top: 0;
    left: 15px;
    width: 15px;
    border-radius: 0 15px 15px 0;
}

tournament-scoresheet table.tournament .result > .none {
    display: grid;
    align-items: center;
    text-align: center;
    font-size: 1.5em;
    color: lightgray;
    white-space: nowrap;
    height: 100%;
}

/* tfoot */

tournament-scoresheet table.tournament tfoot tr td:first-child {
    padding: 20px 60px;
}

tournament-scoresheet table.tournament tfoot tr td {
    border: none;
}

tournament-scoresheet table.tournament tfoot .legend {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 60px;
}

tournament-scoresheet table.tournament tfoot .legend .item {
    text-align: center;
}

tournament-scoresheet table.tournament tfoot .legend .label {
    text-align: center;
    font-weight: bold;
    font-size: 0.8em;
}

tournament-scoresheet table.tournament tfoot .confirmation {
    height: 100%;
    font-weight: bold;
    text-align: center;
    padding-left: 100px;
    padding-right: 50px;
}

tournament-scoresheet table.tournament tfoot .confirmation .underline {
    border-bottom: 1px solid black;
}

tournament-scoresheet table.tournament tfoot .confirmation .location-and-date {
    font-weight: normal;
    font-size: 1.4em;
}

tournament-scoresheet table.tournament tfoot .confirmation .signature {
    margin-top: 60px;
}

/*******************************************************************************/
/*** diagonal square                                                         ***/
/*******************************************************************************/

tournament-scoresheet table.tournament tbody div.scoreboard .diag {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 113.1370849px;
    height: 113.1370849px;
    transform: rotate(45deg);
    transform-origin: bottom left;
    font-size: 15pt;
}

tournament-scoresheet table.tournament tbody div.scoreboard .diag:hover {
    background-color: #337ab7;
    color: white;
}

tournament-scoresheet table.tournament tbody div.scoreboard .sub-1 {
    border: 1px solid black;
    transform: translatex(-80px) translatey(-80px) rotate(45deg);
}

tournament-scoresheet table.tournament tbody div.scoreboard .diag > div {
    width: 20pt;
}

tournament-scoresheet table.tournament tbody div.scoreboard .sub-1 > div {
    transform: translatex(75px) translatey(40px) rotate(-45deg);
}

tournament-scoresheet table.tournament tbody div.scoreboard .sub-2 > div {
    transform: translatex(10px) translatey(40px) rotate(-45deg);
}

/*******************************************************************************/
/*** placeholder                                                             ***/
/*******************************************************************************/

tournament-scoresheet .scoresheet-placeholder {
    position: relative;
    height: 100%;
    color: gray;
    background: repeating-linear-gradient(
            -45deg,
            rgba(0, 0, 0, 0.01),
            rgba(0, 0, 0, 0.01) 30px,
            rgba(0, 0, 0, 0.03) 30px,
            rgba(0, 0, 0, 0.03) 60px
    );
}

tournament-scoresheet .scoresheet-placeholder > div {
    text-align: center;
    font-size: 3em;
    padding: 2em;
    /*
      width: 70%;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    */
}
