
body {
    display: flex;
    height: 100vh;
    margin: 0;
}

.menu-btn {
    position: fixed;
    top: 30px;
    left: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001;
}

.menu-btn2 {
    position: fixed;
    top: 30px;
    right: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001;
}

.menu-btn span, .menu-btn2 span {
    display: block;
    height: 3px;
    background: #514e4e;
    border-radius: 3px;
    transition: 0.3s;
}

.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 250px;
    height: 100vh;
    padding: 60px 20px;
    z-index: 1000;
    background-color: #3f3f3f;
}

.rules {
    position: fixed;
    top: 0;
    right: -300px; /* 初期は隠す */
    width: 250px;
    height: 100vh;
    padding: 60px 20px;
    z-index: 1000;
    background-color: #3f3f3f;
}

.side-menu.active {
    left: 0px; 
}

.rules.active {
    right: 0px;
}

.menu-btn.active span:nth-child(1),
.menu-btn2.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-btn.active span:nth-child(2),
.menu-btn2.active span:nth-child(2) {
  opacity: 0;
}

.menu-btn.active span:nth-child(3),
.menu-btn2.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.menu-btn.active span,
.menu-btn2.active span {
  background-color: #f7f7f7;
}

.two {
    margin-top: 40px;
}

.win, .detail, .create {
    margin-top: 10px;
}

.east {
    transform: rotate(90deg);
}
.south {
    transform: rotate(180deg);
}
.west {
    transform: rotate(270deg);
}

h2 {
    color: #ffffff;
}

input[type="text"] {
    padding: 8px;
    width: 60%;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 14px;
}

        .direction {
            position: absolute;
            top: 20px;
            left: 80px;
            width: 40px;
            height: 40px;
            background: rgba(0, 200, 255, 0.2);
            border: 2px solid rgba(0, 200, 255, 0.6);
            border-radius: 20px;
            color: #007a99;
            font-size: 20px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10;
            backdrop-filter: blur(4px);
        }
        
        

        .koma {
            word-wrap: break-word; /* 折り返し */
            overflow-wrap: break-word; /* 最新ブラウザ向け */
            background-color: #3f3f3f;
            margin: 10px;
            overflow: auto;
            border-radius: 20px;
        }

        .container {
            overflow: auto;
            display: grid;
            gap: 10px;
            align-items: center;
            justify-items: center;
        }

        .close {
            padding: 10px 20px;
            font-size: 16px;
            border-radius: 8px;
            transition: all 0.2s ease;
            border: none;
            outline: none;
            margin-top: 5px;
            margin-bottom: 5px;
        }

        .save-array {
            padding: 10px 20px;
            font-size: 16px;
            border-radius: 8px;
            transition: all 0.2s ease;
            border: none;
            outline: none;
        }

        .menu-btn.disabled {
           pointer-events: none;
           opacity: 0.5; /* 見た目も“無効化”っぽく */
        }

        .menu-btn2.disabled {
            pointer-events: none;
            opacity: 0.5; /* 見た目も“無効化”っぽく */
        }

        .grow, .normal {
            padding: 10px 20px;
            font-size: 16px;
            border-radius: 8px;
            transition: all 0.2s ease;
            border: none;
            outline: none;
            display: none;
        }

        .container_1 {
            max-width: 100vw; 
            margin-bottom: 30px;
            max-height: 60vh;
            display: flex;
            overflow: auto;
            padding: 20px;
        }

        .overlay {
            padding-top: 30px;
            padding-bottom: 30px;        
            box-sizing: border-box;    
            transition: all 0.3s ease-in-out;  
            max-height: 90vh;
            position: fixed;
            top: 70px;
            background-color: rgba(255, 255, 255, 0.9);
            display: none;
            z-index: 10;
            box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.4);
            border-radius: 15px; /* 角を丸く */
        }

        .button-container {
            display: flex;
            gap: 15px;
            justify-content: center;
        }
        #have {
            position: absolute;
            bottom: 320px;  /* 親の下から10px */
            right: 68px;   /* 親の右から10px */
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: rgb(248, 204, 204);
        }


        #lost {
            position: absolute;
            bottom: 320px;  /* 親の下から10px */
            right: 20px;   /* 親の右から10px */
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: rgb(200, 201, 242);
        }
        .grid {
            display: grid;
            gap: 5px;
            direction: ltr;
        }
        .main {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #ffffff;
        }

        .cter {
            display: inline;
        }

        button, input[type="submit"] {
            position: relative;
            padding: 8px 16px;
            border: none;
            border-radius: 8px;
            background-color: #eeeeee;
            color: #333;
            font-size: 14px;
            transition: all 0.2s ease;
            cursor: pointer;
        }

        button:hover, input[type="submit"]:hover {
            background-color: #a9d4f9;
        }

        #press {
            margin-top: 10px;
        }
        
        .deco::before {
            content: '👑';
            position: absolute;
            top: -10px;
            left: 50%;
            font-size: 22px;
        }
        
        .number::after {
            content: var(--circle-content, '①'); /* デフォルトは① */
            position: absolute;
            top: -5px;
            left: -5px;
            width: 24px;
            height: 24px;
            font-size: 16px;
            line-height: 24px;
            text-align: center;
            color: white; /* 数字の色 */
            background-color: rgb(0, 0, 0); /* 丸の色（変更可） */
            border-radius: 50%; /* 丸くする */
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        
        .grow:hover, .normal:hover {
            background-color: #5c67b3;
        }
        .save-array:hover {
            background-color: #388e3c;
        }
        .close:hover {
            background-color: #d32f2f;
        }
        
        #press_1 {
            position: absolute;
            bottom: 350px;
        }
        #together {
            height: 240px;
            gap: 10px;
            overflow: auto;
            margin: 5px;
        }
        #together_1 {
            margin-top: 200px;
            height: 200px;
            overflow: auto;
        }
        button.active {
            background-color: #4CAF50;
            color: white;
        }

        button.active_1 {
            background-color: #3ed6ee;
            color: white;
        }

        button.active_2 {
            background-color: #4c89af;
            color: white;
        }

        button.active_3 {
            background-color: #dfe681;
            color: white;
        }
        .add-row, .remove-row, .add-col, .remove-col {
            font-weight: bold;
        }

        

