body {
    margin: 0;
    padding: 20px;
    font-family: 'Arial', sans-serif;
    background: #1a1a1a;
    color: white;
}

.container {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

.middle-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 10%);
}

.footer {
    position: fixed;
    text-align: center;
    bottom: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    width: 100%;
}

.team {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 100px;
    font-size: 20px;
}

#team-a {
    background: rgba(0, 0, 255, 0.2);
    border: 3px solid #0066cc;
}

#team-b {
    background: rgba(255, 0, 0, 0.2);
    border: 3px solid #cc0000;
}

.team-top {
    display: flex;
    justify-content: space-between;
    width: 100%;
    
}

.team-heading {
    font-size: 24px;
    padding-right: 5px;
}

#character-pool {
    display: grid;
    grid-template-columns: repeat(5, minmax(100px, 1fr));
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow-y: auto;
}

@media (max-width: 1045px) {
    #character-pool {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }
}

@media (max-width: 800px) {
    #character-pool {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }
}

.character {
    position: relative;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.character img {
    width: 64px;
    height: 64px;
}

.character:hover {
    box-shadow: 2px 2px 2px 2px #f934d0;
    animation: blinking 1s infinite;
}

@keyframes blinking {
    50% {
        box-shadow: 2px 2px 2px 2px #9724f0;
    }
}

.character.selected {
    background: rgba(51, 51, 51, 0.2);
    cursor: not-allowed;
}

.character.selected img,
.character.selected span {
    opacity: 0.3;
}

.character.banned {
    background: linear-gradient(to right, #f934d0, #9724f0);
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(80%);
}

.character.team-a-previous {
    border-left: 4px solid rgba(0, 102, 204, 0.3);
    border-bottom: 4px solid rgba(0, 102, 204, 0.3);
    cursor: not-allowed;
}

.character.team-b-previous {
    border-right: 4px solid rgba(204, 0, 0, 0.3);
    border-top: 4px solid rgba(204, 0, 0, 0.3);
    cursor: not-allowed;
}

.character.team-a-picked {
    background: linear-gradient(to right, rgba(0, 0, 255, 0.2), rgba(255, 255, 255, 0.0));
    opacity: 0.8;
    cursor: not-allowed;
}

.character.team-b-picked {
    background: linear-gradient(to left, rgba(255, 0, 0, 0.2), rgba(255, 255, 255, 0.0));
    opacity: 0.9;
    cursor: not-allowed;
}

.character.both-picked {
    background: linear-gradient(to left, rgba(255, 0, 0, 0.2), rgba(0, 0, 255, 0.2));
    opacity: 0.9;
    cursor: not-allowed;
}

.character.auto-selected::after {
    content: '🕒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

.character.picked img {
    width: calc(15vh);
    height: calc(15vh);
}

.timer {
    font-size: 14px;
    margin: 10px 0;
}

.edit-team-name {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    margin-left: 8px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.edit-team-name:hover {
    opacity: 1;
}

button {
    padding: 10px 10px;
    margin: 2px;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

#create-room-button {
    background: #2196F3;
}

#join-room-button, #reconnect-button {
    background: #00BCD4;
}

#ready-button, #enter-button {
    background: #26A69A;
}

#start-draft {
    background: #4CAF50;
    padding: 10px 20px
}

#leave-room-button, #cancel-session-button {
    background: #CC5500;
}

#config-button, #skip-ban {
    background: #757575;
}

#config {
    position: fixed;
    z-index: 2;
    bottom: 0;
    background-color: #1a1a1a;
    border: 3px solid #4CAF50;
    min-width: 200px;
    padding-left: 10px;
    margin-left: 100px;
}

.draft-status {
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
}

.controls-wrapper, .controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ban-select,
.exclusivity-select {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

#skip-ban.visible {
    display: inline-block;
}

.hidden {
    display: none;
}

.team-name-input.hidden {
    display: none;
}

#history-spectator {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

#match-history-container {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    color: rgb(56, 56, 56);
    font-size: 10px;
    width: 75%;
    margin-top: auto;
}

.match, #match-history {
    margin-top: 20px;
    margin: 5px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    cursor: default;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    color: white;
    font-size: 12px;
}

.match {
    flex-direction: row;
}

#spectator-list-container {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    color: rgb(56, 56, 56);
    font-size: 10px;
    width: 15%;
    margin-left: auto;
}

#spectator-list {
    margin-top: 20px;
    margin: 5px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    cursor: default;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    color: white;
    font-size: 12px;
}

.game-counter {
    display: inline-block;
    margin-left: 10px;
    font-size: 1.2em;
    color: #666;
}

#status-message {
    display: inline-block;
    margin-left: 10px;
}

#team-action {
    background: none;
    border: none;
    opacity: 0;
}

@keyframes oscillate {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
  }
  @keyframes blink-opacity {
     0%, 100% { opacity: 0.6; }
     50% { opacity: 0.2; }
   }

  .swap-pending {
    /* Option 1: Oscillation */
     animation: oscillate 0.8s ease-in-out infinite;

     /* Option 2: Blinking */
     /* animation: blink-opacity 1s ease-in-out infinite; */
  }

  #timer-duration {
    width: 35px
}

.timer-display {
    outline: thick ridge white;
    outline-offset: 3px;
    border-radius: 1px;
    margin-left: 15px;
}

.timer-display.elapsed {
    color: red;
    outline-color: red;
    animation: blink-opacity 1s ease-in-out infinite;
}